From owner-svn-src-all@freebsd.org Sun Feb 17 01:16: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 13D5714DA5E5; Sun, 17 Feb 2019 01:16:28 +0000 (UTC) (envelope-from ganbold@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 AA895759A2; Sun, 17 Feb 2019 01:16:27 +0000 (UTC) (envelope-from ganbold@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 A1028EE81; Sun, 17 Feb 2019 01:16:27 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H1GR7D055736; Sun, 17 Feb 2019 01:16:27 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H1GRg5055735; Sun, 17 Feb 2019 01:16:27 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902170116.x1H1GRg5055735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sun, 17 Feb 2019 01:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344219 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA895759A2 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.998,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)[-0.999,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, 17 Feb 2019 01:16:28 -0000 Author: ganbold Date: Sun Feb 17 01:16:27 2019 New Revision: 344219 URL: https://svnweb.freebsd.org/changeset/base/344219 Log: Add sysctl for setting battery charging current. The charging current can be set using steps from 0: 200mA to 13: 2800mA (200mA/step). While there, fix battery charging current related sensor descriptions. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D19212 Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sat Feb 16 23:57:38 2019 (r344218) +++ head/sys/arm/allwinner/axp81x.c Sun Feb 17 01:16:27 2019 (r344219) @@ -120,6 +120,10 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_VOLTCTL_MASK 0x7f #define AXP_POWERBAT 0x32 #define AXP_POWERBAT_SHUTDOWN (1 << 7) +#define AXP_CHARGERCTL1 0x33 +#define AXP_CHARGERCTL1_MIN 0 +#define AXP_CHARGERCTL1_MAX 13 +#define AXP_CHARGERCTL1_CMASK 0xf #define AXP_IRQEN1 0x40 #define AXP_IRQEN1_ACIN_HI (1 << 6) #define AXP_IRQEN1_ACIN_LO (1 << 5) @@ -614,13 +618,13 @@ static const struct axp8xx_sensors axp8xx_common_senso .id = AXP_SENSOR_BATT_CHARGE_CURRENT, .name = "batchargecurrent", .format = "I", - .desc = "Battery Charging Current", + .desc = "Average Battery Charging Current", }, { .id = AXP_SENSOR_BATT_DISCHARGE_CURRENT, .name = "batdischargecurrent", .format = "I", - .desc = "Battery Discharging Current", + .desc = "Average Battery Discharging Current", }, { .id = AXP_SENSOR_BATT_CAPACITY_PERCENT, @@ -890,6 +894,33 @@ axp8xx_shutdown(void *devp, int howto) } static int +axp8xx_sysctl_chargecurrent(SYSCTL_HANDLER_ARGS) +{ + device_t dev = arg1; + uint8_t data; + int val, error; + + error = axp8xx_read(dev, AXP_CHARGERCTL1, &data, 1); + if (error != 0) + return (error); + + if (bootverbose) + device_printf(dev, "Raw CHARGECTL1 val: 0x%0x\n", data); + val = (data & AXP_CHARGERCTL1_CMASK); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) /* error || read request */ + return (error); + + if ((val < AXP_CHARGERCTL1_MIN) || (val > AXP_CHARGERCTL1_MAX)) + return (EINVAL); + + val |= (data & (AXP_CHARGERCTL1_CMASK << 4)); + axp8xx_write(dev, AXP_CHARGERCTL1, val); + + return (0); +} + +static int axp8xx_sysctl(SYSCTL_HANDLER_ARGS) { struct axp8xx_softc *sc; @@ -1482,6 +1513,16 @@ axp8xx_attach(device_t dev) sc->sensors[i].format, sc->sensors[i].desc); } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "batchargecurrentstep", + CTLTYPE_INT | CTLFLAG_RW, + dev, 0, axp8xx_sysctl_chargecurrent, + "I", "Battery Charging Current Step, " + "0: 200mA, 1: 400mA, 2: 600mA, 3: 800mA, " + "4: 1000mA, 5: 1200mA, 6: 1400mA, 7: 1600mA, " + "8: 1800mA, 9: 2000mA, 10: 2200mA, 11: 2400mA, " + "12: 2600mA, 13: 2800mA"); /* Get thresholds */ if (axp8xx_read(dev, AXP_BAT_CAP_WARN, &val, 1) == 0) { From owner-svn-src-all@freebsd.org Sun Feb 17 02:39: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 AD71014DE7EB; Sun, 17 Feb 2019 02:39:28 +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 4B70A80F3D; Sun, 17 Feb 2019 02:39:28 +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 1EE4EFF69; Sun, 17 Feb 2019 02:39:28 +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 x1H2dRMb098752; Sun, 17 Feb 2019 02:39:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H2dHEq098698; Sun, 17 Feb 2019 02:39:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902170239.x1H2dHEq098698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 17 Feb 2019 02:39:17 +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: r344220 - in stable/11: . contrib/lua contrib/lua/doc contrib/lua/src share/man/man9 share/mk stand stand/common stand/defaults stand/liblua stand/liblua32 stand/libsa stand/lua sys/sys... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . contrib/lua contrib/lua/doc contrib/lua/src share/man/man9 share/mk stand stand/common stand/defaults stand/liblua stand/liblua32 stand/libsa stand/lua sys/sys tools/build/options X-SVN-Commit-Revision: 344220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B70A80F3D 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.998,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)[-0.999,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, 17 Feb 2019 02:39:29 -0000 Author: kevans Date: Sun Feb 17 02:39:17 2019 New Revision: 344220 URL: https://svnweb.freebsd.org/changeset/base/344220 Log: MFC lualoader: r326353, r328440, r328443, r329166-r329167, r329274, r329329, r329349-r329352, r329355-r329359, r329366-r329369, r329386-r329387, r329393, r329413-r329415, r329417, r329424-r329436, r329457, r329473-r329474, r329496-r329501, r329503-r329504, r329543, r329547-r329551, r329576-r329578, r329580, r329583, r329585-r329590, r329592-r329596, r329609-r329611, r329614, r329619, r329621-r329622, r329624, r329626-r329627, r329629-r329632, r329640-r329641, r329643-r329646, r329649-r329650, r329654, r329656, r329662, r329669-r329671, r329673-r329674, r329680, r329684-r329689, r329692-r329693, r329696-r329700, r329709, r329716, r329731, r329733-r329734, r329747-r329748, r329756, r329779, r329782, r329784, r329786, r329804, r329806, r329809, r329811, r329836, r329850-r329852, r329854, r329856-r329858, r329861, r329895, r329897-r329899, r329901-r329903, r329922-r329924, r329927-r329928, r329944-r329949, r329986-r329987, r330008-r330010, r330012, r330020, r330082-r330084, r330087-r330088, r330098-r330101, r330138-r330139, r330261-r330263, r330267-r330269, r330281-r330284, r330287, r330339-r330342, r330345-r330346, r330369-r330370, r330434-r330435, r330564, r330616-r330618, r330620, r330625, r330690, r330701, r330703, r330825, r331211, r331257, r331259, r331281-r331282, r331304, r331314, r331476-r331477, r331563-r331564, r331854-r331857, r331859-r331860, r332106, r334723, r334879, r334891, r334907, r334912, r334939, r334986, r335009, r335371, r336759, r337711, r337807-r337810, r338054, r338063, r338065-r338067, r338083, r338085-r338086, r338108, r338167-r338168, r338173, r338203, r338255, r338259, r338309, r338394, r338438, r338886, r338893, r339173, r339200, r339218, r339222, r339301, r339307, r339677-r339678, r339702, r339805, r339831, r339849, r340040, r340152 Some notes for this MFC: - This is still pre-forth/lua coexistance; that will come shortly-ish so that forth/lua may be installed together (with forth remaining the default) - module_blacklist support for lualoader has been MFC'd, but the drm modules are not blacklisted in this stable branch. r326353: Import lua 5.3.4 to contrib r328440: Preserve the original luaconf.h in a convenient place. Clients will r328443: Gross hack to omit printing hex floating point when the lua number r329166: Add Lua as a scripting langauge to /boot/loader r329167: Add the lua scripts from the lua-bootloader SoC r329274: stand/lua: Exit sub-menus on backspace r329329: stand/lua: Always boot on 'enter' keypress in menus r329349: stand/lua: Reduce magic numbers r329350: stand/lua: Don't descend into an empty kernels submenu r329351: stand/lua: Set reasonable ACPI default based on presence r329352: stand/lua: Consistently use semicolons for line endings r329355: stand/lua: Move kernel selection into main menu r329356: stand/lua: Allow menu items to not have explicit aliases r329357: stand/lua: Remove explicit alias from "Back to main menu" r329358: stand/lua: Say "loader prompt" instead of "lua interpreter" r329359: stand/lua: Remove a magic number/string (not a trivial literal) r329366: stand/lua: Set ACPI's default the proper way (setACPI) r329367: stand/lua: Create a "carousel" menu entry type r329368: stand/lua: Create/use some MENU_ constants where applicable r329369: stand/lua: Remove sneaky kernel assignment r329386: stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys r329387: stand/lua: Chop off the decimal for numbers passed to setcursor r329393: stand/lua: Use escaped dot instead of single character class r329413: stand/lua: Allow MENU_RETURN items to have func, fix esc. to prompt r329414: stand/lua: Don't try to divide by 0; do nothing r329415: stand/lua: Don't reload kernel config if we only have one kernel r329417: stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name r329424: stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence r329425: stand/lua: Enable menu autoboot; it seems to work r329426: stand/lua: Correct interpretation of autoboot_delay r329427: stand/lua: Color non-default kernels blue r329428: stand/lua: Correct some trivial errors in config r329429: stand/lua: Add debug method to dump modules r329430: stand/lua: Address some nits r329431: stand/lua: Correct test sense, this should have been 'not nil' r329432: stand/lua: Try to load alternate kernels as directories first r329433: stand/lua: Add optional GELI passphrase prompt r329434: stand/lua: Check for nil (GELI prompt) r329435: stand/lua: Style pass r329436: stand/lua: Debugging string snuck in... r329457: stand/lua: dumpModules => lsModules r329473: liblua: Clean up io/loader C module registration r329474: liblua: Emulate DIR, opendir, fdopendir, closedir r329496: stand/lua: Fix verbiage and some typos r329497: stand/lua: Fix module_path handling with multiple kernels r329498: stand/lua: Remove some debugging bits that snuck in... gr... r329499: interp_lua: Register io/loader with regular Lua module system r329500: Lua loader: Add barebones "lfs" module r329501: lua loader: Auto detect eligible list of kernels to boot r329503: liblua: Fix missing '}' in lutil.c after r329499 r329504: stand/lua: More style nits, config.lua r329543: Create style.lua(9) r329547: stand/lua: Allow menu items to be conditionally (in)visible r329548: stand/lua: Addres style.lua(9) concern r329549: stand/lua: Clear the screen before prompting for passwords r329550: stand/lua: Store the loaded kernel as config.kernel_loaded r329551: stand/lua: reload previously loaded kernel at config-load/reload r329576: stand/lua: Defer kernel/module loading until boot or menu escape r329577: stand/lua: Rename bootserial for clarity r329578: stand/lua: Menu style.lua(9) nits r329580: stand/lua: Remove some unused local declarations r329583: stand/lua: Store menu entries in an "entries" table r329585: stand/lua: Add core.isSingleUserBoot r329586: stand/lua: Call menu_entries if it's a function r329587: stand/lua: Swap single-/multi- user boot entries as needed r329588: stand/lua: Re-wrap menu.lua now that I've added indentation... r329589: stand/lua: Track env changes that come in via loader.conf(5) r329590: stand/lua: Restore environment upon config reload r329592: stand/lua: Remove inaccurate comment after r329590 r329593: stand/lua: Change boot menu items' names when swapped r329594: stand/lua: Round up some more style.lua(9) concerns r329595: stand/lua: Re-order locals after copyright notice; require first r329596: stand/lua: Add copyright notice in places r329609: stand/lua: Cache swapped menu, and don't create locals for swapping r329610: style.lua(9): Note that wrapping at 80-columns is not rigid r329611: stand/lua: Wrap tuple assignment earlier for readability r329614: stand/lua: Don't set ACPI off just because we can't detect it. r329619: stand/lua: Extract menu handlers out into menu.handlers table r329621: stand/lua: Add and use drawer.menu_name_handlers r329622: stand/lua: Move drawer.menu_name_handlers further up r329624: stand/lua: Reduce exposure of the drawer module r329626: stand/lua: Refactor logos into drawer.logodefs table r329627: stand/lua: Refactor brands into drawer.branddefs r329629: stand/lua: Use 'graphic' instead of 'logo' for depicting graphics r329630: stand/lua: Stick a copyright notice on drawer.lua r329631: stand/lua: Insert helpful comment for drawer.branddefs r329632: style.lua(9): Clarify local variable guideline r329640: stand/lua: Consistently declare local functions at module scope r329641: stand/lua: Consistently organize modules r329643: Implement loader.command r329644: lualoader: Add ability to intercept cli commands r329645: lualoader: Move carousel storage out into config r329646: lualoader: Eliminate global namespace pollution in loader.lua r329649: Lua lfs.attributes: Provide a more consistent error return r329650: liblua: Add loader.machine and loader.machine_arch properties r329654: lualoader: Ignore ACPI bits on !i386 r329656: loader.lua: Expose errno table to lua r329662: lualoader: Replace invalid construct with valid construct r329669: lualoader: Prefer selected kernel to currently loaded r329670: lualoader: Don't try so hard to load a kernel r329671: lualoader: Prepare for interception of "boot" CLI cmd r329673: lualoader: Intercept boot cli command r329674: lualoader: Intercept the 'autoboot' cli command r329680: lualoader: When restoring environment, only restore unchanged vars r329684: lualoader: Drop terminating semicolons r329685: lualoader: Drop excessive parenthesizing r329686: style.lua(9): Drop notes about semicolons r329687: lualoader: Drop explicit boolean tests; b or not b r329688: lualoader: Don't return false for failure to open config on silent r329689: lualoader: Output "Failed to parse" messages r329692: lualoader: Bring in local.lua module if it exists r329693: lualoader: Return only argstr if with_kernel not requested r329696: lualoader: Add "menu.default", initialized to menu.welcome r329697: lualoader: Drop name requirement for menu separators r329698: lualoader: Directly reference submenu definition with submenu key r329699: lualoader: Simplify menu definitions a little further r329700: lualoader: Allow carousel 'items' to be a table as well r329709: lualoader: Don't autodetect kernels if 'kernels' is explicitly set r329716: lualoader: Use the key that interrupts autoboot as a menu choice r329731: lualoader: Add boot environment support r329733: lualoader: Make kernel autodetect. contingent on loader.conf(5) var r329734: lualoader: Don't execute menu.autoboot() for every opened menu r329747: lualoader: Replace 8-space indentation with a single tab r329748: lualoader: Drop password length restrictions r329756: lualoader: Remove nasty hack for not printing out ".0" r329779: lualoader: Split cli bits out into a cli module r329782: lualoader: Unbreak 'boot [kernel]' by including config r329784: lualoader: Pull argument extraction for cli funcs to cli.arguments r329786: lualoader: Attach cli command functions to cli module r329804: lualoader: Eliminate some unused locals r329806: lualoader: Consistently use double quotes r329809: lualoader: Address some 'luacheck' concerns r329811: lualoader: Clear up an empty conditional branch r329836: lualoader: Attend to some 80-col issues, pointed out by luacheck r329850: lualoader: Drop unused return values; we'll only use the first r329851: Add SPDX tags to lua files r329852: Add copyright notice to core.lua r329854: lualoader: shallowCopyTable => deepCopyTable r329856: lualoader: Use "local function x()" instead "local x = function()" r329857: Centralize lua defines r329858: When the LUA_FLOAT_TYPE != LUA_FLOAT_INT64, we can't ref. float r329861: lualoader: Track effective line number, use it for drawing r329895: liblua: Implement write support r329897: lualoader: Add nextboot support r329898: lualoader: Plug file handle not properly closed r329899: lualoader: Correct test and name r329901: lualoader: Add comment on trailing space, don't operate on nil r329902: lualoader: Remove unused variable; we now use effective line number r329903: lualoader: Explain nextboot stuff a little bit more r329922: lualoader: Split config file I/O out into a separate function r329923: lualoader: Strip config.parse of its I/O privileges r329924: lualoader: throw out nextboot's usage of standard config processing r329927: lualoader: Clean up naming conventions a little bit r329928: lualoader: Remove inaccurate part of comment r329944: lualoader: Don't explicitly index tables without reason r329945: lualoader: menu: Terminate final values in tables with a comma r329946: lualoader: Clean up menu handling a little bit r329947: lualoader: Pull menu redrawing specifics out of menu.process r329948: lualoader: Pull autoboot handling out into menu.run() r329949: lualoader: Explain deviation from naming guidelines r329986: lualoader: Invalidate the screen from menu perspective mnu exit r329987: lualoader: Track the menu currently drawn, instead of validity r330008: lualoader: A little more general menu cleanup r330009: lualoader: More argument name expansion, part 2 r330010: lualoader: screen argument fixes r330012: style.lua(9): Add some additional notes about naming and commas r330020: lualoader: Re-work menu skipping bits r330082: lualoader: Add a twiddle at password prompt r330083: lualoader: Remove remnants of testing... r330084: lualoader: Replace instances of \027 with KEYSTR_ESCAPE r330087: lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI r330088: lualoader: Correct test sense, comments, and add some more comments r330098: lualoader: Re-do twiddle r330099: lualoader: Further screen cleanup r330100: lualoader: Remove debug function r330101: lualoader: Add note that \027 is a decimal representation r330138: lualoader: Dedup these "Return to main menu" entries r330139: lualoader: config: Pull some messages out into constants r330261: lualoader: Fix some lint-mentioned errors r330262: lualoader: Use #str instead of tracking length with 'n' r330263: lualoader: Use string literal \xNN instead of string.char() r330267: Add core.lua(8), but do not add to distribution r330268: Add menu.lua(8), but do not add to distribution r330269: core.lua(8): Add missing note about core.KEYSTR_CSI r330281: lualoader: Steamroll the box-drawing r330282: lualoader: Register loader.printc as global printc r330283: lualoader: Use global printc instead of loader.printc r330284: liblua: Use putc instead of printf for printc r330287: lualoader: Reset the cursor position after the menu is drawn r330339: liblua: Add loader.interpret r330340: lualoader: Execute menu_timeout_command at the end of menu autoboot r330341: lualoader: Respect loader_menu_title, prepare for align r330342: lualoader: Respect loader_menu_title_align r330345: lualoader: Tweak positioning and fix an off-by-one r330346: lualoader: Shift menu+brand even for logo=none with customized pos r330369: lualoader: Return meaningful value in cli_execute r330370: lualoader: logdef -> logodef typo r330434: lualoader: Add note about importance of including cli module early r330435: lualoader: Use FILESDIR instead of BINDIR r330564: lualoader: Only loadelf before boot/autoboot if no kernel loaded r330616: lualoader: Expose loader.parse and add cli_execute_unparsed r330617: lualoader: Fix name, cli.execute_unparsed -> cli_execute_unparsed r330618: lualoader: Use cli_execute_unparsed instead of loader.interpret r330620: lualoader: Use cli_execute_unparsed for commands via loader.conf r330625: lualoader: Return status in cli_execute_unparsed properly r330690: stand: Fix copy-paste-o, unbreaks libi386 lualoader build r330701: lualoader: Don't redraw the autoboot message every .05s r330703: lualoader: Cache kernel list r330825: lualoader: Sprinkle some verbose_loading salt r331211: lualoader: Setup default color scheme if we're using colors r331257: lualoader: Reset attributes and color scheme with color.highlight() r331259: lualoader: Use less atomic options for resetting colors/attributes r331281: lualoader: Add primitive hook module to untangle bogus reference r331282: core.lua(8): Update to reflect recently added function r331304: lualoader: Clear up some possible naming confusion r331314: lualoader: Use printc when we expect ANSI escape sequences r331476: lualoader: Make config env-related bits private API r331477: lualoader: Privatize some more config.lua bits r331563: lualoader: Implement try_include and use it for including local r331564: lualoader: Actually re-raise error in try_include r331854: lualoader: Do case-insensitive comparison of "yes" r331855: lualoader: Don't assume that {module}_load is set r331856: lualoader: revert whitespace change that snuck in r331857: lualoader: Simplify some expressions r331859: lualoader: Split logodefs out into logo-* files r331860: lualoader: Don't try to lookup a nil logo r332106: lualoader: Fix menu skipping with loader.conf(5) vars r334723: lualoader: Add a loaded hook for others to execute upon config load r334879: lualoader: Add hook.lua(8) to tree r334891: lualoader: Add cli.lua(8) to the tree r334907: lualoader: Process loader_conf_files properly r334912: lualoader: Support variable substitution in env var settings r334939: lualoader: Allow brand-*.lua for adding new brands r334986: lualoader: More black-on-white fixes r335009: lualoader: Match Forth module-loading behavior w.r.t flags r335371: lualoader: Correct kernel_options handling r336759: lualoader: "nextboot_file" should be spelled "nextboot_conf" r337711: lualoader: Fix parsing of negative number loader.conf(5) variables r337807: Prevent a wanring about checkdp being unused. r337808: When the LUA floating point model is INT64, we don't need to do the r337809: For our INT64 implementation, we can compare integers and numbers r337810: MFV r337586: lua: Update to 5.3.5 r338054: Add config.lua(8) to the tree r338063: lualoader: Stop exporting drawer.draw r338065: lualoader: Hide most of the internal drawing functions r338066: lualoader: Hide the rest of the private interfaces r338067: lualoader: Add drawer-exported variables for default logodefs r338083: Add drawer.lua(8) r338085: Add color.lua(8), password.lua(8), and screen.lua(8) r338086: lualoader: Install all manpages r338108: Serial console menus for lua. r338167: lualoader: Just compare expression directly r338168: lualoader: Refactor config line expressions r338173: lualoader: Fix loader.conf(5) EOL validation for 'exec' lines r338203: Turn off LOADER_GELI and LOADER_LUA for sparc64, until functional r338255: lualoader: Fix (add) Xen support r338259: lualoader: Accept that people use unquoted values in loader.conf r338309: lualoader: Fix override of module_path on loader prompt r338394: lualoader: fix color usage r338438: lualoader: Handle comma-separated kernels as well r338886: Improve loader passwords: r338893: Set the default loader for powerpc(32- and 64-bit) back to to forth r339173: Set the default loader for powerpc64 back to to forth too. r339200: lualoader: Don't draw loader menu with autoboot_delay=-1 r339218: lualoader: Create a module blacklist, add DRM modules to it r339222: lualoader: Honor boot_* variables at lua init r339301: Loader GELI support, like lua loader, seems to be broken on PowerPC r339307: lualoader: Provide a 'menu' command to redraw the menu at prompt r339677: lualoader: unload upon kernel change if a kernel was loaded r339678: menu.lua: Abort autoboot sequence on failed command r339702: lualoader: Improve module loading diagnostics r339805: lualoader: Always return a proper dictionary for blacklist r339831: Move LUA_ROOT to /boot/lua r339849: lualoader: Fix try_include error handling r340040: lualoader: Implement boot-conf r340152: lualoader: Add chainload menu entry Relnotes: yes ("lualoader has been merged to stable/11, off by default, to facilitate testing") Added: stable/11/contrib/lua/ - copied from r326353, head/contrib/lua/ stable/11/contrib/lua/src/luaconf.h.dist - copied unchanged from r328440, head/contrib/lua/src/luaconf.h.dist stable/11/share/man/man9/style.lua.9 - copied, changed from r329543, head/share/man/man9/style.lua.9 stable/11/stand/common/interp_lua.c - copied, changed from r329167, head/stand/common/interp_lua.c stable/11/stand/liblua/ - copied from r329167, head/stand/liblua/ stable/11/stand/liblua/lerrno.c - copied unchanged from r329656, head/stand/liblua/lerrno.c stable/11/stand/liblua/lerrno.h - copied unchanged from r329656, head/stand/liblua/lerrno.h stable/11/stand/liblua/lfs.c - copied, changed from r329501, head/stand/liblua/lfs.c stable/11/stand/liblua/lfs.h - copied unchanged from r329501, head/stand/liblua/lfs.h stable/11/stand/liblua32/ - copied from r329167, head/stand/liblua32/ stable/11/stand/lua/ - copied from r329167, head/stand/lua/ stable/11/stand/lua.mk - copied, changed from r329167, head/stand/lua.mk stable/11/stand/lua/cli.lua - copied, changed from r329779, head/stand/lua/cli.lua stable/11/stand/lua/cli.lua.8 - copied, changed from r334891, head/stand/lua/cli.lua.8 stable/11/stand/lua/color.lua.8 - copied unchanged from r338086, head/stand/lua/color.lua.8 stable/11/stand/lua/config.lua.8 - copied unchanged from r338054, head/stand/lua/config.lua.8 stable/11/stand/lua/core.lua.8 - copied, changed from r330269, head/stand/lua/core.lua.8 stable/11/stand/lua/drawer.lua.8 - copied unchanged from r338083, head/stand/lua/drawer.lua.8 stable/11/stand/lua/hook.lua - copied unchanged from r331282, head/stand/lua/hook.lua stable/11/stand/lua/hook.lua.8 - copied unchanged from r334879, head/stand/lua/hook.lua.8 stable/11/stand/lua/logo-beastie.lua - copied unchanged from r331860, head/stand/lua/logo-beastie.lua stable/11/stand/lua/logo-beastiebw.lua - copied unchanged from r331860, head/stand/lua/logo-beastiebw.lua stable/11/stand/lua/logo-fbsdbw.lua - copied unchanged from r331860, head/stand/lua/logo-fbsdbw.lua stable/11/stand/lua/logo-orb.lua - copied unchanged from r331860, head/stand/lua/logo-orb.lua stable/11/stand/lua/logo-orbbw.lua - copied unchanged from r331860, head/stand/lua/logo-orbbw.lua stable/11/stand/lua/menu.lua.8 - copied unchanged from r330269, head/stand/lua/menu.lua.8 stable/11/stand/lua/password.lua.8 - copied unchanged from r338086, head/stand/lua/password.lua.8 stable/11/stand/lua/screen.lua.8 - copied unchanged from r338086, head/stand/lua/screen.lua.8 stable/11/tools/build/options/WITH_LOADER_LUA - copied unchanged from r329167, head/tools/build/options/WITH_LOADER_LUA Deleted: stable/11/contrib/lua/src/luaconf.h Modified: stable/11/UPDATING stable/11/contrib/lua/README stable/11/contrib/lua/doc/contents.html stable/11/contrib/lua/doc/lua.css stable/11/contrib/lua/doc/manual.html stable/11/contrib/lua/doc/readme.html stable/11/contrib/lua/src/Makefile stable/11/contrib/lua/src/lapi.c stable/11/contrib/lua/src/lapi.h stable/11/contrib/lua/src/lauxlib.c stable/11/contrib/lua/src/lauxlib.h stable/11/contrib/lua/src/lbaselib.c stable/11/contrib/lua/src/lbitlib.c stable/11/contrib/lua/src/lcode.c stable/11/contrib/lua/src/lcode.h stable/11/contrib/lua/src/lcorolib.c stable/11/contrib/lua/src/lctype.c stable/11/contrib/lua/src/lctype.h stable/11/contrib/lua/src/ldblib.c stable/11/contrib/lua/src/ldebug.c stable/11/contrib/lua/src/ldebug.h stable/11/contrib/lua/src/ldo.c stable/11/contrib/lua/src/ldo.h stable/11/contrib/lua/src/ldump.c stable/11/contrib/lua/src/lfunc.c stable/11/contrib/lua/src/lfunc.h stable/11/contrib/lua/src/lgc.c stable/11/contrib/lua/src/lgc.h stable/11/contrib/lua/src/linit.c stable/11/contrib/lua/src/liolib.c stable/11/contrib/lua/src/llex.c stable/11/contrib/lua/src/llex.h stable/11/contrib/lua/src/llimits.h stable/11/contrib/lua/src/lmathlib.c stable/11/contrib/lua/src/lmem.c stable/11/contrib/lua/src/lmem.h stable/11/contrib/lua/src/loadlib.c stable/11/contrib/lua/src/lobject.c stable/11/contrib/lua/src/lobject.h stable/11/contrib/lua/src/lopcodes.c stable/11/contrib/lua/src/lopcodes.h stable/11/contrib/lua/src/loslib.c stable/11/contrib/lua/src/lparser.c stable/11/contrib/lua/src/lparser.h stable/11/contrib/lua/src/lprefix.h stable/11/contrib/lua/src/lstate.c stable/11/contrib/lua/src/lstate.h stable/11/contrib/lua/src/lstring.c stable/11/contrib/lua/src/lstring.h stable/11/contrib/lua/src/lstrlib.c stable/11/contrib/lua/src/ltable.c stable/11/contrib/lua/src/ltable.h stable/11/contrib/lua/src/ltablib.c stable/11/contrib/lua/src/ltm.c stable/11/contrib/lua/src/ltm.h stable/11/contrib/lua/src/lua.c stable/11/contrib/lua/src/lua.h stable/11/contrib/lua/src/luac.c stable/11/contrib/lua/src/lualib.h stable/11/contrib/lua/src/lundump.c stable/11/contrib/lua/src/lundump.h stable/11/contrib/lua/src/lutf8lib.c stable/11/contrib/lua/src/lvm.c stable/11/contrib/lua/src/lvm.h stable/11/contrib/lua/src/lzio.c stable/11/contrib/lua/src/lzio.h stable/11/share/man/man9/Makefile stable/11/share/mk/src.opts.mk stable/11/stand/Makefile stable/11/stand/defaults/loader.conf stable/11/stand/defaults/loader.conf.5 stable/11/stand/defs.mk stable/11/stand/liblua/Makefile stable/11/stand/liblua/lstd.c stable/11/stand/liblua/lstd.h stable/11/stand/liblua/luaconf.h stable/11/stand/liblua/lutils.c stable/11/stand/liblua/lutils.h stable/11/stand/libsa/stand.h stable/11/stand/loader.mk stable/11/stand/lua/Makefile stable/11/stand/lua/color.lua stable/11/stand/lua/config.lua stable/11/stand/lua/core.lua stable/11/stand/lua/drawer.lua stable/11/stand/lua/loader.lua stable/11/stand/lua/menu.lua stable/11/stand/lua/password.lua stable/11/stand/lua/screen.lua stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sun Feb 17 01:16:27 2019 (r344219) +++ stable/11/UPDATING Sun Feb 17 02:39:17 2019 (r344220) @@ -17,6 +17,14 @@ the tip of head, and then rebuild without this option. from older version of current across the gcc/clang cutover is a bit fragile. 20190216: + Lualoader has been merged to facilitate testing on this branch. It's + purely opt-in for now by building WITH_LOADER_LUA and WITHOUT_FORTH in + /etc/src.conf, but co-existance will come shortly. Booting is a complex + environment and test coverage for Lua-enabled loaders has been thin, so + it would be prudent to assume it might not work and make provisions for + backup boot methods. + +20190216: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 7.0.1. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 Modified: stable/11/contrib/lua/README ============================================================================== --- head/contrib/lua/README Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/README Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ -This is Lua 5.3.4, released on 12 Jan 2017. +This is Lua 5.3.5, released on 26 Jun 2018. For installation instructions, license details, and further information about Lua, see doc/readme.html. Modified: stable/11/contrib/lua/doc/contents.html ============================================================================== --- head/contrib/lua/doc/contents.html Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/doc/contents.html Sun Feb 17 02:39:17 2019 (r344220) @@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see th

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -609,10 +609,10 @@ Freely available under the terms of the

Modified: stable/11/contrib/lua/doc/lua.css ============================================================================== --- head/contrib/lua/doc/lua.css Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/doc/lua.css Sun Feb 17 02:39:17 2019 (r344220) @@ -10,7 +10,7 @@ body { line-height: 1.25 ; margin: 16px auto ; padding: 32px ; - border: solid #a0a0a0 1px ; + border: solid #ccc 1px ; border-radius: 20px ; max-width: 70em ; width: 90% ; @@ -111,36 +111,29 @@ pre.session { border-radius: 8px ; } -td.gutter { - width: 4% ; -} - -table.columns { +table { border: none ; border-spacing: 0 ; border-collapse: collapse ; } +td { + padding: 0 ; + margin: 0 ; +} + +td.gutter { + width: 4% ; +} + table.columns td { vertical-align: top ; - padding: 0 ; padding-bottom: 1em ; text-align: justify ; line-height: 1.25 ; } -p.logos a:link:hover, p.logos a:visited:hover { - background-color: inherit ; -} - -table.book { - border: none ; - border-spacing: 0 ; - border-collapse: collapse ; -} - table.book td { - padding: 0 ; vertical-align: top ; } @@ -157,6 +150,10 @@ table.book span { text-align: left ; display: block ; margin-top: 0.25em ; +} + +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; } img { Modified: stable/11/contrib/lua/doc/manual.html ============================================================================== --- head/contrib/lua/doc/manual.html Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/doc/manual.html Sun Feb 17 02:39:17 2019 (r344220) @@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo,

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -35,7 +35,7 @@ Freely available under the terms of the

- + @@ -203,8 +203,8 @@ even those that do not support threads natively.

The type table implements associative arrays, -that is, arrays that can be indexed not only with numbers, -but with any Lua value except nil and NaN. +that is, arrays that can have as indices not only numbers, +but any Lua value except nil and NaN. (Not a Number is a special value used to represent undefined or unrepresentable numerical results, such as 0/0.) Tables can be heterogeneous; @@ -400,6 +400,8 @@ with the event name prefixed by two underscores; the corresponding values are called metamethods. In the previous example, the key is "__add" and the metamethod is the function that performs the addition. +Unless stated otherwise, +metamethods should be function values.

@@ -597,7 +599,7 @@ it is also slower than a real __le metame

  • __index: -The indexing access table[key]. +The indexing access operation table[key]. This event happens when table is not a table or when key is not present in table. The metamethod is looked up in table. @@ -1276,13 +1278,8 @@ Square brackets are used to index a table:
     	var ::= prefixexp ‘[’ exp ‘]

    -The meaning of accesses to table fields can be changed via metatables. -An access to an indexed variable t[i] is equivalent to -a call gettable_event(t,i). -(See §2.4 for a complete description of the -gettable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) +The meaning of accesses to table fields can be changed via metatables +(see §2.4).

    @@ -1477,25 +1474,20 @@ cyclically permutes the values of x, -The meaning of assignments to global variables -and table fields can be changed via metatables. -An assignment to an indexed variable t[i] = val is equivalent to -settable_event(t,i,val). -(See §2.4 for a complete description of the -settable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) - - -

    An assignment to a global name x = val is equivalent to the assignment _ENV.x = val (see §2.2). +

    +The meaning of assignments to table fields and +global variables (which are actually table fields, too) +can be changed via metatables (see §2.4). + +

    3.3.4 – Control Structures

    The control structures if, while, and repeat have the usual meaning and @@ -1831,17 +1823,17 @@ Here are some examples: g(f(), x) -- f() is adjusted to 1 result g(x, f()) -- g gets x plus all results from f() a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil) - a,b = ... -- a gets the first vararg parameter, b gets + a,b = ... -- a gets the first vararg argument, b gets -- the second (both a and b can get nil if there - -- is no corresponding vararg parameter) + -- is no corresponding vararg argument) a,b,c = x, f() -- f() is adjusted to 2 results a,b,c = f() -- f() is adjusted to 3 results return f() -- returns all results from f() - return ... -- returns all received vararg parameters + return ... -- returns all received vararg arguments return x,y,f() -- returns x, y, and all results from f() {f()} -- creates a list with all results from f() - {...} -- creates a list with all vararg parameters + {...} -- creates a list with all vararg arguments {f(), nil} -- f() is adjusted to 1 result @@ -2039,9 +2031,12 @@ two objects are considered equal only if they are the Every time you create a new object (a table, userdata, or thread), this new object is different from any previously existing object. -Closures with the same reference are always equal. +A closure is always equal to itself. Closures with any detectable difference (different behavior, different definition) are always different. +Closures created at different times but with no detectable differences +may be classified as equal or not +(depending on internal caching details).

    @@ -2303,7 +2298,7 @@ If the value of prefixexp has type function, then this function is called with the given arguments. Otherwise, the prefixexp "call" metamethod is called, -having as first parameter the value of prefixexp, +having as first argument the value of prefixexp, followed by the original call arguments (see §2.4). @@ -2881,7 +2876,7 @@ it can do whatever it wants on that Lua state, as it should be already protected. However, when C code operates on other Lua states -(e.g., a Lua parameter to the function, +(e.g., a Lua argument to the function, a Lua state stored in the registry, or the result of lua_newthread), it should use them only in API calls that cannot raise errors. @@ -3370,7 +3365,7 @@ it is left unchanged. Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state. -On several platforms, you may not need to call this function, +In several platforms, you may not need to call this function, because all resources are naturally released when the host program ends. On the other hand, long-running programs that create multiple states, such as daemons or web servers, @@ -5584,7 +5579,7 @@ given as argument to a hook (see <

    -To get information about a function you push it onto the stack +To get information about a function, you push it onto the stack and start the what string with the character '>'. (In that case, lua_getinfo pops the function from the top of the stack.) @@ -6462,7 +6457,7 @@ file-related functions in the standard library

    Pushes onto the stack the field e from the metatable -of the object at index obj and returns the type of pushed value. +of the object at index obj and returns the type of the pushed value. If the object does not have a metatable, or if the metatable does not have this field, pushes nothing and returns LUA_TNIL. @@ -6749,7 +6744,7 @@ In words, if the argument arg is nil or a the macro results in the default dflt. Otherwise, it results in the result of calling func with the state L and the argument index arg as -parameters. +arguments. Note that it evaluates the expression dflt only if needed. @@ -8680,7 +8675,7 @@ the lowercase letters plus the '-' charac

    You can put a closing square bracket in a set by positioning it as the first character in the set. -You can put an hyphen in a set +You can put a hyphen in a set by positioning it as the first or the last character in the set. (You can also use an escape for both cases.) @@ -9082,8 +9077,8 @@ Returns the destination table a2.

    -Returns a new table with all parameters stored into keys 1, 2, etc. -and with a field "n" with the total number of parameters. +Returns a new table with all arguments stored into keys 1, 2, etc. +and with a field "n" with the total number of arguments. Note that the resulting table may not be a sequence. @@ -9215,7 +9210,7 @@ Returns the arc sine of x (in radians).

    Returns the arc tangent of y/x (in radians), -but uses the signs of both parameters to find the +but uses the signs of both arguments to find the quadrant of the result. (It also handles correctly the case of x being zero.) @@ -9516,7 +9511,7 @@ all I/O functions return nil on failure (plus an error message as a second result and a system-dependent error code as a third result) and some value different from nil on success. -On non-POSIX systems, +In non-POSIX systems, the computation of the error message and error code in case of errors may be not thread safe, @@ -9553,7 +9548,7 @@ When called with a file name, it opens the named file and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. -When called without parameters, +When called without arguments, it returns the current default input file. @@ -9580,7 +9575,7 @@ it returns no values (to finish the loop) and automati The call io.lines() (with no file name) is equivalent to io.input():lines("*l"); that is, it iterates over the lines of the default input file. -In this case it does not close the file when the loop ends. +In this case, the iterator does not close the file when the loop ends.

    @@ -9963,7 +9958,7 @@ the host system and on the current locale.

    -On non-POSIX systems, +In non-POSIX systems, this function may be not thread safe because of its reliance on C function gmtime and C function localtime. @@ -10163,7 +10158,7 @@ and explicitly removed when no longer needed.

    -On POSIX systems, +In POSIX systems, this function also creates a file with that name, to avoid security risks. (Someone else might create the file with wrong permissions @@ -10301,8 +10296,8 @@ The first parameter or local variable has index 1 following the order that they are declared in the code, counting only the variables that are active in the current scope of the function. -Negative indices refer to vararg parameters; --1 is the first vararg parameter. +Negative indices refer to vararg arguments; +-1 is the first vararg argument. The function returns nil if there is no variable with the given index, and raises an error when called with a level out of range. (You can call debug.getinfo to check whether the level is valid.) @@ -10400,7 +10395,7 @@ When called without arguments,

    -When the hook is called, its first parameter is a string +When the hook is called, its first argument is a string describing the event that has triggered its call: "call" (or "tail call"), "return", @@ -10551,7 +10546,8 @@ The options are:

    • -e stat: executes string stat;
    • -
    • -l mod: "requires" mod;
    • +
    • -l mod: "requires" mod and assigns the + result to global @mod;
    • -i: enters interactive mode after running script;
    • -v: prints version information;
    • -E: ignores environment variables;
    • @@ -10629,7 +10625,7 @@ For instance, the call

      will print "-e". If there is a script, -the script is called with parameters +the script is called with arguments arg[1], ···, arg[#arg]. (Like all chunks in Lua, the script is compiled as a vararg function.) @@ -10815,7 +10811,7 @@ The following functions were deprecated in the mathema frexp, and ldexp. You can replace math.pow(x,y) with x^y; you can replace math.atan2 with math.atan, -which now accepts one or two parameters; +which now accepts one or two arguments; you can replace math.ldexp(x,exp) with x * 2.0^exp. For the other operations, you can either use an external library or @@ -10850,7 +10846,7 @@ of the first result.)

      • -Continuation functions now receive as parameters what they needed +Continuation functions now receive as arguments what they needed to get through lua_getctx, so lua_getctx has been removed. Adapt your code accordingly. @@ -10973,12 +10969,13 @@ and LiteralString, see §3.1.) + Modified: stable/11/contrib/lua/doc/readme.html ============================================================================== --- head/contrib/lua/doc/readme.html Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/doc/readme.html Sun Feb 17 02:39:17 2019 (r344220) @@ -107,7 +107,7 @@ Here are the details.
        1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.x. +the top-level directory, which is named lua-5.3.5. The Makefile there controls both the build process and the installation process.

        2. @@ -355,10 +355,10 @@ THE SOFTWARE. Modified: stable/11/contrib/lua/src/Makefile ============================================================================== --- head/contrib/lua/src/Makefile Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/Makefile Sun Feb 17 02:39:17 2019 (r344220) @@ -102,7 +102,7 @@ c89: freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" generic: $(ALL) @@ -110,7 +110,7 @@ linux: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" macosx: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" mingw: $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \ Modified: stable/11/contrib/lua/src/lapi.c ============================================================================== --- head/contrib/lua/src/lapi.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lapi.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp $ +** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc lua_lock(L); if (n == 0) { setfvalue(L->top, fn); + api_incr_top(L); } else { CClosure *cl; @@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc /* does not need barrier because closure is white */ } setclCvalue(L, L->top, cl); + api_incr_top(L); + luaC_checkGC(L); } - api_incr_top(L); - luaC_checkGC(L); lua_unlock(L); } Modified: stable/11/contrib/lua/src/lapi.h ============================================================================== --- head/contrib/lua/src/lapi.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lapi.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ +** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lauxlib.c ============================================================================== --- head/contrib/lua/src/lauxlib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lauxlib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.289 2016/12/20 18:37:00 roberto Exp $ +** $Id: lauxlib.c,v 1.289.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lauxlib.h ============================================================================== --- head/contrib/lua/src/lauxlib.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lauxlib.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.131 2016/12/06 14:54:31 roberto Exp $ +** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lbaselib.c ============================================================================== --- head/contrib/lua/src/lbaselib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lbaselib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.314 2016/09/05 19:06:34 roberto Exp $ +** $Id: lbaselib.c,v 1.314.1.1 2017/04/19 17:39:34 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lbitlib.c ============================================================================== --- head/contrib/lua/src/lbitlib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lbitlib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.30 2015/11/11 19:08:09 roberto Exp $ +** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lcode.c ============================================================================== --- head/contrib/lua/src/lcode.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lcode.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.112 2016/12/22 13:08:50 roberto Exp $ +** $Id: lcode.c,v 2.112.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lcode.h ============================================================================== --- head/contrib/lua/src/lcode.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lcode.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $ +** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lcorolib.c ============================================================================== --- head/contrib/lua/src/lcorolib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lcorolib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lcorolib.c,v 1.10 2016/04/11 19:19:55 roberto Exp $ +** $Id: lcorolib.c,v 1.10.1.1 2017/04/19 17:20:42 roberto Exp $ ** Coroutine Library ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lctype.c ============================================================================== --- head/contrib/lua/src/lctype.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lctype.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lctype.c,v 1.12 2014/11/02 19:19:04 roberto Exp $ +** $Id: lctype.c,v 1.12.1.1 2017/04/19 17:20:42 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lctype.h ============================================================================== --- head/contrib/lua/src/lctype.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lctype.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ +** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/ldblib.c ============================================================================== --- head/contrib/lua/src/ldblib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldblib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp $ +** $Id: ldblib.c,v 1.151.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/ldebug.c ============================================================================== --- head/contrib/lua/src/ldebug.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldebug.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.121 2016/10/19 12:32:10 roberto Exp $ +** $Id: ldebug.c,v 2.121.1.2 2017/07/10 17:21:50 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, CallInfo *ci = L->ci; const char *msg; va_list argp; + luaC_checkGC(L); /* error message uses memory */ va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); Modified: stable/11/contrib/lua/src/ldebug.h ============================================================================== --- head/contrib/lua/src/ldebug.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldebug.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ +** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/ldo.c ============================================================================== --- head/contrib/lua/src/ldo.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldo.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.157 2016/12/13 15:52:21 roberto Exp $ +** $Id: ldo.c,v 2.157.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/ldo.h ============================================================================== --- head/contrib/lua/src/ldo.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldo.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $ +** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/ldump.c ============================================================================== --- head/contrib/lua/src/ldump.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/ldump.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 2.37 2015/10/08 15:53:49 roberto Exp $ +** $Id: ldump.c,v 2.37.1.1 2017/04/19 17:20:42 roberto Exp $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lfunc.c ============================================================================== --- head/contrib/lua/src/lfunc.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lfunc.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 roberto Exp $ +** $Id: lfunc.c,v 2.45.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lfunc.h ============================================================================== --- head/contrib/lua/src/lfunc.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lfunc.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ +** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lgc.c ============================================================================== --- head/contrib/lua/src/lgc.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lgc.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.215 2016/12/22 13:08:50 roberto Exp $ +** $Id: lgc.c,v 2.215.1.2 2017/08/31 16:15:27 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, G for (n = gnode(h, 0); n < limit; n++) { if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { setnilvalue(gval(n)); /* remove value ... */ - removeentry(n); /* and remove entry from table */ } + if (ttisnil(gval(n))) /* is entry empty? */ + removeentry(n); /* remove entry from table */ } } } Modified: stable/11/contrib/lua/src/lgc.h ============================================================================== --- head/contrib/lua/src/lgc.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lgc.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $ +** $Id: lgc.h,v 2.91.1.1 2017/04/19 17:39:34 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/linit.c ============================================================================== --- head/contrib/lua/src/linit.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/linit.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.39 2016/12/04 20:17:24 roberto Exp $ +** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/liolib.c ============================================================================== --- head/contrib/lua/src/liolib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/liolib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $ +** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) { } +static int f_close (lua_State *L) { + tofile(L); /* make sure argument is an open stream */ + return aux_close(L); +} + + static int io_close (lua_State *L) { if (lua_isnone(L, 1)) /* no argument? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ - tofile(L); /* make sure argument is an open stream */ - return aux_close(L); + return f_close(L); } @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = { ** methods for file handles */ static const luaL_Reg flib[] = { - {"close", io_close}, + {"close", f_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, Modified: stable/11/contrib/lua/src/llex.c ============================================================================== --- head/contrib/lua/src/llex.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/llex.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.c,v 2.96.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/llex.h ============================================================================== --- head/contrib/lua/src/llex.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/llex.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/llimits.h ============================================================================== --- head/contrib/lua/src/llimits.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/llimits.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.141 2015/11/19 19:16:22 roberto Exp $ +** $Id: llimits.h,v 1.141.1.1 2017/04/19 17:20:42 roberto Exp $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -66,7 +66,9 @@ typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; #else typedef union { lua_Number n; +#if LUA_FLOAT_TYPE != LUA_FLOAT_INT64 double u; +#endif void *s; lua_Integer i; long l; Modified: stable/11/contrib/lua/src/lmathlib.c ============================================================================== --- head/contrib/lua/src/lmathlib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lmathlib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.119 2016/12/22 13:08:50 roberto Exp $ +** $Id: lmathlib.c,v 1.119.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard mathematical library ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lmem.c ============================================================================== --- head/contrib/lua/src/lmem.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lmem.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.91 2015/03/06 19:45:54 roberto Exp $ +** $Id: lmem.c,v 1.91.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lmem.h ============================================================================== --- head/contrib/lua/src/lmem.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lmem.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $ +** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/loadlib.c ============================================================================== --- head/contrib/lua/src/loadlib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/loadlib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.130 2017/01/12 17:14:26 roberto Exp $ +** $Id: loadlib.c,v 1.130.1.1 2017/04/19 17:20:42 roberto Exp $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** Modified: stable/11/contrib/lua/src/lobject.c ============================================================================== --- head/contrib/lua/src/lobject.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lobject.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.113 2016/12/22 13:08:50 roberto Exp $ +** $Id: lobject.c,v 2.113.1.1 2017/04/19 17:29:57 roberto Exp $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -435,7 +435,8 @@ const char *luaO_pushvfstring (lua_State *L, const cha } case 'p': { /* a pointer */ char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ - int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *)); + void *p = va_arg(argp, void *); + int l = lua_pointer2str(buff, sizeof(buff), p); pushstr(L, buff, l); break; } Modified: stable/11/contrib/lua/src/lobject.h ============================================================================== --- head/contrib/lua/src/lobject.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lobject.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp $ +** $Id: lobject.h,v 2.117.1.1 2017/04/19 17:39:34 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lopcodes.c ============================================================================== --- head/contrib/lua/src/lopcodes.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lopcodes.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.c,v 1.55 2015/01/05 13:48:33 roberto Exp $ +** $Id: lopcodes.c,v 1.55.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lopcodes.h ============================================================================== --- head/contrib/lua/src/lopcodes.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lopcodes.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.149 2016/07/19 17:12:21 roberto Exp $ +** $Id: lopcodes.h,v 1.149.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/loslib.c ============================================================================== --- head/contrib/lua/src/loslib.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/loslib.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp $ +** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -293,7 +293,8 @@ static int os_date (lua_State *L) { else stm = l_localtime(&t, &tmr); if (stm == NULL) /* invalid date? */ - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); if (strcmp(s, "*t") == 0) { lua_createtable(L, 0, 9); /* 9 = number of fields */ setallfields(L, stm); @@ -340,7 +341,8 @@ static int os_time (lua_State *L) { setallfields(L, &ts); /* update fields with normalized values */ } if (t != (time_t)(l_timet)t || t == (time_t)(-1)) - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); l_pushtime(L, t); return 1; } Modified: stable/11/contrib/lua/src/lparser.c ============================================================================== --- head/contrib/lua/src/lparser.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lparser.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.155 2016/08/01 19:51:24 roberto Exp $ +** $Id: lparser.c,v 2.155.1.2 2017/04/29 18:11:40 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escape luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ enterblock(fs, &bl, 0); /* must enter block before 'goto' */ gotostat(ls, v.t); /* handle goto/break */ - skipnoopstat(ls); /* skip other no-op statements */ + while (testnext(ls, ';')) {} /* skip colons */ if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ leaveblock(fs); return; /* and that is it */ Modified: stable/11/contrib/lua/src/lparser.h ============================================================================== --- head/contrib/lua/src/lparser.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lparser.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $ +** $Id: lparser.h,v 1.76.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lprefix.h ============================================================================== --- head/contrib/lua/src/lprefix.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lprefix.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ +** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ ** Definitions for Lua code that must come before any other header file ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lstate.c ============================================================================== --- head/contrib/lua/src/lstate.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lstate.c Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.133 2015/11/13 12:16:51 roberto Exp $ +** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ Modified: stable/11/contrib/lua/src/lstate.h ============================================================================== --- head/contrib/lua/src/lstate.h Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lstate.h Sun Feb 17 02:39:17 2019 (r344220) @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstate.h,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -26,6 +26,24 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray: +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** The last three lists are used only during the atomic phase. */ Modified: stable/11/contrib/lua/src/lstring.c ============================================================================== --- head/contrib/lua/src/lstring.c Wed Nov 29 00:46:36 2017 (r326353) +++ stable/11/contrib/lua/src/lstring.c Sun Feb 17 02:39:17 2019 (r344220) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Feb 17 02:58: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 ABD0914DEEB2; Sun, 17 Feb 2019 02:58:45 +0000 (UTC) (envelope-from avos@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 4F8E28165B; Sun, 17 Feb 2019 02:58:45 +0000 (UTC) (envelope-from avos@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 453DA182E5; Sun, 17 Feb 2019 02:58:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H2wjH3009343; Sun, 17 Feb 2019 02:58:45 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H2wjdm009342; Sun, 17 Feb 2019 02:58:45 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170258.x1H2wjdm009342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 02:58:45 +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: r344221 - in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 344221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F8E28165B 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.998,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)[-0.999,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, 17 Feb 2019 02:58:45 -0000 Author: avos Date: Sun Feb 17 02:58:44 2019 New Revision: 344221 URL: https://svnweb.freebsd.org/changeset/base/344221 Log: MFC r343501: Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras PR: 97472 Submitted by: Fabio Luis Girardi Reviewed by: imp Modified: stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/cam/scsi/scsi_da.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Sun Feb 17 02:39:17 2019 (r344220) +++ stable/12/sys/cam/scsi/scsi_da.c Sun Feb 17 02:58:44 2019 (r344221) @@ -1081,6 +1081,30 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Olympus digital cameras (C-3040ZOOM, C-2040ZOOM, C-1) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "C*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* + * Olympus digital cameras (D-370) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "D*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE + }, + { + /* + * Olympus digital cameras (E-100RS, E-10). + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "E*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* * Olympus FE-210 camera */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", From owner-svn-src-all@freebsd.org Sun Feb 17 02:58: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 5D74814DEEAD; Sun, 17 Feb 2019 02:58:45 +0000 (UTC) (envelope-from avos@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 EFD668165A; Sun, 17 Feb 2019 02:58:44 +0000 (UTC) (envelope-from avos@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 E6068182E4; Sun, 17 Feb 2019 02:58:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H2wiQx009337; Sun, 17 Feb 2019 02:58:44 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H2wiks009336; Sun, 17 Feb 2019 02:58:44 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170258.x1H2wiks009336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 02:58:44 +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: r344221 - in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-10 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 344221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFD668165A 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.998,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)[-0.999,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, 17 Feb 2019 02:58:45 -0000 Author: avos Date: Sun Feb 17 02:58:44 2019 New Revision: 344221 URL: https://svnweb.freebsd.org/changeset/base/344221 Log: MFC r343501: Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras PR: 97472 Submitted by: Fabio Luis Girardi Reviewed by: imp Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/cam/scsi/scsi_da.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Sun Feb 17 02:39:17 2019 (r344220) +++ stable/10/sys/cam/scsi/scsi_da.c Sun Feb 17 02:58:44 2019 (r344221) @@ -941,6 +941,30 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Olympus digital cameras (C-3040ZOOM, C-2040ZOOM, C-1) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "C*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* + * Olympus digital cameras (D-370) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "D*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE + }, + { + /* + * Olympus digital cameras (E-100RS, E-10). + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "E*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* * Olympus FE-210 camera */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", From owner-svn-src-all@freebsd.org Sun Feb 17 03:14: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 6B29914E00F7; Sun, 17 Feb 2019 03:14:42 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B84E82F21; Sun, 17 Feb 2019 03:14:41 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id z20so10494071ljj.10; Sat, 16 Feb 2019 19:14:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=+IEa2Q8JoUp67GeDjbQTz7LCkQV4Aik3Ytv6FJZx76c=; b=uDkngcuDwP0PXzDQuc6kC9ZeWUwGCag4E7kni6pm/sKjNhH88YjLnICyelXQZGQStE w5scsuxpzhzsfLOGKxNJJMo7LLEd+e+BKsSy/SyWkuQ92FRp/ftIWncxgD7bNTgQ3Xck dXyBnA/lPbrar2Nn6XGwUOTd/P3RrZHQiU1WVcWu7Fci7ewWTHAHaUv3E2vOWZFj0Fwc tFkbUMfvOPzCf0oGk7bBpeVBDUmn4IT2qoWHoBMHxN4x45sdQBKo9Aoke284j/e2rUDY K37y4E++QfZ9H6/c41yp4NL++yAto58EkqctuBT0uH0pN0eb5A0x5FBZaxV2Lqmi+ayI yt4w== X-Gm-Message-State: AHQUAuZFuIVpdGsgQjzro9TXz3WA2mg9250ww2DdZ1kJkSkhm9hkpG2B WSPf/RF0P9JQxucY9RgPOpgSSe7xXHw= X-Google-Smtp-Source: AHgI3IZe9l5gowbgldgON9rsH80Yooi4U6GmByyPdrOE+rBNQG6H6BPOtXVI1j+ASNicOdu/3NnH5Q== X-Received: by 2002:a2e:90cd:: with SMTP id o13mr665376ljg.153.1550373273397; Sat, 16 Feb 2019 19:14:33 -0800 (PST) Received: from localhost ([37.73.200.183]) by smtp.gmail.com with ESMTPSA id z17sm2763558lfh.9.2019.02.16.19.14.32 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 16 Feb 2019 19:14:32 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r344223 - stable/11/sys/net80211 References: <201902170312.x1H3CRHx020898@repo.freebsd.org> Date: Sun, 17 Feb 2019 05:13:27 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902170312.x1H3CRHx020898@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 4B84E82F21 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of andriyvos@gmail.com designates 209.85.208.176 as permitted sender) smtp.mailfrom=andriyvos@gmail.com X-Spamd-Result: default: False [-3.49 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.72)[-0.720,0]; RCVD_IN_DNSWL_NONE(0.00)[176.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; IP_SCORE(-1.26)[ip: (-0.43), ipnet: 209.85.128.0/17(-3.79), asn: 15169(-1.99), country: US(-0.07)]; FORGED_SENDER(0.30)[avos@freebsd.org,andriyvos@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[183.200.73.37.zen.spamhaus.org : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_NOT_FQDN(0.50)[]; FROM_NEQ_ENVFROM(0.00)[avos@freebsd.org,andriyvos@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2019 03:14:42 -0000 Sun, 17 Feb 2019 05:12:27 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Sun Feb 17 03:12:27 2019 > New Revision: 344223 > URL: https://svnweb.freebsd.org/changeset/base/344223 > > Log: > MFC r343696: > net80211: do not setup roaming parameters for unsupported modes. > ifconfig(8) prints per-mode parameters if they are non-zero; since > we have 13 possible modes with 3...5 typically supported this change= > should greatly reduce amount of information for 'ifconfig lis= t = > roam' > command. Note for 11-STABLE: here we have only 11 modes (no VHT 2GHz / 5GHz). From owner-svn-src-all@freebsd.org Sun Feb 17 03:21: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 7ED3714E0230; Sun, 17 Feb 2019 03:21:19 +0000 (UTC) (envelope-from avos@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 23C1383204; Sun, 17 Feb 2019 03:21:19 +0000 (UTC) (envelope-from avos@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 187E618736; Sun, 17 Feb 2019 03:21:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3LIiW023590; Sun, 17 Feb 2019 03:21:18 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3LItk023589; Sun, 17 Feb 2019 03:21:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170321.x1H3LItk023589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 03:21:18 +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: r344224 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 344224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23C1383204 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.998,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)[-0.999,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, 17 Feb 2019 03:21:19 -0000 Author: avos Date: Sun Feb 17 03:21:18 2019 New Revision: 344224 URL: https://svnweb.freebsd.org/changeset/base/344224 Log: MFC r343699: net80211: do not setup Tx parameters for unsupported modes. That should shorten 'ifconfig list txparam' output since unsupported modes will not be shown. Modified: stable/12/sys/net80211/ieee80211_proto.c stable/12/sys/net80211/ieee80211_tdma.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/12/sys/net80211/ieee80211_proto.c Sun Feb 17 03:12:27 2019 (r344223) +++ stable/12/sys/net80211/ieee80211_proto.c Sun Feb 17 03:21:18 2019 (r344224) @@ -347,6 +347,9 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) * driver and/or user applications. */ for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { + if (isclr(ic->ic_modecaps, i)) + continue; + const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; Modified: stable/12/sys/net80211/ieee80211_tdma.c ============================================================================== --- stable/12/sys/net80211/ieee80211_tdma.c Sun Feb 17 03:12:27 2019 (r344223) +++ stable/12/sys/net80211/ieee80211_tdma.c Sun Feb 17 03:21:18 2019 (r344224) @@ -127,6 +127,9 @@ static int tdma_process_params(struct ieee80211_node * static void settxparms(struct ieee80211vap *vap, enum ieee80211_phymode mode, int rate) { + if (isclr(vap->iv_ic->ic_modecaps, mode)) + return; + vap->iv_txparms[mode].ucastrate = rate; vap->iv_txparms[mode].mcastrate = rate; } From owner-svn-src-all@freebsd.org Sun Feb 17 03:12: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 500FD14E0073; Sun, 17 Feb 2019 03:12:28 +0000 (UTC) (envelope-from avos@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 E810082DE8; Sun, 17 Feb 2019 03:12:27 +0000 (UTC) (envelope-from avos@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 C0157186E4; Sun, 17 Feb 2019 03:12:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3CRT0020899; Sun, 17 Feb 2019 03:12:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3CRHx020898; Sun, 17 Feb 2019 03:12:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170312.x1H3CRHx020898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 03:12: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: r344223 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 344223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E810082DE8 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.998,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)[-0.999,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, 17 Feb 2019 03:12:28 -0000 Author: avos Date: Sun Feb 17 03:12:27 2019 New Revision: 344223 URL: https://svnweb.freebsd.org/changeset/base/344223 Log: MFC r343696: net80211: do not setup roaming parameters for unsupported modes. ifconfig(8) prints per-mode parameters if they are non-zero; since we have 13 possible modes with 3...5 typically supported this change should greatly reduce amount of information for 'ifconfig list roam' command. While here ensure that sta_roam_check() will not use roaming parameters for unsupported modes (it should not). This change effectively reverts r188776. Modified: stable/11/sys/net80211/ieee80211_scan.c stable/11/sys/net80211/ieee80211_scan_sta.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_scan.c ============================================================================== --- stable/11/sys/net80211/ieee80211_scan.c Sun Feb 17 03:11:42 2019 (r344222) +++ stable/11/sys/net80211/ieee80211_scan.c Sun Feb 17 03:12:27 2019 (r344223) @@ -122,13 +122,21 @@ void ieee80211_scan_vattach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + int m; vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz; vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz; vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz; vap->iv_roaming = IEEE80211_ROAMING_AUTO; - memcpy(vap->iv_roamparms, defroam, sizeof(defroam)); + + memset(vap->iv_roamparms, 0, sizeof(vap->iv_roamparms)); + for (m = IEEE80211_MODE_AUTO + 1; m < IEEE80211_MODE_MAX; m++) { + if (isclr(ic->ic_modecaps, m)) + continue; + + memcpy(&vap->iv_roamparms[m], &defroam[m], sizeof(defroam[m])); + } ic->ic_scan_methods->sc_vattach(vap); } Modified: stable/11/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- stable/11/sys/net80211/ieee80211_scan_sta.c Sun Feb 17 03:11:42 2019 (r344222) +++ stable/11/sys/net80211/ieee80211_scan_sta.c Sun Feb 17 03:12:27 2019 (r344223) @@ -1324,6 +1324,9 @@ sta_roam_check(struct ieee80211_scan_state *ss, struct mode = ieee80211_chan2mode(ic->ic_bsschan); roamRate = vap->iv_roamparms[mode].rate; roamRssi = vap->iv_roamparms[mode].rssi; + KASSERT(roamRate != 0 && roamRssi != 0, ("iv_roamparms are not" + "initialized for %s mode!", ieee80211_phymode_name[mode])); + ucastRate = vap->iv_txparms[mode].ucastrate; /* NB: the most up to date rssi is in the node, not the scan cache */ curRssi = ic->ic_node_getrssi(ni); From owner-svn-src-all@freebsd.org Sun Feb 17 03:11: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 8ACC114DFE6B; Sun, 17 Feb 2019 03:11:43 +0000 (UTC) (envelope-from avos@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 2E67D82AF7; Sun, 17 Feb 2019 03:11:43 +0000 (UTC) (envelope-from avos@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 246D6186A4; Sun, 17 Feb 2019 03:11:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3Bgua020819; Sun, 17 Feb 2019 03:11:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3Bg8a020817; Sun, 17 Feb 2019 03:11:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170311.x1H3Bg8a020817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 03:11: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: r344222 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 344222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E67D82AF7 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.998,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)[-0.999,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, 17 Feb 2019 03:11:43 -0000 Author: avos Date: Sun Feb 17 03:11:42 2019 New Revision: 344222 URL: https://svnweb.freebsd.org/changeset/base/344222 Log: MFC r343696: net80211: do not setup roaming parameters for unsupported modes. ifconfig(8) prints per-mode parameters if they are non-zero; since we have 13 possible modes with 3...5 typically supported this change should greatly reduce amount of information for 'ifconfig list roam' command. While here ensure that sta_roam_check() will not use roaming parameters for unsupported modes (it should not). This change effectively reverts r188776. Modified: stable/12/sys/net80211/ieee80211_scan.c stable/12/sys/net80211/ieee80211_scan_sta.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_scan.c ============================================================================== --- stable/12/sys/net80211/ieee80211_scan.c Sun Feb 17 02:58:44 2019 (r344221) +++ stable/12/sys/net80211/ieee80211_scan.c Sun Feb 17 03:11:42 2019 (r344222) @@ -130,13 +130,21 @@ void ieee80211_scan_vattach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + int m; vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz; vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz; vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz; vap->iv_roaming = IEEE80211_ROAMING_AUTO; - memcpy(vap->iv_roamparms, defroam, sizeof(defroam)); + + memset(vap->iv_roamparms, 0, sizeof(vap->iv_roamparms)); + for (m = IEEE80211_MODE_AUTO + 1; m < IEEE80211_MODE_MAX; m++) { + if (isclr(ic->ic_modecaps, m)) + continue; + + memcpy(&vap->iv_roamparms[m], &defroam[m], sizeof(defroam[m])); + } ic->ic_scan_methods->sc_vattach(vap); } Modified: stable/12/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- stable/12/sys/net80211/ieee80211_scan_sta.c Sun Feb 17 02:58:44 2019 (r344221) +++ stable/12/sys/net80211/ieee80211_scan_sta.c Sun Feb 17 03:11:42 2019 (r344222) @@ -1354,6 +1354,9 @@ sta_roam_check(struct ieee80211_scan_state *ss, struct mode = ieee80211_chan2mode(ic->ic_bsschan); roamRate = vap->iv_roamparms[mode].rate; roamRssi = vap->iv_roamparms[mode].rssi; + KASSERT(roamRate != 0 && roamRssi != 0, ("iv_roamparms are not" + "initialized for %s mode!", ieee80211_phymode_name[mode])); + ucastRate = vap->iv_txparms[mode].ucastrate; /* NB: the most up to date rssi is in the node, not the scan cache */ curRssi = ic->ic_node_getrssi(ni); From owner-svn-src-all@freebsd.org Sun Feb 17 03:21: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 0026514E0244; Sun, 17 Feb 2019 03:21:43 +0000 (UTC) (envelope-from avos@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 98C108332B; Sun, 17 Feb 2019 03:21:43 +0000 (UTC) (envelope-from avos@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 8470E1875A; Sun, 17 Feb 2019 03:21:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3Lh8I024460; Sun, 17 Feb 2019 03:21:43 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3LhiH024458; Sun, 17 Feb 2019 03:21:43 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170321.x1H3LhiH024458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 03:21: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: r344225 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 344225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98C108332B 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.998,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)[-0.999,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, 17 Feb 2019 03:21:44 -0000 Author: avos Date: Sun Feb 17 03:21:42 2019 New Revision: 344225 URL: https://svnweb.freebsd.org/changeset/base/344225 Log: MFC r343699: net80211: do not setup Tx parameters for unsupported modes. That should shorten 'ifconfig list txparam' output since unsupported modes will not be shown. Modified: stable/11/sys/net80211/ieee80211_proto.c stable/11/sys/net80211/ieee80211_tdma.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/11/sys/net80211/ieee80211_proto.c Sun Feb 17 03:21:18 2019 (r344224) +++ stable/11/sys/net80211/ieee80211_proto.c Sun Feb 17 03:21:42 2019 (r344225) @@ -345,6 +345,9 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) * driver and/or user applications. */ for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { + if (isclr(ic->ic_modecaps, i)) + continue; + const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; Modified: stable/11/sys/net80211/ieee80211_tdma.c ============================================================================== --- stable/11/sys/net80211/ieee80211_tdma.c Sun Feb 17 03:21:18 2019 (r344224) +++ stable/11/sys/net80211/ieee80211_tdma.c Sun Feb 17 03:21:42 2019 (r344225) @@ -125,6 +125,9 @@ static int tdma_process_params(struct ieee80211_node * static void settxparms(struct ieee80211vap *vap, enum ieee80211_phymode mode, int rate) { + if (isclr(vap->iv_ic->ic_modecaps, mode)) + return; + vap->iv_txparms[mode].ucastrate = rate; vap->iv_txparms[mode].mcastrate = rate; } From owner-svn-src-all@freebsd.org Sun Feb 17 02:58: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 0786514DEEA9; Sun, 17 Feb 2019 02:58:45 +0000 (UTC) (envelope-from avos@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 9E56681659; Sun, 17 Feb 2019 02:58:44 +0000 (UTC) (envelope-from avos@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 91DF1182E3; Sun, 17 Feb 2019 02:58:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H2wi9c009331; Sun, 17 Feb 2019 02:58:44 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H2wiV4009330; Sun, 17 Feb 2019 02:58:44 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902170258.x1H2wiV4009330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 17 Feb 2019 02:58:44 +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: r344221 - in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 10/sys/cam/scsi 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 344221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E56681659 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.998,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)[-0.999,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, 17 Feb 2019 02:58:45 -0000 Author: avos Date: Sun Feb 17 02:58:44 2019 New Revision: 344221 URL: https://svnweb.freebsd.org/changeset/base/344221 Log: MFC r343501: Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras PR: 97472 Submitted by: Fabio Luis Girardi Reviewed by: imp Modified: stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/cam/scsi/scsi_da.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Sun Feb 17 02:39:17 2019 (r344220) +++ stable/11/sys/cam/scsi/scsi_da.c Sun Feb 17 02:58:44 2019 (r344221) @@ -1059,6 +1059,30 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Olympus digital cameras (C-3040ZOOM, C-2040ZOOM, C-1) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "C*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* + * Olympus digital cameras (D-370) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "D*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE + }, + { + /* + * Olympus digital cameras (E-100RS, E-10). + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "E*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* * Olympus FE-210 camera */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", From owner-svn-src-all@freebsd.org Sun Feb 17 03:35: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 3E16114E082C; Sun, 17 Feb 2019 03:35:16 +0000 (UTC) (envelope-from pkelsey@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 D0F938393B; Sun, 17 Feb 2019 03:35:15 +0000 (UTC) (envelope-from pkelsey@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 C215018A53; Sun, 17 Feb 2019 03:35:15 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3ZFbV031622; Sun, 17 Feb 2019 03:35:15 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3ZFPH031621; Sun, 17 Feb 2019 03:35:15 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902170335.x1H3ZFPH031621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 03:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344226 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 344226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0F938393B 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.998,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)[-0.999,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, 17 Feb 2019 03:35:16 -0000 Author: pkelsey Date: Sun Feb 17 03:35:15 2019 New Revision: 344226 URL: https://svnweb.freebsd.org/changeset/base/344226 Log: Fix memory corruption bug introduced in r325310 The bug occurred when a bounce buffer was used and the requested read size was greater than the size of the bounce buffer. This commit also rewrites the read logic so that it is easier to systematically verify all alignment and size cases. Reviewed by: allanjude, tsoome MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19140 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Feb 17 03:21:42 2019 (r344225) +++ head/stand/libsa/zfs/zfs.c Sun Feb 17 03:35:15 2019 (r344226) @@ -363,51 +363,100 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t offset, void *buf, size_t bytes) { int fd, ret; - size_t res, size, remainder, rb_size, blksz; - unsigned secsz; - off_t off; - char *bouncebuf, *rb_buf; + size_t res, head, tail, total_size, full_sec_size; + unsigned secsz, do_tail_read; + off_t start_sec; + char *outbuf, *bouncebuf; fd = (uintptr_t) priv; + outbuf = (char *) buf; bouncebuf = NULL; ret = ioctl(fd, DIOCGSECTORSIZE, &secsz); if (ret != 0) return (ret); - off = offset / secsz; - remainder = offset % secsz; - if (lseek(fd, off * secsz, SEEK_SET) == -1) - return (errno); + /* + * Handling reads of arbitrary offset and size - multi-sector case + * and single-sector case. + * + * Multi-sector Case + * (do_tail_read = true if tail > 0) + * + * |<----------------------total_size--------------------->| + * | | + * |<--head-->|<--------------bytes------------>|<--tail-->| + * | | | | + * | | |<~full_sec_size~>| | | + * +------------------+ +------------------+ + * | |0101010| . . . |0101011| | + * +------------------+ +------------------+ + * start_sec start_sec + n + * + * + * Single-sector Case + * (do_tail_read = false) + * + * |<------total_size = secsz----->| + * | | + * |<-head->|<---bytes--->|<-tail->| + * +-------------------------------+ + * | |0101010101010| | + * +-------------------------------+ + * start_sec + */ + start_sec = offset / secsz; + head = offset % secsz; + total_size = roundup2(head + bytes, secsz); + tail = total_size - (head + bytes); + do_tail_read = ((tail > 0) && (head + bytes > secsz)); + full_sec_size = total_size; + if (head > 0) + full_sec_size -= secsz; + if (do_tail_read) + full_sec_size -= secsz; - rb_buf = buf; - rb_size = bytes; - size = roundup2(bytes + remainder, secsz); - blksz = size; - if (remainder != 0 || size != bytes) { + /* Return of partial sector data requires a bounce buffer. */ + if ((head > 0) || do_tail_read) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); return (ENOMEM); } - rb_buf = bouncebuf; - blksz = rb_size - remainder; } - while (bytes > 0) { - res = read(fd, rb_buf, rb_size); - if (res != rb_size) { + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) + return (errno); + + /* Partial data return from first sector */ + if (head > 0) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { ret = EIO; goto error; } - if (bytes < blksz) - blksz = bytes; - if (bouncebuf != NULL) - memcpy(buf, rb_buf + remainder, blksz); - buf = (void *)((uintptr_t)buf + blksz); - bytes -= blksz; - remainder = 0; - blksz = rb_size; + memcpy(outbuf, bouncebuf + head, secsz - head); + outbuf += secsz - head; + } + + /* Full data return from read sectors */ + if (full_sec_size > 0) { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; + } + + /* Partial data return from last sector */ + if (do_tail_read) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, secsz - tail); } ret = 0; From owner-svn-src-all@freebsd.org Sun Feb 17 03:52: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 00EE614E1168; Sun, 17 Feb 2019 03:52:45 +0000 (UTC) (envelope-from pkelsey@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 9B0EA84398; Sun, 17 Feb 2019 03:52:44 +0000 (UTC) (envelope-from pkelsey@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 8A61218DD1; Sun, 17 Feb 2019 03:52:44 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1H3qiCA041664; Sun, 17 Feb 2019 03:52:44 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H3qiPo041663; Sun, 17 Feb 2019 03:52:44 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902170352.x1H3qiPo041663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 03:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344227 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 344227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B0EA84398 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 03:52:45 -0000 Author: pkelsey Date: Sun Feb 17 03:52:44 2019 New Revision: 344227 URL: https://svnweb.freebsd.org/changeset/base/344227 Log: Remove whole-disk vdev support from zfsboot This is consistent with the removal of whole-disk vdev support from libsa/zfs/zfs.c in r342151, and is part way to having the LBAs read during probe be fully constrained by partition tables when present. Reviewed by: tsoome MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19142 Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Feb 17 03:35:15 2019 (r344226) +++ head/stand/i386/zfsboot/zfsboot.c Sun Feb 17 03:52:44 2019 (r344227) @@ -545,32 +545,19 @@ probe_drive(struct zfsdsk *zdsk) char *sec; unsigned i; - /* - * If we find a vdev on the whole disk, stop here. - */ - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) - return; - #ifdef LOADER_GELI_SUPPORT /* - * Taste the disk, if it is GELI encrypted, decrypt it and check to see if - * it is a usable vdev then. Otherwise dig - * out the partition table and probe each slice/partition - * in turn for a vdev or GELI encrypted vdev. + * Taste the disk, if it is GELI encrypted, decrypt it then dig out the + * partition table and probe each slice/partition in turn for a vdev or + * GELI encrypted vdev. */ elba = drvsize_ext(zdsk); if (elba > 0) { elba--; } zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:"); - if (zdsk->gdev != NULL) { - if (geli_havekey(zdsk->gdev) == 0 || - geli_passphrase(zdsk->gdev, gelipw) == 0) { - if (vdev_probe(vdev_read2, zdsk, NULL) == 0) { - return; - } - } - } + if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0)) + geli_passphrase(zdsk->gdev, gelipw); #endif /* LOADER_GELI_SUPPORT */ sec = dmadat->secbuf; From owner-svn-src-all@freebsd.org Sun Feb 17 09:56: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 C63DB14EBF41; Sun, 17 Feb 2019 09:56: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 6C6E48E68C; Sun, 17 Feb 2019 09:56:12 +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 5FF681CB6E; Sun, 17 Feb 2019 09:56:12 +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 x1H9uC2a028916; Sun, 17 Feb 2019 09:56:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H9uC6E028915; Sun, 17 Feb 2019 09:56:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902170956.x1H9uC6E028915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Feb 2019 09:56:12 +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: r344228 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 344228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C6E48E68C 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 09:56:13 -0000 Author: kib Date: Sun Feb 17 09:56:11 2019 New Revision: 344228 URL: https://svnweb.freebsd.org/changeset/base/344228 Log: MFC r343966: struct xswdev on amd64 requires compat32 shims after ino64. Modified: stable/12/sys/vm/swap_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/swap_pager.c ============================================================================== --- stable/12/sys/vm/swap_pager.c Sun Feb 17 03:52:44 2019 (r344227) +++ stable/12/sys/vm/swap_pager.c Sun Feb 17 09:56:11 2019 (r344228) @@ -2475,10 +2475,23 @@ struct xswdev11 { }; #endif +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) +struct xswdev32 { + u_int xsw_version; + u_int xsw_dev1, xsw_dev2; + int xsw_flags; + int xsw_nblks; + int xsw_used; +}; +#endif + static int sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) { struct xswdev xs; +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) + struct xswdev32 xs32; +#endif #if defined(COMPAT_FREEBSD11) struct xswdev11 xs11; #endif @@ -2489,6 +2502,18 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) error = swap_dev_info(*(int *)arg1, &xs, NULL, 0); if (error != 0) return (error); +#if defined(__amd64__) && defined(COMPAT_FREEBSD32) + if (req->oldlen == sizeof(xs32)) { + xs32.xsw_version = XSWDEV_VERSION; + xs32.xsw_dev1 = xs.xsw_dev; + xs32.xsw_dev2 = xs.xsw_dev >> 32; + xs32.xsw_flags = xs.xsw_flags; + xs32.xsw_nblks = xs.xsw_nblks; + xs32.xsw_used = xs.xsw_used; + error = SYSCTL_OUT(req, &xs32, sizeof(xs32)); + return (error); + } +#endif #if defined(COMPAT_FREEBSD11) if (req->oldlen == sizeof(xs11)) { xs11.xsw_version = XSWDEV_VERSION_11; @@ -2497,9 +2522,10 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) xs11.xsw_nblks = xs.xsw_nblks; xs11.xsw_used = xs.xsw_used; error = SYSCTL_OUT(req, &xs11, sizeof(xs11)); - } else + return (error); + } #endif - error = SYSCTL_OUT(req, &xs, sizeof(xs)); + error = SYSCTL_OUT(req, &xs, sizeof(xs)); return (error); } From owner-svn-src-all@freebsd.org Sun Feb 17 09:57: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 3905C14EC09A; Sun, 17 Feb 2019 09:57:44 +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 D45758E818; Sun, 17 Feb 2019 09:57:43 +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 C7DA41CB70; Sun, 17 Feb 2019 09:57:43 +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 x1H9vhaW029035; Sun, 17 Feb 2019 09:57:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1H9vhnv029034; Sun, 17 Feb 2019 09:57:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902170957.x1H9vhnv029034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Feb 2019 09:57: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: r344229 - stable/12/sys/i386/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/include X-SVN-Commit-Revision: 344229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D45758E818 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2019 09:57:44 -0000 Author: kib Date: Sun Feb 17 09:57:43 2019 New Revision: 344229 URL: https://svnweb.freebsd.org/changeset/base/344229 Log: MFC r343723: i386: Do not ever store to other-CPU counter64 slot. Modified: stable/12/sys/i386/include/counter.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/include/counter.h ============================================================================== --- stable/12/sys/i386/include/counter.h Sun Feb 17 09:56:11 2019 (r344228) +++ stable/12/sys/i386/include/counter.h Sun Feb 17 09:57:43 2019 (r344229) @@ -72,7 +72,12 @@ counter_64_inc_8b(uint64_t *p, int64_t inc) } #ifdef IN_SUBR_COUNTER_C -static inline uint64_t +struct counter_u64_fetch_cx8_arg { + uint64_t res; + uint64_t *p; +}; + +static uint64_t counter_u64_read_one_8b(uint64_t *p) { uint32_t res_lo, res_high; @@ -87,9 +92,22 @@ counter_u64_read_one_8b(uint64_t *p) return (res_lo + ((uint64_t)res_high << 32)); } +static void +counter_u64_fetch_cx8_one(void *arg1) +{ + struct counter_u64_fetch_cx8_arg *arg; + uint64_t val; + + arg = arg1; + val = counter_u64_read_one_8b((uint64_t *)((char *)arg->p + + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))); + atomic_add_64(&arg->res, val); +} + static inline uint64_t counter_u64_fetch_inline(uint64_t *p) { + struct counter_u64_fetch_cx8_arg arg; uint64_t res; int i; @@ -108,9 +126,10 @@ counter_u64_fetch_inline(uint64_t *p) } critical_exit(); } else { - CPU_FOREACH(i) - res += counter_u64_read_one_8b((uint64_t *)((char *)p + - UMA_PCPU_ALLOC_SIZE * i)); + arg.p = p; + arg.res = 0; + smp_rendezvous(NULL, counter_u64_fetch_cx8_one, NULL, &arg); + res = arg.res; } return (res); } From owner-svn-src-all@freebsd.org Sun Feb 17 12:17: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 87EBE14F0DD5; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB7E6C420; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 0439291FB; Sun, 17 Feb 2019 12:17:45 +0000 (UTC) From: Jan Beich To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344021 - head/share/man/man7 References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> Date: Sun, 17 Feb 2019 13:17:40 +0100 In-Reply-To: <201902112046.x1BKkWFJ007744@repo.freebsd.org> (Edward Tomasz Napierala's message of "Mon, 11 Feb 2019 20:46:32 +0000 (UTC)") Message-ID: <36om-fw2j-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 2AB7E6C420 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.997,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, 17 Feb 2019 12:17:45 -0000 Edward Tomasz Napierala writes: > ... while the > +.Em quarterly .Em looks unnecessary as "the" is enough. /quarterly is a package set (or repository), not an actual name of the branch. - /head -> /latest - /branches/*Q* -> /quarterly - /tags/RELEASE_* -> /release_* > +subdirectory, eg: Did you mean "subdirectory e.g.," ? https://english.stackexchange.com/questions/16172/should-i-always-use-a-comma-after-e-g-or-i-e From owner-svn-src-all@freebsd.org Sun Feb 17 10:01: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 DC25D14EC34C; Sun, 17 Feb 2019 10:01:42 +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 7B2E48EC00; Sun, 17 Feb 2019 10:01:42 +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 7013D1CCFD; Sun, 17 Feb 2019 10:01:42 +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 x1HA1gSq033430; Sun, 17 Feb 2019 10:01:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HA1gYa033429; Sun, 17 Feb 2019 10:01:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902171001.x1HA1gYa033429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 17 Feb 2019 10:01:42 +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: r344230 - stable/11/sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/i386/include X-SVN-Commit-Revision: 344230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B2E48EC00 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.998,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)[-0.999,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, 17 Feb 2019 10:01:43 -0000 Author: kib Date: Sun Feb 17 10:01:42 2019 New Revision: 344230 URL: https://svnweb.freebsd.org/changeset/base/344230 Log: MFC r343723: i386: Do not ever store to other-CPU counter64 slot. Modified: stable/11/sys/i386/include/counter.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/include/counter.h ============================================================================== --- stable/11/sys/i386/include/counter.h Sun Feb 17 09:57:43 2019 (r344229) +++ stable/11/sys/i386/include/counter.h Sun Feb 17 10:01:42 2019 (r344230) @@ -68,7 +68,12 @@ counter_64_inc_8b(uint64_t *p, int64_t inc) } #ifdef IN_SUBR_COUNTER_C -static inline uint64_t +struct counter_u64_fetch_cx8_arg { + uint64_t res; + uint64_t *p; +}; + +static uint64_t counter_u64_read_one_8b(uint64_t *p) { uint32_t res_lo, res_high; @@ -83,9 +88,22 @@ counter_u64_read_one_8b(uint64_t *p) return (res_lo + ((uint64_t)res_high << 32)); } +static void +counter_u64_fetch_cx8_one(void *arg1) +{ + struct counter_u64_fetch_cx8_arg *arg; + uint64_t val; + + arg = arg1; + val = counter_u64_read_one_8b((uint64_t *)((char *)arg->p + + sizeof(struct pcpu) * PCPU_GET(cpuid))); + atomic_add_64(&arg->res, val); +} + static inline uint64_t counter_u64_fetch_inline(uint64_t *p) { + struct counter_u64_fetch_cx8_arg arg; uint64_t res; int i; @@ -104,9 +122,10 @@ counter_u64_fetch_inline(uint64_t *p) } critical_exit(); } else { - CPU_FOREACH(i) - res += counter_u64_read_one_8b((uint64_t *)((char *)p + - sizeof(struct pcpu) * i)); + arg.p = p; + arg.res = 0; + smp_rendezvous(NULL, counter_u64_fetch_cx8_one, NULL, &arg); + res = arg.res; } return (res); } From owner-svn-src-all@freebsd.org Sun Feb 17 16:05: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 63DC014F83BF; Sun, 17 Feb 2019 16:05:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC16F73888; Sun, 17 Feb 2019 16:05:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id y10so7501120plp.0; Sun, 17 Feb 2019 08:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7CP69BX+lw4/DShjv8GftJWJge1trFK6APLCKeU3kRM=; b=PhlwR2uhmX3KTZb4nYKXLX0q7FqTYCfPDsDdhBTuOj8N9F9HzcTtarGS6gbAAUyHlV gmVuFG2guU/9znCyV2WIILjXQob779ZyCB6miZK8zjKS7fORTiPsgKIpRS9tQ4D6QDRc czz/vJPTw3jsJRJwL89K0mpKlVKSj9vJ/Shx3IQUGjtt/XHNoAXBCNTmrDTXI92q7UsA zGBbAc/GRnjHRLUKzza3bu1b96ijbVVDCFH/Zq5ls0w9RdQcxmoDOOk5csngxg+d2XrM 5yXwDDW8Zy9bTkb+6xuLx8WxJKYDu6bhDkWv3YGWbRShqRojatfJh56cokPVgnRAbVCs 6M7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7CP69BX+lw4/DShjv8GftJWJge1trFK6APLCKeU3kRM=; b=Yro7ht/qTLGp7HasIK8Aab5/CrU7ZNZJdlU4d0rI7XTJDxZayaNGmXAGM63iyUoO8n 2exTaJ0Mox13Sk4qvh0hWUSV2voORYnoNDMZvP6rESgD6UE/xpFAtJvnPHjUro0Zsr/Q LjJ5WWUuESEG4xKQrbAssFn5Yhxb3uuiBPG29oRSoL0BGzXX6ZJiiNuwWAeEr5w+0KdK SfD1zx4qKM6XsyxUK1ZoxjkihXlAxdFR/tE+m6Ww8jAh7jBRrTs/NSoTfkc5pnzExlkx TWOOgW4o4i7gfBFQiH7uAEj2AOLxnVsTxoIGIlR3fe5Dnm2MFJRH8DxOjkGY+rUN/RAw xlxw== X-Gm-Message-State: AHQUAuamsiofCnZihwB4YiEBcNcn6/lZspkynaEMRvkWoCNV2caJnJTn HuG8daJJtmmSD7kN9NEBDxvAaeQO X-Google-Smtp-Source: AHgI3IbLt4CX7CrvzxbH9MGISIXQW9DkWFsiV12/zpNgOsDm+HxVNsyy3K/CXMevOJPgl1uxrJfzCA== X-Received: by 2002:a17:902:f091:: with SMTP id go17mr21058027plb.235.1550419512326; Sun, 17 Feb 2019 08:05:12 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q75sm17921180pfa.38.2019.02.17.08.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Feb 2019 08:05:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344021 - head/share/man/man7 From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <36om-fw2j-wny@FreeBSD.org> Date: Sun, 17 Feb 2019 08:05:10 -0800 Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> <36om-fw2j-wny@FreeBSD.org> To: Jan Beich X-Rspamd-Queue-Id: CC16F73888 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 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.92)[-0.917,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, 17 Feb 2019 16:05:14 -0000 > On Feb 17, 2019, at 04:17, Jan Beich wrote: >=20 > Edward Tomasz Napierala writes: >=20 >> ... while the >> +.Em quarterly >=20 > .Em looks unnecessary as "the" is enough. /quarterly is a package set > (or repository), not an actual name of the branch. >=20 > - /head -> /latest > - /branches/*Q* -> /quarterly > - /tags/RELEASE_* -> /release_* >=20 >> +subdirectory, eg: >=20 > Did you mean "subdirectory e.g.," ? >=20 > https://english.stackexchange.com/questions/16172/should-i-always-use-a-co= mma-after-e-g-or-i-e It=E2=80=99s actually =E2=80=9Csubdirectory, e.g.,=E2=80=9D. igor will corre= ct the usage :). Cheers! -Enji= From owner-svn-src-all@freebsd.org Sun Feb 17 16:43: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 A2D5414D220C; Sun, 17 Feb 2019 16:43:45 +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 4845B74DFB; Sun, 17 Feb 2019 16:43:45 +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 38E1A21115; Sun, 17 Feb 2019 16:43:45 +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 x1HGhjx8042296; Sun, 17 Feb 2019 16:43:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGhjlF042295; Sun, 17 Feb 2019 16:43:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171643.x1HGhjlF042295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344232 - head/sys/amd64/sgx X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/sgx X-SVN-Commit-Revision: 344232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4845B74DFB 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 16:43:45 -0000 Author: markj Date: Sun Feb 17 16:43:44 2019 New Revision: 344232 URL: https://svnweb.freebsd.org/changeset/base/344232 Log: Fix refcount leaks in the SGX Linux compat ioctl handler. Some argument validation error paths would return without releasing the file reference obtained at the beginning of the function. While here, fix some style bugs and remove trivial debug prints. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19214 Modified: head/sys/amd64/sgx/sgx_linux.c Modified: head/sys/amd64/sgx/sgx_linux.c ============================================================================== --- head/sys/amd64/sgx/sgx_linux.c Sun Feb 17 16:35:19 2019 (r344231) +++ head/sys/amd64/sgx/sgx_linux.c Sun Feb 17 16:43:44 2019 (r344232) @@ -70,30 +70,26 @@ sgx_linux_ioctl(struct thread *td, struct linux_ioctl_ cmd = args->cmd; args->cmd &= ~(LINUX_IOC_IN | LINUX_IOC_OUT); - if (cmd & LINUX_IOC_IN) + if ((cmd & LINUX_IOC_IN) != 0) args->cmd |= IOC_IN; - if (cmd & LINUX_IOC_OUT) + if ((cmd & LINUX_IOC_OUT) != 0) args->cmd |= IOC_OUT; len = IOCPARM_LEN(cmd); if (len > SGX_IOCTL_MAX_DATA_LEN) { - printf("%s: Can't copy data: cmd len is too big %d\n", - __func__, len); - return (EINVAL); + error = EINVAL; + goto out; } - if (cmd & LINUX_IOC_IN) { + if ((cmd & LINUX_IOC_IN) != 0) { error = copyin((void *)args->arg, data, len); - if (error) { - printf("%s: Can't copy data, error %d\n", - __func__, error); - return (EINVAL); - } + if (error != 0) + goto out; } - error = (fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td)); + error = fo_ioctl(fp, args->cmd, (caddr_t)data, td->td_ucred, td); +out: fdrop(fp, td); - return (error); } From owner-svn-src-all@freebsd.org Sun Feb 17 16:35: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 E8A3E14F8F0D; Sun, 17 Feb 2019 16:35:20 +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 834C87492A; Sun, 17 Feb 2019 16:35:20 +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 2651220F6C; Sun, 17 Feb 2019 16:35:20 +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 x1HGZJVK037071; Sun, 17 Feb 2019 16:35:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGZJCh037070; Sun, 17 Feb 2019 16:35:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171635.x1HGZJCh037070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344231 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 834C87492A 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 16:35:21 -0000 Author: markj Date: Sun Feb 17 16:35:19 2019 New Revision: 344231 URL: https://svnweb.freebsd.org/changeset/base/344231 Log: Remove a redundant flag variable. Use the object pointer itself to determine whether the object is locked. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19215 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Feb 17 10:01:42 2019 (r344230) +++ head/sys/vm/vm_pageout.c Sun Feb 17 16:35:19 2019 (r344231) @@ -695,10 +695,9 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, vm_page_t m, marker; int act_delta, error, numpagedout, queue, starting_target; int vnodes_skipped; - bool obj_locked, pageout_ok; + bool pageout_ok; mtx = NULL; - obj_locked = false; object = NULL; starting_target = launder; vnodes_skipped = 0; @@ -760,22 +759,16 @@ recheck: } if (object != m->object) { - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } object = m->object; - } - if (!obj_locked) { if (!VM_OBJECT_TRYWLOCK(object)) { mtx_unlock(mtx); /* Depends on type-stability. */ VM_OBJECT_WLOCK(object); - obj_locked = true; mtx_lock(mtx); goto recheck; - } else - obj_locked = true; + } } if (vm_page_busied(m)) @@ -897,17 +890,13 @@ free_page: vnodes_skipped++; } mtx = NULL; - obj_locked = false; + object = NULL; } } - if (mtx != NULL) { + if (mtx != NULL) mtx_unlock(mtx); - mtx = NULL; - } - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } vm_pagequeue_lock(pq); vm_pageout_end_scan(&ss); vm_pagequeue_unlock(pq); @@ -1368,7 +1357,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh vm_object_t object; int act_delta, addl_page_shortage, deficit, page_shortage; int starting_page_shortage; - bool obj_locked; /* * The addl_page_shortage is an estimate of the number of temporarily @@ -1388,7 +1376,6 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh starting_page_shortage = page_shortage = shortage + deficit; mtx = NULL; - obj_locked = false; object = NULL; vm_batchqueue_init(&rq); @@ -1446,22 +1433,16 @@ recheck: } if (object != m->object) { - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } object = m->object; - } - if (!obj_locked) { if (!VM_OBJECT_TRYWLOCK(object)) { mtx_unlock(mtx); /* Depends on type-stability. */ VM_OBJECT_WLOCK(object); - obj_locked = true; mtx_lock(mtx); goto recheck; - } else - obj_locked = true; + } } if (vm_page_busied(m)) { @@ -1563,14 +1544,10 @@ free_page: reinsert: vm_pageout_reinsert_inactive(&ss, &rq, m); } - if (mtx != NULL) { + if (mtx != NULL) mtx_unlock(mtx); - mtx = NULL; - } - if (obj_locked) { + if (object != NULL) VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } vm_pageout_reinsert_inactive(&ss, &rq, NULL); vm_pageout_reinsert_inactive(&ss, &ss.bq, NULL); vm_pagequeue_lock(pq); From owner-svn-src-all@freebsd.org Sun Feb 17 17:47: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 73E5C14D715B; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@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 14C1E77ABD; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@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 048E721B6C; Sun, 17 Feb 2019 17:47:09 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HHl8n5074436; Sun, 17 Feb 2019 17:47:08 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HHl8A7074435; Sun, 17 Feb 2019 17:47:08 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902171747.x1HHl8A7074435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 17 Feb 2019 17:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344234 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 344234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14C1E77ABD 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.998,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)[-0.999,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, 17 Feb 2019 17:47:09 -0000 Author: pkelsey Date: Sun Feb 17 17:47:08 2019 New Revision: 344234 URL: https://svnweb.freebsd.org/changeset/base/344234 Log: It turns out r344226 narrowed the overrun bug but did not eliminate it entirely This commit fixes a remaining output buffer overrun in the single-sector case when there is a non-zero tail. Reviewed by: allanjude, tsoome MFC after: 3 months MFC with: r344226 Differential Revision: https://reviews.freebsd.org/D19220 Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Feb 17 16:56:41 2019 (r344233) +++ head/stand/libsa/zfs/zfs.c Sun Feb 17 17:47:08 2019 (r344234) @@ -435,8 +435,8 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void ret = EIO; goto error; } - memcpy(outbuf, bouncebuf + head, secsz - head); - outbuf += secsz - head; + memcpy(outbuf, bouncebuf + head, min(secsz - head, bytes)); + outbuf += min(secsz - head, bytes); } /* Full data return from read sectors */ From owner-svn-src-all@freebsd.org Sun Feb 17 20:25: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 354DC14DD99A; Sun, 17 Feb 2019 20:25:08 +0000 (UTC) (envelope-from jilles@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 CFF1F877FA; Sun, 17 Feb 2019 20:25:07 +0000 (UTC) (envelope-from jilles@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 C1514236CF; Sun, 17 Feb 2019 20:25:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HKP7tm063378; Sun, 17 Feb 2019 20:25:07 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HKP79a063377; Sun, 17 Feb 2019 20:25:07 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201902172025.x1HKP79a063377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 17 Feb 2019 20:25: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: r344237 - stable/12/sbin/dhclient X-SVN-Group: stable-12 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/12/sbin/dhclient X-SVN-Commit-Revision: 344237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFF1F877FA 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.998,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)[-0.999,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, 17 Feb 2019 20:25:08 -0000 Author: jilles Date: Sun Feb 17 20:25:07 2019 New Revision: 344237 URL: https://svnweb.freebsd.org/changeset/base/344237 Log: MFC r343896,r343922: dhclient: Pass through exit status from script The wait status is translated into 8 bits the same way as the shell calculates $?. Modified: stable/12/sbin/dhclient/dhclient.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dhclient/dhclient.c ============================================================================== --- stable/12/sbin/dhclient/dhclient.c Sun Feb 17 18:32:19 2019 (r344236) +++ stable/12/sbin/dhclient/dhclient.c Sun Feb 17 20:25:07 2019 (r344237) @@ -2350,7 +2350,8 @@ priv_script_go(void) if (ip) script_flush_env(ip->client); - return (wstatus & 0xff); + return (WIFEXITED(wstatus) ? + WEXITSTATUS(wstatus) : 128 + WTERMSIG(wstatus)); } void From owner-svn-src-all@freebsd.org Sun Feb 17 22:22: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 9212814E2718; Sun, 17 Feb 2019 22:22:52 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [144.76.30.122]) (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 "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAA48BDFF; Sun, 17 Feb 2019 22:22:51 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Sun, 17 Feb 2019 23:22:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1550442169; bh=8rK1x++DXsWcwp+9o9dx51DSdBufTEtw9cVokwvozes=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=Bzg1UNPohLQ29DPlElbfUk8FiT1hE0PXhitJAlxznBKMdcZKMCRGdY4oOIcbz1Vof P/KJUBj3qODRjUkGueGloIOFAj6DoyvYBXUhmDu0juj8GSCOCwdrgGQ5qxWYWgQQMC nToYoy6pCdGGFpSJtH75h4yE4WjBSf5ofOeUOVy/kXQwgf1WUqEGPrSp00YIW3HKfQ 7/Tk36fTjVdcB68GuFfZWNzktt63F7Y3w/RJ53j3aCOfFgROrt3ugVM28ZGCB+G0rJ tPAiCap3n/odH3rxMJxWPukSq19fvMbLzppf0P9cYhLLQbaqERk4RjQfJjwP8gOBq9 1OX2F3pJVf1CA== Message-ID: <87bm3aawcn.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys In-Reply-To: <20190217211916.GD2420@kib.kiev.ua> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> <20190217211916.GD2420@kib.kiev.ua> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/27.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2AAA48BDFF 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.928,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: Sun, 17 Feb 2019 22:22:52 -0000 On Sun, 17 Feb 2019 22:19:16 +0100, Konstantin Belousov wrote: > > On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > > > Author: kib > > > Date: Fri Feb 15 11:33:48 2019 > > > New Revision: 344157 > > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > > > Log: > > > MFC r343855, r343859: > > > Use ifunc to select the barrier instruction for RDTSC. > > > > > > Modified: > > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > > Directory Properties: > > > stable/12/ (props changed) > > > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > > system is unusable. Basically all programs produce a "Segmentation > > fault (core dumped)": > > > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > > pid 877 (su), jid 0, uid 0: exited on signal 11 > > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > > pid 885 (sudo), jid 0, uid 0: exited on signal 11 > > What do you have in your make.conf and src.conf ? I am building on a faster machine with a Intel(R) Xeon(R) CPU. /etc/src.conf: WITHOUT_DEBUG_FILES= WITHOUT_KERNEL_SYMBOLS= WITHOUT_PROFILE= WITH_KERNEL_RETPOLINE= WITH_RETPOLINE= INSTALL_NODEBUG= WITHOUT_TESTS= WITHOUT_GAMES= /etc/make.conf contains only a line for KERNCONF and DEFAULT_VERSIONS. > Can you show me CPU identification lines from dmesg for a verbose boot ? CPU: Genuine Intel(R) CPU @ 1.60GHz (1600.06-MHz K8-class CPU) Origin="GenuineIntel" Id=0x20661 Family=0x6 Model=0x26 Stepping=1 Features=0xbfe9fbff Features2=0x40e3bd AMD Features=0x20100800 AMD Features2=0x1 VT-x: (disabled in BIOS) Basic Features=0x5a0400 Pin-Based Controls=0x3f Primary Processor Controls=0x77f9fffe Exit Controls=0x5a0400 Entry Controls=0x5a0400 TSC: P-state invariant, performance statistics Data TLB0: 4 KByte pages, fully associative, 16 entries Data TLB1: 4 KByte pages, 4-way associative, 64 entries Instruction TLB: 4 KByte pages, 32 entries Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries 2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size 1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size 1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size L2 cache: 512 kbytes, 8-way associative, 64 bytes/line > I suspect that you can take /lib/libc.so.7 from 12.0 RELEASE and restore > the system. If it helps, please move your existing libc.so.7 into some > directory, reproduce the problem with 'LD_LIBRARY_PATH= bad libc.so.7> /bin/ls' and load the core into gdb. I want to see > the backtrace for start. Yes, restoring /lib/libc.so.7 from previous build (r344152) works. #0 0x0000000800487800 in *ABS*@plt () from /home/herbert/broken_libc/libc.so.7 #1 0x000000080048781c in *ABS*@plt () from /home/herbert/broken_libc/libc.so.7 #2 0x00000008003f2e6a in xdr_ypresponse () from /home/herbert/broken_libc/libc.so.7 #3 0x0000000800464849 in access () from /home/herbert/broken_libc/libc.so.7 #4 0x0000000800464938 in access () from /home/herbert/broken_libc/libc.so.7 #5 0x0000000800429ad1 in clock_gettime () from /home/herbert/broken_libc/libc.so.7 #6 0x00000008003b574f in madvise () from /home/herbert/broken_libc/libc.so.7 #7 0x00000008003da262 in _pthread_mutex_init_calloc_cb () from /home/herbert/broken_libc/libc.so.7 #8 0x00000008003dc4ba in _pthread_mutex_init_calloc_cb () from /home/herbert/broken_libc/libc.so.7 #9 0x00000008003e958c in _malloc_first_thread () from /home/herbert/broken_libc/libc.so.7 #10 0x00000008003e7ba8 in nallocm () from /home/herbert/broken_libc/libc.so.7 #11 0x0000000800214479 in r_debug_state () from /libexec/ld-elf.so.1 #12 0x000000080021305a in __tls_get_addr () from /libexec/ld-elf.so.1 #13 0x0000000800211019 in ?? () from /libexec/ld-elf.so.1 #14 0x0000000000000000 in ?? () -- Herbert From owner-svn-src-all@freebsd.org Sun Feb 17 16:56: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 D5B1114D2A6A; Sun, 17 Feb 2019 16:56: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 74FEC754D8; Sun, 17 Feb 2019 16:56: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 64E4D212BE; Sun, 17 Feb 2019 16:56: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 x1HGugj4047682; Sun, 17 Feb 2019 16:56:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HGug58047681; Sun, 17 Feb 2019 16:56:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902171656.x1HGug58047681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Feb 2019 16:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344233 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74FEC754D8 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.998,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)[-0.999,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, 17 Feb 2019 16:56:43 -0000 Author: markj Date: Sun Feb 17 16:56:41 2019 New Revision: 344233 URL: https://svnweb.freebsd.org/changeset/base/344233 Log: Remove a write-only variable orphaned by r340677. Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sun Feb 17 16:43:44 2019 (r344232) +++ head/sys/kern/sys_pipe.c Sun Feb 17 16:56:41 2019 (r344233) @@ -379,9 +379,7 @@ void pipe_dtor(struct pipe *dpipe) { struct pipe *peer; - ino_t ino; - ino = dpipe->pipe_ino; peer = (dpipe->pipe_state & PIPE_NAMED) != 0 ? dpipe->pipe_peer : NULL; funsetown(&dpipe->pipe_sigio); pipeclose(dpipe); From owner-svn-src-all@freebsd.org Sun Feb 17 18:26: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 5084C14D8A2B; Sun, 17 Feb 2019 18:26:28 +0000 (UTC) (envelope-from oshogbo@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 E1F1081124; Sun, 17 Feb 2019 18:26:27 +0000 (UTC) (envelope-from oshogbo@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 C866622250; Sun, 17 Feb 2019 18:26:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HIQRZX095460; Sun, 17 Feb 2019 18:26:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HIQRdg095459; Sun, 17 Feb 2019 18:26:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201902171826.x1HIQRdg095459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 17 Feb 2019 18:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344235 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 344235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1F1081124 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 17 Feb 2019 18:26:28 -0000 Author: oshogbo Date: Sun Feb 17 18:26:27 2019 New Revision: 344235 URL: https://svnweb.freebsd.org/changeset/base/344235 Log: libnv: fix double free In r343986 we introduced a double free. The structure was already freed fixed in the r302966. This problem was introduced because the GitHub version was out of sync with the FreeBSD one. Submitted by: Mindaugas Rasiukevicius MFC with: r343986 Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Sun Feb 17 17:47:08 2019 (r344234) +++ head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:26:27 2019 (r344235) @@ -229,14 +229,6 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); for (i = 0; i < count; i++) { - nvlist_t *nvl; - nvpair_t *nnvp; - - nvl = nvlarray[i]; - nnvp = nvlist_get_array_next_nvpair(nvl); - if (nnvp != NULL) { - nvpair_free_structure(nnvp); - } nvlist_set_array_next(nvl, NULL); nvlist_set_parent(nvl, NULL); } From owner-svn-src-all@freebsd.org Sun Feb 17 18:32: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 5800E14D8DA1; Sun, 17 Feb 2019 18:32:20 +0000 (UTC) (envelope-from oshogbo@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 EBD3681641; Sun, 17 Feb 2019 18:32:19 +0000 (UTC) (envelope-from oshogbo@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 DD7BB223EB; Sun, 17 Feb 2019 18:32:19 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1HIWJZo000456; Sun, 17 Feb 2019 18:32:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HIWJQW000455; Sun, 17 Feb 2019 18:32:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201902171832.x1HIWJQW000455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 17 Feb 2019 18:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344236 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 344236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBD3681641 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 18:32:20 -0000 Author: oshogbo Date: Sun Feb 17 18:32:19 2019 New Revision: 344236 URL: https://svnweb.freebsd.org/changeset/base/344236 Log: libnv: fix revert Reported by: jenkins Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:26:27 2019 (r344235) +++ head/sys/contrib/libnv/nvpair.c Sun Feb 17 18:32:19 2019 (r344236) @@ -229,8 +229,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); for (i = 0; i < count; i++) { - nvlist_set_array_next(nvl, NULL); - nvlist_set_parent(nvl, NULL); + nvlist_set_array_next(nvlarray[i], NULL); + nvlist_set_parent(nvlarray[i], NULL); } } From owner-svn-src-all@freebsd.org Sun Feb 17 18:33: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 79C2F14D8DDA; Sun, 17 Feb 2019 18:33:36 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC26581768; Sun, 17 Feb 2019 18:33:35 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.254.108]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MKYsh-1gwoxw3MNr-001whd; Sun, 17 Feb 2019 19:33:31 +0100 Date: Sun, 17 Feb 2019 19:32:53 +0100 From: "O. Hartmann" To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344235 - head/sys/contrib/libnv Message-ID: <20190217193320.799424e6@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201902171826.x1HIQRdg095459@repo.freebsd.org> References: <201902171826.x1HIQRdg095459@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:AlET25rEesps1vqHW+j578f+PT8pBTySZt4ngR3fN9Ga6luoStb Xj8wYgNDD4mGnwIxIuDHctZkcW6qetHS1b+KdOcT2GFRgxQMzmcyUKPIDdvQakY943COMIX +gWy6/qtnaz8S+cjXaPHJEGjKCpSQC+MFGlTb0JKqXG2frg92LgPu0pa5AqWnXRkLXmaohO ap5DEeuOOr3f85ix4O+wA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KEwMJzO+92c=:oitOyEJCCjWwpxBImmgtuh Rr1im0zYrByC27jzKIMusSYOGMjFxmp7+NsG8RBWBJ+83/gIImbCisKKin6BjMS+wEVUkGBW6 5bBwo+XTLsYWvPdP1Tmxpo06FXZEArN6dk3KvNteoGgrMHDaFqWiFDSAa6vN1KYCNFerzATSa ARupNaYHUOlF/OkfaNKc8yVjizpJ8L/XmIaIATEQ5zzbhO/RCoat+EC3eTxEibfu35XWNiANe osQWBhKU2aekS0Ch+lIAZtqcrmK+csQDbWSL9Z2/J9ZgiMYMOyEnxsFdqoHhTxICbBt2pq0hG Q0LFaDH+A+7WpT2pw8hkwt2RH2PtygOKscShxmicUZ2FkQbk6TG5N2Tn4SP0s0oUR7yxBZpOn po3F+DNRnKGNhjNLY1rLmYls+gcTKYSgsOG5f9BYhpIHQHTCGT98De73+oJEFn95zHkuZDOhj s+p3FHw1bCWGAq7a0c5bG1HvHaPTtTBp6JwrymfVsMPwa2P5iMOpskjN0kCxXkKVtchqGSeIE uxF1HlJI2uOD23Z2v0tHsXkA7WeCNvozpkVzKzlV6SpHiFxh14+NudGzLIiYJJfb0vV5oX097 bzYBQPNV9/10fFXjPo4O3O2+3FfHJ7qrJC8g1DY0anQV5gSuexpS0EcsP4Vpba4WgdbuGSfqM U0LugkEeyXA0Y5JGfR+rYQCmQfZ25dv5IC0ZaF9XLejsvxTFEUuRFr0fNgLV9LRBton76e5t1 SAiV8XLNhqzjr08tPg2RyRuB5xsnuGNBct7Bj/bvYwEoWu8bhvsSS3xfrTxVVCls7+RM1X2JZ CnKbhTHlVG8r1+VJKEt7MPFwpBqPvqw0jt6vU4RLmKgE39BceeQj9VLCtuEQrN7iGJF1kiOcL vcW2sF30lH0K2SR1VQ047/3+hxwvM8SgX4ZmMe9f0AlLwMLiG2GVPmFr0ngz+s5bS3MQru35y 490AI+tidOQ== X-Rspamd-Queue-Id: DC26581768 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,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, 17 Feb 2019 18:33:36 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFN1 biwgMTcgRmViIDIwMTkgMTg6MjY6MjcgKzAwMDAgKFVUQykNCk1hcml1c3ogWmFib3Jza2kgPG9z aG9nYm9ARnJlZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBvc2hvZ2JvDQo+IERhdGU6 IFN1biBGZWIgMTcgMTg6MjY6MjcgMjAxOQ0KPiBOZXcgUmV2aXNpb246IDM0NDIzNQ0KPiBVUkw6 IGh0dHBzOi8vc3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzM0NDIzNQ0KPiANCj4g TG9nOg0KPiAgIGxpYm52OiBmaXggZG91YmxlIGZyZWUNCj4gICANCj4gICBJbiByMzQzOTg2IHdl IGludHJvZHVjZWQgYSBkb3VibGUgZnJlZS4gVGhlIHN0cnVjdHVyZSB3YXMgYWxyZWFkeQ0KPiAg IGZyZWVkIGZpeGVkIGluIHRoZSByMzAyOTY2LiBUaGlzIHByb2JsZW0gd2FzIGludHJvZHVjZWQN Cj4gICBiZWNhdXNlIHRoZSBHaXRIdWIgdmVyc2lvbiB3YXMgb3V0IG9mIHN5bmMgd2l0aCB0aGUg RnJlZUJTRCBvbmUuDQo+ICAgDQo+ICAgU3VibWl0dGVkIGJ5OglNaW5kYXVnYXMgUmFzaXVrZXZp Y2l1cyA8cm1pbmRAbmV0YnNkLm9yZz4NCj4gICBNRkMgd2l0aDoJcjM0Mzk4Ng0KPiANCj4gTW9k aWZpZWQ6DQo+ICAgaGVhZC9zeXMvY29udHJpYi9saWJudi9udnBhaXIuYw0KPiANCj4gTW9kaWZp ZWQ6IGhlYWQvc3lzL2NvbnRyaWIvbGlibnYvbnZwYWlyLmMNCj4gPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09DQo+IC0tLSBoZWFkL3N5cy9jb250cmliL2xpYm52L252cGFpci5jCVN1biBGZWIgMTcgMTc6 NDc6MDggMjAxOQkocjM0NDIzNCkNCj4gKysrIGhlYWQvc3lzL2NvbnRyaWIvbGlibnYvbnZwYWly LmMJU3VuIEZlYiAxNyAxODoyNjoyNyAyMDE5CShyMzQ0MjM1KQ0KPiBAQCAtMjI5LDE0ICsyMjks NiBAQCBudnBhaXJfcmVtb3ZlX252bGlzdF9hcnJheShudnBhaXJfdCAqbnZwKQ0KPiAgCW52bGFy cmF5ID0gX19ERUNPTlNUKG52bGlzdF90ICoqLA0KPiAgCSAgICBudnBhaXJfZ2V0X252bGlzdF9h cnJheShudnAsICZjb3VudCkpOw0KPiAgCWZvciAoaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7DQo+ IC0JCW52bGlzdF90ICpudmw7DQo+IC0JCW52cGFpcl90ICpubnZwOw0KPiAtDQo+IC0JCW52bCA9 IG52bGFycmF5W2ldOw0KPiAtCQlubnZwID0gbnZsaXN0X2dldF9hcnJheV9uZXh0X252cGFpcihu dmwpOw0KPiAtCQlpZiAobm52cCAhPSBOVUxMKSB7DQo+IC0JCQludnBhaXJfZnJlZV9zdHJ1Y3R1 cmUobm52cCk7DQo+IC0JCX0NCj4gIAkJbnZsaXN0X3NldF9hcnJheV9uZXh0KG52bCwgTlVMTCk7 DQo+ICAJCW52bGlzdF9zZXRfcGFyZW50KG52bCwgTlVMTCk7DQo+ICAJfQ0KPiBfX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhlYWRAZnJl ZWJzZC5vcmcgbWFpbGluZyBsaXN0DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1h bi9saXN0aW5mby9zdm4tc3JjLWhlYWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55IG1haWwg dG8gInN2bi1zcmMtaGVhZC11bnN1YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KDQpUaGlzIGNvbW1p dCBicmVha3MgYnVpbGR3b3JsZDoNClsuLi5dDQoNCm1rZGlyIC1wICIvdXNyL29iai91c3Ivc3Jj L2FtZDY0LmFtZDY0L3RtcC9sZWdhY3kvL3Vzci9pbmNsdWRlL3N5cyINCj09PT4gbGliL2xpYm52 IChvYmosaW5jbHVkZXMsYWxsLGluc3RhbGwpDQpCdWlsZGluZyAvdXNyL29iai91c3Ivc3JjL2Ft ZDY0LmFtZDY0L3RtcC9vYmotdG9vbHMvbGliL2xpYm52L252cGFpci5vDQotIC0tLSBudnBhaXIu byAtLS0NCi91c3Ivc3JjL3N5cy9jb250cmliL2xpYm52L252cGFpci5jOjIzMjoyNTogZXJyb3I6 IHVzZSBvZiB1bmRlY2xhcmVkIGlkZW50aWZpZXIgJ252bCc7IGRpZCB5b3UNCm1lYW4gJ252cCc/ IG52bGlzdF9zZXRfYXJyYXlfbmV4dChudmwsIE5VTEwpOw0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBefn4NCg0KLSAtLSANCk8uIEhhcnRtYW5uDQoNCkljaCB3aWRlcnNw cmVjaGUgZGVyIE51dHp1bmcgb2RlciDDnGJlcm1pdHRsdW5nIG1laW5lciBEYXRlbiBmw7xyDQpX ZXJiZXp3ZWNrZSBvZGVyIGbDvHIgZGllIE1hcmt0LSBvZGVyIE1laW51bmdzZm9yc2NodW5nICjC pyAyOCBBYnMuIDQgQkRTRykuDQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUtLS0tLQ0KDQppSFVF QVJZSUFCMFdJUVN5OElCeEFQRGtxVkJhVEo0NE4xWlpQYmE1UndVQ1hHbW84QUFLQ1JBNE4xWlpQ YmE1DQpSMWRZQVFESmVpM3J4eHRkbGlUSzEza1JUbEdzUHZHK1hNMnhNSlBodkljQmRVK2syQUQ4 RFQzS0NWdU1qZ3VHDQpXUEZWWGVsVmFBd0lFLzA1RWxWTmcxRlJvWEdXOFFzPQ0KPXRyVksNCi0t LS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-all@freebsd.org Sun Feb 17 23:32: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 A481214E57DC; Sun, 17 Feb 2019 23:32:10 +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 4AECF8E903; Sun, 17 Feb 2019 23:32: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 34D0425602; Sun, 17 Feb 2019 23:32: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 x1HNW9Fm059441; Sun, 17 Feb 2019 23:32:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNW9ut059440; Sun, 17 Feb 2019 23:32:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172332.x1HNW9ut059440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344238 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AECF8E903 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.998,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)[-0.999,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, 17 Feb 2019 23:32:11 -0000 Author: ian Date: Sun Feb 17 23:32:09 2019 New Revision: 344238 URL: https://svnweb.freebsd.org/changeset/base/344238 Log: Restore loader(8)'s ability for lsdev to show partitions within a bsd slice. I'm pretty sure this used to work at one time, perhaps long ago. It has been failing recently because if you call disk_open() with dev->d_partition set to -1 when d_slice refers to a bsd slice, it assumes you want it to open the first partition within that slice. When you then pass that open dev instance to ptable_open(), it tries to read the start of the 'a' partition and decides there is no recognizable partition type there. This restores the old functionality by resetting d_offset to the start of the raw slice after disk_open() returns. For good measure, d_partition is also set back to -1, although that doesn't currently affect anything. I would have preferred to make disk_open() avoid such rude assumptions and if you ask for partition -1 you get the raw slice. But the commit history shows that someone already did that once (r239058), and had to revert it (r239232), so I didn't even try to go down that road. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 20:25:07 2019 (r344237) +++ head/stand/common/disk.c Sun Feb 17 23:32:09 2019 (r344238) @@ -133,6 +133,13 @@ ptable_print(void *arg, const char *pname, const struc dev.d_partition = -1; if (disk_open(&dev, part->end - part->start + 1, od->sectorsize) == 0) { + /* + * disk_open() for partition -1 on a bsd slice assumes + * you want the first bsd partition. Reset things so + * that we're looking at the start of the raw slice. + */ + dev.d_partition = -1; + dev.d_offset = part->start; table = ptable_open(&dev, part->end - part->start + 1, od->sectorsize, ptblread); if (table != NULL) { From owner-svn-src-all@freebsd.org Sun Feb 17 21:19: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 C0FC114E04F2; Sun, 17 Feb 2019 21:19:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 C46D589DAB; Sun, 17 Feb 2019 21:19:24 +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 x1HLJGgK079083 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 17 Feb 2019 23:19:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1HLJGgK079083 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1HLJG6a079082; Sun, 17 Feb 2019 23:19:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 17 Feb 2019 23:19:16 +0200 From: Konstantin Belousov To: "Herbert J. Skuhra" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys Message-ID: <20190217211916.GD2420@kib.kiev.ua> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0nqazuq.wl-herbert@gojira.at> User-Agent: Mutt/1.11.2 (2019-01-07) 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, 17 Feb 2019 21:19:25 -0000 On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > Author: kib > > Date: Fri Feb 15 11:33:48 2019 > > New Revision: 344157 > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > Log: > > MFC r343855, r343859: > > Use ifunc to select the barrier instruction for RDTSC. > > > > Modified: > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > Directory Properties: > > stable/12/ (props changed) > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > system is unusable. Basically all programs produce a "Segmentation > fault (core dumped)": > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > pid 877 (su), jid 0, uid 0: exited on signal 11 > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > pid 885 (sudo), jid 0, uid 0: exited on signal 11 What do you have in your make.conf and src.conf ? Can you show me CPU identification lines from dmesg for a verbose boot ? I suspect that you can take /lib/libc.so.7 from 12.0 RELEASE and restore the system. If it helps, please move your existing libc.so.7 into some directory, reproduce the problem with 'LD_LIBRARY_PATH= /bin/ls' and load the core into gdb. I want to see the backtrace for start. From owner-svn-src-all@freebsd.org Sun Feb 17 21:07: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 6FA7114DFAF3; Sun, 17 Feb 2019 21:07:15 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:191:217b::25]) (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 "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1471F895C2; Sun, 17 Feb 2019 21:07:12 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Sun, 17 Feb 2019 22:07:09 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1550437630; bh=Q0gPZETozAM/mqH0jOCYOHAwqQBhwQUkd/YlXRxTcSY=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=nieTqIPv07xs4YdZQm0ocbZIszWmoTTA5FFs2q7D+jTRwLu/leFy5FBMYWLXVkmv3 aBg4/9bo2cVWLn03CrrGB0V0eh2iYYUutE2bsv5SFW/Laf8ElqQ+bVnb3OEkcZeYn7 9jnOMR63ycUqM9oezAzWVzMlXNjviYuyui3z8sNSb7rqTqD3dYohTyseh1vXzQKyua amP0yW8AS7oq48GY/snmlQ9zKqk/2t1p5ITH8qNhfdtEhedmA4ANWH8zzQAmnYmMK8 l0LLZsxUraRF5nj2YKLxWeY7wg3e+TLoLSgrAQxiqRegol9leyAPWzIBpPcZlaC4g2 0BEQ2XXQI9hJg== Message-ID: <87d0nqazuq.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys In-Reply-To: <201902151133.x1FBXmHU060955@repo.freebsd.org> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/27.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 1471F895C2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail201809 header.b=nieTqIPv; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 2a01:4f8:191:217b::25 as permitted sender) smtp.mailfrom=herbert@gojira.at X-Spamd-Result: default: False [-3.35 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail201809]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:191:217b::25]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gojira.at]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; MX_GOOD(-0.01)[mail.bsd4all.net]; DKIM_TRACE(0.00)[gojira.at:+]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.92)[ipnet: 2a01:4f8::/29(-2.36), asn: 24940(-2.25), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(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: Sun, 17 Feb 2019 21:07:15 -0000 On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > Author: kib > Date: Fri Feb 15 11:33:48 2019 > New Revision: 344157 > URL: https://svnweb.freebsd.org/changeset/base/344157 > > Log: > MFC r343855, r343859: > Use ifunc to select the barrier instruction for RDTSC. > > Modified: > stable/12/lib/libc/x86/sys/__vdso_gettc.c > Directory Properties: > stable/12/ (props changed) After upgrading my Soekris Net 6501-70 (amd64) to this revision the system is unusable. Basically all programs produce a "Segmentation fault (core dumped)": pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) pid 877 (su), jid 0, uid 0: exited on signal 11 pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) pid 885 (sudo), jid 0, uid 0: exited on signal 11 -- Herbert From owner-svn-src-all@freebsd.org Sun Feb 17 23:48: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 649EE14E635C; Sun, 17 Feb 2019 23:48:52 +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 00CF98F4E2; Sun, 17 Feb 2019 23:48:52 +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 BD1E1258FA; Sun, 17 Feb 2019 23:48:51 +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 x1HNmpii067501; Sun, 17 Feb 2019 23:48:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNmpO7067500; Sun, 17 Feb 2019 23:48:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172348.x1HNmpO7067500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344241 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00CF98F4E2 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.998,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)[-0.999,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, 17 Feb 2019 23:48:52 -0000 Author: ian Date: Sun Feb 17 23:48:51 2019 New Revision: 344241 URL: https://svnweb.freebsd.org/changeset/base/344241 Log: Garbage collection no-longer-used constant. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:46:11 2019 (r344240) +++ head/stand/common/disk.c Sun Feb 17 23:48:51 2019 (r344241) @@ -102,7 +102,6 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o blocks * od->sectorsize, (char *)buf, NULL)); } -#define PWIDTH 35 static int ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { @@ -154,7 +153,6 @@ ptable_print(void *arg, const char *pname, const struc return (res); } -#undef PWIDTH int disk_print(struct disk_devdesc *dev, char *prefix, int verbose) From owner-svn-src-all@freebsd.org Sun Feb 17 23:38: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 0531514E5AF2; Sun, 17 Feb 2019 23:38: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 9D7C88EC1B; Sun, 17 Feb 2019 23:38: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 8A0E125746; Sun, 17 Feb 2019 23:38: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 x1HNcHMA061984; Sun, 17 Feb 2019 23:38:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNcHhq061983; Sun, 17 Feb 2019 23:38:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172338.x1HNcHhq061983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344239 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D7C88EC1B 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 17 Feb 2019 23:38:18 -0000 Author: ian Date: Sun Feb 17 23:38:17 2019 New Revision: 344239 URL: https://svnweb.freebsd.org/changeset/base/344239 Log: Use a couple local variables to avoid repetitive long expressions that cause line-wrapping. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:32:09 2019 (r344238) +++ head/stand/common/disk.c Sun Feb 17 23:38:17 2019 (r344239) @@ -112,15 +112,18 @@ ptable_print(void *arg, const char *pname, const struc struct ptable *table; char line[80]; int res; + u_int sectsize; + uint64_t partsize; pa = (struct print_args *)arg; od = (struct open_disk *)pa->dev->dd.d_opendata; + sectsize = od->sectorsize; + partsize = part->end - part->start + 1; sprintf(line, " %s%s: %s", pa->prefix, pname, parttype2str(part->type)); if (pa->verbose) sprintf(line, "%-*s%s", PWIDTH, line, - display_size(part->end - part->start + 1, - od->sectorsize)); + display_size(partsize, sectsize)); strcat(line, "\n"); if (pager_output(line)) return 1; @@ -131,8 +134,7 @@ ptable_print(void *arg, const char *pname, const struc dev.dd.d_unit = pa->dev->dd.d_unit; dev.d_slice = part->index; dev.d_partition = -1; - if (disk_open(&dev, part->end - part->start + 1, - od->sectorsize) == 0) { + if (disk_open(&dev, partsize, sectsize) == 0) { /* * disk_open() for partition -1 on a bsd slice assumes * you want the first bsd partition. Reset things so @@ -140,8 +142,7 @@ ptable_print(void *arg, const char *pname, const struc */ dev.d_partition = -1; dev.d_offset = part->start; - table = ptable_open(&dev, part->end - part->start + 1, - od->sectorsize, ptblread); + table = ptable_open(&dev, partsize, sectsize, ptblread); if (table != NULL) { sprintf(line, " %s%s", pa->prefix, pname); bsd.dev = pa->dev; From owner-svn-src-all@freebsd.org Sun Feb 17 23:46: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 B55CF14E6164; Sun, 17 Feb 2019 23:46:12 +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 53DFE8F2E5; Sun, 17 Feb 2019 23:46:12 +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 451CE258F0; Sun, 17 Feb 2019 23:46:12 +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 x1HNkCA9067352; Sun, 17 Feb 2019 23:46:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1HNkCSl067351; Sun, 17 Feb 2019 23:46:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902172346.x1HNkCSl067351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Feb 2019 23:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344240 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53DFE8F2E5 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.998,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)[-0.999,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, 17 Feb 2019 23:46:13 -0000 Author: ian Date: Sun Feb 17 23:46:11 2019 New Revision: 344240 URL: https://svnweb.freebsd.org/changeset/base/344240 Log: Make lsdev -v output line up in neat columns by using a fixed width for the size field and a tab between the partition type and the size. Changes this disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB to this disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Feb 17 23:38:17 2019 (r344239) +++ head/stand/common/disk.c Sun Feb 17 23:46:11 2019 (r344240) @@ -75,7 +75,7 @@ display_size(uint64_t size, u_int sectorsize) size /= 1024; unit = 'M'; } - sprintf(buf, "%ld%cB", (long)size, unit); + sprintf(buf, "%4ld%cB", (long)size, unit); return (buf); } @@ -119,12 +119,9 @@ ptable_print(void *arg, const char *pname, const struc od = (struct open_disk *)pa->dev->dd.d_opendata; sectsize = od->sectorsize; partsize = part->end - part->start + 1; - sprintf(line, " %s%s: %s", pa->prefix, pname, - parttype2str(part->type)); - if (pa->verbose) - sprintf(line, "%-*s%s", PWIDTH, line, - display_size(partsize, sectsize)); - strcat(line, "\n"); + sprintf(line, " %s%s: %s\t%s\n", pa->prefix, pname, + parttype2str(part->type), + pa->verbose ? display_size(partsize, sectsize) : ""); if (pager_output(line)) return 1; res = 0; From owner-svn-src-all@freebsd.org Mon Feb 18 01:57: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 2B64514EC1F0; Mon, 18 Feb 2019 01:57:49 +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 C73886D8A9; Mon, 18 Feb 2019 01:57:48 +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 9C29E26ED8; Mon, 18 Feb 2019 01:57:48 +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 x1I1vmx7035272; Mon, 18 Feb 2019 01:57:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I1vmlA035269; Mon, 18 Feb 2019 01:57:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201902180157.x1I1vmlA035269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 18 Feb 2019 01:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344242 - in head: etc/mtree stand/powerpc/uboot usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: etc/mtree stand/powerpc/uboot usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 344242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73886D8A9 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.998,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)[-0.999,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, 18 Feb 2019 01:57:49 -0000 Author: jhibbits Date: Mon Feb 18 01:57:47 2019 New Revision: 344242 URL: https://svnweb.freebsd.org/changeset/base/344242 Log: powerpc/boot: Move ubldr to /boot/uboot, and make this a separate filesystem Summary: Now that mpc85xx can boot via ubldr, move ubldr to a separate filesystem, mounted on /boot/uboot, so that a fresh install can boot correctly. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D18709 Modified: head/etc/mtree/BSD.root.dist head/stand/powerpc/uboot/Makefile head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sun Feb 17 23:48:51 2019 (r344241) +++ head/etc/mtree/BSD.root.dist Mon Feb 18 01:57:47 2019 (r344242) @@ -26,6 +26,8 @@ .. modules .. + uboot + .. zfs .. .. Modified: head/stand/powerpc/uboot/Makefile ============================================================================== --- head/stand/powerpc/uboot/Makefile Sun Feb 17 23:48:51 2019 (r344241) +++ head/stand/powerpc/uboot/Makefile Mon Feb 18 01:57:47 2019 (r344242) @@ -11,6 +11,7 @@ LOADER_BZIP2_SUPPORT?= no .include +BINDIR= /boot/uboot PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Sun Feb 17 23:48:51 2019 (r344241) +++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Feb 18 01:57:47 2019 (r344242) @@ -94,9 +94,10 @@ bootpart_size(const char *part_type) return (0); if (strcmp(platform, "chrp") == 0) return (800*1024); - if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0 || - strcmp(platform, "mpc85xx") == 0) + if (strcmp(platform, "ps3") == 0 || strcmp(platform, "powernv") == 0) return (512*1024*1024); + if (strcmp(platform, "mpc85xx") == 0) + return (16*1024*1024); return (0); } @@ -111,13 +112,16 @@ bootpart_type(const char *scheme, const char **mountpo return ("prep-boot"); if (strcmp(platform, "powermac") == 0) return ("apple-boot"); - if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0 || - strcmp(platform, "mpc85xx") == 0) { + if (strcmp(platform, "powernv") == 0 || strcmp(platform, "ps3") == 0) { *mountpoint = "/boot"; if (strcmp(scheme, "GPT") == 0) return ("ms-basic-data"); else if (strcmp(scheme, "MBR") == 0) return ("fat32"); + } + if (strcmp(platform, "mpc85xx") == 0) { + *mountpoint = "/boot/uboot"; + return ("fat16"); } return ("freebsd-boot"); From owner-svn-src-all@freebsd.org Mon Feb 18 02:59: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 83FD114EFCA6; Mon, 18 Feb 2019 02:59:48 +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 233DD70885; Mon, 18 Feb 2019 02:59:48 +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 135262792D; Mon, 18 Feb 2019 02:59:48 +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 x1I2xl0A066208; Mon, 18 Feb 2019 02:59:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I2xler066207; Mon, 18 Feb 2019 02:59:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902180259.x1I2xler066207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 Feb 2019 02:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344243 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 344243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DD70885 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.998,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)[-0.999,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, 18 Feb 2019 02:59:48 -0000 Author: kevans Date: Mon Feb 18 02:59:47 2019 New Revision: 344243 URL: https://svnweb.freebsd.org/changeset/base/344243 Log: lualoader: only clear the screen before first password prompt This was previously an unconditional screen clear, regardless of whether or not we would be prompting for any passwords. This is pointless, given that the screen clear is only there to put our screen into a consistent state before we draw the prompts and do cursor manipulation. This is also the only screen clear besides that to draw the menu. One can now see early pre-loader and loader output with the menu disabled, which may be useful for diagnostics. Reported by: ian MFC after: 3 days Modified: head/stand/lua/password.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password -- Asterisks as a password mask local show_password_mask = false local twiddle_chars = {"/", "-", "\\", "|"} +local screen_setup = false -- Module exports function password.read(prompt_length) @@ -80,14 +81,18 @@ function password.read(prompt_length) end function password.check() - screen.clear() - screen.defcursor() -- pwd is optionally supplied if we want to check it local function doPrompt(prompt, pwd) local attempts = 1 local function clear_incorrect_text_prompt() printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) + end + + if not screen_setup then + screen.clear() + screen.defcursor() + screen_setup = true end while true do From owner-svn-src-all@freebsd.org Mon Feb 18 03:03: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 5CEE014F0167 for ; Mon, 18 Feb 2019 03:03:59 +0000 (UTC) (envelope-from kevans@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 EB6EB71130 for ; Mon, 18 Feb 2019 03:03:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 79C328C66 for ; Mon, 18 Feb 2019 03:03:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f181.google.com with SMTP id v16so12976926ljg.13 for ; Sun, 17 Feb 2019 19:03:58 -0800 (PST) X-Gm-Message-State: AHQUAuYTd41uqLuY1iyN4lzv5Rdnvy4+nWavlF3OviaYoJt/H3/x+CRa gn5YTUkJhKmxym+78G7dIDZaD/85bulJvUWhdig= X-Received: by 2002:a2e:6801:: with SMTP id c1mt758229lja.81.1550459036909; Sun, 17 Feb 2019 19:03:56 -0800 (PST) MIME-Version: 1.0 References: <201902180259.x1I2xler066207@repo.freebsd.org> In-Reply-To: <201902180259.x1I2xler066207@repo.freebsd.org> From: Kyle Evans Date: Sun, 17 Feb 2019 21:03:45 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EB6EB71130 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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 03:03:59 -0000 On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > Author: kevans > Date: Mon Feb 18 02:59:47 2019 > New Revision: 344243 > URL: https://svnweb.freebsd.org/changeset/base/344243 > > Log: > lualoader: only clear the screen before first password prompt > > This was previously an unconditional screen clear, regardless of whether or > not we would be prompting for any passwords. This is pointless, given that > the screen clear is only there to put our screen into a consistent state > before we draw the prompts and do cursor manipulation. > > This is also the only screen clear besides that to draw the menu. One can > now see early pre-loader and loader output with the menu disabled, which may > be useful for diagnostics. > > Reported by: ian > MFC after: 3 days > > Modified: > head/stand/lua/password.lua > > Modified: head/stand/lua/password.lua > ============================================================================== > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password > -- Asterisks as a password mask > local show_password_mask = false > local twiddle_chars = {"/", "-", "\\", "|"} > +local screen_setup = false > > -- Module exports > function password.read(prompt_length) > @@ -80,14 +81,18 @@ function password.read(prompt_length) > end > > function password.check() > - screen.clear() > - screen.defcursor() > -- pwd is optionally supplied if we want to check it > local function doPrompt(prompt, pwd) > local attempts = 1 > > local function clear_incorrect_text_prompt() > printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) > + end > + > + if not screen_setup then > + screen.clear() > + screen.defcursor() > + screen_setup = true > end > > while true do > I noted in testing that this may look kinda funky if you have neither a bootlock password or GELi prompt done by loader(8), but you have a loader password. The autoboot text gets blown away by the subsequent clear screen. I'd be interesting in feedback as to whether this looks odd or how important it is that the autoboot text remains intact, as it's an easy fix to retain it. From owner-svn-src-all@freebsd.org Mon Feb 18 03:15: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 4B08514F087B; Mon, 18 Feb 2019 03:15:26 +0000 (UTC) (envelope-from avos@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 E35D8719AF; Mon, 18 Feb 2019 03:15:25 +0000 (UTC) (envelope-from avos@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 CE3A327CF3; Mon, 18 Feb 2019 03:15:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1I3FP1L077891; Mon, 18 Feb 2019 03:15:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3FPkD077890; Mon, 18 Feb 2019 03:15:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902180315.x1I3FPkD077890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Feb 2019 03:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344244 - head/usr.sbin/rpc.ypupdated X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/rpc.ypupdated X-SVN-Commit-Revision: 344244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E35D8719AF 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 03:15:26 -0000 Author: avos Date: Mon Feb 18 03:15:25 2019 New Revision: 344244 URL: https://svnweb.freebsd.org/changeset/base/344244 Log: Fix memory / resource leaks in usr.sbin/rpc.ypupdated/update.c Re-apply r343909 to this file to get the issue fixed. PR: 204956 Reported by: David Binderman MFC after: 5 days Modified: head/usr.sbin/rpc.ypupdated/update.c Modified: head/usr.sbin/rpc.ypupdated/update.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/update.c Mon Feb 18 02:59:47 2019 (r344243) +++ head/usr.sbin/rpc.ypupdated/update.c Mon Feb 18 03:15:25 2019 (r344244) @@ -263,11 +263,14 @@ localupdate(char *name, char *filename, u_int op, u_in sprintf(tmpname, "%s.tmp", filename); rf = fopen(filename, "r"); if (rf == NULL) { - return (ERR_READ); + err = ERR_READ; + goto cleanup; } wf = fopen(tmpname, "w"); if (wf == NULL) { - return (ERR_WRITE); + fclose(rf); + err = ERR_WRITE; + goto cleanup; } err = -1; while (fgets(line, sizeof (line), rf)) { @@ -307,13 +310,17 @@ localupdate(char *name, char *filename, u_int op, u_in fclose(rf); if (err == 0) { if (rename(tmpname, filename) < 0) { - return (ERR_DBASE); + err = ERR_DBASE; + goto cleanup; } } else { if (unlink(tmpname) < 0) { - return (ERR_DBASE); + err = ERR_DBASE; + goto cleanup; } } +cleanup: + free(tmpname); return (err); } From owner-svn-src-all@freebsd.org Mon Feb 18 03:23: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 AB08114F0E4C; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@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 4ABD37206F; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@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 0159327EBB; Mon, 18 Feb 2019 03:23:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1I3NAls082979; Mon, 18 Feb 2019 03:23:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3NAna082978; Mon, 18 Feb 2019 03:23:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902180323.x1I3NAna082978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Feb 2019 03:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344245 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Commit-Revision: 344245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4ABD37206F 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 03:23:11 -0000 Author: avos Date: Mon Feb 18 03:23:10 2019 New Revision: 344245 URL: https://svnweb.freebsd.org/changeset/base/344245 Log: snmp_hostres(3): fix a typo in sanity checks in handle_chunk() PR: 204253 Submitted by: David Binderman MFC after: 5 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Mon Feb 18 03:15:25 2019 (r344244) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Mon Feb 18 03:23:10 2019 (r344245) @@ -312,7 +312,7 @@ handle_chunk(int32_t ds_index, const char *chunk_name, assert(chunk_name != NULL); assert(chunk_name[0] != '\0'); - if (chunk_name == NULL || chunk_name == '\0') + if (chunk_name == NULL || chunk_name[0] == '\0') return; HRDBG("ANALYZE chunk %s", chunk_name); From owner-svn-src-all@freebsd.org Mon Feb 18 03:41: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 4438814F1476; Mon, 18 Feb 2019 03:41:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 96F0F72A19; Mon, 18 Feb 2019 03:41:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1I3fjva003562; Sun, 17 Feb 2019 19:41:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1I3fjf5003561; Sun, 17 Feb 2019 19:41:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344243 - head/stand/lua In-Reply-To: To: Kyle Evans Date: Sun, 17 Feb 2019 19:41:45 -0800 (PST) CC: src-committers , 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: 96F0F72A19 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.940,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, 18 Feb 2019 03:41:49 -0000 > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > > > Author: kevans > > Date: Mon Feb 18 02:59:47 2019 > > New Revision: 344243 > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > Log: > > lualoader: only clear the screen before first password prompt > > > > This was previously an unconditional screen clear, regardless of whether or > > not we would be prompting for any passwords. This is pointless, given that > > the screen clear is only there to put our screen into a consistent state > > before we draw the prompts and do cursor manipulation. > > > > This is also the only screen clear besides that to draw the menu. One can > > now see early pre-loader and loader output with the menu disabled, which may > > be useful for diagnostics. > > > > Reported by: ian > > MFC after: 3 days > > > > Modified: > > head/stand/lua/password.lua > > > > Modified: head/stand/lua/password.lua > > ============================================================================== > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 (r344242) > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 (r344243) > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect password > > -- Asterisks as a password mask > > local show_password_mask = false > > local twiddle_chars = {"/", "-", "\\", "|"} > > +local screen_setup = false > > > > -- Module exports > > function password.read(prompt_length) > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > end > > > > function password.check() > > - screen.clear() > > - screen.defcursor() > > -- pwd is optionally supplied if we want to check it > > local function doPrompt(prompt, pwd) > > local attempts = 1 > > > > local function clear_incorrect_text_prompt() > > printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) > > + end > > + > > + if not screen_setup then > > + screen.clear() > > + screen.defcursor() > > + screen_setup = true > > end > > > > while true do > > > > I noted in testing that this may look kinda funky if you have neither > a bootlock password or GELi prompt done by loader(8), but you have a > loader password. The autoboot text gets blown away by the subsequent > clear screen. I'd be interesting in feedback as to whether this looks > odd or how important it is that the autoboot text remains intact, as > it's an easy fix to retain it. Personally I would like to see all screen clears go away, as they always seem to wipe out the very diagnostic output that would tell you what went wrong. If possible, instead of clearing the screen, we should go to the bottom and scroll it upwards, drawing new things and scrolling old things off the top. screen clear == evil, unless specifically requested by the user. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 18 03:49: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 73F3A14F171A; Mon, 18 Feb 2019 03:49:17 +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 180EF72CBC; Mon, 18 Feb 2019 03:49:17 +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 0927E287; Mon, 18 Feb 2019 03:49:17 +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 x1I3nGNA093919; Mon, 18 Feb 2019 03:49:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I3nGnt093918; Mon, 18 Feb 2019 03:49:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902180349.x1I3nGnt093918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Feb 2019 03:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344246 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 344246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 180EF72CBC 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 03:49:17 -0000 Author: emaste Date: Mon Feb 18 03:49:16 2019 New Revision: 344246 URL: https://svnweb.freebsd.org/changeset/base/344246 Log: kdump: expand comment on reasons for CAPFAIL_LOOKUP Comment for CAPFAIL_LOOKUP refered only to paths containing ".." but it is returned for other restricted VFS lookup cases, such as absolute paths or openat(AT_FDCWD, ...). Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Feb 18 03:23:10 2019 (r344245) +++ head/usr.bin/kdump/kdump.c Mon Feb 18 03:49:16 2019 (r344246) @@ -2006,7 +2006,7 @@ ktrcapfail(struct ktr_cap_fail *ktr) printf("disallowed system call"); break; case CAPFAIL_LOOKUP: - /* used ".." in strict-relative mode */ + /* absolute or AT_FDCWD path, ".." path, etc. */ printf("restricted VFS lookup"); break; default: From owner-svn-src-all@freebsd.org Mon Feb 18 04:11: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 92A5F14F1F85 for ; Mon, 18 Feb 2019 04:11:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 0CBF87367D for ; Mon, 18 Feb 2019 04:11:17 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1550463009; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=iS+qj0yD/5mKMs+uyimOAF1vR7hiVe1tFch7o5KGuUh0TIXgVb2NR8h7Vn9aqulHS+Qzrtbp9iouY t73g2oqahAyjarp3DbRqUvBND+QJPNv9PH2u1caNkmcX/u520jZsdwmwEs1JrKXKcasseQn4GsDVGc h3l9Ynp4T0FHqkvEB4UARjr/TSaFMktv9npTzFLJf0lTlgJQuXab/kdOb0O82oO5migVbp6KJOUzqa 2tTDcePsnxf0jbk99a6rfYc8D9CE3aITet+hZKEE/3bCSolAZ4CJ6oxoC9e9GURWIr17oMG9eNZQiG gkPGfKP+h7SSul+m6e19wlX4REEjb0w== 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:cc:to:from:subject:message-id:dkim-signature:from; bh=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=I8wGST9o2tdEZHzQYUPAxLrx1kEd2V3E8fJHByMk8P6eiSfEuQc2Aj0HBEAT2YB7//wKzbZneqBbd 3TBK8rdj65hAwjeKuy1g9gPu78uRHjyhSEUWgZpspS40R7KLvjysTNGUQtx3otYwcOEocgKZwXtuWD u4PRQ5ANYqbkPkONHoykL73kWhcm3rHKvZQhlf9srueVjw4Qcj3vid/C7/sw+dqfz3Fab16zDmat3R xKBbx56kl3JEpa+sMt1sqJf22yih7XGR1nIGtccG/alsylndzEBDvFJtJHNQgbUwoXg3DbImKrSOqS su+x5NvKx5qRIGDcQIvGjTpaYAhvjyw== ARC-Authentication-Results: i=1; outbound4.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:cc:to:from:subject:message-id:from; bh=yk73LEpTyTpsSE+8BK2q2UeOHCgzcmvcxQumIXJMnHY=; b=P/fe3PPVxhnnMRgjSoc0hSQo3P/Ly2b91l3VCv/UNJ9tqsAyNRb15ZyzyydPg8/uGw+KTFJGPMnGj DT/AOFLdQoytLnMuzefTOuP200tMI4VclYtroZCu24frPLFPU/u0hocCZTN46Jbg3x0HQ2bNijAvet /OXDkd9zLg7oF/xXgG8OV8XrsfJeI637YJOQIC80AZZkAqnNZYLArx3KbjljcG59xlaebQtVibwJzD cdyjYr9ZNcm9DjOXxYle/XBL0+kcOuNhqhW4dCYC7kov3mta/ajhVrW8jpZfx7L7m3yMB2s6pVGXTu tfiD5fDzgNqpxqMc98KMtSjp5X0Ty3A== X-MHO-RoutePath: aGlwcGll X-MHO-User: 12eb1e51-3333-11e9-befd-af03bedce89f 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 outbound4.ore.mailhop.org (Halon) with ESMTPSA id 12eb1e51-3333-11e9-befd-af03bedce89f; Mon, 18 Feb 2019 04:10:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1I4B9uf076837; Sun, 17 Feb 2019 21:11:09 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua From: Ian Lepore To: rgrimes@freebsd.org, Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 17 Feb 2019 21:11:09 -0700 In-Reply-To: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> 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: 0CBF87367D 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: Mon, 18 Feb 2019 04:11:18 -0000 On Sun, 2019-02-17 at 19:41 -0800, Rodney W. Grimes wrote: > > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans > > wrote: > > > > > > Author: kevans > > > Date: Mon Feb 18 02:59:47 2019 > > > New Revision: 344243 > > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > > > Log: > > > lualoader: only clear the screen before first password prompt > > > > > > This was previously an unconditional screen clear, regardless > > > of whether or > > > not we would be prompting for any passwords. This is pointless, > > > given that > > > the screen clear is only there to put our screen into a > > > consistent state > > > before we draw the prompts and do cursor manipulation. > > > > > > This is also the only screen clear besides that to draw the > > > menu. One can > > > now see early pre-loader and loader output with the menu > > > disabled, which may > > > be useful for diagnostics. > > > > > > Reported by: ian > > > MFC after: 3 days > > > > > > Modified: > > > head/stand/lua/password.lua > > > > > > Modified: head/stand/lua/password.lua > > > ================================================================= > > > ============= > > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 > > > 2019 (r344242) > > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 > > > 2019 (r344243) > > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect > > > password > > > -- Asterisks as a password mask > > > local show_password_mask = false > > > local twiddle_chars = {"/", "-", "\\", "|"} > > > +local screen_setup = false > > > > > > -- Module exports > > > function password.read(prompt_length) > > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > > end > > > > > > function password.check() > > > - screen.clear() > > > - screen.defcursor() > > > -- pwd is optionally supplied if we want to check it > > > local function doPrompt(prompt, pwd) > > > local attempts = 1 > > > > > > local function clear_incorrect_text_prompt() > > > printc("\r" .. string.rep(" ", > > > #INCORRECT_PASSWORD)) > > > + end > > > + > > > + if not screen_setup then > > > + screen.clear() > > > + screen.defcursor() > > > + screen_setup = true > > > end > > > > > > while true do > > > > > > > I noted in testing that this may look kinda funky if you have > > neither > > a bootlock password or GELi prompt done by loader(8), but you have > > a > > loader password. The autoboot text gets blown away by the > > subsequent > > clear screen. I'd be interesting in feedback as to whether this > > looks > > odd or how important it is that the autoboot text remains intact, > > as > > it's an easy fix to retain it. > > Personally I would like to see all screen clears go away, > as they always seem to wipe out the very diagnostic output > that would tell you what went wrong. > > If possible, instead of clearing the screen, we should go to the > bottom and scroll it upwards, drawing new things and scrolling > old things off the top. > > screen clear == evil, unless specifically requested by the user. > Screen clear before drawing the menu makes sense. What I noticed is that the screen was still clearing even with beastie_disable=YES. Clearing before prompting for passwords seems like a marginal case... as Kyle mentioned, you've got to get the screen into a known state so that not-echoing the typed pw works reliably. -- Ian From owner-svn-src-all@freebsd.org Mon Feb 18 04:44: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 0E9C414F28FF; Mon, 18 Feb 2019 04:44: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 A4F60748CC; Mon, 18 Feb 2019 04:44:53 +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 95668CFE; Mon, 18 Feb 2019 04:44:53 +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 x1I4ir9X024969; Mon, 18 Feb 2019 04:44:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I4irNv024967; Mon, 18 Feb 2019 04:44:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902180444.x1I4irNv024967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 04:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344247 - in head/stand/uboot: common lib X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/stand/uboot: common lib X-SVN-Commit-Revision: 344247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4F60748CC 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.998,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)[-0.999,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, 18 Feb 2019 04:44:54 -0000 Author: ian Date: Mon Feb 18 04:44:52 2019 New Revision: 344247 URL: https://svnweb.freebsd.org/changeset/base/344247 Log: Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot loaderdev variable works correctly. The uboot_devdesc struct is variously cast back and forth between uboot_devdesc and disk_devdesc as pointers are handed off through various opaque interfaces. uboot_devdesc attempted to mimic the layout of disk_devdesc by having a devdesc struct, followed by a union of some device-specific stuff that included a struct that contains the same fields as a disk_devdesc. However, one of those fields inside the struct is 64-bit which causes the entire union to be 64-bit aligned -- 32 bits of padding is added between the struct devdesc and the union, so the whole mess ends up NOT properly mimicking a disk_devdesc after all. (In disk_devdesc there is also 32 bits of padding, but it shows up immediately before the d_offset field, rather than before the whole collection of d_* fields.) This fixes the problem by using an anonymous union to overlay the devdesc field uboot network devices need with the disk_devdesc that uboot storage devices need. This is a different solution than the one contributed with the PR (so if anything goes wrong, the blame goes to me), but 95% of the credit for this fix goes to Pawel Worach and Manuel Stuhn who analyzed the problem and proposed a fix. PR: 233097 Modified: head/stand/uboot/common/main.c head/stand/uboot/lib/libuboot.h Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 03:49:16 2019 (r344246) +++ head/stand/uboot/common/main.c Mon Feb 18 04:44:52 2019 (r344247) @@ -310,13 +310,13 @@ print_disk_probe_info() char slice[32]; char partition[32]; - if (currdev.d_disk.slice > 0) - sprintf(slice, "%d", currdev.d_disk.slice); + if (currdev.d_disk.d_slice > 0) + sprintf(slice, "%d", currdev.d_disk.d_slice); else strcpy(slice, ""); - if (currdev.d_disk.partition >= 0) - sprintf(partition, "%d", currdev.d_disk.partition); + if (currdev.d_disk.d_partition >= 0) + sprintf(partition, "%d", currdev.d_disk.d_partition); else strcpy(partition, ""); @@ -332,8 +332,8 @@ probe_disks(int devidx, int load_type, int load_unit, int open_result, unit; struct open_file f; - currdev.d_disk.slice = load_slice; - currdev.d_disk.partition = load_partition; + currdev.d_disk.d_slice = load_slice; + currdev.d_disk.d_partition = load_partition; f.f_devdata = &currdev; open_result = -1; Modified: head/stand/uboot/lib/libuboot.h ============================================================================== --- head/stand/uboot/lib/libuboot.h Mon Feb 18 03:49:16 2019 (r344246) +++ head/stand/uboot/lib/libuboot.h Mon Feb 18 04:44:52 2019 (r344247) @@ -27,18 +27,14 @@ * $FreeBSD$ */ +#include + struct uboot_devdesc { - struct devdesc dd; /* Must be first. */ union { - struct { - int slice; - int partition; - off_t offset; - } disk; - } d_kind; + struct devdesc dd; + struct disk_devdesc d_disk; + }; }; - -#define d_disk d_kind.disk /* * Default network packet alignment in memory. On arm arches packets must be From owner-svn-src-all@freebsd.org Mon Feb 18 05:18: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 E061214F3536 for ; Mon, 18 Feb 2019 05:18:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7569E75931 for ; Mon, 18 Feb 2019 05:18:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id v10so17910614qtp.8 for ; Sun, 17 Feb 2019 21:18:32 -0800 (PST) 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=Qk9pHpPd+kQrC79Z3TmbUiq+OBO+OWKv6g25AaCx18k=; b=pc0ErA2uZMQg0o32PNQlGJ0KgQNFYScq09bKkQXc5GGs1RaQ+oeQZL+/KMK8O2Ail3 E3PXW9jst7spwkJxgt1WxXJLT6LouT1jIDGZh9sfEgRY4lqoHRCxIIDdJAiOb/y9K+hz PGZPPRZT8ukj3dekpP2OP1HA7kRU/MlBpBVHClV+NUW2MlW2RayyGvnSpBGywd68rye1 kVub2eNYSTvS+jyHmMmyT04yWow9GoRQ/yvXNdYO7U85/Bul8iZk4s5OfFFUwFrzgMkf LRgBau4Oy+gxlh0DUvJcPLqw17V+EC2pjjPpFzw6s0wiPQlYJYQWVlrkvoBWnGJKJ2Ue ZWIg== 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=Qk9pHpPd+kQrC79Z3TmbUiq+OBO+OWKv6g25AaCx18k=; b=fT2GY26Wy4b4HFObOGB+HJQ4Oe0S+PFG6diyP5mpUMHb6NDuzN5bNSlXmBsTo3BuHn b//wFTxp7+IURTGaa2TttIgdJzsMcMNurVGYiardyud0ZXGDc2a/jawDE4bv1DAl9uA+ +yvUJCC5rFblddhAHQ68waRt4DekWLv1h98fTC0v1ctXEuEtM1qqWmPUdEI2/XgxM8TS DKfpSuL1+HU34V6cXd7rZaIQk9e/Dy8QI0e5hNvTazj/aVb/N32Jiyi+nNtQnpTiIhGC 3P0Xwwny+4PwsTjiuTTmk7I3trqSDRNJ3otsNKaBfBG/F8PlF2UveMmA8qnqoa+beXti rrSA== X-Gm-Message-State: AHQUAuYhLOxD+xfiGT3D6LjqQzGiGO6N4fsBKvFQQ87ZaELdfUOibJSN eJkGQIDBX7Hq1OYA9RVWFnhrpRA5e64aDQCzpT/hng== X-Google-Smtp-Source: AHgI3IYdg95C7OgD8S3TWbWz8+jELar++ifFBb0/YaF9JZuDmIBno0J+S/HQqGgg3O3Ge506m0qsn2WB74PjtDH/xpY= X-Received: by 2002:a0c:e98f:: with SMTP id z15mr16251322qvn.115.1550467111786; Sun, 17 Feb 2019 21:18:31 -0800 (PST) MIME-Version: 1.0 References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 17 Feb 2019 22:18:20 -0700 Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7569E75931 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_SHORT(-0.97)[-0.972,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: Mon, 18 Feb 2019 05:18:33 -0000 On Sun, Feb 17, 2019 at 8:42 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sun, Feb 17, 2019 at 9:00 PM Kyle Evans wrote: > > > > > > Author: kevans > > > Date: Mon Feb 18 02:59:47 2019 > > > New Revision: 344243 > > > URL: https://svnweb.freebsd.org/changeset/base/344243 > > > > > > Log: > > > lualoader: only clear the screen before first password prompt > > > > > > This was previously an unconditional screen clear, regardless of > whether or > > > not we would be prompting for any passwords. This is pointless, > given that > > > the screen clear is only there to put our screen into a consistent > state > > > before we draw the prompts and do cursor manipulation. > > > > > > This is also the only screen clear besides that to draw the menu. > One can > > > now see early pre-loader and loader output with the menu disabled, > which may > > > be useful for diagnostics. > > > > > > Reported by: ian > > > MFC after: 3 days > > > > > > Modified: > > > head/stand/lua/password.lua > > > > > > Modified: head/stand/lua/password.lua > > > > ============================================================================== > > > --- head/stand/lua/password.lua Mon Feb 18 01:57:47 2019 > (r344242) > > > +++ head/stand/lua/password.lua Mon Feb 18 02:59:47 2019 > (r344243) > > > @@ -38,6 +38,7 @@ local INCORRECT_PASSWORD = "loader: incorrect > password > > > -- Asterisks as a password mask > > > local show_password_mask = false > > > local twiddle_chars = {"/", "-", "\\", "|"} > > > +local screen_setup = false > > > > > > -- Module exports > > > function password.read(prompt_length) > > > @@ -80,14 +81,18 @@ function password.read(prompt_length) > > > end > > > > > > function password.check() > > > - screen.clear() > > > - screen.defcursor() > > > -- pwd is optionally supplied if we want to check it > > > local function doPrompt(prompt, pwd) > > > local attempts = 1 > > > > > > local function clear_incorrect_text_prompt() > > > printc("\r" .. string.rep(" ", > #INCORRECT_PASSWORD)) > > > + end > > > + > > > + if not screen_setup then > > > + screen.clear() > > > + screen.defcursor() > > > + screen_setup = true > > > end > > > > > > while true do > > > > > > > I noted in testing that this may look kinda funky if you have neither > > a bootlock password or GELi prompt done by loader(8), but you have a > > loader password. The autoboot text gets blown away by the subsequent > > clear screen. I'd be interesting in feedback as to whether this looks > > odd or how important it is that the autoboot text remains intact, as > > it's an easy fix to retain it. > > Personally I would like to see all screen clears go away, > as they always seem to wipe out the very diagnostic output > that would tell you what went wrong. > Sometimes it's unavoidable. But we have bigger problems here: when you set the console output to something other than default, for example, all messages before we do that (which we necessarily have to do late) are lost. Clearing the screen isn't the problem here: the lack of a dmesg-like history is the problem. > If possible, instead of clearing the screen, we should go to the > bottom and scroll it upwards, drawing new things and scrolling > old things off the top. > This isn't always possible. We don't necessarily know how many lines to scroll, and this will cause things to be overwritten in all serial scenarios, which we get complaints about. > screen clear == evil, unless specifically requested by the user. > Again, the issue is destroying information, not necessarily screen clearing. We did a lot of that traditionally in the FORTH loader too, and weren't always that good about it. I do agree clearing unconditionally at the start is a hassle, especially when you turn off menus. However, with menus, the expectation is to clear the screen so you'd have a clean presentation of the menu. So if we're really worried about error messages, we should implement a history mechanism to get the early printed stuff. It was one of the items that we spoke about while I was doing the Lua work and associated technical debt retirement. There were many other items that were on the list ahead of this feature, and likely still are. Warner From owner-svn-src-all@freebsd.org Mon Feb 18 07:17: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 6E83714F5BD7; Mon, 18 Feb 2019 07:17:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 0B3218160E; Mon, 18 Feb 2019 07:17:50 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=53550 helo=[192.168.86.51]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gvd3l-0001Xc-2v; Sun, 17 Feb 2019 23:09:49 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344243 - head/stand/lua From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: Date: Sun, 17 Feb 2019 23:17:46 -0800 Cc: "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, dteske@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> To: Warner Losh Sender: devin@shxd.cx X-Rspamd-Queue-Id: 0B3218160E 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_SHORT(-0.97)[-0.968,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, 18 Feb 2019 07:17:50 -0000 > On 17 Feb 2019, at 9:18 PM, Warner Losh wrote: >=20 > We did a lot of that traditionally in the FORTH loader too, and weren't al= ways that good about it. Uh, no. I only clear regions of the screen by positioning the cursor using A= NSI escape sequences and then drawing spaces. I do not clear the screen =E2=80= =9Ca lot=E2=80=9D and would like to think I was damned good about it. =E2=80=94=20 Devin= From owner-svn-src-all@freebsd.org Mon Feb 18 07:58: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 1BD9814F681D; Mon, 18 Feb 2019 07:58:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4B5DA8299F; Mon, 18 Feb 2019 07:58:23 +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 x1I7wFtC025189 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 09:58:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1I7wFtC025189 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1I7wEwA025188; Mon, 18 Feb 2019 09:58:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 18 Feb 2019 09:58:14 +0200 From: Konstantin Belousov To: "Herbert J. Skuhra" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys Message-ID: <20190218075814.GE2420@kib.kiev.ua> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> <20190217211916.GD2420@kib.kiev.ua> <87bm3aawcn.wl-herbert@gojira.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bm3aawcn.wl-herbert@gojira.at> User-Agent: Mutt/1.11.2 (2019-01-07) 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: Mon, 18 Feb 2019 07:58:24 -0000 On Sun, Feb 17, 2019 at 11:22:48PM +0100, Herbert J. Skuhra wrote: > On Sun, 17 Feb 2019 22:19:16 +0100, Konstantin Belousov wrote: > > > > On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > > > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > > > > > Author: kib > > > > Date: Fri Feb 15 11:33:48 2019 > > > > New Revision: 344157 > > > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > > > > > Log: > > > > MFC r343855, r343859: > > > > Use ifunc to select the barrier instruction for RDTSC. > > > > > > > > Modified: > > > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > > > Directory Properties: > > > > stable/12/ (props changed) > > > > > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > > > system is unusable. Basically all programs produce a "Segmentation > > > fault (core dumped)": > > > > > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > > > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > > > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > > > pid 877 (su), jid 0, uid 0: exited on signal 11 > > > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > > > pid 885 (sudo), jid 0, uid 0: exited on signal 11 > > > > What do you have in your make.conf and src.conf ? > > I am building on a faster machine with a Intel(R) Xeon(R) CPU. > > /etc/src.conf: > > WITHOUT_DEBUG_FILES= > WITHOUT_KERNEL_SYMBOLS= > WITHOUT_PROFILE= > WITH_KERNEL_RETPOLINE= > WITH_RETPOLINE= ^^^^^^ Remove this setting and rebuild the world. Is it still broken ? > INSTALL_NODEBUG= > WITHOUT_TESTS= > WITHOUT_GAMES= > > /etc/make.conf contains only a line for KERNCONF and DEFAULT_VERSIONS. > > > Can you show me CPU identification lines from dmesg for a verbose boot ? > > CPU: Genuine Intel(R) CPU @ 1.60GHz (1600.06-MHz K8-class CPU) > Origin="GenuineIntel" Id=0x20661 Family=0x6 Model=0x26 Stepping=1 > Features=0xbfe9fbff > Features2=0x40e3bd > AMD Features=0x20100800 > AMD Features2=0x1 > VT-x: (disabled in BIOS) Basic Features=0x5a0400 > Pin-Based Controls=0x3f > Primary Processor Controls=0x77f9fffe MSRmap,MONITOR,PAUSE> > Exit Controls=0x5a0400 > Entry Controls=0x5a0400 > TSC: P-state invariant, performance statistics > Data TLB0: 4 KByte pages, fully associative, 16 entries > Data TLB1: 4 KByte pages, 4-way associative, 64 entries > Instruction TLB: 4 KByte pages, 32 entries > Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries > 2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size > 1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size > 1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size > L2 cache: 512 kbytes, 8-way associative, 64 bytes/line > > > I suspect that you can take /lib/libc.so.7 from 12.0 RELEASE and restore > > the system. If it helps, please move your existing libc.so.7 into some > > directory, reproduce the problem with 'LD_LIBRARY_PATH= > bad libc.so.7> /bin/ls' and load the core into gdb. I want to see > > the backtrace for start. > > Yes, restoring /lib/libc.so.7 from previous build (r344152) works. > > #0 0x0000000800487800 in *ABS*@plt () from /home/herbert/broken_libc/libc.so.7 > #1 0x000000080048781c in *ABS*@plt () from /home/herbert/broken_libc/libc.so.7 > #2 0x00000008003f2e6a in xdr_ypresponse () from /home/herbert/broken_libc/libc.so.7 > #3 0x0000000800464849 in access () from /home/herbert/broken_libc/libc.so.7 > #4 0x0000000800464938 in access () from /home/herbert/broken_libc/libc.so.7 > #5 0x0000000800429ad1 in clock_gettime () from /home/herbert/broken_libc/libc.so.7 > #6 0x00000008003b574f in madvise () from /home/herbert/broken_libc/libc.so.7 > #7 0x00000008003da262 in _pthread_mutex_init_calloc_cb () from /home/herbert/broken_libc/libc.so.7 > #8 0x00000008003dc4ba in _pthread_mutex_init_calloc_cb () from /home/herbert/broken_libc/libc.so.7 > #9 0x00000008003e958c in _malloc_first_thread () from /home/herbert/broken_libc/libc.so.7 > #10 0x00000008003e7ba8 in nallocm () from /home/herbert/broken_libc/libc.so.7 > #11 0x0000000800214479 in r_debug_state () from /libexec/ld-elf.so.1 > #12 0x000000080021305a in __tls_get_addr () from /libexec/ld-elf.so.1 > #13 0x0000000800211019 in ?? () from /libexec/ld-elf.so.1 > #14 0x0000000000000000 in ?? () > > -- > Herbert From owner-svn-src-all@freebsd.org Mon Feb 18 08:25: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 AB07214F724C; Mon, 18 Feb 2019 08:25:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBD483971; Mon, 18 Feb 2019 08:25:03 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 95AB92025619; Mon, 18 Feb 2019 08:24:57 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x1I8Ovlo062271 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 08:24:57 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x1I8OuXA062264; Mon, 18 Feb 2019 08:24:56 GMT (envelope-from phk) To: Devin Teske cc: Warner Losh , "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344243 - head/stand/lua In-reply-to: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> From: "Poul-Henning Kamp" References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <62261.1550478296.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Feb 2019 08:24:56 +0000 Message-ID: <62262.1550478296@critter.freebsd.dk> X-Rspamd-Queue-Id: 2BBD483971 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_SHORT(-0.97)[-0.968,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: Mon, 18 Feb 2019 08:25:04 -0000 -------- In message <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org>, Devin Teske= writes: >Uh, no. I only clear regions of the screen by positioning the cursor usin= g >ANSI escape sequences and then drawing spaces. [...] One thing the loader should do, is clear any scrolling regions which may have been left behind, for instance after a panic. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Mon Feb 18 08:26: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 40D8414F72D3; Mon, 18 Feb 2019 08:26:19 +0000 (UTC) (envelope-from tsoome@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 D55B283ADF; Mon, 18 Feb 2019 08:26:18 +0000 (UTC) (envelope-from tsoome@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 C157D31F9; Mon, 18 Feb 2019 08:26:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1I8QIgD040684; Mon, 18 Feb 2019 08:26:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1I8QI0K040683; Mon, 18 Feb 2019 08:26:18 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902180826.x1I8QI0K040683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 18 Feb 2019 08:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344248 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 344248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D55B283ADF 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 08:26:19 -0000 Author: tsoome Date: Mon Feb 18 08:26:18 2019 New Revision: 344248 URL: https://svnweb.freebsd.org/changeset/base/344248 Log: cd9660: dirmatch fails to unmatch when name is prefix for directory record Loader does fail to properly match the file name in directory record and does open file based on prefix match. For fix, we check the name lengths first. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19213 Modified: head/stand/libsa/cd9660.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Mon Feb 18 04:44:52 2019 (r344247) +++ head/stand/libsa/cd9660.c Mon Feb 18 08:26:18 2019 (r344248) @@ -241,6 +241,10 @@ dirmatch(struct open_file *f, const char *path, struct icase = 1; } else icase = 0; + + if (strlen(path) != len) + return (0); + for (i = len; --i >= 0; path++, cp++) { if (!*path || *path == '/') break; From owner-svn-src-all@freebsd.org Mon Feb 18 10:11: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 ED0E114D2724; Mon, 18 Feb 2019 10:11:27 +0000 (UTC) (envelope-from marck@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 8D22C87659; Mon, 18 Feb 2019 10:11:27 +0000 (UTC) (envelope-from marck@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 7E513461F; Mon, 18 Feb 2019 10:11:27 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IABR4v093721; Mon, 18 Feb 2019 10:11:27 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IABRB9093720; Mon, 18 Feb 2019 10:11:27 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201902181011.x1IABRB9093720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Mon, 18 Feb 2019 10:11: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: r344249 - stable/12/usr.sbin/jail X-SVN-Group: stable-12 X-SVN-Commit-Author: marck X-SVN-Commit-Paths: stable/12/usr.sbin/jail X-SVN-Commit-Revision: 344249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D22C87659 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.998,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)[-0.999,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, 18 Feb 2019 10:11:28 -0000 Author: marck (doc committer) Date: Mon Feb 18 10:11:26 2019 New Revision: 344249 URL: https://svnweb.freebsd.org/changeset/base/344249 Log: MFC: r343164 Clarify error messages a bit. X-Found-With: r343112 Reviewed by: eugen (implicitly, when r343112 analysis) Modified: stable/12/usr.sbin/jail/command.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/jail/command.c ============================================================================== --- stable/12/usr.sbin/jail/command.c Mon Feb 18 08:26:18 2019 (r344248) +++ stable/12/usr.sbin/jail/command.c Mon Feb 18 10:11:26 2019 (r344249) @@ -497,7 +497,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.devfs: no path"); + jail_warnx(j, "mount.devfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 5); @@ -528,7 +528,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.fdescfs: no path"); + jail_warnx(j, "mount.fdescfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 8); @@ -554,7 +554,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.procfs: no path"); + jail_warnx(j, "mount.procfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 6); From owner-svn-src-all@freebsd.org Mon Feb 18 10:13: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 6CCC914D28A1; Mon, 18 Feb 2019 10:13:53 +0000 (UTC) (envelope-from marck@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 108CF87A80; Mon, 18 Feb 2019 10:13:53 +0000 (UTC) (envelope-from marck@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 F30AC4780; Mon, 18 Feb 2019 10:13:52 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IADqh4097953; Mon, 18 Feb 2019 10:13:52 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IADq7J097952; Mon, 18 Feb 2019 10:13:52 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201902181013.x1IADq7J097952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Mon, 18 Feb 2019 10:13:52 +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: r344250 - stable/11/usr.sbin/jail X-SVN-Group: stable-11 X-SVN-Commit-Author: marck X-SVN-Commit-Paths: stable/11/usr.sbin/jail X-SVN-Commit-Revision: 344250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 108CF87A80 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 10:13:53 -0000 Author: marck (doc committer) Date: Mon Feb 18 10:13:52 2019 New Revision: 344250 URL: https://svnweb.freebsd.org/changeset/base/344250 Log: MFC: r343164 Clarify error messages a bit. X-Found-With: r343112 Reviewed by: eugen (implicitly, when r343112 analysis) Modified: stable/11/usr.sbin/jail/command.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/command.c ============================================================================== --- stable/11/usr.sbin/jail/command.c Mon Feb 18 10:11:26 2019 (r344249) +++ stable/11/usr.sbin/jail/command.c Mon Feb 18 10:13:52 2019 (r344250) @@ -497,7 +497,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.devfs: no path"); + jail_warnx(j, "mount.devfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 5); @@ -528,7 +528,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.fdescfs: no path"); + jail_warnx(j, "mount.fdescfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 8); @@ -554,7 +554,7 @@ run_command(struct cfjail *j) argv = alloca(7 * sizeof(char *)); path = string_param(j->intparams[KP_PATH]); if (path == NULL) { - jail_warnx(j, "mount.procfs: no path"); + jail_warnx(j, "mount.procfs: no jail root path defined"); return -1; } devpath = alloca(strlen(path) + 6); From owner-svn-src-all@freebsd.org Mon Feb 18 10:51: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 C626014D587B; Mon, 18 Feb 2019 10:51:27 +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 7972988B41; Mon, 18 Feb 2019 10:51:27 +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 69E394DF1; Mon, 18 Feb 2019 10:51:27 +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 x1IApR4A016367; Mon, 18 Feb 2019 10:51:27 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IApRCD016366; Mon, 18 Feb 2019 10:51:27 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201902181051.x1IApRCD016366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 18 Feb 2019 10:51: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: r344251 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 344251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7972988B41 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 10:51:28 -0000 Author: ae Date: Mon Feb 18 10:51:27 2019 New Revision: 344251 URL: https://svnweb.freebsd.org/changeset/base/344251 Log: MFC r344018: Remove `set' field from state structure and use set from parent rule. Initially it was introduced because parent rule pointer could be freed, and rule's information could become inaccessible. In r341471 this was changed. And now we don't need this information, and also it can become stale. E.g. rule can be moved from one set to another. This can lead to parent's set and state's set will not match. In this case it is possible that static rule will be freed, but dynamic state will not. This can happen when `ipfw delete set N` command is used to delete rules, that were moved to another set. To fix the problem we will use the set number from parent rule. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Feb 18 10:13:52 2019 (r344250) +++ stable/12/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Feb 18 10:51:27 2019 (r344251) @@ -135,9 +135,8 @@ struct dyn_data { uint32_t hashval; /* hash value used for hash resize */ uint16_t fibnum; /* fib used to send keepalives */ - uint8_t _pad[2]; + uint8_t _pad[3]; uint8_t flags; /* internal flags */ - uint8_t set; /* parent rule set number */ uint16_t rulenum; /* parent rule number */ uint32_t ruleid; /* parent rule id */ @@ -163,8 +162,7 @@ struct dyn_data { struct dyn_parent { void *parent; /* pointer to parent rule */ uint32_t count; /* number of linked states */ - uint8_t _pad; - uint8_t set; /* parent rule set number */ + uint8_t _pad[2]; uint16_t rulenum; /* parent rule number */ uint32_t ruleid; /* parent rule id */ uint32_t hashval; /* hash value used for hash resize */ @@ -507,7 +505,7 @@ static int dyn_lookup_ipv6_state_locked(const struct i uint32_t, const void *, int, uint32_t, uint16_t); static struct dyn_ipv6_state *dyn_alloc_ipv6_state( const struct ipfw_flow_id *, uint32_t, uint16_t, uint8_t); -static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, uint8_t, +static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, const struct ipfw_flow_id *, uint32_t, const void *, int, uint32_t, struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); static void dyn_export_ipv6_state(const struct dyn_ipv6_state *, @@ -528,8 +526,7 @@ static struct dyn_ipv6_state *dyn_lookup_ipv6_parent_l const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, uint32_t); static struct dyn_ipv6_state *dyn_add_ipv6_parent(void *, uint32_t, uint16_t, - uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, - uint16_t); + const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, uint16_t); #endif /* INET6 */ /* Functions to work with limit states */ @@ -540,17 +537,17 @@ static struct dyn_ipv4_state *dyn_lookup_ipv4_parent( static struct dyn_ipv4_state *dyn_lookup_ipv4_parent_locked( const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); static struct dyn_parent *dyn_alloc_parent(void *, uint32_t, uint16_t, - uint8_t, uint32_t); + uint32_t); static struct dyn_ipv4_state *dyn_add_ipv4_parent(void *, uint32_t, uint16_t, - uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); + const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); static void dyn_tick(void *); static void dyn_expire_states(struct ip_fw_chain *, ipfw_range_tlv *); static void dyn_free_states(struct ip_fw_chain *); -static void dyn_export_parent(const struct dyn_parent *, uint16_t, +static void dyn_export_parent(const struct dyn_parent *, uint16_t, uint8_t, ipfw_dyn_rule *); static void dyn_export_data(const struct dyn_data *, uint16_t, uint8_t, - ipfw_dyn_rule *); + uint8_t, ipfw_dyn_rule *); static uint32_t dyn_update_tcp_state(struct dyn_data *, const struct ipfw_flow_id *, const struct tcphdr *, int); static void dyn_update_proto_state(struct dyn_data *, @@ -563,7 +560,7 @@ static int dyn_lookup_ipv4_state_locked(const struct i const void *, int, uint32_t, uint16_t); static struct dyn_ipv4_state *dyn_alloc_ipv4_state( const struct ipfw_flow_id *, uint16_t, uint8_t); -static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, uint8_t, +static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, const struct ipfw_flow_id *, const void *, int, uint32_t, struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); static void dyn_export_ipv4_state(const struct dyn_ipv4_state *, @@ -1460,7 +1457,7 @@ ipfw_dyn_lookup_state(const struct ip_fw_args *args, c static struct dyn_parent * dyn_alloc_parent(void *parent, uint32_t ruleid, uint16_t rulenum, - uint8_t set, uint32_t hashval) + uint32_t hashval) { struct dyn_parent *limit; @@ -1479,7 +1476,6 @@ dyn_alloc_parent(void *parent, uint32_t ruleid, uint16 limit->parent = parent; limit->ruleid = ruleid; limit->rulenum = rulenum; - limit->set = set; limit->hashval = hashval; limit->expire = time_uptime + V_dyn_short_lifetime; return (limit); @@ -1487,7 +1483,7 @@ dyn_alloc_parent(void *parent, uint32_t ruleid, uint16 static struct dyn_data * dyn_alloc_dyndata(void *parent, uint32_t ruleid, uint16_t rulenum, - uint8_t set, const struct ipfw_flow_id *pkt, const void *ulp, int pktlen, + const struct ipfw_flow_id *pkt, const void *ulp, int pktlen, uint32_t hashval, uint16_t fibnum) { struct dyn_data *data; @@ -1506,7 +1502,6 @@ dyn_alloc_dyndata(void *parent, uint32_t ruleid, uint1 data->parent = parent; data->ruleid = ruleid; data->rulenum = rulenum; - data->set = set; data->fibnum = fibnum; data->hashval = hashval; data->expire = time_uptime + V_dyn_syn_lifetime; @@ -1543,8 +1538,8 @@ dyn_alloc_ipv4_state(const struct ipfw_flow_id *pkt, u */ static struct dyn_ipv4_state * dyn_add_ipv4_parent(void *rule, uint32_t ruleid, uint16_t rulenum, - uint8_t set, const struct ipfw_flow_id *pkt, uint32_t hashval, - uint32_t version, uint16_t kidx) + const struct ipfw_flow_id *pkt, uint32_t hashval, uint32_t version, + uint16_t kidx) { struct dyn_ipv4_state *s; struct dyn_parent *limit; @@ -1571,7 +1566,7 @@ dyn_add_ipv4_parent(void *rule, uint32_t ruleid, uint1 } } - limit = dyn_alloc_parent(rule, ruleid, rulenum, set, hashval); + limit = dyn_alloc_parent(rule, ruleid, rulenum, hashval); if (limit == NULL) { DYN_BUCKET_UNLOCK(bucket); return (NULL); @@ -1596,7 +1591,7 @@ dyn_add_ipv4_parent(void *rule, uint32_t ruleid, uint1 static int dyn_add_ipv4_state(void *parent, uint32_t ruleid, uint16_t rulenum, - uint8_t set, const struct ipfw_flow_id *pkt, const void *ulp, int pktlen, + const struct ipfw_flow_id *pkt, const void *ulp, int pktlen, uint32_t hashval, struct ipfw_dyn_info *info, uint16_t fibnum, uint16_t kidx, uint8_t type) { @@ -1621,7 +1616,7 @@ dyn_add_ipv4_state(void *parent, uint32_t ruleid, uint } } - data = dyn_alloc_dyndata(parent, ruleid, rulenum, set, pkt, ulp, + data = dyn_alloc_dyndata(parent, ruleid, rulenum, pkt, ulp, pktlen, hashval, fibnum); if (data == NULL) { DYN_BUCKET_UNLOCK(bucket); @@ -1674,8 +1669,8 @@ dyn_alloc_ipv6_state(const struct ipfw_flow_id *pkt, u */ static struct dyn_ipv6_state * dyn_add_ipv6_parent(void *rule, uint32_t ruleid, uint16_t rulenum, - uint8_t set, const struct ipfw_flow_id *pkt, uint32_t zoneid, - uint32_t hashval, uint32_t version, uint16_t kidx) + const struct ipfw_flow_id *pkt, uint32_t zoneid, uint32_t hashval, + uint32_t version, uint16_t kidx) { struct dyn_ipv6_state *s; struct dyn_parent *limit; @@ -1702,7 +1697,7 @@ dyn_add_ipv6_parent(void *rule, uint32_t ruleid, uint1 } } - limit = dyn_alloc_parent(rule, ruleid, rulenum, set, hashval); + limit = dyn_alloc_parent(rule, ruleid, rulenum, hashval); if (limit == NULL) { DYN_BUCKET_UNLOCK(bucket); return (NULL); @@ -1727,8 +1722,8 @@ dyn_add_ipv6_parent(void *rule, uint32_t ruleid, uint1 static int dyn_add_ipv6_state(void *parent, uint32_t ruleid, uint16_t rulenum, - uint8_t set, const struct ipfw_flow_id *pkt, uint32_t zoneid, - const void *ulp, int pktlen, uint32_t hashval, struct ipfw_dyn_info *info, + const struct ipfw_flow_id *pkt, uint32_t zoneid, const void *ulp, + int pktlen, uint32_t hashval, struct ipfw_dyn_info *info, uint16_t fibnum, uint16_t kidx, uint8_t type) { struct dyn_ipv6_state *s; @@ -1752,7 +1747,7 @@ dyn_add_ipv6_state(void *parent, uint32_t ruleid, uint } } - data = dyn_alloc_dyndata(parent, ruleid, rulenum, set, pkt, ulp, + data = dyn_alloc_dyndata(parent, ruleid, rulenum, pkt, ulp, pktlen, hashval, fibnum); if (data == NULL) { DYN_BUCKET_UNLOCK(bucket); @@ -1802,8 +1797,7 @@ dyn_get_parent_state(const struct ipfw_flow_id *pkt, u DYNSTATE_CRITICAL_EXIT(); s = dyn_add_ipv4_parent(rule, rule->id, - rule->rulenum, rule->set, pkt, hashval, - version, kidx); + rule->rulenum, pkt, hashval, version, kidx); if (s == NULL) return (NULL); /* Now we are in critical section again. */ @@ -1826,8 +1820,8 @@ dyn_get_parent_state(const struct ipfw_flow_id *pkt, u DYNSTATE_CRITICAL_EXIT(); s = dyn_add_ipv6_parent(rule, rule->id, - rule->rulenum, rule->set, pkt, zoneid, hashval, - version, kidx); + rule->rulenum, pkt, zoneid, hashval, version, + kidx); if (s == NULL) return (NULL); /* Now we are in critical section again. */ @@ -1870,8 +1864,7 @@ dyn_get_parent_state(const struct ipfw_flow_id *pkt, u static int dyn_install_state(const struct ipfw_flow_id *pkt, uint32_t zoneid, - uint16_t fibnum, const void *ulp, int pktlen, void *rule, - uint32_t ruleid, uint16_t rulenum, uint8_t set, + uint16_t fibnum, const void *ulp, int pktlen, struct ip_fw *rule, struct ipfw_dyn_info *info, uint32_t limit, uint16_t limit_mask, uint16_t kidx, uint8_t type) { @@ -1935,11 +1928,11 @@ dyn_install_state(const struct ipfw_flow_id *pkt, uint hashval = hash_packet(pkt); if (IS_IP4_FLOW_ID(pkt)) - ret = dyn_add_ipv4_state(rule, ruleid, rulenum, set, pkt, + ret = dyn_add_ipv4_state(rule, rule->id, rule->rulenum, pkt, ulp, pktlen, hashval, info, fibnum, kidx, type); #ifdef INET6 else if (IS_IP6_FLOW_ID(pkt)) - ret = dyn_add_ipv6_state(rule, ruleid, rulenum, set, pkt, + ret = dyn_add_ipv6_state(rule, rule->id, rule->rulenum, pkt, zoneid, ulp, pktlen, hashval, info, fibnum, kidx, type); #endif /* INET6 */ else @@ -2012,8 +2005,8 @@ ipfw_dyn_install_state(struct ip_fw_chain *chain, stru #ifdef INET6 IS_IP6_FLOW_ID(&args->f_id) ? dyn_getscopeid(args): #endif - 0, M_GETFIB(args->m), ulp, pktlen, rule, rule->id, rule->rulenum, - rule->set, info, limit, limit_mask, cmd->o.arg1, cmd->o.opcode)); + 0, M_GETFIB(args->m), ulp, pktlen, rule, info, limit, + limit_mask, cmd->o.arg1, cmd->o.opcode)); } /* @@ -2198,17 +2191,19 @@ dyn_match_ipv4_state(struct ip_fw_chain *ch, struct dy struct ip_fw *rule; int ret; - if (s->type == O_LIMIT_PARENT) - return (dyn_match_range(s->limit->rulenum, - s->limit->set, rt)); + if (s->type == O_LIMIT_PARENT) { + rule = s->limit->parent; + return (dyn_match_range(s->limit->rulenum, rule->set, rt)); + } - ret = dyn_match_range(s->data->rulenum, s->data->set, rt); - if (ret == 0 || V_dyn_keep_states == 0 || ret > 1) - return (ret); - rule = s->data->parent; if (s->type == O_LIMIT) rule = ((struct dyn_ipv4_state *)rule)->limit->parent; + + ret = dyn_match_range(s->data->rulenum, rule->set, rt); + if (ret == 0 || V_dyn_keep_states == 0 || ret > 1) + return (ret); + dyn_acquire_rule(ch, s->data, rule, s->kidx); return (0); } @@ -2221,17 +2216,19 @@ dyn_match_ipv6_state(struct ip_fw_chain *ch, struct dy struct ip_fw *rule; int ret; - if (s->type == O_LIMIT_PARENT) - return (dyn_match_range(s->limit->rulenum, - s->limit->set, rt)); + if (s->type == O_LIMIT_PARENT) { + rule = s->limit->parent; + return (dyn_match_range(s->limit->rulenum, rule->set, rt)); + } - ret = dyn_match_range(s->data->rulenum, s->data->set, rt); - if (ret == 0 || V_dyn_keep_states == 0 || ret > 1) - return (ret); - rule = s->data->parent; if (s->type == O_LIMIT) rule = ((struct dyn_ipv6_state *)rule)->limit->parent; + + ret = dyn_match_range(s->data->rulenum, rule->set, rt); + if (ret == 0 || V_dyn_keep_states == 0 || ret > 1) + return (ret); + dyn_acquire_rule(ch, s->data, rule, s->kidx); return (0); } @@ -2899,7 +2896,7 @@ ipfw_is_dyn_rule(struct ip_fw *rule) } static void -dyn_export_parent(const struct dyn_parent *p, uint16_t kidx, +dyn_export_parent(const struct dyn_parent *p, uint16_t kidx, uint8_t set, ipfw_dyn_rule *dst) { @@ -2911,9 +2908,9 @@ dyn_export_parent(const struct dyn_parent *p, uint16_t /* 'rule' is used to pass up the rule number and set */ memcpy(&dst->rule, &p->rulenum, sizeof(p->rulenum)); + /* store set number into high word of dst->rule pointer. */ - memcpy((char *)&dst->rule + sizeof(p->rulenum), &p->set, - sizeof(p->set)); + memcpy((char *)&dst->rule + sizeof(p->rulenum), &set, sizeof(set)); /* unused fields */ dst->pcnt = 0; @@ -2932,7 +2929,7 @@ dyn_export_parent(const struct dyn_parent *p, uint16_t static void dyn_export_data(const struct dyn_data *data, uint16_t kidx, uint8_t type, - ipfw_dyn_rule *dst) + uint8_t set, ipfw_dyn_rule *dst) { dst->dyn_type = type; @@ -2944,9 +2941,9 @@ dyn_export_data(const struct dyn_data *data, uint16_t /* 'rule' is used to pass up the rule number and set */ memcpy(&dst->rule, &data->rulenum, sizeof(data->rulenum)); + /* store set number into high word of dst->rule pointer. */ - memcpy((char *)&dst->rule + sizeof(data->rulenum), &data->set, - sizeof(data->set)); + memcpy((char *)&dst->rule + sizeof(data->rulenum), &set, sizeof(set)); dst->state = data->state; if (data->flags & DYN_REFERENCED) @@ -2968,13 +2965,18 @@ dyn_export_data(const struct dyn_data *data, uint16_t static void dyn_export_ipv4_state(const struct dyn_ipv4_state *s, ipfw_dyn_rule *dst) { + struct ip_fw *rule; switch (s->type) { case O_LIMIT_PARENT: - dyn_export_parent(s->limit, s->kidx, dst); + rule = s->limit->parent; + dyn_export_parent(s->limit, s->kidx, rule->set, dst); break; default: - dyn_export_data(s->data, s->kidx, s->type, dst); + rule = s->data->parent; + if (s->type == O_LIMIT) + rule = ((struct dyn_ipv4_state *)rule)->limit->parent; + dyn_export_data(s->data, s->kidx, s->type, rule->set, dst); } dst->id.dst_ip = s->dst; @@ -2995,13 +2997,18 @@ dyn_export_ipv4_state(const struct dyn_ipv4_state *s, static void dyn_export_ipv6_state(const struct dyn_ipv6_state *s, ipfw_dyn_rule *dst) { + struct ip_fw *rule; switch (s->type) { case O_LIMIT_PARENT: - dyn_export_parent(s->limit, s->kidx, dst); + rule = s->limit->parent; + dyn_export_parent(s->limit, s->kidx, rule->set, dst); break; default: - dyn_export_data(s->data, s->kidx, s->type, dst); + rule = s->data->parent; + if (s->type == O_LIMIT) + rule = ((struct dyn_ipv6_state *)rule)->limit->parent; + dyn_export_data(s->data, s->kidx, s->type, rule->set, dst); } dst->id.src_ip6 = s->src; From owner-svn-src-all@freebsd.org Mon Feb 18 11: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 0B34214D71E8; Mon, 18 Feb 2019 11:37:53 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [144.76.30.122]) (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 "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ACCF8A5E7; Mon, 18 Feb 2019 11:37:52 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Mon, 18 Feb 2019 12:37:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1550489865; bh=AQ7evdAH0pest8ll0f8qdbHRhH1X8rwLBaUmWf2J3qk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=uDK2ykHVk0QaHJs8c/54n5fdbCuEmvDMIYzbHXLGtU5TQVGR78izWhXu7s5qDVz8k jRFKQ/NtNa8RoQRYz81k60GlXhgZMzHGUGemgkwPVeF2CP5FgbjiXk7G6YgXbjvwYL WYrvDwHZHC6xEFQCds23EYuVLMLrKK11l5uwn8GSq6nCvMooVlHmNcQM37pzopeynF P+tJK8KH567rQJv3QP6z4Wq8+HRqnbykaa1Lv0ef5YCBdRBSLxl5aeiGvbJ5FnYOtm JzEbA2vr/Z7l/n/xAV4twNCW0yQSSUj6//nL/xfxbT3iixRy4Nuh61R5bEp3zcLzoG UnFD7aUy8RTLg== From: "Herbert J. Skuhra" To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys Message-ID: <20190218113745.skk5eoofarzsjbq6@mail.bsd4all.net> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> <20190217211916.GD2420@kib.kiev.ua> <87bm3aawcn.wl-herbert@gojira.at> <20190218075814.GE2420@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190218075814.GE2420@kib.kiev.ua> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 9ACCF8A5E7 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.981,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: Mon, 18 Feb 2019 11:37:53 -0000 On Mon, Feb 18, 2019 at 09:58:14AM +0200, Konstantin Belousov wrote: > On Sun, Feb 17, 2019 at 11:22:48PM +0100, Herbert J. Skuhra wrote: > > On Sun, 17 Feb 2019 22:19:16 +0100, Konstantin Belousov wrote: > > > > > > On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > > > > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > > > > > > > Author: kib > > > > > Date: Fri Feb 15 11:33:48 2019 > > > > > New Revision: 344157 > > > > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > > > > > > > Log: > > > > > MFC r343855, r343859: > > > > > Use ifunc to select the barrier instruction for RDTSC. > > > > > > > > > > Modified: > > > > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > > > > Directory Properties: > > > > > stable/12/ (props changed) > > > > > > > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > > > > system is unusable. Basically all programs produce a "Segmentation > > > > fault (core dumped)": > > > > > > > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > > > > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > > > > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > pid 877 (su), jid 0, uid 0: exited on signal 11 > > > > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > pid 885 (sudo), jid 0, uid 0: exited on signal 11 > > > > > > What do you have in your make.conf and src.conf ? > > > > I am building on a faster machine with a Intel(R) Xeon(R) CPU. > > > > /etc/src.conf: > > > > WITHOUT_DEBUG_FILES= > > WITHOUT_KERNEL_SYMBOLS= > > WITHOUT_PROFILE= > > WITH_KERNEL_RETPOLINE= > > > WITH_RETPOLINE= > ^^^^^^ > Remove this setting and rebuild the world. > Is it still broken ? No, without the line "WITH_RETPOLINE=" the system is OK. Thanks. -- Herbert From owner-svn-src-all@freebsd.org Mon Feb 18 11:43: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 3CB5314D7514; Mon, 18 Feb 2019 11:43:07 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F5E8AB10; Mon, 18 Feb 2019 11:43:05 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id c8694b62; Mon, 18 Feb 2019 06:40:51 -0500 (EST) Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id 83485eea TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 18 Feb 2019 06:40:50 -0500 (EST) From: Charlie Li Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: freebsd-toolchain@freebsd.org References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=ml+freebsd@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw== Organization: FreeBSD Message-ID: Date: Mon, 18 Feb 2019 06:40:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zB5u772myuDxqfDd8RswRUnRHHcJn4JCU" X-Rspamd-Queue-Id: A2F5E8AB10 X-Spamd-Bar: -------- X-Spamd-Result: default: False [-8.57 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[vishwin.info:+]; DMARC_POLICY_ALLOW(-0.50)[vishwin.info,reject]; MX_GOOD(-0.01)[varun.vishwin.info,gehlot.vishwin.info]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-2.47)[ip: (-9.91), ipnet: 46.101.80.0/20(-4.96), asn: 14061(2.58), country: US(-0.07)]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[vishwin.info:s=fuccboi12]; TAGGED_FROM(0.00)[freebsd]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 11:43:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU Content-Type: multipart/mixed; boundary="GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G"; protected-headers="v1" From: Charlie Li To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: freebsd-toolchain@freebsd.org Message-ID: Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> In-Reply-To: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> --GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 11/12/2018 14:05, Dimitry Andric wrote: > head/contrib/libc++/include/type_traits >=20 The change to the above named file breaks building any C++ code containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, but not 8.0.0.r1 or any earlier LLVM) on head (but not projects/clang800-import, obviously). Example error, from our own copy of LLVM libunwind: --- libunwind.o --- In file included from /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56: error: _Float16 is not supported on this target template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; ^ 1 error generated. *** [libunwind.o] Error code 1 Upstream LLVM has already reverted this: https://reviews.llvm.org/D53670 world builds successfully after applying the upstream revert. Ports that use the clang portion of devel/llvm80 when set in DEFAULT_VERSIONS, ie gecko@, also build successfully. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --GvQoeDSSWY3drNLyiZF22o5RLhUOOk61G-- --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlxqmcAACgkQjnB43vID q2ypdRAAjZS/6RBLNWI8wJtLtdxzMuAoGdxs4eJy6+fGmaXPDVHEylE0bonjMZ3Q UlM0Gp16Iv4wfQixPHl4BVM93sbesODe6tzf1Un5CIfpZdQbqPSID3Ma1wD+Iles 4WAlRG+xgByAuNqEbBefQ19Ez/6h0UyobXe7OW59ZcJTACeTFLJsh0tBldZT6XvE nKhyi2AoBLwX4T5KYxvrB4dL4t4SN12zBzgIXG5rGk8iMm6W344LTYYFKf0/KP4+ tZ8Ey+vtquIKhipyp55Dp1maJ1Jmf9LUSYqmFJxyEtdPMb7hHtYUcXA+/YfbAMKw 3UWOAIXtIQYNxtaVOs3TfQCerj2LAbDMYnmXMJGKdwDrQ2/ol3utYwgGwKMmadyQ 57/rPojoIfqYMclm0L04xcYdv/PCA3yUKbb8ZbKlHERO0oH3xixfF8L9Iox9u2wb 6D61Jaf4JeVv/PUYcuWiaV4UN59gWHOmt7bLrpL+iVHsR4CRynHm/B2B7w0Gh7qA tw2EGstWpgl0+i4CwKLukwxCOG//wdzV45vL03AANsz2pteTAV0+blIRHxb6oqvb N2CiD6us/IPNJJJi0sx3eZAvVAaGve08WFclOu0P3xvLXWjBUE4WUSv4G3i+vyE5 R2K26mRICQKy0+Vjg/X7mFt2cpC+DUpi49mYyjkXVtsuKH0IedI= =EcN3 -----END PGP SIGNATURE----- --zB5u772myuDxqfDd8RswRUnRHHcJn4JCU-- From owner-svn-src-all@freebsd.org Mon Feb 18 11:49: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 A55E114D77D8; Mon, 18 Feb 2019 11:49:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (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 "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 374D48AEBA; Mon, 18 Feb 2019 11:49:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [192.168.1.32] (92-111-45-98.static.v4.ziggozakelijk.nl [92.111.45.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1BC6032367; Mon, 18 Feb 2019 12:49:08 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... Date: Mon, 18 Feb 2019 12:49:07 +0100 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org To: Charlie Li References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 11:49:17 -0000 --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 18 Feb 2019, at 12:40, Charlie Li via freebsd-toolchain = wrote: >=20 > On 11/12/2018 14:05, Dimitry Andric wrote: >> head/contrib/libc++/include/type_traits >>=20 > The change to the above named file breaks building any C++ code > containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, = but > not 8.0.0.r1 or any earlier LLVM) on head (but not > projects/clang800-import, obviously). Example error, from our own copy > of LLVM libunwind: >=20 > --- libunwind.o --- > In file included from > /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: > In file included from > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: > In file included from > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: > = /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56: > error: _Float16 is not supported on this target > template <> struct __libcpp_is_floating_point<_Float16> : > public true_type {}; > ^ > 1 error generated. > *** [libunwind.o] Error code 1 Hm, which target did you compile for? I have run multiple universe builds, so I thought I had covered all possible targets. Or are you building with gcc? > Upstream LLVM has already reverted this: = https://reviews.llvm.org/D53670 >=20 > world builds successfully after applying the upstream revert. Ports = that > use the clang portion of devel/llvm80 when set in DEFAULT_VERSIONS, ie > gecko@, also build successfully. Thanks, I'll take a look. -Dimitry --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXGqbswAKCRCwXqMKLiCW o6ztAJ0TEzT8R6YqBoYDJmbOx28qZhyjbwCfVq88r0/J6AfoMQ0O+iQ3JuSqg1Y= =t2C1 -----END PGP SIGNATURE----- --Apple-Mail=_95B52D4C-22C5-4154-A213-9440A1097A14-- From owner-svn-src-all@freebsd.org Mon Feb 18 12:02: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 9C57314D97B5; Mon, 18 Feb 2019 12:02:23 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B01638BB2B; Mon, 18 Feb 2019 12:02:22 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 98149a9d; Mon, 18 Feb 2019 07:02:18 -0500 (EST) Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id 911474ac TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 18 Feb 2019 07:02:18 -0500 (EST) Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml+freebsd@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw== Organization: FreeBSD Message-ID: Date: Mon, 18 Feb 2019 07:02:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ" X-Rspamd-Queue-Id: B01638BB2B X-Spamd-Bar: ------ 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)[]; TAGGED_FROM(0.00)[freebsd]; 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, 18 Feb 2019 12:02:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ Content-Type: multipart/mixed; boundary="vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ"; protected-headers="v1" From: Charlie Li To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-toolchain@freebsd.org Message-ID: Subject: Re: svn commit: r341825 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contri... References: <201812111905.wBBJ5Yfu053488@repo.freebsd.org> In-Reply-To: --vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 18/02/2019 06:49, Dimitry Andric wrote: > On 18 Feb 2019, at 12:40, Charlie Li via freebsd-toolchain wrote: >> >> On 11/12/2018 14:05, Dimitry Andric wrote: >>> head/contrib/libc++/include/type_traits >>> >> The change to the above named file breaks building any C++ code >> containing _Float16 with devel/llvm80-8.0.0.r2 (and probably later, bu= t >> not 8.0.0.r1 or any earlier LLVM) on head (but not >> projects/clang800-import, obviously). Example error, from our own copy= >> of LLVM libunwind: >> >> --- libunwind.o --- >> In file included from >> /usr/src/contrib/llvm/projects/libunwind/src/libunwind.cpp:18: >> In file included from >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/new:91: >> In file included from >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/exception:83: >> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:740:56= : >> error: _Float16 is not supported on this target >> template <> struct __libcpp_is_floating_point<_Float16> : >> public true_type {}; >> ^ >> 1 error generated. >> *** [libunwind.o] Error code 1 >=20 > Hm, which target did you compile for? I have run multiple universe > builds, so I thought I had covered all possible targets. Or are you > building with gcc? >=20 Building head using xtoolchain-llvm80 on amd64, for amd64. Interestingly didn't error when cross-building for aarch64. The projects/clang800-import branch already has the bit in question reverted, so is a moot point there. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --vIxjsFHhQHgQX4FC264IsbUsulYi78BqZ-- --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlxqnsMACgkQjnB43vID q2yPcw/9HYsFnCBac7vX/Un9Co2E5cXVz11fma339t6bi6TPfSJvuE57rbiKoWwA J+A2pTjFsDFH4epmpeNcdbGDXs96vyYvipGKvA/i+zfqvsHJW/U3ypukpgIZoHMQ gLQ467P+mc1RXii1iqGf2Ypu9M1ZFiRwbx4gDZ2JkZjyOhx/ebyCw+nBoONy7yCi hTYj0Vy9+ES9ZBnrM7a7zFQMEzX1ZZqUx+/nsVIdOLHBge8kau8/yO6mSJxm0adq IrKwdauvKdyvZoRKPvXP9nHqtmugo93sNCYqGsH2AWpUspxVlHP9L7X0uLo9JXJ5 25i/uZcR51evXJsCRgsmq6gfgZQN1I6YV0XH+Xg4B3tNMBwNJUuqrjhfd+5ggUR2 HZhi9RU7T+Utrsn52rr39Luzmpf5timyt/09p8TlR6qN0gkr0HaWRSOiCApD05oU qrcyvEcCpVJpUpsZ6DVTr6hFqCwYxoWW784SmX53bopx7qhlvhIUyMLQLMo/53VH r6rrjAx3IY1B46vYLUSg6aTLSZC+5j+uZc9GfuUinu9CTdZ4GfRsirQ1q0bICsSF ZrRaj9dJ0sPi70diSTl8KtFfk/P6BdV1BCC7J3Ac1TzJyhJvgjFCpHRxBoYBeM0t /22GrSTfwTxZvKaKq1I9PqXtyoDolxgjHeSU534eURZE9pT3A8E= =3W4s -----END PGP SIGNATURE----- --egkOvq0hTMDHcwrPVDhgPLZmyLOT8VBxJ-- From owner-svn-src-all@freebsd.org Mon Feb 18 13:09: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 BA71314DBBE9 for ; Mon, 18 Feb 2019 13:09:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-zteg10021301.me.com (pv50p00im-zteg10021301.me.com [17.58.6.46]) (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 2E8858E099 for ; Mon, 18 Feb 2019 13:09:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-zteg10021301.me.com (Postfix) with ESMTPSA id C0B895800E8; Mon, 18 Feb 2019 13:09:05 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344238 - head/stand/common From: Toomas Soome In-Reply-To: <201902172332.x1HNW9ut059440@repo.freebsd.org> Date: Mon, 18 Feb 2019 15:09:02 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> References: <201902172332.x1HNW9ut059440@repo.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-18_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902180099 X-Rspamd-Queue-Id: 2E8858E099 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,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, 18 Feb 2019 13:09:16 -0000 > On 18 Feb 2019, at 01:32, Ian Lepore wrote: >=20 > Author: ian > Date: Sun Feb 17 23:32:09 2019 > New Revision: 344238 > URL: https://svnweb.freebsd.org/changeset/base/344238 >=20 > Log: > Restore loader(8)'s ability for lsdev to show partitions within a bsd = slice. >=20 > I'm pretty sure this used to work at one time, perhaps long ago. It = has > been failing recently because if you call disk_open() with = dev->d_partition > set to -1 when d_slice refers to a bsd slice, it assumes you want it = to > open the first partition within that slice. When you then pass that = open > dev instance to ptable_open(), it tries to read the start of the 'a' > partition and decides there is no recognizable partition type there. >=20 > This restores the old functionality by resetting d_offset to the = start > of the raw slice after disk_open() returns. For good measure, = d_partition > is also set back to -1, although that doesn't currently affect = anything. >=20 > I would have preferred to make disk_open() avoid such rude = assumptions and > if you ask for partition -1 you get the raw slice. But the commit = history > shows that someone already did that once (r239058), and had to revert = it > (r239232), so I didn't even try to go down that road. What was the reason for the revert? I still do think the current = disk_open() approach is not good because it does break the promise to = get MBR partition (see common/disk.h).=20 Of course I can see the appeal for something like =E2=80=9Cboot = disk0:=E2=80=9D but case like that should be solved by iterating = partition table, and not by making API to do wrong thing - if I did ask = to for disk0s0: I really would expect to get disk0s0: and not disk0s0a: But anyhow, it would be good to understand the actual reasoning behind = that decision. rgds, toomas >=20 > Modified: > head/stand/common/disk.c >=20 > Modified: head/stand/common/disk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/stand/common/disk.c Sun Feb 17 20:25:07 2019 = (r344237) > +++ head/stand/common/disk.c Sun Feb 17 23:32:09 2019 = (r344238) > @@ -133,6 +133,13 @@ ptable_print(void *arg, const char *pname, const = struc > dev.d_partition =3D -1; > if (disk_open(&dev, part->end - part->start + 1, > od->sectorsize) =3D=3D 0) { > + /* > + * disk_open() for partition -1 on a bsd slice = assumes > + * you want the first bsd partition. Reset = things so > + * that we're looking at the start of the raw = slice. > + */ > + dev.d_partition =3D -1; > + dev.d_offset =3D part->start; > table =3D ptable_open(&dev, part->end - = part->start + 1, > od->sectorsize, ptblread); > if (table !=3D NULL) { >=20 From owner-svn-src-all@freebsd.org Mon Feb 18 13:14: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 8F99F14DBE3E; Mon, 18 Feb 2019 13:14:54 +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 29D888E8C3; Mon, 18 Feb 2019 13:14:54 +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 D533F65BC; Mon, 18 Feb 2019 13:14:53 +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 x1IDErNL091675; Mon, 18 Feb 2019 13:14:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IDErbM091674; Mon, 18 Feb 2019 13:14:53 GMT (envelope-from br@FreeBSD.org) Message-Id: <201902181314.x1IDErbM091674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 18 Feb 2019 13:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344252 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29D888E8C3 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 13:14:54 -0000 Author: br Date: Mon Feb 18 13:14:53 2019 New Revision: 344252 URL: https://svnweb.freebsd.org/changeset/base/344252 Log: Avoid orphan sections between __bss_start and .(s)bss. Ensure __bss_start is associated with the next section in case orphan sections are placed directly after .sdata, as has been seen to happen with LLD. Submitted by: "J.R.T. Clarke" Differential Revision: https://reviews.freebsd.org/D18429 Modified: head/sys/conf/ldscript.riscv Modified: head/sys/conf/ldscript.riscv ============================================================================== --- head/sys/conf/ldscript.riscv Mon Feb 18 10:51:27 2019 (r344251) +++ head/sys/conf/ldscript.riscv Mon Feb 18 13:14:53 2019 (r344252) @@ -87,6 +87,10 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); + /* Ensure __bss_start is associated with the next section in case orphan + sections are placed directly after .sdata, as has been seen to happen with + LLD. */ + . = .; __bss_start = .; .sbss : { *(.sbss) *(.scommon) } .bss : From owner-svn-src-all@freebsd.org Mon Feb 18 14:03: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 E9D6614DCCE7; Mon, 18 Feb 2019 14:03:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 27921680A4; Mon, 18 Feb 2019 14:03:18 +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 x1IE36wU009737 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 16:03:09 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1IE36wU009737 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1IE36Ma009736; Mon, 18 Feb 2019 16:03:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 18 Feb 2019 16:03:05 +0200 From: Konstantin Belousov To: "Herbert J. Skuhra" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys Message-ID: <20190218140305.GH2420@kib.kiev.ua> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> <20190217211916.GD2420@kib.kiev.ua> <87bm3aawcn.wl-herbert@gojira.at> <20190218075814.GE2420@kib.kiev.ua> <20190218113745.skk5eoofarzsjbq6@mail.bsd4all.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190218113745.skk5eoofarzsjbq6@mail.bsd4all.net> User-Agent: Mutt/1.11.2 (2019-01-07) 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: Mon, 18 Feb 2019 14:03:19 -0000 On Mon, Feb 18, 2019 at 12:37:45PM +0100, Herbert J. Skuhra wrote: > On Mon, Feb 18, 2019 at 09:58:14AM +0200, Konstantin Belousov wrote: > > On Sun, Feb 17, 2019 at 11:22:48PM +0100, Herbert J. Skuhra wrote: > > > On Sun, 17 Feb 2019 22:19:16 +0100, Konstantin Belousov wrote: > > > > > > > > On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > > > > > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > > > > > > > > > Author: kib > > > > > > Date: Fri Feb 15 11:33:48 2019 > > > > > > New Revision: 344157 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > > > > > > > > > Log: > > > > > > MFC r343855, r343859: > > > > > > Use ifunc to select the barrier instruction for RDTSC. > > > > > > > > > > > > Modified: > > > > > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > > > > > Directory Properties: > > > > > > stable/12/ (props changed) > > > > > > > > > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > > > > > system is unusable. Basically all programs produce a "Segmentation > > > > > fault (core dumped)": > > > > > > > > > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > > > > > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > > > > > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > pid 877 (su), jid 0, uid 0: exited on signal 11 > > > > > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > pid 885 (sudo), jid 0, uid 0: exited on signal 11 > > > > > > > > What do you have in your make.conf and src.conf ? > > > > > > I am building on a faster machine with a Intel(R) Xeon(R) CPU. > > > > > > /etc/src.conf: > > > > > > WITHOUT_DEBUG_FILES= > > > WITHOUT_KERNEL_SYMBOLS= > > > WITHOUT_PROFILE= > > > WITH_KERNEL_RETPOLINE= > > > > > WITH_RETPOLINE= > > ^^^^^^ > > Remove this setting and rebuild the world. > > Is it still broken ? > > No, without the line "WITH_RETPOLINE=" the system is OK. Which version of clang do you get ? It was recently bumped from 6.0.1 to 7.0.1, and there was a ifunc use in libc in quite fundamental place already. From owner-svn-src-all@freebsd.org Mon Feb 18 14:21: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 7E8C214DD371; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@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 1B02A6A03C; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@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 0B59A702E; Mon, 18 Feb 2019 14:21:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IELfNQ027287; Mon, 18 Feb 2019 14:21:41 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IELfEP027285; Mon, 18 Feb 2019 14:21:41 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201902181421.x1IELfEP027285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 18 Feb 2019 14:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344253 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 344253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B02A6A03C 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.998,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)[-0.999,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, 18 Feb 2019 14:21:42 -0000 Author: vmaffione Date: Mon Feb 18 14:21:41 2019 New Revision: 344253 URL: https://svnweb.freebsd.org/changeset/base/344253 Log: netmap: don't schedule kqueue notify task when kqueue is not used This change adds a counter (kqueue_users) to keep track of how many kqueue users are referencing a given struct nm_selinfo. In this way, nm_os_selwakeup() can schedule the kevent notification task only when kqueue is actually being used. This is important to avoid wasting CPU in the common case where kqueue is not used. Reviewed by: Aleksandr Fedorov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19177 Modified: head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Feb 18 13:14:53 2019 (r344252) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Feb 18 14:21:41 2019 (r344253) @@ -105,6 +105,7 @@ int nm_os_selinfo_init(NM_SELINFO_T *si, const char *n snprintf(si->mtxname, sizeof(si->mtxname), "nmkl%s", name); mtx_init(&si->m, si->mtxname, NULL, MTX_DEF); knlist_init_mtx(&si->si.si_note, &si->m); + si->kqueue_users = 0; return (0); } @@ -1351,7 +1352,9 @@ void nm_os_selwakeup(struct nm_selinfo *si) { selwakeuppri(&si->si, PI_NET); - taskqueue_enqueue(si->ntfytq, &si->ntfytask); + if (si->kqueue_users > 0) { + taskqueue_enqueue(si->ntfytq, &si->ntfytask); + } } void @@ -1364,20 +1367,28 @@ static void netmap_knrdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = &priv->np_si[NR_RX]->si; + struct nm_selinfo *si = priv->np_si[NR_RX]; - nm_prinf("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, /*islocked=*/0); + knlist_remove(&si->si.si_note, kn, /*islocked=*/0); + NMG_LOCK(); + KASSERT(si->kqueue_users > 0, ("kqueue_user underflow on %s", + si->mtxname)); + si->kqueue_users--; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); } static void netmap_knwdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = &priv->np_si[NR_TX]->si; + struct nm_selinfo *si = priv->np_si[NR_TX]; - nm_prinf("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, /*islocked=*/0); + knlist_remove(&si->si.si_note, kn, /*islocked=*/0); + NMG_LOCK(); + si->kqueue_users--; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); } /* @@ -1465,6 +1476,10 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; + NMG_LOCK(); + si->kqueue_users++; + nm_prinf("kqueue users for %s: %d", si->mtxname, si->kqueue_users); + NMG_UNLOCK(); knlist_add(&si->si.si_note, kn, /*islocked=*/0); return 0; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Feb 18 13:14:53 2019 (r344252) +++ head/sys/dev/netmap/netmap_kern.h Mon Feb 18 14:21:41 2019 (r344253) @@ -132,11 +132,14 @@ struct netmap_adapter *netmap_getna(if_t ifp); #define MBUF_QUEUED(m) 1 struct nm_selinfo { + /* Support for select(2) and poll(2). */ struct selinfo si; + /* Support for kqueue(9). See comments in netmap_freebsd.c */ struct taskqueue *ntfytq; struct task ntfytask; struct mtx m; char mtxname[32]; + int kqueue_users; }; From owner-svn-src-all@freebsd.org Mon Feb 18 14:31: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 6708014DD807 for ; Mon, 18 Feb 2019 14:31:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 CDA9F6A6D3 for ; Mon, 18 Feb 2019 14:31:24 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1550500250; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Xrg/m/lGJwtL3EtJzKWwQbrJ4s8qjPIL21hv/46T2Ic1wNd1B8g5ecrQhuAxi57c8aEw28SeUanKk 432BuNeKmCRUHFu4JF2LUJP1CsJfFaG33datLOEwm4MzCPRIYKeQX6GkUZMaN6IA/S6H9Oy6iN3MeA BToE3vmkYl3k4DFSxOWNFSesrIXvD02Hvb3DzS2teiCAR166Law66pLZEwysr3OCtRqgqbkoMYtOw0 IB2tRuB8eAyCM/E8Or1DDbgog6aWoObFZamQEztymEdORwTPwI2OuziHU888uM/z+dBIT06pZFFtmX eKGHwJ1fpeGa/6MOm298I1NMC90kLog== 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:cc:to:from:subject:message-id:dkim-signature:from; bh=fWSqC37P5KAebJ7w2S/guvAEiOlVYUL4ahocWFLLBe0=; b=qrrD5kkZrRxm/T3Agp+OhQxi0vqLhiXaMhyQcnT3jbS+w2N6zigp5gCLHgpJMum0MuLskCeBw+X8w QTC56i8VVx1MucszJpUGrxYre4IndR6tz9UExnUuPPbLlCSBkcRBuFlzzGyjDyyN25ntC1FNJtuiOQ xtDYQrwubmhUx0ZL05vJ+TZSrRpJCjlLrUMzAGtvwrtQrhj0KmewApoSDLCziPdFeH5f36o/LX46yw YoZXes9ykYYyPfxJskqyWikUzt4gMKb+4KTZ9MnFC7ALn1kaL+nm0UjhRZxyeO0Ebz0o6j4jLz/9IK dmKgE+FnauotzGKB6yyTIuVS3OJlf0A== 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:cc:to:from:subject:message-id:from; bh=fWSqC37P5KAebJ7w2S/guvAEiOlVYUL4ahocWFLLBe0=; b=fRlWFcTbhxNJApcaixu6nihuEtuw7eS7x+iOBxTRwHcucJtonjpUdvV+B3XtLC0Pfg40GG+Wq74kZ pUiZHIEfMmFEwOgVYowElh/MSQt6F0hcuPNfLCbVxf9OHKyQ1O88Porl/aAG6epbA9S0iL6N9tgHkI zbZhWtMGm1UccM6/ZrhekpN5j8FnuE3FoYCwCCTTf7jUCtIWPR05Hu+EVpXL0pmr0mhkA8x3lKybp2 Amge7n7TxJoiObITT0HnoGcnoYKVST/VHMCHudq+c9lHpOx6UH5njav9RP3PF+2EW3ZfwUIGKeyiZM 8a/JRdJ4xQTQZbAeZvV3MieQHc/2YCA== X-MHO-RoutePath: aGlwcGll X-MHO-User: c85eba61-3389-11e9-9789-75353a1f43cf 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 c85eba61-3389-11e9-9789-75353a1f43cf; Mon, 18 Feb 2019 14:30:48 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1IEVKMO078152; Mon, 18 Feb 2019 07:31:20 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> Subject: Re: svn commit: r344238 - head/stand/common From: Ian Lepore To: Toomas Soome Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Feb 2019 07:31:20 -0700 In-Reply-To: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDA9F6A6D3 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.985,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: Mon, 18 Feb 2019 14:31:25 -0000 On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > Author: ian > > Date: Sun Feb 17 23:32:09 2019 > > New Revision: 344238 > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > Log: > > Restore loader(8)'s ability for lsdev to show partitions within a bsd slice. > > > > I'm pretty sure this used to work at one time, perhaps long ago. It has > > been failing recently because if you call disk_open() with dev->d_partition > > set to -1 when d_slice refers to a bsd slice, it assumes you want it to > > open the first partition within that slice. When you then pass that open > > dev instance to ptable_open(), it tries to read the start of the 'a' > > partition and decides there is no recognizable partition type there. > > > > This restores the old functionality by resetting d_offset to the start > > of the raw slice after disk_open() returns. For good measure, d_partition > > is also set back to -1, although that doesn't currently affect anything. > > > > I would have preferred to make disk_open() avoid such rude assumptions and > > if you ask for partition -1 you get the raw slice. But the commit history > > shows that someone already did that once (r239058), and had to revert it > > (r239232), so I didn't even try to go down that road. > > > What was the reason for the revert? I still do think the current > disk_open() approach is not good because it does break the promise to > get MBR partition (see common/disk.h). > > Of course I can see the appeal for something like “boot disk0:†but > case like that should be solved by iterating partition table, and not > by making API to do wrong thing - if I did ask to for disk0s0: I > really would expect to get disk0s0: and not disk0s0a: > > But anyhow, it would be good to understand the actual reasoning > behind that decision. > I have no idea. As is so often the case, the commit message for the revert said what the commit did ("revert to historic behavior") without any hint of why the change was made. One has to assume that it broke some working cases and people complained. Part of the problem for the disk_open() "api" is that there is not even a comment block with some hints in it. I was thinking one potential solution might instead of using "if (partition < 0)" we could define a couple magical partition number values, PNUM_GETBEST = -1, PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully combing through the existing code looking at all calls to disk_open() and all usage of disk_devdesc.d_partition. -- Ian From owner-svn-src-all@freebsd.org Mon Feb 18 15:09: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 DE46414DE604; Mon, 18 Feb 2019 15:09:19 +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 7CA046BAED; Mon, 18 Feb 2019 15:09:19 +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 6C548782F; Mon, 18 Feb 2019 15:09:19 +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 x1IF9JmL050013; Mon, 18 Feb 2019 15:09:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IF9JcA050012; Mon, 18 Feb 2019 15:09:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181509.x1IF9JcA050012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 15:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344254 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CA046BAED 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 15:09:20 -0000 Author: ian Date: Mon Feb 18 15:09:19 2019 New Revision: 344254 URL: https://svnweb.freebsd.org/changeset/base/344254 Log: Use DEV_TYP_NONE instead of -1 to indicate no device was specified. DEV_TYP_NONE has a value of zero, which makes more sense since the device type is a bunch of bits describing the device, crammed into an int. Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 14:21:41 2019 (r344253) +++ head/stand/uboot/common/main.c Mon Feb 18 15:09:19 2019 (r344254) @@ -156,7 +156,7 @@ get_device_type(const char *devstr, int *devtype) printf("Unknown device type '%s'\n", devstr); } - *devtype = -1; + *devtype = DEV_TYP_NONE; return (NULL); } @@ -202,7 +202,7 @@ get_load_device(int *type, int *unit, int *slice, int const char *p; char *endp; - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; *partition = -1; @@ -467,14 +467,14 @@ main(int argc, char **argv) currdev.dd.d_dev = devsw[i]; currdev.dd.d_unit = 0; - if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && + if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { if (probe_disks(i, load_type, load_unit, load_slice, load_partition) == 0) break; } - if ((load_type == -1 || (load_type & DEV_TYP_NET)) && + if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_NET)) && strcmp(devsw[i]->dv_name, "net") == 0) break; } From owner-svn-src-all@freebsd.org Mon Feb 18 15:28: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 2BB2B14DEBCA; Mon, 18 Feb 2019 15:28:13 +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 99A7B6C3AE; Mon, 18 Feb 2019 15:28:12 +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 860937B8D; Mon, 18 Feb 2019 15:28:12 +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 x1IFSCGx060240; Mon, 18 Feb 2019 15:28:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IFSC5V060239; Mon, 18 Feb 2019 15:28:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181528.x1IFSC5V060239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 15:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344255 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99A7B6C3AE 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 15:28:13 -0000 Author: ian Date: Mon Feb 18 15:28:12 2019 New Revision: 344255 URL: https://svnweb.freebsd.org/changeset/base/344255 Log: Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'. Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 15:09:19 2019 (r344254) +++ head/stand/uboot/common/main.c Mon Feb 18 15:28:12 2019 (r344255) @@ -221,13 +221,13 @@ get_load_device(int *type, int *unit, int *slice, int p++; /* Unknown device name, or a known name without unit number. */ - if ((*type == -1) || (*p == '\0')) { + if ((*type == DEV_TYP_NONE) || (*p == '\0')) { return; } /* Malformed unit number. */ if (!isdigit(*p)) { - *type = -1; + *type = DEV_TYP_NONE; return; } @@ -242,7 +242,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Device string is malformed beyond unit number. */ if (*p != ':') { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; return; } @@ -255,7 +255,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Only DEV_TYP_STOR devices can have a slice specification. */ if (!(*type & DEV_TYP_STOR)) { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; return; } @@ -264,7 +264,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Malformed slice number. */ if (p == endp) { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; return; @@ -278,7 +278,7 @@ get_load_device(int *type, int *unit, int *slice, int /* Device string is malformed beyond slice number. */ if (*p != '.') { - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; return; @@ -298,7 +298,7 @@ get_load_device(int *type, int *unit, int *slice, int return; /* Junk beyond partition number. */ - *type = -1; + *type = DEV_TYP_NONE; *unit = -1; *slice = 0; *partition = -1; From owner-svn-src-all@freebsd.org Mon Feb 18 16:02: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 01D6A14E0566; Mon, 18 Feb 2019 16:02:02 +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 848716DED6; Mon, 18 Feb 2019 16:02:01 +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 515C3822F; Mon, 18 Feb 2019 16:02:01 +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 x1IG215N081252; Mon, 18 Feb 2019 16:02:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IG21wm081251; Mon, 18 Feb 2019 16:02:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902181602.x1IG21wm081251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 Feb 2019 16:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344256 - 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: 344256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 848716DED6 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2019 16:02:02 -0000 Author: kib Date: Mon Feb 18 16:02:00 2019 New Revision: 344256 URL: https://svnweb.freebsd.org/changeset/base/344256 Log: amd64: cleanup pmap_init_pat(). The pmap_works variable is always true for amd64. Remove it, the branch in the initialization taken when false, and corresponding sysctl. Remove pat_table[] local array, work on pat_index[] directly. Collapse whole initialization to not override already assigned values. Add comment explaining the choice for PAT4 and PAT7. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week MFC note: Leave the sysctl around Differential revision: https://reviews.freebsd.org/D19225 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Feb 18 15:28:12 2019 (r344255) +++ head/sys/amd64/amd64/pmap.c Mon Feb 18 16:02:00 2019 (r344256) @@ -353,10 +353,6 @@ pt_entry_t pg_nx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int pat_works = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, - "Is page attribute table fully functional?"); - static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pg_ps_enabled, 0, "Are large page mappings enabled?"); @@ -1222,7 +1218,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) void pmap_init_pat(void) { - int pat_table[PAT_INDEX_SIZE]; uint64_t pat_msr; u_long cr0, cr4; int i; @@ -1233,45 +1228,32 @@ pmap_init_pat(void) /* Set default PAT index table. */ for (i = 0; i < PAT_INDEX_SIZE; i++) - pat_table[i] = -1; - pat_table[PAT_WRITE_BACK] = 0; - pat_table[PAT_WRITE_THROUGH] = 1; - pat_table[PAT_UNCACHEABLE] = 3; - pat_table[PAT_WRITE_COMBINING] = 3; - pat_table[PAT_WRITE_PROTECTED] = 3; - pat_table[PAT_UNCACHED] = 3; + pat_index[i] = -1; + pat_index[PAT_WRITE_BACK] = 0; + pat_index[PAT_WRITE_THROUGH] = 1; + pat_index[PAT_UNCACHEABLE] = 3; + pat_index[PAT_WRITE_COMBINING] = 6; + pat_index[PAT_WRITE_PROTECTED] = 5; + pat_index[PAT_UNCACHED] = 2; - /* Initialize default PAT entries. */ + /* + * Initialize default PAT entries. + * Leave the indices 0-3 at the default of WB, WT, UC-, and UC. + * Program 5 and 6 as WP and WC. + * + * Leave 4 and 7 as WB and UC. Note that a recursive page table + * mapping for a 2M page uses a PAT value with the bit 3 set due + * to its overload with PG_PS. + */ pat_msr = PAT_VALUE(0, PAT_WRITE_BACK) | PAT_VALUE(1, PAT_WRITE_THROUGH) | PAT_VALUE(2, PAT_UNCACHED) | PAT_VALUE(3, PAT_UNCACHEABLE) | PAT_VALUE(4, PAT_WRITE_BACK) | - PAT_VALUE(5, PAT_WRITE_THROUGH) | - PAT_VALUE(6, PAT_UNCACHED) | + PAT_VALUE(5, PAT_WRITE_PROTECTED) | + PAT_VALUE(6, PAT_WRITE_COMBINING) | PAT_VALUE(7, PAT_UNCACHEABLE); - if (pat_works) { - /* - * Leave the indices 0-3 at the default of WB, WT, UC-, and UC. - * Program 5 and 6 as WP and WC. - * Leave 4 and 7 as WB and UC. - */ - pat_msr &= ~(PAT_MASK(5) | PAT_MASK(6)); - pat_msr |= PAT_VALUE(5, PAT_WRITE_PROTECTED) | - PAT_VALUE(6, PAT_WRITE_COMBINING); - pat_table[PAT_UNCACHED] = 2; - pat_table[PAT_WRITE_PROTECTED] = 5; - pat_table[PAT_WRITE_COMBINING] = 6; - } else { - /* - * Just replace PAT Index 2 with WC instead of UC-. - */ - pat_msr &= ~PAT_MASK(2); - pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING); - pat_table[PAT_WRITE_COMBINING] = 2; - } - /* Disable PGE. */ cr4 = rcr4(); load_cr4(cr4 & ~CR4_PGE); @@ -1286,8 +1268,6 @@ pmap_init_pat(void) /* Update PAT and index table. */ wrmsr(MSR_PAT, pat_msr); - for (i = 0; i < PAT_INDEX_SIZE; i++) - pat_index[i] = pat_table[i]; /* Flush caches and TLBs again. */ wbinvd(); From owner-svn-src-all@freebsd.org Mon Feb 18 16:02: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 56F2114E0634; Mon, 18 Feb 2019 16:02:51 +0000 (UTC) (envelope-from trasz@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 E6A5B6E0B9; Mon, 18 Feb 2019 16:02:50 +0000 (UTC) (envelope-from trasz@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 CB1F58260; Mon, 18 Feb 2019 16:02:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IG2oh7081327; Mon, 18 Feb 2019 16:02:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IG2oGg081326; Mon, 18 Feb 2019 16:02:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902181602.x1IG2oGg081326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 18 Feb 2019 16:02:50 +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: r344257 - stable/11/usr.sbin/nscd X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/usr.sbin/nscd X-SVN-Commit-Revision: 344257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6A5B6E0B9 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 16:02:51 -0000 Author: trasz Date: Mon Feb 18 16:02:50 2019 New Revision: 344257 URL: https://svnweb.freebsd.org/changeset/base/344257 Log: MFC r339194: Remove the BUGS section of nscd(8) man page. According to bushman@'s reponse quoted in PR, he no longer maintains it. PR: 210590 Sponsored by: DARPA, AFRL Modified: stable/11/usr.sbin/nscd/nscd.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nscd/nscd.8 ============================================================================== --- stable/11/usr.sbin/nscd/nscd.8 Mon Feb 18 16:02:00 2019 (r344256) +++ stable/11/usr.sbin/nscd/nscd.8 Mon Feb 18 16:02:50 2019 (r344257) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2005 +.Dd October 5, 2018 .Dt NSCD 8 .Os .Sh NAME @@ -160,6 +160,3 @@ The default configuration file. .Xr nsswitch.conf 5 .Sh AUTHORS .An Michael Bushkov Aq Mt bushman@FreeBSD.org -.Sh BUGS -Please send bug reports and suggestions to -.Aq Mt bushman@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Feb 18 16:03: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 291DD14E070D; Mon, 18 Feb 2019 16:03:49 +0000 (UTC) (envelope-from trasz@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 BD5206E284; Mon, 18 Feb 2019 16:03:48 +0000 (UTC) (envelope-from trasz@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 99C308269; Mon, 18 Feb 2019 16:03:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IG3mlZ081435; Mon, 18 Feb 2019 16:03:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IG3mrG081434; Mon, 18 Feb 2019 16:03:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902181603.x1IG3mrG081434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 18 Feb 2019 16:03:48 +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: r344258 - stable/11/usr.sbin/nscd X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/usr.sbin/nscd X-SVN-Commit-Revision: 344258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD5206E284 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 16:03:49 -0000 Author: trasz Date: Mon Feb 18 16:03:48 2019 New Revision: 344258 URL: https://svnweb.freebsd.org/changeset/base/344258 Log: MFC r339214: Remove BUGS section from nscd.conf(5) man page. This was missed in r339194. Sponsored by: DARPA, AFRL Modified: stable/11/usr.sbin/nscd/nscd.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- stable/11/usr.sbin/nscd/nscd.conf.5 Mon Feb 18 16:02:50 2019 (r344257) +++ stable/11/usr.sbin/nscd/nscd.conf.5 Mon Feb 18 16:03:48 2019 (r344258) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2006 +.Dd October 6, 2018 .Dt NSCD.CONF 5 .Os .Sh NAME @@ -153,6 +153,3 @@ symbol at the beginning of the line for comments. .Xr nscd 8 .Sh AUTHORS .An Michael Bushkov Aq Mt bushman@FreeBSD.org -.Sh BUGS -Please send bug reports and suggestions to -.Aq Mt bushman@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Feb 18 16:11: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 CAEDC14E0A6D; Mon, 18 Feb 2019 16:11:12 +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 7230D6E68F; Mon, 18 Feb 2019 16:11:12 +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 634F282AE; Mon, 18 Feb 2019 16:11:12 +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 x1IGBCOG085994; Mon, 18 Feb 2019 16:11:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IGBCF0085993; Mon, 18 Feb 2019 16:11:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902181611.x1IGBCF0085993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 Feb 2019 16:11:12 +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: r344259 - stable/12/sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sbin/bectl/tests X-SVN-Commit-Revision: 344259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7230D6E68F 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 16:11:13 -0000 Author: kevans Date: Mon Feb 18 16:11:11 2019 New Revision: 344259 URL: https://svnweb.freebsd.org/changeset/base/344259 Log: MFC r343543: bectl(8) test: Force destroy the zpool in cleanup This is a wild guess as to why bectl tests failed once upon a time in CI, given no apparent way to see a transcript of cleanup routines with Kyua. The bectl tests construct a new, clean zpool for every test. The failure indicated was because of a mount that was leftover from a previous test, but the previous test had succeeded so it's not clear how the mount remained leftover unless the `zpool get health ${pool}` had somehow failed. Modified: stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- stable/12/sbin/bectl/tests/bectl_test.sh Mon Feb 18 16:03:48 2019 (r344258) +++ stable/12/sbin/bectl/tests/bectl_test.sh Mon Feb 18 16:11:11 2019 (r344259) @@ -62,7 +62,7 @@ bectl_cleanup() zpool=$1 if zpool get health ${zpool} >/dev/null 2>&1; then - zpool destroy ${zpool} + zpool destroy -f ${zpool} fi } From owner-svn-src-all@freebsd.org Mon Feb 18 16:19: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 D851D14E118E for ; Mon, 18 Feb 2019 16:19:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCB16EF23 for ; Mon, 18 Feb 2019 16:19:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x831.google.com with SMTP id y4so19751140qtc.10 for ; Mon, 18 Feb 2019 08:19:46 -0800 (PST) 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=X87BLl/Efm7RMTXNQwxPR+z9H2ITTIK1Gk1Mw0n0B3Q=; b=0TfwmckiPAcqlwbqVxkvTI/walWSZTtiD6xXPtkl/6CPzawhUuapofww/hN5xdrTRW xRlaJymGNp9BvQ/BGD+a3PLvOk8OAw0K6PV2ynmb7IZ8Vpj7o5SohMJqGcI9/eGFq5u0 CJ2XKWNMnHB085Z5IDhVgGqadUsF1fpcL1ipOmFLVNId5viG4IoZJhGU450qQOo1ognc bFIzEvPjURpqA4h79lLkdgIkqMxM8+QWDkdlVsXycEPda9UATnhFbZZrJ2G0yC9iKKtJ CzLNga2kjjNZFpBwlM2eM4dUDuZtFxY5ilG7o0nBmQYXPX+iF/P8NEtHz5cIK8w4JQZ1 FbTA== 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=X87BLl/Efm7RMTXNQwxPR+z9H2ITTIK1Gk1Mw0n0B3Q=; b=QIzQy/RXVCo1B/UHnUv2hWQVHsPs2wBbQgdGxyBaHF0qmIALooOz2z06hCu+kY1Kp3 280PawcXKhFdRgBfkq5h8BWNOveX0pWvCHltHPBFbUSull2XRRHF8Bd7RoD8HdL9FZhD x6vMzbVjgceYq4p4d6YiEp8d+ZctKzr2WSmoyLUhr0h9daQah21muyzCiYKa1TAuzckH /sqjgyHVS8CP9RvPvYwIBjtsDj7OimETT4AGmrp+O6tMVIZU8iS1tjm5dqihAE6v2Qzu JmN7iJa4QSIdVFgwQM5fBZvdezY3RnhNL3d07JXCwLZcsxZxjUjESeDcf/PdDEyOiDGk 6T4Q== X-Gm-Message-State: AHQUAuYboA4tXA3hws6J65sOvuQAHblB8RUnB6KgXdHc4kZVcz8terga /HvYDiqtUpJa9DTUXt9CvkqCuxqOwFj0W/i/ccXz4w== X-Google-Smtp-Source: AHgI3IY3WMRUzDVRtuKZycqpxEbAjVrACgwWoZorybGvRu08UrskAngnxzmukp7GrbmM89xAHRY91QTDNZandBhELQY= X-Received: by 2002:ac8:3974:: with SMTP id t49mr19325846qtb.118.1550506785875; Mon, 18 Feb 2019 08:19:45 -0800 (PST) MIME-Version: 1.0 References: <201902180341.x1I3fjf5003561@pdx.rh.CN85.dnsmgr.net> <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> In-Reply-To: <0D51AC98-0E84-4E66-B552-CE9D4A7EFCD7@freebsd.org> From: Warner Losh Date: Mon, 18 Feb 2019 09:19:35 -0700 Message-ID: Subject: Re: svn commit: r344243 - head/stand/lua To: Devin Teske Cc: "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 5DCB16EF23 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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: Mon, 18 Feb 2019 16:19:47 -0000 On Mon, Feb 18, 2019 at 12:17 AM Devin Teske wrote: > > > > On 17 Feb 2019, at 9:18 PM, Warner Losh wrote: > > > > We did a lot of that traditionally in the FORTH loader too, and weren't > always that good about it. > > Uh, no. I only clear regions of the screen by positioning the cursor usin= g > ANSI escape sequences and then drawing spaces. I do not clear the screen = =E2=80=9Ca > lot=E2=80=9D and would like to think I was damned good about it. > Generally speaking, both FORTH and LUA clear it the same amount was more my point. It's more visible on the serial port than on the video screen, though, because that is attached to a terminal of who knows how large a screen. Part of the problem here, though, is that UEFI clears things independently from the others as it sets up the proper video modes as well, which neither FORTH nor LUA controls directly today. So my point was more that screen clearing is a red-herring issue if you want to preserve error messages. I'll gladly concede I used imprecise language to make one of points surrounding it. If we want to be able to preserve error messages, we need to preserve them, and we don't today. Warner From owner-svn-src-all@freebsd.org Mon Feb 18 16:25: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 6394714E15EE for ; Mon, 18 Feb 2019 16:25:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE1D46F5EC for ; Mon, 18 Feb 2019 16:25:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id b8so19759417qtr.9 for ; Mon, 18 Feb 2019 08:25:13 -0800 (PST) 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=QeCGp8iAmq194NJteXxBukowUS86SPt0DnFmhPckR/o=; b=eUu+k3B3t6B14iZXYQIito4XMPE1wbFCtmGQm9wOr9pndQDtnX1j+lexB2EasTNhtc DJT+5HDJa05Wd2ye+AXw2dLd0IEVRNEwrx0bQZuMYnBxrEFgDNAuY6re3+eamrJc3nTy C8TwhigJoQDhOqCiDNyJ2CIPl54yzyCYroTri38jilcdmZ80Nuk9kjcw2q1vQbHxUIjy ihU7C43PSYTW+q08S76l00ZlrfAzZeqN/dyNgHSLgPt08oaKL9BpmXv7z0aXmlOES8rm u996x2SURy9mnrPyObxR5YDwZf+s8my0TLSbDfzpOzI73QDRXLEseANJngm9+PCsPbXK IHPQ== 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=QeCGp8iAmq194NJteXxBukowUS86SPt0DnFmhPckR/o=; b=D3yulL73QEqaHVBuAnZKH5MGu/Jzxc1RpR55CgN8aJXLHrMoak/0/zzybo+uWzKdwq lYJAoTmxPTU8VHp+GktXVguTWo8x7DSdow0NF7wjaDi9cWwxVqPAiSLJfX00o+K6i5ew ThNtb5MyU0k+NL7dO3yJDN3nRMItOsfco9ZZlllVWOc4JK9XOY4Jk7wy3dRGsnxTwvrA 6wmLly3+9bf/VywLXrKUWc0BiX1DrZMqb1lZX0KnqFTkQHwvVLiew+ubVyrm1HCW4bVY Zgp8qvqjpMeTafSX6Bba4T/glhHVOkxg0SGVXOibcDqBJmZtf5LSNx/jbdSa+gIclkkh hG/A== X-Gm-Message-State: AHQUAuZcHDPf5QvD6yqxKOzi0DjGyAfYkLry2ThBHWwhacWBwGdVOlrN +rj2kQCpaFJ9QeDBK2cimoTZxb1murZ2Nalsik8nMQ== X-Google-Smtp-Source: AHgI3IbNOcaseM4hErMVKJ3jW3n665/t+rVKBK5zFJnBVCrmAg4FjaSO3F8P2BKA+xuuIRP8qtpwQe+WQvrZioa5T0w= X-Received: by 2002:a0c:b068:: with SMTP id l37mr18318816qvc.21.1550507113451; Mon, 18 Feb 2019 08:25:13 -0800 (PST) MIME-Version: 1.0 References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> In-Reply-To: <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> From: Warner Losh Date: Mon, 18 Feb 2019 09:25:02 -0700 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: Ian Lepore Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: EE1D46F5EC 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.927,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Mon, 18 Feb 2019 16:25:14 -0000 On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Feb 17 23:32:09 2019 > > > New Revision: 344238 > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > Log: > > > Restore loader(8)'s ability for lsdev to show partitions within a bs= d > slice. > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. It > has > > > been failing recently because if you call disk_open() with > dev->d_partition > > > set to -1 when d_slice refers to a bsd slice, it assumes you want it > to > > > open the first partition within that slice. When you then pass that > open > > > dev instance to ptable_open(), it tries to read the start of the 'a' > > > partition and decides there is no recognizable partition type there. > > > > > > This restores the old functionality by resetting d_offset to the sta= rt > > > of the raw slice after disk_open() returns. For good measure, > d_partition > > > is also set back to -1, although that doesn't currently affect > anything. > > > > > > I would have preferred to make disk_open() avoid such rude > assumptions and > > > if you ask for partition -1 you get the raw slice. But the commit > history > > > shows that someone already did that once (r239058), and had to rever= t > it > > > (r239232), so I didn't even try to go down that road. > > > > > > What was the reason for the revert? I still do think the current > > disk_open() approach is not good because it does break the promise to > > get MBR partition (see common/disk.h). > > > > Of course I can see the appeal for something like =E2=80=9Cboot disk0:= =E2=80=9D but > > case like that should be solved by iterating partition table, and not > > by making API to do wrong thing - if I did ask to for disk0s0: I > > really would expect to get disk0s0: and not disk0s0a: > > > > But anyhow, it would be good to understand the actual reasoning > > behind that decision. > > > > I have no idea. As is so often the case, the commit message for the > revert said what the commit did ("revert to historic behavior") without > any hint of why the change was made. One has to assume that it broke > some working cases and people complained. > > Part of the problem for the disk_open() "api" is that there is not even > a comment block with some hints in it. I was thinking one potential > solution might instead of using "if (partition < 0)" we could define a > couple magical partition number values, PNUM_GETBEST =3D -1, > PNUM_RAWSLICE =3D -2, that sort of thing. But it would require carefully > combing through the existing code looking at all calls to disk_open() > and all usage of disk_devdesc.d_partition. > I think that we should fix the disk_open() api. And then fix everything that uses it to comply with the new rules. The current hodge-podge that we have causes a number of issues for different environments that are only mostly worked around. I've done some work in this area to make things more regular, but it's still a dog's breakfast of almost-stackable devices that we overload too many things on, resulting in the mis-mash we have today. When the whole world was just MBR + BSD label, we could get away with it. But now that we have GPT as well as GELI support and ZFS pool devices on top of disk devices, the arrangements aren't working as well as could be desired. Warner From owner-svn-src-all@freebsd.org Mon Feb 18 16:31: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 EA22B14E18BF; Mon, 18 Feb 2019 16:31:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817116FB34; Mon, 18 Feb 2019 16:31:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id i20so29319676otl.0; Mon, 18 Feb 2019 08:31:08 -0800 (PST) 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:content-transfer-encoding; bh=kJHRusBvMcFcwBosf6frrFCynlA+lBSHt3mcyjlxv1g=; b=nlrmnuiW7Bj6bWiDFdqSirYgrf3bLXJ7uQoCdBW0FBeNO4R4QUvZsJDUl0PW3vCnSN Fw/24R3XIRr7GDLH7Jkjz9w/PA/qaqO8USO6DdTFKgUxKRDVOFPSC0mLALThG36llb/A mz1k2Oarrzd7ysc+bSrI/5VBfYGTmEkf/fCISmY5JzTpy8n+NdlZUr4dh6mGfU71g878 OxS+AtgYYDM583nkD6N4Gpzg7pUUbP2MCImIxNkpqYcZGx6GIaGroWJX/AGufoXlUhe4 Fe64S8yOATtWkgd9NoG6uxhuVz2/T94Y89puQ2LAKecpEkTMFP/P7xFCRtw5hk8vmAhK tH3A== X-Gm-Message-State: AHQUAuab98pJPEhTjdvCW+L5nGj599r07As7Cgjz6qzq8mmzYQIYjkyN P5iVLkqiWgCo3BV1MDPEghoo3f9oRlS+GBiNseg= X-Google-Smtp-Source: AHgI3Ia+IhMbh7QsP5Gt6j0c+RHN98pWFK6OI/5u4hI6KiC5fZWdv+4g6LUO5vBV+EcZrfuAvnAIS2TaffssQUc7ZL4= X-Received: by 2002:a9d:7cd3:: with SMTP id r19mr1457212otn.139.1550507462117; Mon, 18 Feb 2019 08:31:02 -0800 (PST) MIME-Version: 1.0 References: <201902112046.x1BKkWFJ007744@repo.freebsd.org> <36om-fw2j-wny@FreeBSD.org> <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> In-Reply-To: <1F9F5F69-856A-49C5-91F1-5846016E2B34@gmail.com> From: Edward Napierala Date: Mon, 18 Feb 2019 16:30:50 +0000 Message-ID: Subject: Re: svn commit: r344021 - head/share/man/man7 To: Enji Cooper Cc: Jan Beich , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 817116FB34 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.81 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.81)[-0.810,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, 18 Feb 2019 16:31:09 -0000 niedz., 17 lut 2019 o 16:05 Enji Cooper napisa=C5= =82(a): > > > > On Feb 17, 2019, at 04:17, Jan Beich wrote: > > > > Edward Tomasz Napierala writes: > > > >> ... while the > >> +.Em quarterly > > > > .Em looks unnecessary as "the" is enough. /quarterly is a package set > > (or repository), not an actual name of the branch. > > > > - /head -> /latest > > - /branches/*Q* -> /quarterly > > - /tags/RELEASE_* -> /release_* Jan, do you mean to drop just this single .Em, drop .Ems in all places it's being used for "quarterly", or drop it for both "quarterly" and "head"? > >> +subdirectory, eg: > > > > Did you mean "subdirectory e.g.," ? > > > > https://english.stackexchange.com/questions/16172/should-i-always-use-a= -comma-after-e-g-or-i-e > > It=E2=80=99s actually =E2=80=9Csubdirectory, e.g.,=E2=80=9D. igor will co= rrect the usage :). It would, if only I've spelled it correctly, as "e.g." and not "eg". I'm not sure about this case, though, because it's followed by a colon. Should it become "subdirectory, e.g.,", and then the URL, without the colon= ? From owner-svn-src-all@freebsd.org Mon Feb 18 17:04: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 C568B14E3E27 for ; Mon, 18 Feb 2019 17:04:22 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-tydg10011801.me.com (pv50p00im-tydg10011801.me.com [17.58.6.52]) (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 4C1197239A for ; Mon, 18 Feb 2019 17:04:22 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-tydg10011801.me.com (Postfix) with ESMTPSA id 205726601B8; Mon, 18 Feb 2019 17:04:11 +0000 (UTC) From: Toomas Soome Message-Id: <7C165E48-DB8B-40F2-B9E9-2FB57C348252@me.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344238 - head/stand/common Date: Mon, 18 Feb 2019 19:04:09 +0200 In-Reply-To: Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> <4283f17c1841561a41a03a9203ab295564aa0ba5.camel@freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-18_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902180127 X-Rspamd-Queue-Id: 4C1197239A X-Spamd-Bar: ------ 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 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: Mon, 18 Feb 2019 17:04:23 -0000 > On 18 Feb 2019, at 18:25, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore > wrote: > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > >=20 > > > Author: ian > > > Date: Sun Feb 17 23:32:09 2019 > > > New Revision: 344238 > > > URL: https://svnweb.freebsd.org/changeset/base/344238 = > > >=20 > > > Log: > > > Restore loader(8)'s ability for lsdev to show partitions within a = bsd slice. > > >=20 > > > I'm pretty sure this used to work at one time, perhaps long ago. = It has > > > been failing recently because if you call disk_open() with = dev->d_partition > > > set to -1 when d_slice refers to a bsd slice, it assumes you want = it to > > > open the first partition within that slice. When you then pass = that open > > > dev instance to ptable_open(), it tries to read the start of the = 'a' > > > partition and decides there is no recognizable partition type = there. > > >=20 > > > This restores the old functionality by resetting d_offset to the = start > > > of the raw slice after disk_open() returns. For good measure, = d_partition > > > is also set back to -1, although that doesn't currently affect = anything. > > >=20 > > > I would have preferred to make disk_open() avoid such rude = assumptions and > > > if you ask for partition -1 you get the raw slice. But the = commit history > > > shows that someone already did that once (r239058), and had to = revert it > > > (r239232), so I didn't even try to go down that road. > >=20 > >=20 > > What was the reason for the revert? I still do think the current > > disk_open() approach is not good because it does break the promise = to > > get MBR partition (see common/disk.h).=20 > >=20 > > Of course I can see the appeal for something like =E2=80=9Cboot = disk0:=E2=80=9D but > > case like that should be solved by iterating partition table, and = not > > by making API to do wrong thing - if I did ask to for disk0s0: I > > really would expect to get disk0s0: and not disk0s0a: > >=20 > > But anyhow, it would be good to understand the actual reasoning > > behind that decision. > >=20 >=20 > I have no idea. As is so often the case, the commit message for the > revert said what the commit did ("revert to historic behavior") = without > any hint of why the change was made. One has to assume that it broke > some working cases and people complained. >=20 > Part of the problem for the disk_open() "api" is that there is not = even > a comment block with some hints in it. I was thinking one potential > solution might instead of using "if (partition < 0)" we could define a > couple magical partition number values, PNUM_GETBEST =3D -1, > PNUM_RAWSLICE =3D -2, that sort of thing. But it would require = carefully > combing through the existing code looking at all calls to disk_open() > and all usage of disk_devdesc.d_partition. >=20 > I think that we should fix the disk_open() api. And then fix = everything that uses it to comply with the new rules. The current = hodge-podge that we have causes a number of issues for different = environments that are only mostly worked around. I've done some work in = this area to make things more regular, but it's still a dog's breakfast = of almost-stackable devices that we overload too many things on, = resulting in the mis-mash we have today. When the whole world was just = MBR + BSD label, we could get away with it. But now that we have GPT as = well as GELI support and ZFS pool devices on top of disk devices, the = arrangements aren't working as well as could be desired. >=20 > Warner I am looking on it too, but it has more traps than I was suspecting:) rgds, toomas From owner-svn-src-all@freebsd.org Mon Feb 18 17:12: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 CA5DC14E499C; Mon, 18 Feb 2019 17:12: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 58F917322D; Mon, 18 Feb 2019 17:12: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 47D4D8E7E; Mon, 18 Feb 2019 17:12:31 +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 x1IHCVsN019307; Mon, 18 Feb 2019 17:12:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IHCV50019306; Mon, 18 Feb 2019 17:12:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181712.x1IHCV50019306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 17:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344260 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58F917322D 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)[-0.999,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, 18 Feb 2019 17:12:32 -0000 Author: ian Date: Mon Feb 18 17:12:30 2019 New Revision: 344260 URL: https://svnweb.freebsd.org/changeset/base/344260 Log: Allow the u-boot loaderdev env var to be formatted in the "usual" loader(8) way: device[s|p]. E.g., disk0s2a or disk3p12. The code first tries to parse the variable in this format using the standard disk_parsedev(). If that fails, it falls back to parsing the legacy format that has been supported by ubldr for years. In addition to 'disk', all the valid uboot device names can also be used: mmc, sata, usb, ide, scsi. The 'disk' device serves as an alias for all those types and will match the Nth storage-type device found (where N is the unit number). Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Feb 18 16:11:11 2019 (r344259) +++ head/stand/uboot/common/main.c Mon Feb 18 17:12:30 2019 (r344260) @@ -182,6 +182,14 @@ device_typename(int type) * The returned values for slice and partition are interpreted by * disk_open(). * + * The device string can be a standard loader(8) disk specifier: + * + * disks disk0s1 + * disks disk1s2a + * diskp disk0p4 + * + * or one of the following formats: + * * Valid device strings: For device types: * * DEV_TYP_STOR, DEV_TYP_NET @@ -198,6 +206,7 @@ device_typename(int type) static void get_load_device(int *type, int *unit, int *slice, int *partition) { + struct disk_devdesc dev; char *devstr; const char *p; char *endp; @@ -215,6 +224,19 @@ get_load_device(int *type, int *unit, int *slice, int printf("U-Boot env: loaderdev='%s'\n", devstr); p = get_device_type(devstr, type); + + /* + * If type is DEV_TYP_STOR we have a disk-like device. If we can parse + * the remainder of the string as a standard unit+slice+partition (e.g., + * 0s2a or 1p12), return those results. Otherwise we'll fall through to + * the code that parses the legacy format. + */ + if ((*type & DEV_TYP_STOR) && disk_parsedev(&dev, p, NULL) == 0) { + *unit = dev.dd.d_unit; + *slice = dev.d_slice; + *partition = dev.d_partition; + return; + } /* Ignore optional spaces after the device name. */ while (*p == ' ') From owner-svn-src-all@freebsd.org Mon Feb 18 17:51: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 ABFCC14E5DD3; Mon, 18 Feb 2019 17:51:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 394F074F6A; Mon, 18 Feb 2019 17:51:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1IHp9B8006396; Mon, 18 Feb 2019 09:51:09 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1IHp9gc006395; Mon, 18 Feb 2019 09:51:09 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344238 - head/stand/common In-Reply-To: To: Warner Losh Date: Mon, 18 Feb 2019 09:51:09 -0800 (PST) CC: Ian Lepore , Toomas Soome , src-committers , 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: 394F074F6A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.917,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, 18 Feb 2019 17:51:13 -0000 > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > > > Author: ian > > > > Date: Sun Feb 17 23:32:09 2019 > > > > New Revision: 344238 > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > > > Log: > > > > Restore loader(8)'s ability for lsdev to show partitions within a bsd > > slice. > > > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. It > > has > > > > been failing recently because if you call disk_open() with > > dev->d_partition > > > > set to -1 when d_slice refers to a bsd slice, it assumes you want it > > to > > > > open the first partition within that slice. When you then pass that > > open > > > > dev instance to ptable_open(), it tries to read the start of the 'a' > > > > partition and decides there is no recognizable partition type there. > > > > > > > > This restores the old functionality by resetting d_offset to the start > > > > of the raw slice after disk_open() returns. For good measure, > > d_partition > > > > is also set back to -1, although that doesn't currently affect > > anything. > > > > > > > > I would have preferred to make disk_open() avoid such rude > > assumptions and > > > > if you ask for partition -1 you get the raw slice. But the commit > > history > > > > shows that someone already did that once (r239058), and had to revert > > it > > > > (r239232), so I didn't even try to go down that road. > > > > > > > > > What was the reason for the revert? I still do think the current > > > disk_open() approach is not good because it does break the promise to > > > get MBR partition (see common/disk.h). > > > > > > Of course I can see the appeal for something like ?boot disk0:? but > > > case like that should be solved by iterating partition table, and not > > > by making API to do wrong thing - if I did ask to for disk0s0: I > > > really would expect to get disk0s0: and not disk0s0a: > > > > > > But anyhow, it would be good to understand the actual reasoning > > > behind that decision. > > > > > > > I have no idea. As is so often the case, the commit message for the > > revert said what the commit did ("revert to historic behavior") without > > any hint of why the change was made. One has to assume that it broke > > some working cases and people complained. > > > > Part of the problem for the disk_open() "api" is that there is not even > > a comment block with some hints in it. I was thinking one potential > > solution might instead of using "if (partition < 0)" we could define a > > couple magical partition number values, PNUM_GETBEST = -1, > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully > > combing through the existing code looking at all calls to disk_open() > > and all usage of disk_devdesc.d_partition. > > > > I think that we should fix the disk_open() api. And then fix everything > that uses it to comply with the new rules. The current hodge-podge that we > have causes a number of issues for different environments that are only > mostly worked around. I've done some work in this area to make things more > regular, but it's still a dog's breakfast of almost-stackable devices that > we overload too many things on, resulting in the mis-mash we have today. > When the whole world was just MBR + BSD label, we could get away with it. > But now that we have GPT as well as GELI support and ZFS pool devices on > top of disk devices, the arrangements aren't working as well as could be > desired. Yes please. Could this be some of the cause of issues with legacy mbr boots that use to work, that now stop working? I have observed this on zfs in mbr on a machine here. I did not have time to debug it, it was faster to nuke and pave the machine that was critical to operations, the error came as part of a failed freenas upgrade to the 11.2 based version. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Feb 18 18:34: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 B3D8C14E7765; Mon, 18 Feb 2019 18:34:14 +0000 (UTC) (envelope-from dim@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 5551777D7E; Mon, 18 Feb 2019 18:34:14 +0000 (UTC) (envelope-from dim@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 463729C2D; Mon, 18 Feb 2019 18:34:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IIYEOU064412; Mon, 18 Feb 2019 18:34:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IIYE81064411; Mon, 18 Feb 2019 18:34:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902181834.x1IIYE81064411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 Feb 2019 18:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344261 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 344261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5551777D7E 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.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 18:34:14 -0000 Author: dim Date: Mon Feb 18 18:34:13 2019 New Revision: 344261 URL: https://svnweb.freebsd.org/changeset/base/344261 Log: Pull in r345199 from upstream libc++ trunk (by Petr Hosek): Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are floating-point types." This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 This prevents "_Float16 is not supported on this target" errors in libc++'s type_traits header, in some cases. Reported by: Charlie Li MFC after: 3 days Modified: head/contrib/libc++/include/type_traits Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Mon Feb 18 17:12:30 2019 (r344260) +++ head/contrib/libc++/include/type_traits Mon Feb 18 18:34:13 2019 (r344261) @@ -733,12 +733,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_ // is_floating_point template struct __libcpp_is_floating_point : public false_type {}; -#ifdef __clang__ -template <> struct __libcpp_is_floating_point<__fp16> : public true_type {}; -#endif -#ifdef __FLT16_MANT_DIG__ -template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; -#endif template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; From owner-svn-src-all@freebsd.org Mon Feb 18 18: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 DF31914E7EFF; Mon, 18 Feb 2019 18:44:21 +0000 (UTC) (envelope-from brooks@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 84970806B1; Mon, 18 Feb 2019 18:44:21 +0000 (UTC) (envelope-from brooks@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 783409DD7; Mon, 18 Feb 2019 18:44:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IIiLk8069569; Mon, 18 Feb 2019 18:44:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IIiLW3069568; Mon, 18 Feb 2019 18:44:21 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201902181844.x1IIiLW3069568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 18 Feb 2019 18:44: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: r344262 - stable/12/sbin/mdmfs X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sbin/mdmfs X-SVN-Commit-Revision: 344262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84970806B1 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 18:44:22 -0000 Author: brooks Date: Mon Feb 18 18:44:20 2019 New Revision: 344262 URL: https://svnweb.freebsd.org/changeset/base/344262 Log: MFC r344023: mdmfs: Fix many bugs in automatic md(4) creation. This code allocated a correctly sized buffer, read past the end of the source buffer, writing off the end of the target buffer, and then writing a '\0' terminator past the end of the target buffer (in the wrong place). It then leaked the buffer. Switch to a statically sized buffer on the stack and update the source pointer and length before use so the correct things are copied. Fix a logic error in the checks that the format of the line is as expected and move on out of an assert. Remove an unneeded close(). fclose() closes the descriptor. Found with: CheriABI Obtained from: CheriBSD Reviewed by: kib, jhb, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19122 Modified: stable/12/sbin/mdmfs/mdmfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/mdmfs/mdmfs.c ============================================================================== --- stable/12/sbin/mdmfs/mdmfs.c Mon Feb 18 18:34:13 2019 (r344261) +++ stable/12/sbin/mdmfs/mdmfs.c Mon Feb 18 18:44:20 2019 (r344262) @@ -441,7 +441,8 @@ static void do_mdconfig_attach_au(const char *args, const enum md_types mdtype) { const char *ta; /* Type arg. */ - char *linep, *linebuf; /* Line pointer, line buffer. */ + char *linep; + char linebuf[12]; /* 32-bit unit (10) + '\n' (1) + '\0' (1) */ int fd; /* Standard output of mdconfig invocation. */ FILE *sfd; int rv; @@ -475,14 +476,15 @@ do_mdconfig_attach_au(const char *args, const enum md_ if (sfd == NULL) err(1, "fdopen"); linep = fgetln(sfd, &linelen); - if (linep == NULL && linelen < mdnamelen + 1) - errx(1, "unexpected output from mdconfig (attach)"); /* If the output format changes, we want to know about it. */ - assert(strncmp(linep, mdname, mdnamelen) == 0); - linebuf = malloc(linelen - mdnamelen + 1); - assert(linebuf != NULL); + if (linep == NULL || linelen <= mdnamelen + 1 || + linelen - mdnamelen >= sizeof(linebuf) || + strncmp(linep, mdname, mdnamelen) != 0) + errx(1, "unexpected output from mdconfig (attach)"); + linep += mdnamelen; + linelen -= mdnamelen; /* Can't use strlcpy because linep is not NULL-terminated. */ - strncpy(linebuf, linep + mdnamelen, linelen); + strncpy(linebuf, linep, linelen); linebuf[linelen] = '\0'; ul = strtoul(linebuf, &p, 10); if (ul == ULONG_MAX || *p != '\n') @@ -490,7 +492,6 @@ do_mdconfig_attach_au(const char *args, const enum md_ unit = ul; fclose(sfd); - close(fd); } /* From owner-svn-src-all@freebsd.org Mon Feb 18 18:57: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 1258B14E83FC; Mon, 18 Feb 2019 18:57:53 +0000 (UTC) (envelope-from brooks@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 A760680DCE; Mon, 18 Feb 2019 18:57:52 +0000 (UTC) (envelope-from brooks@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 93F2B9FA4; Mon, 18 Feb 2019 18:57:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IIvq41075213; Mon, 18 Feb 2019 18:57:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IIvqC1075212; Mon, 18 Feb 2019 18:57:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201902181857.x1IIvqC1075212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 18 Feb 2019 18:57:52 +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: r344263 - stable/11/sbin/mdmfs X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sbin/mdmfs X-SVN-Commit-Revision: 344263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A760680DCE 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 18 Feb 2019 18:57:53 -0000 Author: brooks Date: Mon Feb 18 18:57:52 2019 New Revision: 344263 URL: https://svnweb.freebsd.org/changeset/base/344263 Log: MFC r344023: mdmfs: Fix many bugs in automatic md(4) creation. This code allocated a correctly sized buffer, read past the end of the source buffer, writing off the end of the target buffer, and then writing a '\0' terminator past the end of the target buffer (in the wrong place). It then leaked the buffer. Switch to a statically sized buffer on the stack and update the source pointer and length before use so the correct things are copied. Fix a logic error in the checks that the format of the line is as expected and move on out of an assert. Remove an unneeded close(). fclose() closes the descriptor. Found with: CheriABI Obtained from: CheriBSD Reviewed by: kib, jhb, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19122 Modified: stable/11/sbin/mdmfs/mdmfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mdmfs/mdmfs.c ============================================================================== --- stable/11/sbin/mdmfs/mdmfs.c Mon Feb 18 18:44:20 2019 (r344262) +++ stable/11/sbin/mdmfs/mdmfs.c Mon Feb 18 18:57:52 2019 (r344263) @@ -441,7 +441,8 @@ static void do_mdconfig_attach_au(const char *args, const enum md_types mdtype) { const char *ta; /* Type arg. */ - char *linep, *linebuf; /* Line pointer, line buffer. */ + char *linep; + char linebuf[12]; /* 32-bit unit (10) + '\n' (1) + '\0' (1) */ int fd; /* Standard output of mdconfig invocation. */ FILE *sfd; int rv; @@ -475,14 +476,15 @@ do_mdconfig_attach_au(const char *args, const enum md_ if (sfd == NULL) err(1, "fdopen"); linep = fgetln(sfd, &linelen); - if (linep == NULL && linelen < mdnamelen + 1) - errx(1, "unexpected output from mdconfig (attach)"); /* If the output format changes, we want to know about it. */ - assert(strncmp(linep, mdname, mdnamelen) == 0); - linebuf = malloc(linelen - mdnamelen + 1); - assert(linebuf != NULL); + if (linep == NULL || linelen <= mdnamelen + 1 || + linelen - mdnamelen >= sizeof(linebuf) || + strncmp(linep, mdname, mdnamelen) != 0) + errx(1, "unexpected output from mdconfig (attach)"); + linep += mdnamelen; + linelen -= mdnamelen; /* Can't use strlcpy because linep is not NULL-terminated. */ - strncpy(linebuf, linep + mdnamelen, linelen); + strncpy(linebuf, linep, linelen); linebuf[linelen] = '\0'; ul = strtoul(linebuf, &p, 10); if (ul == ULONG_MAX || *p != '\n') @@ -490,7 +492,6 @@ do_mdconfig_attach_au(const char *args, const enum md_ unit = ul; fclose(sfd); - close(fd); } /* From owner-svn-src-all@freebsd.org Mon Feb 18 19:07: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 00D5E14E8826; Mon, 18 Feb 2019 19:07:17 +0000 (UTC) (envelope-from dim@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 8ECAF8148E; Mon, 18 Feb 2019 19:07:16 +0000 (UTC) (envelope-from dim@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 45456A14D; Mon, 18 Feb 2019 19:07:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IJ7Gnn081016; Mon, 18 Feb 2019 19:07:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJ7Grp081015; Mon, 18 Feb 2019 19:07:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902181907.x1IJ7Grp081015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 Feb 2019 19:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344264 - head/lib/clang/libllvmminimal X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang/libllvmminimal X-SVN-Commit-Revision: 344264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ECAF8148E 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)[-0.999,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, 18 Feb 2019 19:07:17 -0000 Author: dim Date: Mon Feb 18 19:07:15 2019 New Revision: 344264 URL: https://svnweb.freebsd.org/changeset/base/344264 Log: Add one additional file to libllvmminimal, since in some cases (e.g. upgrading from stable/10 to stable/11) symbols from it are needed to link llvm-tblgen and clang-tblgen. Reported by: kib MFC after: 3 days Modified: head/lib/clang/libllvmminimal/Makefile Modified: head/lib/clang/libllvmminimal/Makefile ============================================================================== --- head/lib/clang/libllvmminimal/Makefile Mon Feb 18 18:57:52 2019 (r344263) +++ head/lib/clang/libllvmminimal/Makefile Mon Feb 18 19:07:15 2019 (r344264) @@ -18,6 +18,7 @@ SRCS+= Support/Errno.cpp SRCS+= Support/Error.cpp SRCS+= Support/ErrorHandling.cpp SRCS+= Support/FoldingSet.cpp +SRCS+= Support/FormatVariadic.cpp SRCS+= Support/FormattedStream.cpp SRCS+= Support/Hashing.cpp SRCS+= Support/Host.cpp From owner-svn-src-all@freebsd.org Mon Feb 18 19:13: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 35AED14E8BE9; Mon, 18 Feb 2019 19:13:30 +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 CAE8C819B2; Mon, 18 Feb 2019 19:13:29 +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 B2764A2F0; Mon, 18 Feb 2019 19:13:29 +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 x1IJDTdi085907; Mon, 18 Feb 2019 19:13:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJDT4f085906; Mon, 18 Feb 2019 19:13:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902181913.x1IJDT4f085906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 Feb 2019 19:13:29 +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: r344265 - stable/11/stand/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/zfs X-SVN-Commit-Revision: 344265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAE8C819B2 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.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 18 Feb 2019 19:13:30 -0000 Author: kevans Date: Mon Feb 18 19:13:28 2019 New Revision: 344265 URL: https://svnweb.freebsd.org/changeset/base/344265 Log: MFC r329727-r329728: lualoader ZFS BE Support r329727: stand/zfs: Add all bootenvs to environment For the benefit of lualoader, add all bootenvs to environment when init_zfs_bootenv is invoked. All of the boot environment logic can then be implemented in pure lua, rather than going back and forth with C to implement paging. This stores all boot environments in bootenvs[idx] and the final count of bootenvs in bootenvs_count. While here, make a copy of currdev for init_zfs_bootenv since it will be modifying it and the caller may not necessarily want that. Some of the logic was shifted around so that the 'currdev' pointer remains at the beginning of the string and 'beroot' is moved around as needed to modify it or ultimately store it in zfs_be_root. The original zfs_bootenv that this was copied from will be able to go away only if/when forth eventually goes away. r329728: stand/zfs: Unbreak build, 'truct' ~= 'struct' Modified: stable/11/stand/zfs/libzfs.h stable/11/stand/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/zfs/libzfs.h ============================================================================== --- stable/11/stand/zfs/libzfs.h Mon Feb 18 19:07:15 2019 (r344264) +++ stable/11/stand/zfs/libzfs.h Mon Feb 18 19:13:28 2019 (r344265) @@ -75,7 +75,7 @@ char *zfs_fmtdev(void *vdev); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); uint64_t ldi_get_size(void *); -void init_zfs_bootenv(char *currdev); +void init_zfs_bootenv(const char *currdev); int zfs_bootenv(const char *name); int zfs_belist_add(const char *name, uint64_t __unused); int zfs_set_env(void); Modified: stable/11/stand/zfs/zfs.c ============================================================================== --- stable/11/stand/zfs/zfs.c Mon Feb 18 19:07:15 2019 (r344264) +++ stable/11/stand/zfs/zfs.c Mon Feb 18 19:13:28 2019 (r344265) @@ -59,6 +59,8 @@ static off_t zfs_seek(struct open_file *f, off_t offse static int zfs_stat(struct open_file *f, struct stat *sb); static int zfs_readdir(struct open_file *f, struct dirent *d); +static void zfs_bootenv_initial(const char *); + struct devsw zfs_dev; struct fs_ops zfs_fsops = { @@ -758,27 +760,83 @@ zfs_list(const char *name) } void -init_zfs_bootenv(char *currdev) +init_zfs_bootenv(const char *currdev_in) { - char *beroot; + char *beroot, *currdev; + int currdev_len; - if (strlen(currdev) == 0) + currdev = NULL; + currdev_len = strlen(currdev_in); + if (currdev_len == 0) return; - if(strncmp(currdev, "zfs:", 4) != 0) + if (strncmp(currdev_in, "zfs:", 4) != 0) return; + currdev = strdup(currdev_in); + if (currdev == NULL) + return; /* Remove the trailing : */ - currdev[strlen(currdev) - 1] = '\0'; + currdev[currdev_len - 1] = '\0'; setenv("zfs_be_active", currdev, 1); setenv("zfs_be_currpage", "1", 1); - /* Forward past zfs: */ - currdev = strchr(currdev, ':'); - currdev++; /* Remove the last element (current bootenv) */ beroot = strrchr(currdev, '/'); if (beroot != NULL) beroot[0] = '\0'; - beroot = currdev; + beroot = strchr(currdev, ':') + 1; setenv("zfs_be_root", beroot, 1); + zfs_bootenv_initial(beroot); + free(currdev); +} + +static void +zfs_bootenv_initial(const char *name) +{ + char poolname[ZFS_MAXNAMELEN], *dsname; + char envname[32], envval[256]; + uint64_t objid; + spa_t *spa; + int bootenvs_idx, len, rv; + + SLIST_INIT(&zfs_be_head); + zfs_env_count = 0; + len = strlen(name); + dsname = strchr(name, '/'); + if (dsname != NULL) { + len = dsname - name; + dsname++; + } else + dsname = ""; + strlcpy(poolname, name, len + 1); + spa = spa_find_by_name(poolname); + if (spa == NULL) + return; + rv = zfs_lookup_dataset(spa, dsname, &objid); + if (rv != 0) + return; + rv = zfs_callback_dataset(spa, objid, zfs_belist_add); + bootenvs_idx = 0; + /* Populate the initial environment variables */ + SLIST_FOREACH_SAFE(zfs_be, &zfs_be_head, entries, zfs_be_tmp) { + /* Enumerate all bootenvs for general usage */ + snprintf(envname, sizeof(envname), "bootenvs[%d]", bootenvs_idx); + snprintf(envval, sizeof(envval), "zfs:%s/%s", name, zfs_be->name); + rv = setenv(envname, envval, 1); + if (rv != 0) + break; + bootenvs_idx++; + } + snprintf(envval, sizeof(envval), "%d", bootenvs_idx); + setenv("bootenvs_count", envval, 1); + + /* Clean up the SLIST of ZFS BEs */ + while (!SLIST_EMPTY(&zfs_be_head)) { + zfs_be = SLIST_FIRST(&zfs_be_head); + SLIST_REMOVE_HEAD(&zfs_be_head, entries); + free(zfs_be); + } + + return; + } int From owner-svn-src-all@freebsd.org Mon Feb 18 19:16: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 3C43814E8C8F; Mon, 18 Feb 2019 19:16:16 +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 D07B081BC8; Mon, 18 Feb 2019 19:16:15 +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 B4D38A2F1; Mon, 18 Feb 2019 19:16:15 +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 x1IJGFZs086095; Mon, 18 Feb 2019 19:16:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJGFBj086093; Mon, 18 Feb 2019 19:16:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902181916.x1IJGFBj086093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 Feb 2019 19:16:15 +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: r344266 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 344266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D07B081BC8 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)[-0.999,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, 18 Feb 2019 19:16:16 -0000 Author: kevans Date: Mon Feb 18 19:16:14 2019 New Revision: 344266 URL: https://svnweb.freebsd.org/changeset/base/344266 Log: MFC r332170, r332173: light cd9660 cleanup r332170: libsa: cd9660: warning: 'lenskip' may be used uninitialized in this function We better provide value for lenskip in both instances. r332173: libsa: name is not used in dirmatch() Seems like variable 'name' is leftover. Modified: stable/11/stand/libsa/cd9660.c stable/11/stand/libsa/cd9660read.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/cd9660.c ============================================================================== --- stable/11/stand/libsa/cd9660.c Mon Feb 18 19:13:28 2019 (r344265) +++ stable/11/stand/libsa/cd9660.c Mon Feb 18 19:16:14 2019 (r344266) @@ -309,6 +309,7 @@ cd9660_open(const char *path, struct open_file *f) first = 1; use_rrip = 0; + lenskip = 0; while (*path) { bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); dsize = isonum_733(rec.size); @@ -343,7 +344,7 @@ cd9660_open(const char *path, struct open_file *f) use_rrip = rrip_check(f, dp, &lenskip); if (dirmatch(f, path, dp, use_rrip, - first ? 0 : lenskip)) { + first ? 0 : lenskip)) { first = 0; break; } else Modified: stable/11/stand/libsa/cd9660read.c ============================================================================== --- stable/11/stand/libsa/cd9660read.c Mon Feb 18 19:13:28 2019 (r344265) +++ stable/11/stand/libsa/cd9660read.c Mon Feb 18 19:16:14 2019 (r344266) @@ -174,7 +174,7 @@ dirmatch(const char *path, struct iso_directory_record int lenskip) { size_t len; - const char *cp = NULL, *name = NULL; + const char *cp = NULL; int i, icase; if (use_rrip) @@ -187,7 +187,6 @@ dirmatch(const char *path, struct iso_directory_record icase = 1; } else icase = 0; - name = cp; for (i = len; --i >= 0; path++, cp++) { if (!*path || *path == '/') break; @@ -247,6 +246,7 @@ cd9660_lookup(const char *path) first = 1; use_rrip = 0; + lenskip = 0; while (*path) { bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); dsize = isonum_733(rec.size); From owner-svn-src-all@freebsd.org Mon Feb 18 19:50: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 9B96A14E9751; Mon, 18 Feb 2019 19:50: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 40CA382EB9; Mon, 18 Feb 2019 19:50: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 353F6A828; Mon, 18 Feb 2019 19:50: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 x1IJos76005671; Mon, 18 Feb 2019 19:50:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IJosT6005670; Mon, 18 Feb 2019 19:50:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902181950.x1IJosT6005670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Feb 2019 19:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344267 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 344267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40CA382EB9 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)[-0.999,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, 18 Feb 2019 19:50:54 -0000 Author: ian Date: Mon Feb 18 19:50:53 2019 New Revision: 344267 URL: https://svnweb.freebsd.org/changeset/base/344267 Log: Add a compatible string to match recent changes in the upstream dts. Modified: head/sys/arm/freescale/imx/imx6_snvs.c Modified: head/sys/arm/freescale/imx/imx6_snvs.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_snvs.c Mon Feb 18 19:16:14 2019 (r344266) +++ head/sys/arm/freescale/imx/imx6_snvs.c Mon Feb 18 19:50:53 2019 (r344267) @@ -73,6 +73,7 @@ struct snvs_softc { }; static struct ofw_compat_data compat_data[] = { + {"fsl,sec-v4.0-mon-rtc-lp", true}, {"fsl,sec-v4.0-mon", true}, {NULL, false} }; From owner-svn-src-all@freebsd.org Mon Feb 18 20:14: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 6FF5614EA507 for ; Mon, 18 Feb 2019 20:14:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F141C83F3A for ; Mon, 18 Feb 2019 20:14:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id w4so20683843qtc.1 for ; Mon, 18 Feb 2019 12:14:42 -0800 (PST) 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=xMdBmKAUyirc1/d4i/63DqIr+yBGhcb54pBAv+uoIa4=; b=VDjoWU/vUDuLnGicWRXIc0teYsEbuaIwxsYqGal1REaPqg+0yHH0b7+GTW81YfNiLu Wd5Q/55xBzyRAq9r80escB47dcuHKBgrF9Sc8aEvDCXqQFWOWGzRmhJR2S+cx2reOtJE R7IhIUsh897BNEApDN+0f4vtdRXz1vuhNPkgitsd98ZSMmViGkkV2io3yXqgiK2UucKW NvJonqMQ6F9KZgmwXvoz2KYGAz2WYi8+9apO6UcgVUn9dd0S691YpMwdXQO3XrttpLs4 hoKUjJ2hgfErYHoXygUaJiZNqmx+1EPAEgGvxrX64Nlkyq08m3RBoe5+AJJWX5dcChf8 kuvA== 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=xMdBmKAUyirc1/d4i/63DqIr+yBGhcb54pBAv+uoIa4=; b=auhJUpL8QHwn6/YQwvWf31oh63bc2xE6FnUmf6kOy3ziGSVP20KUbCD4mDp9wiNz7N P/PCjUkIPUG1Bo/B58tXZimu1K4Hem/jgUSuecE3BZc5ven0n9458vcynxcSdwIFNaLA UGeWt3FJasSNMYb7rpEu7No8FUMm2KsFkeTZaz5JeGNyCI1ddp2c8xHu4QQU2/Rf9h5Z bCR2hJnQAqKaxCvMCbMBT4dESzL1kVtzi71oIANfJhf0H3J5F2qm+TfaclfO6l9BDXX+ 7ZP7VTMMC1F3bmAgtDfVVjbUdDB9+/Z+JiPSuEio5y4g+cP2obbE8FBDY2hFl7inLDaP CsJg== X-Gm-Message-State: AHQUAubpU0xKKk5TedLAZF4gNZ/KFuD3ek/sBpHc9gWiSdgU7gl3rqjh 7mFMu6GJZDFZTEaBhEkSLLt26oltPRsH01FxNL6W4Q== X-Google-Smtp-Source: AHgI3IZQD+7QpjQGnPqCeJn0dQ8bXvq07fn4h3FQcrkFw0CiHZaA8TF8HlQDCNtAf+eMU3DsMP3921ACP1fTinJk1r4= X-Received: by 2002:a0c:9c89:: with SMTP id i9mr18513307qvf.153.1550520882374; Mon, 18 Feb 2019 12:14:42 -0800 (PST) MIME-Version: 1.0 References: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 18 Feb 2019 13:14:31 -0700 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: "Rodney W. Grimes" Cc: Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: F141C83F3A 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,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: Mon, 18 Feb 2019 20:14:43 -0000 On Mon, Feb 18, 2019 at 10:51 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: > > > > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: > > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: > > > > > > > > > > Author: ian > > > > > Date: Sun Feb 17 23:32:09 2019 > > > > > New Revision: 344238 > > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 > > > > > > > > > > Log: > > > > > Restore loader(8)'s ability for lsdev to show partitions within a > bsd > > > slice. > > > > > > > > > > I'm pretty sure this used to work at one time, perhaps long ago. > It > > > has > > > > > been failing recently because if you call disk_open() with > > > dev->d_partition > > > > > set to -1 when d_slice refers to a bsd slice, it assumes you want > it > > > to > > > > > open the first partition within that slice. When you then pass > that > > > open > > > > > dev instance to ptable_open(), it tries to read the start of the > 'a' > > > > > partition and decides there is no recognizable partition type > there. > > > > > > > > > > This restores the old functionality by resetting d_offset to the > start > > > > > of the raw slice after disk_open() returns. For good measure, > > > d_partition > > > > > is also set back to -1, although that doesn't currently affect > > > anything. > > > > > > > > > > I would have preferred to make disk_open() avoid such rude > > > assumptions and > > > > > if you ask for partition -1 you get the raw slice. But the commit > > > history > > > > > shows that someone already did that once (r239058), and had to > revert > > > it > > > > > (r239232), so I didn't even try to go down that road. > > > > > > > > > > > > What was the reason for the revert? I still do think the current > > > > disk_open() approach is not good because it does break the promise to > > > > get MBR partition (see common/disk.h). > > > > > > > > Of course I can see the appeal for something like ?boot disk0:? but > > > > case like that should be solved by iterating partition table, and not > > > > by making API to do wrong thing - if I did ask to for disk0s0: I > > > > really would expect to get disk0s0: and not disk0s0a: > > > > > > > > But anyhow, it would be good to understand the actual reasoning > > > > behind that decision. > > > > > > > > > > I have no idea. As is so often the case, the commit message for the > > > revert said what the commit did ("revert to historic behavior") without > > > any hint of why the change was made. One has to assume that it broke > > > some working cases and people complained. > > > > > > Part of the problem for the disk_open() "api" is that there is not even > > > a comment block with some hints in it. I was thinking one potential > > > solution might instead of using "if (partition < 0)" we could define a > > > couple magical partition number values, PNUM_GETBEST = -1, > > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully > > > combing through the existing code looking at all calls to disk_open() > > > and all usage of disk_devdesc.d_partition. > > > > > > > I think that we should fix the disk_open() api. And then fix everything > > that uses it to comply with the new rules. The current hodge-podge that > we > > have causes a number of issues for different environments that are only > > mostly worked around. I've done some work in this area to make things > more > > regular, but it's still a dog's breakfast of almost-stackable devices > that > > we overload too many things on, resulting in the mis-mash we have today. > > When the whole world was just MBR + BSD label, we could get away with it. > > But now that we have GPT as well as GELI support and ZFS pool devices on > > top of disk devices, the arrangements aren't working as well as could be > > desired. > > Yes please. > Could this be some of the cause of issues with legacy mbr boots > that use to work, that now stop working? I have observed this > on zfs in mbr on a machine here. I did not have time to debug > it, it was faster to nuke and pave the machine that was critical > to operations, the error came as part of a failed freenas upgrade > to the 11.2 based version. > I think the MBR issues are the same ones that Patrick Kelsey is looking into. He has a differential review. If the upgrade was to FreeBSD 11.2, however, that pre-dates most of the work we've done on the loader, so the root cause of that issue may be different. And it may already be fixed in stable/11 as we've since merged everything in current into stable/11 (except for a few things that changed the defaults in a user-visible way). Warner From owner-svn-src-all@freebsd.org Mon Feb 18 20:24: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 093EB14EA9BF; Mon, 18 Feb 2019 20:24:13 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [144.76.30.122]) (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 "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92350846AD; Mon, 18 Feb 2019 20:24:11 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Mon, 18 Feb 2019 21:24:09 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1550521449; bh=SdyglLGCbIGs6YgC7rg3NvBIJm/Tp3rADLKsRM5p5rc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=FSTaI4ZJi/Tx0Uljio9R4Oul0dW+OLaBS4Re7F+glJF4XGpcqUj9F1iVIkBwsd2di +dxwb+DXO2Yhmp71cbf4Bl/yOmDIZ0Rm81gw9NT0tQt+Iq+c2LkC0MWNmZKGpgrQlA cQe61y9Ukbv15tOMel9nsJU3ClM3nZrgn1TrLDHquHKl5tSj0IW0p8zwx6NdE8R20+ G21pSX8cSHwIV7cy0FIcXnHus27HSULIwEq79/NElT5Qn9zZLHZS6JmeA4veETOJWo dPScWhTywXx4oK3ZW5b94E78k9hqwPaidP5H3Fy/l0pUtdY0MDboA3rR91d2xMtJUN Hz3dS/1sXbAUQ== From: "Herbert J. Skuhra" To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r344157 - stable/12/lib/libc/x86/sys Message-ID: <20190218202409.lcflw6nhdaog4aws@mail.bsd4all.net> References: <201902151133.x1FBXmHU060955@repo.freebsd.org> <87d0nqazuq.wl-herbert@gojira.at> <20190217211916.GD2420@kib.kiev.ua> <87bm3aawcn.wl-herbert@gojira.at> <20190218075814.GE2420@kib.kiev.ua> <20190218113745.skk5eoofarzsjbq6@mail.bsd4all.net> <20190218140305.GH2420@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190218140305.GH2420@kib.kiev.ua> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 92350846AD 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.953,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, 18 Feb 2019 20:24:13 -0000 On Mon, Feb 18, 2019 at 04:03:05PM +0200, Konstantin Belousov wrote: > On Mon, Feb 18, 2019 at 12:37:45PM +0100, Herbert J. Skuhra wrote: > > On Mon, Feb 18, 2019 at 09:58:14AM +0200, Konstantin Belousov wrote: > > > On Sun, Feb 17, 2019 at 11:22:48PM +0100, Herbert J. Skuhra wrote: > > > > On Sun, 17 Feb 2019 22:19:16 +0100, Konstantin Belousov wrote: > > > > > > > > > > On Sun, Feb 17, 2019 at 10:07:09PM +0100, Herbert J. Skuhra wrote: > > > > > > On Fri, 15 Feb 2019 12:33:48 +0100, Konstantin Belousov wrote: > > > > > > > > > > > > > > Author: kib > > > > > > > Date: Fri Feb 15 11:33:48 2019 > > > > > > > New Revision: 344157 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344157 > > > > > > > > > > > > > > Log: > > > > > > > MFC r343855, r343859: > > > > > > > Use ifunc to select the barrier instruction for RDTSC. > > > > > > > > > > > > > > Modified: > > > > > > > stable/12/lib/libc/x86/sys/__vdso_gettc.c > > > > > > > Directory Properties: > > > > > > > stable/12/ (props changed) > > > > > > > > > > > > After upgrading my Soekris Net 6501-70 (amd64) to this revision the > > > > > > system is unusable. Basically all programs produce a "Segmentation > > > > > > fault (core dumped)": > > > > > > > > > > > > pid 856 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > > pid 857 (ls), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > > pid 858 (bsdtar), jid 0, uid 0: exited on signal 11 (core dumped) > > > > > > pid 859 (sh), jid 0, uid 0: exited on signal 11 (core dumped) > > > > > > pid 876 (dmesg), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > > pid 877 (su), jid 0, uid 0: exited on signal 11 > > > > > > pid 880 (more), jid 0, uid 1001: exited on signal 11 (core dumped) > > > > > > pid 885 (sudo), jid 0, uid 0: exited on signal 11 > > > > > > > > > > What do you have in your make.conf and src.conf ? > > > > > > > > I am building on a faster machine with a Intel(R) Xeon(R) CPU. > > > > > > > > /etc/src.conf: > > > > > > > > WITHOUT_DEBUG_FILES= > > > > WITHOUT_KERNEL_SYMBOLS= > > > > WITHOUT_PROFILE= > > > > WITH_KERNEL_RETPOLINE= > > > > > > > WITH_RETPOLINE= > > > ^^^^^^ > > > Remove this setting and rebuild the world. > > > Is it still broken ? > > > > No, without the line "WITH_RETPOLINE=" the system is OK. > > Which version of clang do you get ? It was recently bumped from 6.0.1 > to 7.0.1, and there was a ifunc use in libc in quite fundamental place > already. Build machine is still on stable/12 r343834 (clang 6.0.1). Problem starts with r344157 (also clang 6.0.1). Now the affected machine runs r344247 (clang 7.0.1). -- Herbert From owner-svn-src-all@freebsd.org Mon Feb 18 20:29: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 9D0C214EAB14; Mon, 18 Feb 2019 20:29:20 +0000 (UTC) (envelope-from tsoome@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 3F9A0848ED; Mon, 18 Feb 2019 20:29:20 +0000 (UTC) (envelope-from tsoome@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 DA263AEBD; Mon, 18 Feb 2019 20:29:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1IKTJtd023334; Mon, 18 Feb 2019 20:29:19 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1IKTJJA023333; Mon, 18 Feb 2019 20:29:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902182029.x1IKTJJA023333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 18 Feb 2019 20:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344268 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 344268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F9A0848ED 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)[-0.999,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, 18 Feb 2019 20:29:20 -0000 Author: tsoome Date: Mon Feb 18 20:29:19 2019 New Revision: 344268 URL: https://svnweb.freebsd.org/changeset/base/344268 Log: loader: ptable_close() should check its argument If the passed in table is NULL, just return. Modified: head/stand/common/part.c Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Mon Feb 18 19:50:53 2019 (r344267) +++ head/stand/common/part.c Mon Feb 18 20:29:19 2019 (r344268) @@ -788,6 +788,9 @@ ptable_close(struct ptable *table) { struct pentry *entry; + if (table == NULL) + return; + while (!STAILQ_EMPTY(&table->entries)) { entry = STAILQ_FIRST(&table->entries); STAILQ_REMOVE_HEAD(&table->entries, entry); From owner-svn-src-all@freebsd.org Mon Feb 18 21:27: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 97A3C14EC667; Mon, 18 Feb 2019 21:27:14 +0000 (UTC) (envelope-from glebius@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 318FB86E5A; Mon, 18 Feb 2019 21:27:14 +0000 (UTC) (envelope-from glebius@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 22A35B8EB; Mon, 18 Feb 2019 21:27:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1ILREMf055772; Mon, 18 Feb 2019 21:27:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1ILRDJL055771; Mon, 18 Feb 2019 21:27:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902182127.x1ILRDJL055771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 18 Feb 2019 21:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344269 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 344269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 318FB86E5A 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)[-0.999,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, 18 Feb 2019 21:27:14 -0000 Author: glebius Date: Mon Feb 18 21:27:13 2019 New Revision: 344269 URL: https://svnweb.freebsd.org/changeset/base/344269 Log: With r343051 UMA switched from atomic counts to counter(9) and now kernel reports snap counts of how much a zone alloced and how much it freed. It may happen that snap values doesn't match, e.g alloced - freed < 0. Workaround that in memstat library. Reported by: pho Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Mon Feb 18 20:29:19 2019 (r344268) +++ head/lib/libmemstat/memstat_uma.c Mon Feb 18 21:27:13 2019 (r344269) @@ -213,6 +213,15 @@ retry: mtp->mt_numfrees += upsp->ups_frees; } + /* + * Values for uth_allocs and uth_frees frees are snap. + * It may happen that kernel reports that number of frees + * is greater than number of allocs. See counter(9) for + * details. + */ + if (mtp->mt_numallocs < mtp->mt_numfrees) + mtp->mt_numallocs = mtp->mt_numfrees; + mtp->mt_size = uthp->uth_size; mtp->mt_rsize = uthp->uth_rsize; mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size; From owner-svn-src-all@freebsd.org Mon Feb 18 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 C4E7114ECA95; Mon, 18 Feb 2019 21:37:14 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (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 32447873D9; Mon, 18 Feb 2019 21:37:13 +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 x1ILbC14077058 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Feb 2019 13:37:12 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x1ILbBeX077057; Mon, 18 Feb 2019 13:37:11 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 18 Feb 2019 13:37:11 -0800 From: Gleb Smirnoff To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344188 - in head: lib/libc/sys sys/vm Message-ID: <20190218213711.GR83215@FreeBSD.org> References: <201902152336.x1FNaNUo039321@repo.freebsd.org> <20190217011341.S833@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190217011341.S833@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 32447873D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:2906, ipnet:198.45.48.0/20, 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, 18 Feb 2019 21:37:15 -0000 Bruce, On Sun, Feb 17, 2019 at 02:58:43AM +1100, Bruce Evans wrote: B> This is only a rollback for the vnode pager pbufs sub-pool. Total B> resource usage (preallocated kva and maximum on RAM that can be mapped B> into this kva) is still about 5/2 times higher than before in my B> configuration. It would be 7/2 times higher if I configured fuse and B> smbfs. r343030 changed the allocation methods in all subsystems except B> out-of-tree modules, and broke at least the KBI for these modules (*), B> so it is easy to find the full expansion except for these modules by B> looking at the diffs (I found the use in fuse and smbfs by grepping B> some subtrees). Also, the user's and vfs_bio's resource limit is still B> broken by expanding it by this factor of 5/2 or more. B> B> In the old allocation method, there was a single pool of pbufs of size B> nswbuf which normally has its normal limiting value of 256, where this B> magic 256 is hard-coded in vfs_bio.c, but if the user somehow knows B> about this and the tunable kern.nswbuf, then it can be overridden. B> The limit of 256 was documented in pbuf(9), but the tunable was never B> documented AFAIK. The variable nswbuf for this was documented in B> pbuf(9). The 256 entries are shared between any number of subsystems. B> Most subsystems limited themselves to nswbuf/2 entries, and the man B> page recommended this. This gave overcommit by a factor of about 5/2 B> in my configuration (there are 7 subsystems, but some of these have a B> smaller limit). B> B> Now there each subsystem has a separate pool. The size of the sub-pool B> is still usually nswbuf / 2. This gives overallocation by a factor of B> about 5/2 in my configuration. The overcommit only causes minor B> performance problems. 2 subsystems might use all of the buffers, and B> then all all the other subsystems have to wait, but it is rare for even B> 2 subsystems to be under load at the same time. It is more of a problem B> that the limit is too small for a single subsystem. The overallocation B> gives worse problems such as crashing at boot time or a little later when B> the user or auto-tuning has maxed out nswbuf. This is all true and this is intentional. Before any two subsystems could screw up the system by allocating all bufs. Now they are more separated from each other and yes, the price is extra memory. B> Now the user has to know even more arcane details to limit the kva, and B> it is impossible to recover the old behaviour. To get the old limit, B> kern.nswbuf must be set to (256 * 2 / 5) in my configuration, but B> that significantly decreases the number of buffers for each subsystem. B> Users might already have set kern.nswbuf to a large value. Since most B> subsystems used to use half of that many buffers, the wastage from setting B> it large for the benefit of 1 subsystem was at most a factor of 2. Now B> the limit can't be increased as much without running out of kva, and the B> safe increase is more arcane and machine-dependent (starting with the B> undocumented default being 8 times higher for 64-bit systems, but only B> for 1 of the subsystems). Yes, this sucks. If you can propose auto-tuning algorithm, I'm all for it. For now I'm just shifting defaults from something that was reasonable in 2000 to something that is going to be reasonable in 2020. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Feb 18 23:21: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 D25CA14EF317; Mon, 18 Feb 2019 23:21:09 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::102]) (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 52D588A783; Mon, 18 Feb 2019 23:21:09 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback12o.mail.yandex.net (mxback12o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::63]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 51B71F201D3; Tue, 19 Feb 2019 02:21:05 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xuzGJEvI5K-L5m4oG1j; Tue, 19 Feb 2019 02:21:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1550532065; bh=ax+0y1wkbqk6FWzckaj4BxvWWJmsNB/XfaczI2wV288=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=thWPoNVLm87LTsqva6LdDZbtJdu1TcOk3//sGH7V9hAjwsLgEdYo+4fULkCFbwQDS unzYxAdw41TJMOCoVONzqgkARzQvFZXLT3ghvOMgbnAyYdmpIlFOnwTqhGm8KuTt8i Cps1XoOJayLUr1JCW16/wPWxcTWsVXYZ2d4GI/nY= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mSJGBLYniS-L4pSeEhG; Tue, 19 Feb 2019 02:21:04 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: svn commit: r344238 - head/stand/common To: Toomas Soome , Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902172332.x1HNW9ut059440@repo.freebsd.org> <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> From: "Andrey V. Elsukov" Openpgp: preference=signencrypt Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/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: <87a39bba-c5d7-4429-79dd-123c8bd757fe@yandex.ru> Date: Tue, 19 Feb 2019 02:21:04 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <2EAE5156-2C63-47FC-977F-0D9676CABF7F@me.com> Content-Type: text/plain; charset=utf-8 Content-Language: ru Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D588A783 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_SHORT(-0.97)[-0.967,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, 18 Feb 2019 23:21:10 -0000 18.02.2019 16:09, Toomas Soome пишет: >> This restores the old functionality by resetting d_offset to the start >> of the raw slice after disk_open() returns. For good measure, d_partition >> is also set back to -1, although that doesn't currently affect anything. >> >> I would have preferred to make disk_open() avoid such rude assumptions and >> if you ask for partition -1 you get the raw slice. But the commit history >> shows that someone already did that once (r239058), and had to revert it >> (r239232), so I didn't even try to go down that road. > > > What was the reason for the revert? I still do think the current disk_open() approach is not good because it does break the promise to get MBR partition (see common/disk.h). The reason is that someone has reported that after the change the system fails to boot. > Of course I can see the appeal for something like “boot disk0:†but case like that should be solved by iterating partition table, and not by making API to do wrong thing - if I did ask to for disk0s0: I really would expect to get disk0s0: and not disk0s0a: > > But anyhow, it would be good to understand the actual reasoning behind that decision. -- WBR, Andrey V. Elsukov From owner-svn-src-all@freebsd.org Tue Feb 19 01:20: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 49E4914F45C1; Tue, 19 Feb 2019 01:20:18 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-it1-x12e.google.com (mail-it1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD49F8FE20; Tue, 19 Feb 2019 01:20:17 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-it1-x12e.google.com with SMTP id f10so2394435ita.4; Mon, 18 Feb 2019 17:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XjbzkbhYsl+OFmxjs9XuQPFQxFOG1Z62oDXRpIuj3Wc=; b=X/Gm9Ijg5OCfp9ZfI+9NsQ5z1zjDccYROo8vMfe1p1WDSKjXCzc6JM7IjhDXp036sB Iu9f3qKRasdmhGm/T6MLL56HmfE/5s70vJSQFGNGpVISSsYqoGXolA2g6MkmWk6jLUW8 4SwaZVmMQXLlRM0OIHvEV9lj94Hxb8WbEaqTE= 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=XjbzkbhYsl+OFmxjs9XuQPFQxFOG1Z62oDXRpIuj3Wc=; b=ns2c6J9nhVC7Licq+/tbpRJxRwtQ9GQhgDIOfy2srxT8c2mFbcRJLdoRzmDsmm5QE8 xeDrrL9cglX/0Na5MzPO0UP7v9n3vMQkh5qVrdm3AiZe/N14JOGWTc4p0ajel7VnqYnW l3hJ+WPir2hM1fEnCvMpQ2Iax8XPb7bIsBConP+nR74dd+AwV6Gk09rPaRJZapUgCRwy VfzaDZZMXbVhZstJviJs3PodWDhugA9MekQvS3bNdgRUoAm12gSQIAntt8gYhvbt1IRu u4sVw53mnXP/N0T7bYFD+GKv2ghIW/9BTtCTIrWmJJliTynx4FMlPn59ZQ6VU1uWYw8I JqqQ== X-Gm-Message-State: AHQUAuY8kvlSESZnV4o5/j+WjGsDjyB6jELAms583kKeTMFKzMo2Otjf 0kb8DmBTMOccuBZiNWTLYkCGWQaMAPyKOrX1ogte5A== X-Google-Smtp-Source: AHgI3IZ8Nknyf/bS/wOlKNNfwCMM+iEvDAwFi/Mk8nSMEW9r2KJfXzJhLSGc3/rDzaAABhHz3FqdjwzLcJ9K71n7uKY= X-Received: by 2002:a6b:f70a:: with SMTP id k10mr17279233iog.68.1550539217106; Mon, 18 Feb 2019 17:20:17 -0800 (PST) MIME-Version: 1.0 References: <201902181751.x1IHp9gc006395@pdx.rh.CN85.dnsmgr.net> In-Reply-To: From: Patrick Kelsey Date: Mon, 18 Feb 2019 20:20:04 -0500 Message-ID: Subject: Re: svn commit: r344238 - head/stand/common To: Warner Losh Cc: "Rodney W. Grimes" , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: CD49F8FE20 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.72 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.72)[-0.716,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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, 19 Feb 2019 01:20:18 -0000 On Mon, Feb 18, 2019 at 3:15 PM Warner Losh wrote: > > > On Mon, Feb 18, 2019 at 10:51 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > On Mon, Feb 18, 2019 at 7:31 AM Ian Lepore wrote: >> > >> > > On Mon, 2019-02-18 at 15:09 +0200, Toomas Soome wrote: >> > > > > On 18 Feb 2019, at 01:32, Ian Lepore wrote: >> > > > > >> > > > > Author: ian >> > > > > Date: Sun Feb 17 23:32:09 2019 >> > > > > New Revision: 344238 >> > > > > URL: https://svnweb.freebsd.org/changeset/base/344238 >> > > > > >> > > > > Log: >> > > > > Restore loader(8)'s ability for lsdev to show partitions within >> a bsd >> > > slice. >> > > > > >> > > > > I'm pretty sure this used to work at one time, perhaps long >> ago. It >> > > has >> > > > > been failing recently because if you call disk_open() with >> > > dev->d_partition >> > > > > set to -1 when d_slice refers to a bsd slice, it assumes you >> want it >> > > to >> > > > > open the first partition within that slice. When you then pass >> that >> > > open >> > > > > dev instance to ptable_open(), it tries to read the start of the >> 'a' >> > > > > partition and decides there is no recognizable partition type >> there. >> > > > > >> > > > > This restores the old functionality by resetting d_offset to the >> start >> > > > > of the raw slice after disk_open() returns. For good measure, >> > > d_partition >> > > > > is also set back to -1, although that doesn't currently affect >> > > anything. >> > > > > >> > > > > I would have preferred to make disk_open() avoid such rude >> > > assumptions and >> > > > > if you ask for partition -1 you get the raw slice. But the >> commit >> > > history >> > > > > shows that someone already did that once (r239058), and had to >> revert >> > > it >> > > > > (r239232), so I didn't even try to go down that road. >> > > > >> > > > >> > > > What was the reason for the revert? I still do think the current >> > > > disk_open() approach is not good because it does break the promise >> to >> > > > get MBR partition (see common/disk.h). >> > > > >> > > > Of course I can see the appeal for something like ?boot disk0:? but >> > > > case like that should be solved by iterating partition table, and >> not >> > > > by making API to do wrong thing - if I did ask to for disk0s0: I >> > > > really would expect to get disk0s0: and not disk0s0a: >> > > > >> > > > But anyhow, it would be good to understand the actual reasoning >> > > > behind that decision. >> > > > >> > > >> > > I have no idea. As is so often the case, the commit message for the >> > > revert said what the commit did ("revert to historic behavior") >> without >> > > any hint of why the change was made. One has to assume that it broke >> > > some working cases and people complained. >> > > >> > > Part of the problem for the disk_open() "api" is that there is not >> even >> > > a comment block with some hints in it. I was thinking one potential >> > > solution might instead of using "if (partition < 0)" we could define a >> > > couple magical partition number values, PNUM_GETBEST = -1, >> > > PNUM_RAWSLICE = -2, that sort of thing. But it would require carefully >> > > combing through the existing code looking at all calls to disk_open() >> > > and all usage of disk_devdesc.d_partition. >> > > >> > >> > I think that we should fix the disk_open() api. And then fix everything >> > that uses it to comply with the new rules. The current hodge-podge that >> we >> > have causes a number of issues for different environments that are only >> > mostly worked around. I've done some work in this area to make things >> more >> > regular, but it's still a dog's breakfast of almost-stackable devices >> that >> > we overload too many things on, resulting in the mis-mash we have today. >> > When the whole world was just MBR + BSD label, we could get away with >> it. >> > But now that we have GPT as well as GELI support and ZFS pool devices on >> > top of disk devices, the arrangements aren't working as well as could be >> > desired. >> >> Yes please. >> Could this be some of the cause of issues with legacy mbr boots >> that use to work, that now stop working? I have observed this >> on zfs in mbr on a machine here. I did not have time to debug >> it, it was faster to nuke and pave the machine that was critical >> to operations, the error came as part of a failed freenas upgrade >> to the 11.2 based version. >> > > I think the MBR issues are the same ones that Patrick Kelsey is looking > into. He has a differential review. If the upgrade was to FreeBSD 11.2, > however, that pre-dates most of the work we've done on the loader, so the > root cause of that issue may be different. And it may already be fixed in > stable/11 as we've since merged everything in current into stable/11 > (except for a few things that changed the defaults in a user-visible way). > > To clarify, I recently committed some boot code patches that were the result of me investigating a problem on a machine that I have that initially presented as 'upgraded a ZFS machine to 11.2 and it appeared to hang during boot'. I spent a lot of time root causing the issue I was having on the chance that it might be a/the root cause of problems others have encountered that have a similar summary description. However, it turned out the root cause of my problem was a firmware bug in a 3Ware 9650SE related to multi-sector I/Os being issued to either 'suitably large' LBAs or perhaps LBAs 'suitably close' to the end of the disk causing 60 second I/O timeouts each, and moving to 11.2 triggered it because in 11.2, the ZFS code was modified to look at all the ZFS labels, two of which are very close to the end of the disk. Thankfully my problem was fixed by installing the latest available firmware version for that card (otherwise, the hack needed in the loader would have been to break up multi-sector I/Os 'near' the end of the disk and issue them in descending LBA order). The patches I committed were for issues I found during my investigation that were unrelated to my problem, one of which was the potential for a buffer overrun in the ZFS support code (which I think could only occur on systems running an ashift=9 ZFS configuration on 4K drives), and the other of which was the resolution of an inconsistency between the ZFS probing behavior of zfsboot and loader. -Patrick From owner-svn-src-all@freebsd.org Tue Feb 19 02:26: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 AF99E14FB74D; Tue, 19 Feb 2019 02:26:48 +0000 (UTC) (envelope-from bwidawsk@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 56BA994BFE; Tue, 19 Feb 2019 02:26:48 +0000 (UTC) (envelope-from bwidawsk@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 49C6EF270; Tue, 19 Feb 2019 02:26:48 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1J2QmNJ012929; Tue, 19 Feb 2019 02:26:48 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1J2QmZx012928; Tue, 19 Feb 2019 02:26:48 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902190226.x1J2QmZx012928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 19 Feb 2019 02:26:48 +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: r344270 - stable/12/share/termcap X-SVN-Group: stable-12 X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: stable/12/share/termcap X-SVN-Commit-Revision: 344270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56BA994BFE 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.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 02:26:49 -0000 Author: bwidawsk Date: Tue Feb 19 02:26:47 2019 New Revision: 344270 URL: https://svnweb.freebsd.org/changeset/base/344270 Log: MFC r344043: termcap: Add an entry for kitty The project is here: https://github.com/kovidgoyal/kitty/ I created a port (which now needs updating): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233010 If only we could use terminfo :( Approved by: bapt Differential Revision: https://reviews.freebsd.org/D19060 Modified: stable/12/share/termcap/termcap Directory Properties: stable/12/ (props changed) Modified: stable/12/share/termcap/termcap ============================================================================== --- stable/12/share/termcap/termcap Mon Feb 18 21:27:13 2019 (r344269) +++ stable/12/share/termcap/termcap Tue Feb 19 02:26:47 2019 (r344270) @@ -4734,6 +4734,29 @@ st-meta-256color|simpleterm with meta key and 256 colo :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ :rs=\E[4l\E>\E[?1034h:tc=st-256color: + +# From version 0.13.3 +xterm-kitty|KovId's TTY:\ + :tc=xterm-256color:tc=kitty+common: + +kitty+common|KovId's TTY common properties:\ + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\ + :K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\ + :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\ + :ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\ + :rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\ + :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\ + :vs=\E[?12;25h: + # # END OF TERMCAP # ------------------------ From owner-svn-src-all@freebsd.org Tue Feb 19 10:07: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 34AF214EA1FF; Tue, 19 Feb 2019 10:07:49 +0000 (UTC) (envelope-from vmaffione@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 DB7F977879; Tue, 19 Feb 2019 10:07:48 +0000 (UTC) (envelope-from vmaffione@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 CEAB81C3B7; Tue, 19 Feb 2019 10:07:48 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JA7m6c052445; Tue, 19 Feb 2019 10:07:48 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JA7mSq052443; Tue, 19 Feb 2019 10:07:48 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201902191007.x1JA7mSq052443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 19 Feb 2019 10:07:48 +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: r344272 - stable/11/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 344272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB7F977879 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,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, 19 Feb 2019 10:07:49 -0000 Author: vmaffione Date: Tue Feb 19 10:07:48 2019 New Revision: 344272 URL: https://svnweb.freebsd.org/changeset/base/344272 Log: vmx(4): add native netmap support This change adds native netmap support for the vmx(4) adapter (vmxnet3). Native support comes for free in 12, since the driver has been ported to iflib. To make it minimally intrusive, the native support is only enabled if vmxnet3.netmap_native is set at boot (e.g., in loader.conf). Tested on stable/11 running inside vmplayer. Submitted by: Giuseppe Lettieri Reviewed by: vmaffione, bryanv Sponsored by: Sunny Valley Networks Differential Revision: https://reviews.freebsd.org/D19104 Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h (contents, props changed) Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 03:46:32 2019 (r344271) +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 10:07:48 2019 (r344272) @@ -239,6 +239,10 @@ typedef enum { static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); +#ifdef DEV_NETMAP +#include "vmx_netmap.h" +#endif + /* Tunables. */ static int vmxnet3_mq_disable = 0; TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); @@ -270,6 +274,9 @@ DRIVER_MODULE(vmx, pci, vmxnet3_driver, vmxnet3_devcla MODULE_DEPEND(vmx, pci, 1, 1, 1); MODULE_DEPEND(vmx, ether, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(vmx, netmap, 1, 1, 1); +#endif #define VMXNET3_VMWARE_VENDOR_ID 0x15AD #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 @@ -347,6 +354,10 @@ vmxnet3_attach(device_t dev) vmxnet3_start_taskqueue(sc); #endif +#ifdef DEV_NETMAP + vmxnet3_netmap_attach(sc); +#endif + fail: if (error) vmxnet3_detach(dev); @@ -390,6 +401,10 @@ vmxnet3_detach(device_t dev) #endif vmxnet3_free_interrupts(sc); +#ifdef DEV_NETMAP + netmap_detach(ifp); +#endif + if (ifp != NULL) { if_free(ifp); sc->vmx_ifp = NULL; @@ -1846,6 +1861,11 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *txq) txr = &txq->vxtxq_cmd_ring; txc = &txq->vxtxq_comp_ring; +#ifdef DEV_NETMAP + if (netmap_tx_irq(sc->vmx_ifp, txq - sc->vmx_txq) != NM_IRQ_PASS) + return; +#endif + VMXNET3_TXQ_LOCK_ASSERT(txq); for (;;) { @@ -2111,6 +2131,15 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) ifp = sc->vmx_ifp; rxc = &rxq->vxrxq_comp_ring; +#ifdef DEV_NETMAP + { + int dummy; + if (netmap_rx_irq(ifp, rxq - sc->vmx_rxq, &dummy) != + NM_IRQ_PASS) + return; + } +#endif + VMXNET3_RXQ_LOCK_ASSERT(rxq); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -2401,6 +2430,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_softc *sc) struct vmxnet3_txqueue *txq; int i; +#ifdef DEV_NETMAP + netmap_disable_all_rings(sc->vmx_ifp); +#endif + for (i = 0; i < sc->vmx_nrxqueues; i++) { rxq = &sc->vmx_rxq[i]; VMXNET3_RXQ_LOCK(rxq); @@ -2454,6 +2487,10 @@ vmxnet3_txinit(struct vmxnet3_softc *sc, struct vmxnet bzero(txr->vxtxr_txd, txr->vxtxr_ndesc * sizeof(struct vmxnet3_txdesc)); +#ifdef DEV_NETMAP + vmxnet3_netmap_txq_init(sc, txq); +#endif + txc = &txq->vxtxq_comp_ring; txc->vxcr_next = 0; txc->vxcr_gen = VMXNET3_INIT_GEN; @@ -2468,6 +2505,10 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet struct vmxnet3_rxring *rxr; struct vmxnet3_comp_ring *rxc; int i, populate, idx, frame_size, error; +#ifdef DEV_NETMAP + struct netmap_adapter *na; + struct netmap_slot *slot; +#endif ifp = sc->vmx_ifp; frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) + @@ -2498,12 +2539,24 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet else populate = VMXNET3_RXRINGS_PERQ; +#ifdef DEV_NETMAP + na = NA(ifp); + slot = netmap_reset(na, NR_RX, rxq - sc->vmx_rxq, 0); +#endif + for (i = 0; i < populate; i++) { rxr = &rxq->vxrxq_cmd_ring[i]; rxr->vxrxr_fill = 0; rxr->vxrxr_gen = VMXNET3_INIT_GEN; bzero(rxr->vxrxr_rxd, rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); +#ifdef DEV_NETMAP + if (slot != NULL) { + vmxnet3_netmap_rxq_init(sc, rxq, rxr, slot); + i = populate; + break; + } +#endif for (idx = 0; idx < rxr->vxrxr_ndesc; idx++) { error = vmxnet3_newbuf(sc, rxr); @@ -2625,6 +2678,10 @@ vmxnet3_init_locked(struct vmxnet3_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; vmxnet3_link_status(sc); + +#ifdef DEV_NETMAP + netmap_enable_all_rings(ifp); +#endif vmxnet3_enable_all_intrs(sc); callout_reset(&sc->vmx_tick, hz, vmxnet3_tick, sc); Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h Tue Feb 19 10:07:48 2019 (r344272) @@ -0,0 +1,376 @@ +/* + * Copyright (C) 2019 Universita` di Pisa. + * Sponsored by Sunny Valley Networks. + * + * 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. + */ + +/* $FreeBSD$ */ + +#include +#include + +static int +vmxnet3_netmap_reg(struct netmap_adapter *na, int onoff) +{ + struct ifnet *ifp = na->ifp; + struct vmxnet3_softc *sc = ifp->if_softc; + + VMXNET3_CORE_LOCK(sc); + vmxnet3_stop(sc); + if (onoff) { + nm_set_native_flags(na); + } else { + nm_clear_native_flags(na); + } + vmxnet3_init_locked(sc); + VMXNET3_CORE_UNLOCK(sc); + return 0; +} + +static void +vmxnet3_netmap_rxq_init(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rxq, + struct vmxnet3_rxring *rxr, struct netmap_slot *slot) +{ + struct ifnet *ifp = sc->vmx_ifp; + struct netmap_adapter *na = NA(ifp); + struct vmxnet3_rxdesc *rxd; + int q, i; + + q = rxq - sc->vmx_rxq; + + for (i = 0; ; i++) { + int idx = rxr->vxrxr_fill; + int si = netmap_idx_n2k(na->rx_rings[q], idx); + struct vmxnet3_rxbuf *rxb = &rxr->vxrxr_rxbuf[idx]; + uint64_t paddr; + void *addr; + + addr = PNMB(na, slot + si, &paddr); + netmap_load_map(na, rxr->vxrxr_rxtag, rxb->vrxb_dmamap, addr); + + rxd = &rxr->vxrxr_rxd[idx]; + rxd->addr = paddr; + rxd->len = NETMAP_BUF_SIZE(na); + rxd->gen = rxr->vxrxr_gen ^ 1; + rxd->btype = VMXNET3_BTYPE_HEAD; + nm_prdis("%d: addr %lx len %u btype %u gen %u", + idx, rxd->addr, rxd->len, rxd->btype, rxd->gen); + + if (i == rxr->vxrxr_ndesc -1) + break; + + rxd->gen ^= 1; + vmxnet3_rxr_increment_fill(rxr); + } +} + +static void +vmxnet3_netmap_txq_init(struct vmxnet3_softc *sc, struct vmxnet3_txqueue *txq) +{ + struct ifnet *ifp = sc->vmx_ifp; + struct netmap_adapter *na; + struct netmap_slot *slot; + struct vmxnet3_txring *txr; + int i, gen, q; + + q = txq - sc->vmx_txq; + + na = NA(ifp); + + slot = netmap_reset(na, NR_TX, q, 0); + if (slot == NULL) + return; + + txr = &txq->vxtxq_cmd_ring; + gen = txr->vxtxr_gen ^ 1; + + for (i = 0; i < txr->vxtxr_ndesc; i++) { + int si = netmap_idx_n2k(na->tx_rings[q], i); + struct vmxnet3_txdesc *txd = &txr->vxtxr_txd[i]; + uint64_t paddr; + void *addr; + + addr = PNMB(na, slot + si, &paddr); + + txd->addr = paddr; + txd->len = 0; + txd->gen = gen; + txd->dtype = 0; + txd->offload_mode = VMXNET3_OM_NONE; + txd->offload_pos = 0; + txd->hlen = 0; + txd->eop = 0; + txd->compreq = 0; + txd->vtag_mode = 0; + txd->vtag = 0; + + netmap_load_map(na, txr->vxtxr_txtag, + txr->vxtxr_txbuf[i].vtxb_dmamap, addr); + } +} + +static int +vmxnet3_netmap_txsync(struct netmap_kring *kring, int flags) +{ + struct netmap_adapter *na = kring->na; + struct ifnet *ifp = na->ifp; + struct netmap_ring *ring = kring->ring; + u_int nm_i; + u_int nic_i; + u_int n; + u_int const lim = kring->nkr_num_slots - 1; + u_int const head = kring->rhead; + + /* + * interrupts on every tx packet are expensive so request + * them every half ring, or where NS_REPORT is set + */ + u_int report_frequency = kring->nkr_num_slots >> 1; + /* device specific */ + struct vmxnet3_softc *sc = ifp->if_softc; + struct vmxnet3_txqueue *txq = &sc->vmx_txq[kring->ring_id]; + struct vmxnet3_txring *txr = &txq->vxtxq_cmd_ring; + struct vmxnet3_comp_ring *txc = &txq->vxtxq_comp_ring; + struct vmxnet3_txcompdesc *txcd = txc->vxcr_u.txcd; + int gen = txr->vxtxr_gen; + + /* no need to dma-sync the ring; memory barriers are sufficient */ + + nm_i = kring->nr_hwcur; + if (nm_i != head) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != head; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; + uint64_t paddr; + void *addr = PNMB(na, slot, &paddr); + int compreq = !!(slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency); + + /* device specific */ + struct vmxnet3_txdesc *curr = &txr->vxtxr_txd[nic_i]; + struct vmxnet3_txbuf *txbuf = &txr->vxtxr_txbuf[nic_i]; + + NM_CHECK_ADDR_LEN(na, addr, len); + + /* fill the slot in the NIC ring */ + curr->len = len; + curr->eop = 1; /* NS_MOREFRAG not supported */ + curr->compreq = compreq; + + if (slot->flags & NS_BUF_CHANGED) { + curr->addr = paddr; + netmap_reload_map(na, txr->vxtxr_txtag, + txbuf->vtxb_dmamap, addr); + } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* make sure changes to the buffer are synced */ + bus_dmamap_sync(txr->vxtxr_txtag, txbuf->vtxb_dmamap, + BUS_DMASYNC_PREWRITE); + + /* pass ownership */ + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); + curr->gen = gen; + + nm_i = nm_next(nm_i, lim); + nic_i++; + if (unlikely(nic_i == lim + 1)) { + nic_i = 0; + gen = txr->vxtxr_gen ^= 1; + } + } + + vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), nic_i); + } + kring->nr_hwcur = nm_i; + + /* reclaim completed packets */ + for (;;) { + u_int sop; + struct vmxnet3_txbuf *txb; + + txcd = &txc->vxcr_u.txcd[txc->vxcr_next]; + if (txcd->gen != txc->vxcr_gen) + break; + + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); + + if (++txc->vxcr_next == txc->vxcr_ndesc) { + txc->vxcr_next = 0; + txc->vxcr_gen ^= 1; + } + + sop = txr->vxtxr_next; + txb = &txr->vxtxr_txbuf[sop]; + + bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, + BUS_DMASYNC_POSTWRITE); + + txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; + } + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, txr->vxtxr_next), lim); + + return 0; +} + +static int +vmxnet3_netmap_rxsync(struct netmap_kring *kring, int flags) +{ + struct netmap_adapter *na = kring->na; + struct netmap_ring *ring = kring->ring; + u_int nm_i; + u_int nic_i; + u_int const lim = kring->nkr_num_slots - 1; + u_int const head = kring->rhead; + int force_update = (flags & NAF_FORCE_READ); + + struct ifnet *ifp = na->ifp; + struct vmxnet3_softc *sc = ifp->if_softc; + struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[kring->ring_id]; + struct vmxnet3_rxring *rxr; + struct vmxnet3_comp_ring *rxc; + + if (head > lim) + return netmap_ring_reinit(kring); + + rxr = &rxq->vxrxq_cmd_ring[0]; + + /* no need to dma-sync the ring; memory barriers are sufficient */ + + /* first part: import newly received packets */ + if (netmap_no_pendintr || force_update) { + rxc = &rxq->vxrxq_comp_ring; + nm_i = kring->nr_hwtail; + nic_i = netmap_idx_k2n(kring, nm_i); + for (;;) { + struct vmxnet3_rxcompdesc *rxcd; + struct vmxnet3_rxbuf *rxb; + + rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; + + if (rxcd->gen != rxc->vxcr_gen) + break; + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); + + while (__predict_false(rxcd->rxd_idx != nic_i)) { + nm_prlim(1, "%u skipped! idx %u", nic_i, rxcd->rxd_idx); + /* to shelter the application from this we + * would need to rotate the kernel-owned + * portion of the netmap and nic rings. We + * return len=0 for now and hope for the best. + */ + ring->slot[nm_i].len = 0; + nic_i = nm_next(nm_i, lim); + nm_i = nm_next(nm_i, lim); + } + + rxb = &rxr->vxrxr_rxbuf[nic_i]; + + ring->slot[nm_i].len = rxcd->len; + ring->slot[nm_i].flags = 0; + + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, + BUS_DMASYNC_POSTREAD); + + nic_i = nm_next(nm_i, lim); + nm_i = nm_next(nm_i, lim); + + rxc->vxcr_next++; + if (__predict_false(rxc->vxcr_next == rxc->vxcr_ndesc)) { + rxc->vxcr_next = 0; + rxc->vxcr_gen ^= 1; + } + } + kring->nr_hwtail = nm_i; + } + /* second part: skip past packets that userspace has released */ + nm_i = kring->nr_hwcur; + if (nm_i != head) { + nic_i = netmap_idx_k2n(kring, nm_i); + while (nm_i != head) { + struct netmap_slot *slot = &ring->slot[nm_i]; + struct vmxnet3_rxdesc *rxd_fill; + struct vmxnet3_rxbuf *rxbuf; + + if (slot->flags & NS_BUF_CHANGED) { + uint64_t paddr; + void *addr = PNMB(na, slot, &paddr); + struct vmxnet3_rxdesc *rxd = &rxr->vxrxr_rxd[nic_i]; + + + if (addr == NETMAP_BUF_BASE(na)) + return netmap_ring_reinit(kring); + + rxd->addr = paddr; + rxbuf = &rxr->vxrxr_rxbuf[nic_i]; + netmap_reload_map(na, rxr->vxrxr_rxtag, + rxbuf->vrxb_dmamap, addr); + slot->flags &= ~NS_BUF_CHANGED; + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); + } + + rxd_fill = &rxr->vxrxr_rxd[rxr->vxrxr_fill]; + rxbuf = &rxr->vxrxr_rxbuf[rxr->vxrxr_fill]; + + bus_dmamap_sync(rxr->vxrxr_rxtag, rxbuf->vrxb_dmamap, + BUS_DMASYNC_PREREAD); + + rxd_fill->gen = rxr->vxrxr_gen; + vmxnet3_rxr_increment_fill(rxr); + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); + } + kring->nr_hwcur = head; + if (__predict_false(rxq->vxrxq_rs->update_rxhead)) { + vmxnet3_write_bar0(sc, + VMXNET3_BAR0_RXH1(kring->ring_id), rxr->vxrxr_fill); + } + } + return 0; +} + +static void +vmxnet3_netmap_attach(struct vmxnet3_softc *sc) +{ + struct netmap_adapter na; + int enable = 0; + + if (getenv_int("vmxnet3.netmap_native", &enable) < 0 || !enable) { + return; + } + + bzero(&na, sizeof(na)); + + na.ifp = sc->vmx_ifp; + na.na_flags = NAF_BDG_MAYSLEEP; + na.num_tx_desc = sc->vmx_ntxdescs; + na.num_rx_desc = sc->vmx_nrxdescs; + na.num_tx_rings = sc->vmx_ntxqueues; + na.num_rx_rings = sc->vmx_nrxqueues; + na.nm_register = vmxnet3_netmap_reg; + na.nm_txsync = vmxnet3_netmap_txsync; + na.nm_rxsync = vmxnet3_netmap_rxsync; + netmap_attach(&na); +} From owner-svn-src-all@freebsd.org Tue Feb 19 10:17: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 67EB214EB1BB; Tue, 19 Feb 2019 10:17:50 +0000 (UTC) (envelope-from trasz@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 0F02B804DA; Tue, 19 Feb 2019 10:17:50 +0000 (UTC) (envelope-from trasz@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 DD9FA1C58F; Tue, 19 Feb 2019 10:17:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JAHn9S057808; Tue, 19 Feb 2019 10:17:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JAHnbU057807; Tue, 19 Feb 2019 10:17:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191017.x1JAHnbU057807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 10:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344273 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F02B804DA 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)[-0.999,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, 19 Feb 2019 10:17:50 -0000 Author: trasz Date: Tue Feb 19 10:17:49 2019 New Revision: 344273 URL: https://svnweb.freebsd.org/changeset/base/344273 Log: Add kern.rpc.gss.client_hash tunable, to make it possible to bump it easily. This can lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:07:48 2019 (r344272) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:17:49 2019 (r344273) @@ -172,6 +172,7 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 u_int svc_rpc_gss_client_max = CLIENT_MAX; +u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); @@ -180,12 +181,16 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFL &svc_rpc_gss_client_max, 0, "Max number of rpc-gss clients"); +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_hash, CTLFLAG_RDTUN, + &svc_rpc_gss_client_hash_size, 0, + "Size of rpc-gss client hash table"); + static u_int svc_rpc_gss_client_count; SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, &svc_rpc_gss_client_count, 0, "Number of rpc-gss clients"); -struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; +struct svc_rpc_gss_client_list *svc_rpc_gss_client_hash; struct svc_rpc_gss_client_list svc_rpc_gss_clients; static uint32_t svc_rpc_gss_next_clientid = 1; @@ -194,7 +199,8 @@ svc_rpc_gss_init(void *arg) { int i; - for (i = 0; i < CLIENT_HASH_SIZE; i++) + svc_rpc_gss_client_hash = mem_alloc(sizeof(struct svc_rpc_gss_client_list) * svc_rpc_gss_client_hash_size); + for (i = 0; i < svc_rpc_gss_client_hash_size; i++) TAILQ_INIT(&svc_rpc_gss_client_hash[i]); TAILQ_INIT(&svc_rpc_gss_clients); svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); @@ -530,7 +536,7 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *i if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); - list = &svc_rpc_gss_client_hash[id->ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[id->ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(client, list, cl_link) { if (client->cl_id.ci_id == id->ci_id) { @@ -569,7 +575,7 @@ svc_rpc_gss_create_client(void) getboottime(&boottime); client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_INSERT_HEAD(list, client, cl_link); TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink); @@ -635,7 +641,7 @@ svc_rpc_gss_forget_client_locked(struct svc_rpc_gss_cl struct svc_rpc_gss_client_list *list; sx_assert(&svc_rpc_gss_lock, SX_XLOCKED); - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; TAILQ_REMOVE(list, client, cl_link); TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); svc_rpc_gss_client_count--; @@ -650,7 +656,7 @@ svc_rpc_gss_forget_client(struct svc_rpc_gss_client *c struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client *tclient; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(tclient, list, cl_link) { /* From owner-svn-src-all@freebsd.org Tue Feb 19 10:29: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 8056114EBA80; Tue, 19 Feb 2019 10:29:00 +0000 (UTC) (envelope-from trasz@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 2630F80CF7; Tue, 19 Feb 2019 10:29:00 +0000 (UTC) (envelope-from trasz@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 16EE91C75D; Tue, 19 Feb 2019 10:29:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JASxkD063142; Tue, 19 Feb 2019 10:28:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JASxof063141; Tue, 19 Feb 2019 10:28:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191028.x1JASxof063141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 10:28: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: r344274 - stable/12/sys/rpc/rpcsec_gss X-SVN-Group: stable-12 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/12/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2630F80CF7 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.998,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)[-0.999,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, 19 Feb 2019 10:29:00 -0000 Author: trasz Date: Tue Feb 19 10:28:59 2019 New Revision: 344274 URL: https://svnweb.freebsd.org/changeset/base/344274 Log: MFC r342114: Add kern.rpc.gss.client_max, to make it possible to bump it easily. This can drastically lower the load on gssd(8) on large NFS servers. Modified: stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:17:49 2019 (r344273) +++ stable/12/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:28:59 2019 (r344274) @@ -171,9 +171,22 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 +u_int svc_rpc_gss_client_max = CLIENT_MAX; + +SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); +SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); + +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFLAG_RW, + &svc_rpc_gss_client_max, 0, + "Max number of rpc-gss clients"); + +static u_int svc_rpc_gss_client_count; +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, + &svc_rpc_gss_client_count, 0, + "Number of rpc-gss clients"); + struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; struct svc_rpc_gss_client_list svc_rpc_gss_clients; -static size_t svc_rpc_gss_client_count; static uint32_t svc_rpc_gss_next_clientid = 1; static void @@ -669,7 +682,7 @@ svc_rpc_gss_timeout_clients(void) */ sx_xlock(&svc_rpc_gss_lock); client = TAILQ_LAST(&svc_rpc_gss_clients, svc_rpc_gss_client_list); - while (svc_rpc_gss_client_count > CLIENT_MAX && client != NULL) { + while (svc_rpc_gss_client_count > svc_rpc_gss_client_max && client != NULL) { svc_rpc_gss_forget_client_locked(client); sx_xunlock(&svc_rpc_gss_lock); svc_rpc_gss_release_client(client); From owner-svn-src-all@freebsd.org Tue Feb 19 10:40: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 1D6C714EC024; Tue, 19 Feb 2019 10:40:36 +0000 (UTC) (envelope-from trasz@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 ABB2C8157C; Tue, 19 Feb 2019 10:40:35 +0000 (UTC) (envelope-from trasz@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 9D6DC1C90F; Tue, 19 Feb 2019 10:40:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JAeZEQ068203; Tue, 19 Feb 2019 10:40:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JAeZ3E068202; Tue, 19 Feb 2019 10:40:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191040.x1JAeZ3E068202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 10:40: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: r344275 - stable/11/sys/rpc/rpcsec_gss X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABB2C8157C 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.998,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)[-0.999,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, 19 Feb 2019 10:40:36 -0000 Author: trasz Date: Tue Feb 19 10:40:35 2019 New Revision: 344275 URL: https://svnweb.freebsd.org/changeset/base/344275 Log: MFC r342114: Add kern.rpc.gss.client_max, to make it possible to bump it easily. This can drastically lower the load on gssd(8) on large NFS servers. Modified: stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:28:59 2019 (r344274) +++ stable/11/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:40:35 2019 (r344275) @@ -168,9 +168,22 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 +u_int svc_rpc_gss_client_max = CLIENT_MAX; + +SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); +SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); + +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFLAG_RW, + &svc_rpc_gss_client_max, 0, + "Max number of rpc-gss clients"); + +static u_int svc_rpc_gss_client_count; +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, + &svc_rpc_gss_client_count, 0, + "Number of rpc-gss clients"); + struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; struct svc_rpc_gss_client_list svc_rpc_gss_clients; -static size_t svc_rpc_gss_client_count; static uint32_t svc_rpc_gss_next_clientid = 1; static void @@ -666,7 +679,7 @@ svc_rpc_gss_timeout_clients(void) */ sx_xlock(&svc_rpc_gss_lock); client = TAILQ_LAST(&svc_rpc_gss_clients, svc_rpc_gss_client_list); - while (svc_rpc_gss_client_count > CLIENT_MAX && client != NULL) { + while (svc_rpc_gss_client_count > svc_rpc_gss_client_max && client != NULL) { svc_rpc_gss_forget_client_locked(client); sx_xunlock(&svc_rpc_gss_lock); svc_rpc_gss_release_client(client); From owner-svn-src-all@freebsd.org Tue Feb 19 11:07: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 DE54D14EC9E6; Tue, 19 Feb 2019 11:07:03 +0000 (UTC) (envelope-from trasz@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 7C48A82599; Tue, 19 Feb 2019 11:07:03 +0000 (UTC) (envelope-from trasz@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 690111CE0C; Tue, 19 Feb 2019 11:07:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JB73Ur083935; Tue, 19 Feb 2019 11:07:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JB73Tj083934; Tue, 19 Feb 2019 11:07:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191107.x1JB73Tj083934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 11:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344276 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 344276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C48A82599 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.933,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 11:07:04 -0000 Author: trasz Date: Tue Feb 19 11:07:02 2019 New Revision: 344276 URL: https://svnweb.freebsd.org/changeset/base/344276 Log: Bump the default kern.rpc.gss.client_max from 128 to 1024. The old value resulted in bad performance, with high kernel and gssd(8) load, with more than ~64 clients; it also triggered crashes, which are to be fixed by a different patch. PR: 235582 Discussed with: rmacklem@ MFC after: 2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 10:40:35 2019 (r344275) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Feb 19 11:07:02 2019 (r344276) @@ -170,7 +170,7 @@ struct svc_rpc_gss_cookedcred { }; #define CLIENT_HASH_SIZE 256 -#define CLIENT_MAX 128 +#define CLIENT_MAX 1024 u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; From owner-svn-src-all@freebsd.org Tue Feb 19 12:45: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 6675114F013C; Tue, 19 Feb 2019 12:45:38 +0000 (UTC) (envelope-from trasz@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 A926885C50; Tue, 19 Feb 2019 12:45:37 +0000 (UTC) (envelope-from trasz@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 986341DEEC; Tue, 19 Feb 2019 12:45:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JCjb1U035487; Tue, 19 Feb 2019 12:45:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JCjbYc035486; Tue, 19 Feb 2019 12:45:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201902191245.x1JCjbYc035486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 Feb 2019 12:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344277 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 344277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A926885C50 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)[-0.999,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, 19 Feb 2019 12:45:38 -0000 Author: trasz Date: Tue Feb 19 12:45:37 2019 New Revision: 344277 URL: https://svnweb.freebsd.org/changeset/base/344277 Log: Work around the "nfscl: bad open cnt on server" assertion that can happen when rerooting into NFSv4 rootfs with kernel built with INVARIANTS. I've talked to rmacklem@ (back in 2017), and while the root cause is still unknown, the case guarded by assertion (nfscl_doclose() being called from VOP_INACTIVE) is believed to be safe, and the whole thing seems to run just fine. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 11:07:02 2019 (r344276) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 12:45:37 2019 (r344277) @@ -3188,8 +3188,11 @@ lookformore: !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, nfhp->nfh_len)) { /* Found an open, close it. */ +#ifdef DIAGNOSTIC KASSERT((op->nfso_opencnt == 0), - ("nfscl: bad open cnt on server")); + ("nfscl: bad open cnt on server (%d)", + op->nfso_opencnt)); +#endif NFSUNLOCKCLSTATE(); nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, p); From owner-svn-src-all@freebsd.org Tue Feb 19 14:36: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 CB86514F283E; Tue, 19 Feb 2019 14:36:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 1E959897C6; Tue, 19 Feb 2019 14:36:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1JEaHpV010800; Tue, 19 Feb 2019 06:36:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1JEaHqr010799; Tue, 19 Feb 2019 06:36:17 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902191436.x1JEaHqr010799@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344272 - stable/11/sys/dev/vmware/vmxnet3 In-Reply-To: <201902191007.x1JA7mSq052443@repo.freebsd.org> To: Vincenzo Maffione Date: Tue, 19 Feb 2019 06:36:16 -0800 (PST) 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: 1E959897C6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 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.92)[-0.918,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, 19 Feb 2019 14:36:20 -0000 > Author: vmaffione > Date: Tue Feb 19 10:07:48 2019 > New Revision: 344272 > URL: https://svnweb.freebsd.org/changeset/base/344272 > > Log: > vmx(4): add native netmap support > > This change adds native netmap support for the vmx(4) adapter > (vmxnet3). Native support comes for free in 12, since the driver has been ^^^ This commit is to stable/11 > ported to iflib. To make it minimally intrusive, the native support is > only enabled if vmxnet3.netmap_native is set at boot (e.g., in loader.conf). > > Tested on stable/11 running inside vmplayer. > > Submitted by: Giuseppe Lettieri > Reviewed by: vmaffione, bryanv > Sponsored by: Sunny Valley Networks > Differential Revision: https://reviews.freebsd.org/D19104 Huh? When did the vmx driver in stable/11 become iflib'ed? > > Added: > stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h (contents, props changed) > Modified: > stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > ============================================================================== > --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 03:46:32 2019 (r344271) > +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 10:07:48 2019 (r344272) > @@ -239,6 +239,10 @@ typedef enum { > > static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); > > +#ifdef DEV_NETMAP > +#include "vmx_netmap.h" > +#endif > + > /* Tunables. */ > static int vmxnet3_mq_disable = 0; > TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); > @@ -270,6 +274,9 @@ DRIVER_MODULE(vmx, pci, vmxnet3_driver, vmxnet3_devcla > > MODULE_DEPEND(vmx, pci, 1, 1, 1); > MODULE_DEPEND(vmx, ether, 1, 1, 1); > +#ifdef DEV_NETMAP > +MODULE_DEPEND(vmx, netmap, 1, 1, 1); > +#endif > > #define VMXNET3_VMWARE_VENDOR_ID 0x15AD > #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 > @@ -347,6 +354,10 @@ vmxnet3_attach(device_t dev) > vmxnet3_start_taskqueue(sc); > #endif > > +#ifdef DEV_NETMAP > + vmxnet3_netmap_attach(sc); > +#endif > + > fail: > if (error) > vmxnet3_detach(dev); > @@ -390,6 +401,10 @@ vmxnet3_detach(device_t dev) > #endif > vmxnet3_free_interrupts(sc); > > +#ifdef DEV_NETMAP > + netmap_detach(ifp); > +#endif > + > if (ifp != NULL) { > if_free(ifp); > sc->vmx_ifp = NULL; > @@ -1846,6 +1861,11 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *txq) > txr = &txq->vxtxq_cmd_ring; > txc = &txq->vxtxq_comp_ring; > > +#ifdef DEV_NETMAP > + if (netmap_tx_irq(sc->vmx_ifp, txq - sc->vmx_txq) != NM_IRQ_PASS) > + return; > +#endif > + > VMXNET3_TXQ_LOCK_ASSERT(txq); > > for (;;) { > @@ -2111,6 +2131,15 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) > ifp = sc->vmx_ifp; > rxc = &rxq->vxrxq_comp_ring; > > +#ifdef DEV_NETMAP > + { > + int dummy; > + if (netmap_rx_irq(ifp, rxq - sc->vmx_rxq, &dummy) != > + NM_IRQ_PASS) > + return; > + } > +#endif > + > VMXNET3_RXQ_LOCK_ASSERT(rxq); > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > @@ -2401,6 +2430,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_softc *sc) > struct vmxnet3_txqueue *txq; > int i; > > +#ifdef DEV_NETMAP > + netmap_disable_all_rings(sc->vmx_ifp); > +#endif > + > for (i = 0; i < sc->vmx_nrxqueues; i++) { > rxq = &sc->vmx_rxq[i]; > VMXNET3_RXQ_LOCK(rxq); > @@ -2454,6 +2487,10 @@ vmxnet3_txinit(struct vmxnet3_softc *sc, struct vmxnet > bzero(txr->vxtxr_txd, > txr->vxtxr_ndesc * sizeof(struct vmxnet3_txdesc)); > > +#ifdef DEV_NETMAP > + vmxnet3_netmap_txq_init(sc, txq); > +#endif > + > txc = &txq->vxtxq_comp_ring; > txc->vxcr_next = 0; > txc->vxcr_gen = VMXNET3_INIT_GEN; > @@ -2468,6 +2505,10 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet > struct vmxnet3_rxring *rxr; > struct vmxnet3_comp_ring *rxc; > int i, populate, idx, frame_size, error; > +#ifdef DEV_NETMAP > + struct netmap_adapter *na; > + struct netmap_slot *slot; > +#endif > > ifp = sc->vmx_ifp; > frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) + > @@ -2498,12 +2539,24 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet > else > populate = VMXNET3_RXRINGS_PERQ; > > +#ifdef DEV_NETMAP > + na = NA(ifp); > + slot = netmap_reset(na, NR_RX, rxq - sc->vmx_rxq, 0); > +#endif > + > for (i = 0; i < populate; i++) { > rxr = &rxq->vxrxq_cmd_ring[i]; > rxr->vxrxr_fill = 0; > rxr->vxrxr_gen = VMXNET3_INIT_GEN; > bzero(rxr->vxrxr_rxd, > rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); > +#ifdef DEV_NETMAP > + if (slot != NULL) { > + vmxnet3_netmap_rxq_init(sc, rxq, rxr, slot); > + i = populate; > + break; > + } > +#endif > > for (idx = 0; idx < rxr->vxrxr_ndesc; idx++) { > error = vmxnet3_newbuf(sc, rxr); > @@ -2625,6 +2678,10 @@ vmxnet3_init_locked(struct vmxnet3_softc *sc) > > ifp->if_drv_flags |= IFF_DRV_RUNNING; > vmxnet3_link_status(sc); > + > +#ifdef DEV_NETMAP > + netmap_enable_all_rings(ifp); > +#endif > > vmxnet3_enable_all_intrs(sc); > callout_reset(&sc->vmx_tick, hz, vmxnet3_tick, sc); > > Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h Tue Feb 19 10:07:48 2019 (r344272) > @@ -0,0 +1,376 @@ > +/* > + * Copyright (C) 2019 Universita` di Pisa. > + * Sponsored by Sunny Valley Networks. > + * > + * 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. > + */ > + > +/* $FreeBSD$ */ > + > +#include > +#include > + > +static int > +vmxnet3_netmap_reg(struct netmap_adapter *na, int onoff) > +{ > + struct ifnet *ifp = na->ifp; > + struct vmxnet3_softc *sc = ifp->if_softc; > + > + VMXNET3_CORE_LOCK(sc); > + vmxnet3_stop(sc); > + if (onoff) { > + nm_set_native_flags(na); > + } else { > + nm_clear_native_flags(na); > + } > + vmxnet3_init_locked(sc); > + VMXNET3_CORE_UNLOCK(sc); > + return 0; > +} > + > +static void > +vmxnet3_netmap_rxq_init(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rxq, > + struct vmxnet3_rxring *rxr, struct netmap_slot *slot) > +{ > + struct ifnet *ifp = sc->vmx_ifp; > + struct netmap_adapter *na = NA(ifp); > + struct vmxnet3_rxdesc *rxd; > + int q, i; > + > + q = rxq - sc->vmx_rxq; > + > + for (i = 0; ; i++) { > + int idx = rxr->vxrxr_fill; > + int si = netmap_idx_n2k(na->rx_rings[q], idx); > + struct vmxnet3_rxbuf *rxb = &rxr->vxrxr_rxbuf[idx]; > + uint64_t paddr; > + void *addr; > + > + addr = PNMB(na, slot + si, &paddr); > + netmap_load_map(na, rxr->vxrxr_rxtag, rxb->vrxb_dmamap, addr); > + > + rxd = &rxr->vxrxr_rxd[idx]; > + rxd->addr = paddr; > + rxd->len = NETMAP_BUF_SIZE(na); > + rxd->gen = rxr->vxrxr_gen ^ 1; > + rxd->btype = VMXNET3_BTYPE_HEAD; > + nm_prdis("%d: addr %lx len %u btype %u gen %u", > + idx, rxd->addr, rxd->len, rxd->btype, rxd->gen); > + > + if (i == rxr->vxrxr_ndesc -1) > + break; > + > + rxd->gen ^= 1; > + vmxnet3_rxr_increment_fill(rxr); > + } > +} > + > +static void > +vmxnet3_netmap_txq_init(struct vmxnet3_softc *sc, struct vmxnet3_txqueue *txq) > +{ > + struct ifnet *ifp = sc->vmx_ifp; > + struct netmap_adapter *na; > + struct netmap_slot *slot; > + struct vmxnet3_txring *txr; > + int i, gen, q; > + > + q = txq - sc->vmx_txq; > + > + na = NA(ifp); > + > + slot = netmap_reset(na, NR_TX, q, 0); > + if (slot == NULL) > + return; > + > + txr = &txq->vxtxq_cmd_ring; > + gen = txr->vxtxr_gen ^ 1; > + > + for (i = 0; i < txr->vxtxr_ndesc; i++) { > + int si = netmap_idx_n2k(na->tx_rings[q], i); > + struct vmxnet3_txdesc *txd = &txr->vxtxr_txd[i]; > + uint64_t paddr; > + void *addr; > + > + addr = PNMB(na, slot + si, &paddr); > + > + txd->addr = paddr; > + txd->len = 0; > + txd->gen = gen; > + txd->dtype = 0; > + txd->offload_mode = VMXNET3_OM_NONE; > + txd->offload_pos = 0; > + txd->hlen = 0; > + txd->eop = 0; > + txd->compreq = 0; > + txd->vtag_mode = 0; > + txd->vtag = 0; > + > + netmap_load_map(na, txr->vxtxr_txtag, > + txr->vxtxr_txbuf[i].vtxb_dmamap, addr); > + } > +} > + > +static int > +vmxnet3_netmap_txsync(struct netmap_kring *kring, int flags) > +{ > + struct netmap_adapter *na = kring->na; > + struct ifnet *ifp = na->ifp; > + struct netmap_ring *ring = kring->ring; > + u_int nm_i; > + u_int nic_i; > + u_int n; > + u_int const lim = kring->nkr_num_slots - 1; > + u_int const head = kring->rhead; > + > + /* > + * interrupts on every tx packet are expensive so request > + * them every half ring, or where NS_REPORT is set > + */ > + u_int report_frequency = kring->nkr_num_slots >> 1; > + /* device specific */ > + struct vmxnet3_softc *sc = ifp->if_softc; > + struct vmxnet3_txqueue *txq = &sc->vmx_txq[kring->ring_id]; > + struct vmxnet3_txring *txr = &txq->vxtxq_cmd_ring; > + struct vmxnet3_comp_ring *txc = &txq->vxtxq_comp_ring; > + struct vmxnet3_txcompdesc *txcd = txc->vxcr_u.txcd; > + int gen = txr->vxtxr_gen; > + > + /* no need to dma-sync the ring; memory barriers are sufficient */ > + > + nm_i = kring->nr_hwcur; > + if (nm_i != head) { > + nic_i = netmap_idx_k2n(kring, nm_i); > + for (n = 0; nm_i != head; n++) { > + struct netmap_slot *slot = &ring->slot[nm_i]; > + u_int len = slot->len; > + uint64_t paddr; > + void *addr = PNMB(na, slot, &paddr); > + int compreq = !!(slot->flags & NS_REPORT || > + nic_i == 0 || nic_i == report_frequency); > + > + /* device specific */ > + struct vmxnet3_txdesc *curr = &txr->vxtxr_txd[nic_i]; > + struct vmxnet3_txbuf *txbuf = &txr->vxtxr_txbuf[nic_i]; > + > + NM_CHECK_ADDR_LEN(na, addr, len); > + > + /* fill the slot in the NIC ring */ > + curr->len = len; > + curr->eop = 1; /* NS_MOREFRAG not supported */ > + curr->compreq = compreq; > + > + if (slot->flags & NS_BUF_CHANGED) { > + curr->addr = paddr; > + netmap_reload_map(na, txr->vxtxr_txtag, > + txbuf->vtxb_dmamap, addr); > + } > + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); > + > + /* make sure changes to the buffer are synced */ > + bus_dmamap_sync(txr->vxtxr_txtag, txbuf->vtxb_dmamap, > + BUS_DMASYNC_PREWRITE); > + > + /* pass ownership */ > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > + curr->gen = gen; > + > + nm_i = nm_next(nm_i, lim); > + nic_i++; > + if (unlikely(nic_i == lim + 1)) { > + nic_i = 0; > + gen = txr->vxtxr_gen ^= 1; > + } > + } > + > + vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), nic_i); > + } > + kring->nr_hwcur = nm_i; > + > + /* reclaim completed packets */ > + for (;;) { > + u_int sop; > + struct vmxnet3_txbuf *txb; > + > + txcd = &txc->vxcr_u.txcd[txc->vxcr_next]; > + if (txcd->gen != txc->vxcr_gen) > + break; > + > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > + > + if (++txc->vxcr_next == txc->vxcr_ndesc) { > + txc->vxcr_next = 0; > + txc->vxcr_gen ^= 1; > + } > + > + sop = txr->vxtxr_next; > + txb = &txr->vxtxr_txbuf[sop]; > + > + bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, > + BUS_DMASYNC_POSTWRITE); > + > + txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; > + } > + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, txr->vxtxr_next), lim); > + > + return 0; > +} > + > +static int > +vmxnet3_netmap_rxsync(struct netmap_kring *kring, int flags) > +{ > + struct netmap_adapter *na = kring->na; > + struct netmap_ring *ring = kring->ring; > + u_int nm_i; > + u_int nic_i; > + u_int const lim = kring->nkr_num_slots - 1; > + u_int const head = kring->rhead; > + int force_update = (flags & NAF_FORCE_READ); > + > + struct ifnet *ifp = na->ifp; > + struct vmxnet3_softc *sc = ifp->if_softc; > + struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[kring->ring_id]; > + struct vmxnet3_rxring *rxr; > + struct vmxnet3_comp_ring *rxc; > + > + if (head > lim) > + return netmap_ring_reinit(kring); > + > + rxr = &rxq->vxrxq_cmd_ring[0]; > + > + /* no need to dma-sync the ring; memory barriers are sufficient */ > + > + /* first part: import newly received packets */ > + if (netmap_no_pendintr || force_update) { > + rxc = &rxq->vxrxq_comp_ring; > + nm_i = kring->nr_hwtail; > + nic_i = netmap_idx_k2n(kring, nm_i); > + for (;;) { > + struct vmxnet3_rxcompdesc *rxcd; > + struct vmxnet3_rxbuf *rxb; > + > + rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; > + > + if (rxcd->gen != rxc->vxcr_gen) > + break; > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > + > + while (__predict_false(rxcd->rxd_idx != nic_i)) { > + nm_prlim(1, "%u skipped! idx %u", nic_i, rxcd->rxd_idx); > + /* to shelter the application from this we > + * would need to rotate the kernel-owned > + * portion of the netmap and nic rings. We > + * return len=0 for now and hope for the best. > + */ > + ring->slot[nm_i].len = 0; > + nic_i = nm_next(nm_i, lim); > + nm_i = nm_next(nm_i, lim); > + } > + > + rxb = &rxr->vxrxr_rxbuf[nic_i]; > + > + ring->slot[nm_i].len = rxcd->len; > + ring->slot[nm_i].flags = 0; > + > + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > + BUS_DMASYNC_POSTREAD); > + > + nic_i = nm_next(nm_i, lim); > + nm_i = nm_next(nm_i, lim); > + > + rxc->vxcr_next++; > + if (__predict_false(rxc->vxcr_next == rxc->vxcr_ndesc)) { > + rxc->vxcr_next = 0; > + rxc->vxcr_gen ^= 1; > + } > + } > + kring->nr_hwtail = nm_i; > + } > + /* second part: skip past packets that userspace has released */ > + nm_i = kring->nr_hwcur; > + if (nm_i != head) { > + nic_i = netmap_idx_k2n(kring, nm_i); > + while (nm_i != head) { > + struct netmap_slot *slot = &ring->slot[nm_i]; > + struct vmxnet3_rxdesc *rxd_fill; > + struct vmxnet3_rxbuf *rxbuf; > + > + if (slot->flags & NS_BUF_CHANGED) { > + uint64_t paddr; > + void *addr = PNMB(na, slot, &paddr); > + struct vmxnet3_rxdesc *rxd = &rxr->vxrxr_rxd[nic_i]; > + > + > + if (addr == NETMAP_BUF_BASE(na)) > + return netmap_ring_reinit(kring); > + > + rxd->addr = paddr; > + rxbuf = &rxr->vxrxr_rxbuf[nic_i]; > + netmap_reload_map(na, rxr->vxrxr_rxtag, > + rxbuf->vrxb_dmamap, addr); > + slot->flags &= ~NS_BUF_CHANGED; > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > + } > + > + rxd_fill = &rxr->vxrxr_rxd[rxr->vxrxr_fill]; > + rxbuf = &rxr->vxrxr_rxbuf[rxr->vxrxr_fill]; > + > + bus_dmamap_sync(rxr->vxrxr_rxtag, rxbuf->vrxb_dmamap, > + BUS_DMASYNC_PREREAD); > + > + rxd_fill->gen = rxr->vxrxr_gen; > + vmxnet3_rxr_increment_fill(rxr); > + > + nm_i = nm_next(nm_i, lim); > + nic_i = nm_next(nic_i, lim); > + } > + kring->nr_hwcur = head; > + if (__predict_false(rxq->vxrxq_rs->update_rxhead)) { > + vmxnet3_write_bar0(sc, > + VMXNET3_BAR0_RXH1(kring->ring_id), rxr->vxrxr_fill); > + } > + } > + return 0; > +} > + > +static void > +vmxnet3_netmap_attach(struct vmxnet3_softc *sc) > +{ > + struct netmap_adapter na; > + int enable = 0; > + > + if (getenv_int("vmxnet3.netmap_native", &enable) < 0 || !enable) { > + return; > + } > + > + bzero(&na, sizeof(na)); > + > + na.ifp = sc->vmx_ifp; > + na.na_flags = NAF_BDG_MAYSLEEP; > + na.num_tx_desc = sc->vmx_ntxdescs; > + na.num_rx_desc = sc->vmx_nrxdescs; > + na.num_tx_rings = sc->vmx_ntxqueues; > + na.num_rx_rings = sc->vmx_nrxqueues; > + na.nm_register = vmxnet3_netmap_reg; > + na.nm_txsync = vmxnet3_netmap_txsync; > + na.nm_rxsync = vmxnet3_netmap_rxsync; > + netmap_attach(&na); > +} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Feb 19 14:40: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 EC2AF14F2926; Tue, 19 Feb 2019 14:40:09 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85BB989981; Tue, 19 Feb 2019 14:40:09 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id a48so23339699qtb.4; Tue, 19 Feb 2019 06:40:09 -0800 (PST) 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=t/rN/jnkVznLQKcRRo+3GAvhasilN7bKNvRwCLOLUDo=; b=u+T24JKP4ojzGRpdZMTbHFt9j5YY4SXSD5+T2NePtmWLUB0jtoTPQXnl7BTYrU/qxy xqImDLCP9o5GZSX60sa2FotjL2kkF7CGNqORz3+WXJ8Pz0dUWxkmApJnFszeHrM+WbpB q363Fj5vjCDTQHQIRPkXvrCLyM5Yy+R6xphhD6bZGxL3DBk+wdeRqz5w/KOSUQQc5SVs pbj8j3W30PbXSlO34sAXA9hpxQ7lW2deGhq93rygsKenhlfIHtrk9Ml91uVqW2QqUjLJ bXittVLSqF3USAR6ALysCKFwwczFtcyK+SOrE3x1ZiJ1/HkkuKP6Pcgbuay4SZh56lZd cJyw== 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=t/rN/jnkVznLQKcRRo+3GAvhasilN7bKNvRwCLOLUDo=; b=pKtyHjK4q1D63/i4do0ft/Jc59Dz+BoqOS9AH08pZA8K6BQjiMXnTghdSluEYrQBPU bqvw4Mm0X0fVLQO9VVnpEj/sWpK1vhmpXZrKNa8WiTtsaAutHtztxcz4qDgS5RImcGK6 RFaYAMT6OXx49y1BCyNm+nkOGYXJOkE634UQv9Bh/udu6kISiL9PupNnyyqM5J4dpN40 AYHO4EJ7ojEMvjxXBu2H8CeQ+a4KLMWlNlNtC86SPCCGmDq1fg1cI7EgoBNzjthPJhpI OHepDsH6mhtzQBc6s63vYgCUxgv1nEZDOwDQQr/qcPBopBk4p5OAc1E3UvUMVGHA5nQm 0rog== X-Gm-Message-State: AHQUAuaXe8NL4S1RXnY8xStsF/6VWrAYY3XNGGSrwMd06jNvvs/e21rI qZ6XHnGZ2N77VgxCLoDpfhT/DruvfvVx+lbz5T1vGA== X-Google-Smtp-Source: AHgI3IbLV5PI6vBzVRGyrbFGZe0HdfQz3JypRDaHWcGK+l37xNaAG8GoKFNaejpbL5wF5kNt9qtpscVIzQ7WlTKnZGU= X-Received: by 2002:ac8:25d9:: with SMTP id f25mr23268637qtf.156.1550587208543; Tue, 19 Feb 2019 06:40:08 -0800 (PST) MIME-Version: 1.0 References: <201902191007.x1JA7mSq052443@repo.freebsd.org> <201902191436.x1JEaHqr010799@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902191436.x1JEaHqr010799@pdx.rh.CN85.dnsmgr.net> From: Vincenzo Maffione Date: Tue, 19 Feb 2019 15:39:55 +0100 Message-ID: Subject: Re: svn commit: r344272 - stable/11/sys/dev/vmware/vmxnet3 To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Rspamd-Queue-Id: 85BB989981 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.84 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.84)[-0.841,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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, 19 Feb 2019 14:40:10 -0000 Hi Rodney, Il giorno mar 19 feb 2019 alle ore 15:36 Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> ha scritto: > > Author: vmaffione > > Date: Tue Feb 19 10:07:48 2019 > > New Revision: 344272 > > URL: https://svnweb.freebsd.org/changeset/base/344272 > > > > Log: > > vmx(4): add native netmap support > > > > This change adds native netmap support for the vmx(4) adapter > > (vmxnet3). Native support comes for free in 12, since the driver has > been > ^^^ > This commit is to stable/11 > Yes, this commit is meant for stable/11. Since in head vmx(4) has been ported to iflib, netmap support form vmx(4) is already available there through iflib. In stable/11, on the other hand, vmx(4) is not using iflib, thus explicit netmap support is needed (hence this commit). > > > ported to iflib. To make it minimally intrusive, the native support is > > only enabled if vmxnet3.netmap_native is set at boot (e.g., in > loader.conf). > > > > Tested on stable/11 running inside vmplayer. > > > > Submitted by: Giuseppe Lettieri > > Reviewed by: vmaffione, bryanv > > Sponsored by: Sunny Valley Networks > > Differential Revision: https://reviews.freebsd.org/D19104 > > Huh? When did the vmx driver in stable/11 become iflib'ed? > It didn't. The vmx driver has been ported to iflib in head. Cheers, Vincenzo > > > > > Added: > > stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h (contents, props > changed) > > Modified: > > stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > > Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > ============================================================================== > > --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 03:46:32 2019 > (r344271) > > +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 10:07:48 2019 > (r344272) > > @@ -239,6 +239,10 @@ typedef enum { > > > > static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); > > > > +#ifdef DEV_NETMAP > > +#include "vmx_netmap.h" > > +#endif > > + > > /* Tunables. */ > > static int vmxnet3_mq_disable = 0; > > TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); > > @@ -270,6 +274,9 @@ DRIVER_MODULE(vmx, pci, vmxnet3_driver, > vmxnet3_devcla > > > > MODULE_DEPEND(vmx, pci, 1, 1, 1); > > MODULE_DEPEND(vmx, ether, 1, 1, 1); > > +#ifdef DEV_NETMAP > > +MODULE_DEPEND(vmx, netmap, 1, 1, 1); > > +#endif > > > > #define VMXNET3_VMWARE_VENDOR_ID 0x15AD > > #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 > > @@ -347,6 +354,10 @@ vmxnet3_attach(device_t dev) > > vmxnet3_start_taskqueue(sc); > > #endif > > > > +#ifdef DEV_NETMAP > > + vmxnet3_netmap_attach(sc); > > +#endif > > + > > fail: > > if (error) > > vmxnet3_detach(dev); > > @@ -390,6 +401,10 @@ vmxnet3_detach(device_t dev) > > #endif > > vmxnet3_free_interrupts(sc); > > > > +#ifdef DEV_NETMAP > > + netmap_detach(ifp); > > +#endif > > + > > if (ifp != NULL) { > > if_free(ifp); > > sc->vmx_ifp = NULL; > > @@ -1846,6 +1861,11 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *txq) > > txr = &txq->vxtxq_cmd_ring; > > txc = &txq->vxtxq_comp_ring; > > > > +#ifdef DEV_NETMAP > > + if (netmap_tx_irq(sc->vmx_ifp, txq - sc->vmx_txq) != NM_IRQ_PASS) > > + return; > > +#endif > > + > > VMXNET3_TXQ_LOCK_ASSERT(txq); > > > > for (;;) { > > @@ -2111,6 +2131,15 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) > > ifp = sc->vmx_ifp; > > rxc = &rxq->vxrxq_comp_ring; > > > > +#ifdef DEV_NETMAP > > + { > > + int dummy; > > + if (netmap_rx_irq(ifp, rxq - sc->vmx_rxq, &dummy) != > > + NM_IRQ_PASS) > > + return; > > + } > > +#endif > > + > > VMXNET3_RXQ_LOCK_ASSERT(rxq); > > > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > @@ -2401,6 +2430,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_softc *sc) > > struct vmxnet3_txqueue *txq; > > int i; > > > > +#ifdef DEV_NETMAP > > + netmap_disable_all_rings(sc->vmx_ifp); > > +#endif > > + > > for (i = 0; i < sc->vmx_nrxqueues; i++) { > > rxq = &sc->vmx_rxq[i]; > > VMXNET3_RXQ_LOCK(rxq); > > @@ -2454,6 +2487,10 @@ vmxnet3_txinit(struct vmxnet3_softc *sc, struct > vmxnet > > bzero(txr->vxtxr_txd, > > txr->vxtxr_ndesc * sizeof(struct vmxnet3_txdesc)); > > > > +#ifdef DEV_NETMAP > > + vmxnet3_netmap_txq_init(sc, txq); > > +#endif > > + > > txc = &txq->vxtxq_comp_ring; > > txc->vxcr_next = 0; > > txc->vxcr_gen = VMXNET3_INIT_GEN; > > @@ -2468,6 +2505,10 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct > vmxnet > > struct vmxnet3_rxring *rxr; > > struct vmxnet3_comp_ring *rxc; > > int i, populate, idx, frame_size, error; > > +#ifdef DEV_NETMAP > > + struct netmap_adapter *na; > > + struct netmap_slot *slot; > > +#endif > > > > ifp = sc->vmx_ifp; > > frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) + > > @@ -2498,12 +2539,24 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct > vmxnet > > else > > populate = VMXNET3_RXRINGS_PERQ; > > > > +#ifdef DEV_NETMAP > > + na = NA(ifp); > > + slot = netmap_reset(na, NR_RX, rxq - sc->vmx_rxq, 0); > > +#endif > > + > > for (i = 0; i < populate; i++) { > > rxr = &rxq->vxrxq_cmd_ring[i]; > > rxr->vxrxr_fill = 0; > > rxr->vxrxr_gen = VMXNET3_INIT_GEN; > > bzero(rxr->vxrxr_rxd, > > rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); > > +#ifdef DEV_NETMAP > > + if (slot != NULL) { > > + vmxnet3_netmap_rxq_init(sc, rxq, rxr, slot); > > + i = populate; > > + break; > > + } > > +#endif > > > > for (idx = 0; idx < rxr->vxrxr_ndesc; idx++) { > > error = vmxnet3_newbuf(sc, rxr); > > @@ -2625,6 +2678,10 @@ vmxnet3_init_locked(struct vmxnet3_softc *sc) > > > > ifp->if_drv_flags |= IFF_DRV_RUNNING; > > vmxnet3_link_status(sc); > > + > > +#ifdef DEV_NETMAP > > + netmap_enable_all_rings(ifp); > > +#endif > > > > vmxnet3_enable_all_intrs(sc); > > callout_reset(&sc->vmx_tick, hz, vmxnet3_tick, sc); > > > > Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h > > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h Tue Feb 19 > 10:07:48 2019 (r344272) > > @@ -0,0 +1,376 @@ > > +/* > > + * Copyright (C) 2019 Universita` di Pisa. > > + * Sponsored by Sunny Valley Networks. > > + * > > + * 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. > > + */ > > + > > +/* $FreeBSD$ */ > > + > > +#include > > +#include > > + > > +static int > > +vmxnet3_netmap_reg(struct netmap_adapter *na, int onoff) > > +{ > > + struct ifnet *ifp = na->ifp; > > + struct vmxnet3_softc *sc = ifp->if_softc; > > + > > + VMXNET3_CORE_LOCK(sc); > > + vmxnet3_stop(sc); > > + if (onoff) { > > + nm_set_native_flags(na); > > + } else { > > + nm_clear_native_flags(na); > > + } > > + vmxnet3_init_locked(sc); > > + VMXNET3_CORE_UNLOCK(sc); > > + return 0; > > +} > > + > > +static void > > +vmxnet3_netmap_rxq_init(struct vmxnet3_softc *sc, struct > vmxnet3_rxqueue *rxq, > > + struct vmxnet3_rxring *rxr, struct netmap_slot *slot) > > +{ > > + struct ifnet *ifp = sc->vmx_ifp; > > + struct netmap_adapter *na = NA(ifp); > > + struct vmxnet3_rxdesc *rxd; > > + int q, i; > > + > > + q = rxq - sc->vmx_rxq; > > + > > + for (i = 0; ; i++) { > > + int idx = rxr->vxrxr_fill; > > + int si = netmap_idx_n2k(na->rx_rings[q], idx); > > + struct vmxnet3_rxbuf *rxb = &rxr->vxrxr_rxbuf[idx]; > > + uint64_t paddr; > > + void *addr; > > + > > + addr = PNMB(na, slot + si, &paddr); > > + netmap_load_map(na, rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > addr); > > + > > + rxd = &rxr->vxrxr_rxd[idx]; > > + rxd->addr = paddr; > > + rxd->len = NETMAP_BUF_SIZE(na); > > + rxd->gen = rxr->vxrxr_gen ^ 1; > > + rxd->btype = VMXNET3_BTYPE_HEAD; > > + nm_prdis("%d: addr %lx len %u btype %u gen %u", > > + idx, rxd->addr, rxd->len, rxd->btype, rxd->gen); > > + > > + if (i == rxr->vxrxr_ndesc -1) > > + break; > > + > > + rxd->gen ^= 1; > > + vmxnet3_rxr_increment_fill(rxr); > > + } > > +} > > + > > +static void > > +vmxnet3_netmap_txq_init(struct vmxnet3_softc *sc, struct > vmxnet3_txqueue *txq) > > +{ > > + struct ifnet *ifp = sc->vmx_ifp; > > + struct netmap_adapter *na; > > + struct netmap_slot *slot; > > + struct vmxnet3_txring *txr; > > + int i, gen, q; > > + > > + q = txq - sc->vmx_txq; > > + > > + na = NA(ifp); > > + > > + slot = netmap_reset(na, NR_TX, q, 0); > > + if (slot == NULL) > > + return; > > + > > + txr = &txq->vxtxq_cmd_ring; > > + gen = txr->vxtxr_gen ^ 1; > > + > > + for (i = 0; i < txr->vxtxr_ndesc; i++) { > > + int si = netmap_idx_n2k(na->tx_rings[q], i); > > + struct vmxnet3_txdesc *txd = &txr->vxtxr_txd[i]; > > + uint64_t paddr; > > + void *addr; > > + > > + addr = PNMB(na, slot + si, &paddr); > > + > > + txd->addr = paddr; > > + txd->len = 0; > > + txd->gen = gen; > > + txd->dtype = 0; > > + txd->offload_mode = VMXNET3_OM_NONE; > > + txd->offload_pos = 0; > > + txd->hlen = 0; > > + txd->eop = 0; > > + txd->compreq = 0; > > + txd->vtag_mode = 0; > > + txd->vtag = 0; > > + > > + netmap_load_map(na, txr->vxtxr_txtag, > > + txr->vxtxr_txbuf[i].vtxb_dmamap, addr); > > + } > > +} > > + > > +static int > > +vmxnet3_netmap_txsync(struct netmap_kring *kring, int flags) > > +{ > > + struct netmap_adapter *na = kring->na; > > + struct ifnet *ifp = na->ifp; > > + struct netmap_ring *ring = kring->ring; > > + u_int nm_i; > > + u_int nic_i; > > + u_int n; > > + u_int const lim = kring->nkr_num_slots - 1; > > + u_int const head = kring->rhead; > > + > > + /* > > + * interrupts on every tx packet are expensive so request > > + * them every half ring, or where NS_REPORT is set > > + */ > > + u_int report_frequency = kring->nkr_num_slots >> 1; > > + /* device specific */ > > + struct vmxnet3_softc *sc = ifp->if_softc; > > + struct vmxnet3_txqueue *txq = &sc->vmx_txq[kring->ring_id]; > > + struct vmxnet3_txring *txr = &txq->vxtxq_cmd_ring; > > + struct vmxnet3_comp_ring *txc = &txq->vxtxq_comp_ring; > > + struct vmxnet3_txcompdesc *txcd = txc->vxcr_u.txcd; > > + int gen = txr->vxtxr_gen; > > + > > + /* no need to dma-sync the ring; memory barriers are sufficient */ > > + > > + nm_i = kring->nr_hwcur; > > + if (nm_i != head) { > > + nic_i = netmap_idx_k2n(kring, nm_i); > > + for (n = 0; nm_i != head; n++) { > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > + u_int len = slot->len; > > + uint64_t paddr; > > + void *addr = PNMB(na, slot, &paddr); > > + int compreq = !!(slot->flags & NS_REPORT || > > + nic_i == 0 || nic_i == report_frequency); > > + > > + /* device specific */ > > + struct vmxnet3_txdesc *curr = > &txr->vxtxr_txd[nic_i]; > > + struct vmxnet3_txbuf *txbuf = > &txr->vxtxr_txbuf[nic_i]; > > + > > + NM_CHECK_ADDR_LEN(na, addr, len); > > + > > + /* fill the slot in the NIC ring */ > > + curr->len = len; > > + curr->eop = 1; /* NS_MOREFRAG not supported */ > > + curr->compreq = compreq; > > + > > + if (slot->flags & NS_BUF_CHANGED) { > > + curr->addr = paddr; > > + netmap_reload_map(na, txr->vxtxr_txtag, > > + txbuf->vtxb_dmamap, addr); > > + } > > + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); > > + > > + /* make sure changes to the buffer are synced */ > > + bus_dmamap_sync(txr->vxtxr_txtag, > txbuf->vtxb_dmamap, > > + BUS_DMASYNC_PREWRITE); > > + > > + /* pass ownership */ > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > > + curr->gen = gen; > > + > > + nm_i = nm_next(nm_i, lim); > > + nic_i++; > > + if (unlikely(nic_i == lim + 1)) { > > + nic_i = 0; > > + gen = txr->vxtxr_gen ^= 1; > > + } > > + } > > + > > + vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), > nic_i); > > + } > > + kring->nr_hwcur = nm_i; > > + > > + /* reclaim completed packets */ > > + for (;;) { > > + u_int sop; > > + struct vmxnet3_txbuf *txb; > > + > > + txcd = &txc->vxcr_u.txcd[txc->vxcr_next]; > > + if (txcd->gen != txc->vxcr_gen) > > + break; > > + > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > + > > + if (++txc->vxcr_next == txc->vxcr_ndesc) { > > + txc->vxcr_next = 0; > > + txc->vxcr_gen ^= 1; > > + } > > + > > + sop = txr->vxtxr_next; > > + txb = &txr->vxtxr_txbuf[sop]; > > + > > + bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, > > + BUS_DMASYNC_POSTWRITE); > > + > > + txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; > > + } > > + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, txr->vxtxr_next), > lim); > > + > > + return 0; > > +} > > + > > +static int > > +vmxnet3_netmap_rxsync(struct netmap_kring *kring, int flags) > > +{ > > + struct netmap_adapter *na = kring->na; > > + struct netmap_ring *ring = kring->ring; > > + u_int nm_i; > > + u_int nic_i; > > + u_int const lim = kring->nkr_num_slots - 1; > > + u_int const head = kring->rhead; > > + int force_update = (flags & NAF_FORCE_READ); > > + > > + struct ifnet *ifp = na->ifp; > > + struct vmxnet3_softc *sc = ifp->if_softc; > > + struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[kring->ring_id]; > > + struct vmxnet3_rxring *rxr; > > + struct vmxnet3_comp_ring *rxc; > > + > > + if (head > lim) > > + return netmap_ring_reinit(kring); > > + > > + rxr = &rxq->vxrxq_cmd_ring[0]; > > + > > + /* no need to dma-sync the ring; memory barriers are sufficient */ > > + > > + /* first part: import newly received packets */ > > + if (netmap_no_pendintr || force_update) { > > + rxc = &rxq->vxrxq_comp_ring; > > + nm_i = kring->nr_hwtail; > > + nic_i = netmap_idx_k2n(kring, nm_i); > > + for (;;) { > > + struct vmxnet3_rxcompdesc *rxcd; > > + struct vmxnet3_rxbuf *rxb; > > + > > + rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; > > + > > + if (rxcd->gen != rxc->vxcr_gen) > > + break; > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > + > > + while (__predict_false(rxcd->rxd_idx != nic_i)) { > > + nm_prlim(1, "%u skipped! idx %u", nic_i, > rxcd->rxd_idx); > > + /* to shelter the application from this we > > + * would need to rotate the kernel-owned > > + * portion of the netmap and nic rings. We > > + * return len=0 for now and hope for the > best. > > + */ > > + ring->slot[nm_i].len = 0; > > + nic_i = nm_next(nm_i, lim); > > + nm_i = nm_next(nm_i, lim); > > + } > > + > > + rxb = &rxr->vxrxr_rxbuf[nic_i]; > > + > > + ring->slot[nm_i].len = rxcd->len; > > + ring->slot[nm_i].flags = 0; > > + > > + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > > + BUS_DMASYNC_POSTREAD); > > + > > + nic_i = nm_next(nm_i, lim); > > + nm_i = nm_next(nm_i, lim); > > + > > + rxc->vxcr_next++; > > + if (__predict_false(rxc->vxcr_next == > rxc->vxcr_ndesc)) { > > + rxc->vxcr_next = 0; > > + rxc->vxcr_gen ^= 1; > > + } > > + } > > + kring->nr_hwtail = nm_i; > > + } > > + /* second part: skip past packets that userspace has released */ > > + nm_i = kring->nr_hwcur; > > + if (nm_i != head) { > > + nic_i = netmap_idx_k2n(kring, nm_i); > > + while (nm_i != head) { > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > + struct vmxnet3_rxdesc *rxd_fill; > > + struct vmxnet3_rxbuf *rxbuf; > > + > > + if (slot->flags & NS_BUF_CHANGED) { > > + uint64_t paddr; > > + void *addr = PNMB(na, slot, &paddr); > > + struct vmxnet3_rxdesc *rxd = > &rxr->vxrxr_rxd[nic_i]; > > + > > + > > + if (addr == NETMAP_BUF_BASE(na)) > > + return netmap_ring_reinit(kring); > > + > > + rxd->addr = paddr; > > + rxbuf = &rxr->vxrxr_rxbuf[nic_i]; > > + netmap_reload_map(na, rxr->vxrxr_rxtag, > > + rxbuf->vrxb_dmamap, addr); > > + slot->flags &= ~NS_BUF_CHANGED; > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > > + } > > + > > + rxd_fill = &rxr->vxrxr_rxd[rxr->vxrxr_fill]; > > + rxbuf = &rxr->vxrxr_rxbuf[rxr->vxrxr_fill]; > > + > > + bus_dmamap_sync(rxr->vxrxr_rxtag, > rxbuf->vrxb_dmamap, > > + BUS_DMASYNC_PREREAD); > > + > > + rxd_fill->gen = rxr->vxrxr_gen; > > + vmxnet3_rxr_increment_fill(rxr); > > + > > + nm_i = nm_next(nm_i, lim); > > + nic_i = nm_next(nic_i, lim); > > + } > > + kring->nr_hwcur = head; > > + if (__predict_false(rxq->vxrxq_rs->update_rxhead)) { > > + vmxnet3_write_bar0(sc, > > + VMXNET3_BAR0_RXH1(kring->ring_id), > rxr->vxrxr_fill); > > + } > > + } > > + return 0; > > +} > > + > > +static void > > +vmxnet3_netmap_attach(struct vmxnet3_softc *sc) > > +{ > > + struct netmap_adapter na; > > + int enable = 0; > > + > > + if (getenv_int("vmxnet3.netmap_native", &enable) < 0 || !enable) { > > + return; > > + } > > + > > + bzero(&na, sizeof(na)); > > + > > + na.ifp = sc->vmx_ifp; > > + na.na_flags = NAF_BDG_MAYSLEEP; > > + na.num_tx_desc = sc->vmx_ntxdescs; > > + na.num_rx_desc = sc->vmx_nrxdescs; > > + na.num_tx_rings = sc->vmx_ntxqueues; > > + na.num_rx_rings = sc->vmx_nrxqueues; > > + na.nm_register = vmxnet3_netmap_reg; > > + na.nm_txsync = vmxnet3_netmap_txsync; > > + na.nm_rxsync = vmxnet3_netmap_rxsync; > > + netmap_attach(&na); > > +} > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > -- Vincenzo From owner-svn-src-all@freebsd.org Tue Feb 19 14:47: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 4326A14F2B76; Tue, 19 Feb 2019 14:47:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 58F0B89DED; Tue, 19 Feb 2019 14:47:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1JElBBA010844; Tue, 19 Feb 2019 06:47:11 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1JElBXa010843; Tue, 19 Feb 2019 06:47:11 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902191447.x1JElBXa010843@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344272 - stable/11/sys/dev/vmware/vmxnet3 In-Reply-To: To: Vincenzo Maffione Date: Tue, 19 Feb 2019 06:47:11 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , 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: 58F0B89DED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; 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: Tue, 19 Feb 2019 14:47:14 -0000 > Hi Rodney, > > > Il giorno mar 19 feb 2019 alle ore 15:36 Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> ha scritto: > > > > Author: vmaffione > > > Date: Tue Feb 19 10:07:48 2019 > > > New Revision: 344272 > > > URL: https://svnweb.freebsd.org/changeset/base/344272 > > > > > > Log: > > > vmx(4): add native netmap support > > > > > > This change adds native netmap support for the vmx(4) adapter > > > (vmxnet3). Native support comes for free in 12, since the driver has > > been > > ^^^ > > This commit is to stable/11 > > > > Yes, this commit is meant for stable/11. Since in head vmx(4) has been > ported to iflib, netmap support form vmx(4) > is already available there through iflib. > In stable/11, on the other hand, vmx(4) is not using iflib, thus explicit > netmap support is needed (hence this commit). > > > > > > > ported to iflib. To make it minimally intrusive, the native support is > > > only enabled if vmxnet3.netmap_native is set at boot (e.g., in > > loader.conf). > > > > > > Tested on stable/11 running inside vmplayer. > > > > > > Submitted by: Giuseppe Lettieri > > > Reviewed by: vmaffione, bryanv > > > Sponsored by: Sunny Valley Networks > > > Differential Revision: https://reviews.freebsd.org/D19104 > > > > Huh? When did the vmx driver in stable/11 become iflib'ed? > > > > It didn't. The vmx driver has been ported to iflib in head. Ok, the wording of this commit message was very confusing, first it should of had a line: Direct commit to stable/11 as this code no longer exists in head. Second, It would of been much clearer to not even mention the iflib in head and stable/12. Your first line and the one following sentance with out any additional details other than the fact this is a direct commit would of been clearer. Log: vmx(4): add native netmap support This change adds native netmap support for the vmx(4) adapter (vmxnet3). This is a direct commit to stable/11, this code does not exist in ^/head due to iflib converstion of vmx(4). > > Cheers, > Vincenzo > > > > > > > > > > Added: > > > stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h (contents, props > > changed) > > > Modified: > > > stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > > > > Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > > > ============================================================================== > > > --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 03:46:32 2019 > > (r344271) > > > +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 10:07:48 2019 > > (r344272) > > > @@ -239,6 +239,10 @@ typedef enum { > > > > > > static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); > > > > > > +#ifdef DEV_NETMAP > > > +#include "vmx_netmap.h" > > > +#endif > > > + > > > /* Tunables. */ > > > static int vmxnet3_mq_disable = 0; > > > TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); > > > @@ -270,6 +274,9 @@ DRIVER_MODULE(vmx, pci, vmxnet3_driver, > > vmxnet3_devcla > > > > > > MODULE_DEPEND(vmx, pci, 1, 1, 1); > > > MODULE_DEPEND(vmx, ether, 1, 1, 1); > > > +#ifdef DEV_NETMAP > > > +MODULE_DEPEND(vmx, netmap, 1, 1, 1); > > > +#endif > > > > > > #define VMXNET3_VMWARE_VENDOR_ID 0x15AD > > > #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 > > > @@ -347,6 +354,10 @@ vmxnet3_attach(device_t dev) > > > vmxnet3_start_taskqueue(sc); > > > #endif > > > > > > +#ifdef DEV_NETMAP > > > + vmxnet3_netmap_attach(sc); > > > +#endif > > > + > > > fail: > > > if (error) > > > vmxnet3_detach(dev); > > > @@ -390,6 +401,10 @@ vmxnet3_detach(device_t dev) > > > #endif > > > vmxnet3_free_interrupts(sc); > > > > > > +#ifdef DEV_NETMAP > > > + netmap_detach(ifp); > > > +#endif > > > + > > > if (ifp != NULL) { > > > if_free(ifp); > > > sc->vmx_ifp = NULL; > > > @@ -1846,6 +1861,11 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *txq) > > > txr = &txq->vxtxq_cmd_ring; > > > txc = &txq->vxtxq_comp_ring; > > > > > > +#ifdef DEV_NETMAP > > > + if (netmap_tx_irq(sc->vmx_ifp, txq - sc->vmx_txq) != NM_IRQ_PASS) > > > + return; > > > +#endif > > > + > > > VMXNET3_TXQ_LOCK_ASSERT(txq); > > > > > > for (;;) { > > > @@ -2111,6 +2131,15 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) > > > ifp = sc->vmx_ifp; > > > rxc = &rxq->vxrxq_comp_ring; > > > > > > +#ifdef DEV_NETMAP > > > + { > > > + int dummy; > > > + if (netmap_rx_irq(ifp, rxq - sc->vmx_rxq, &dummy) != > > > + NM_IRQ_PASS) > > > + return; > > > + } > > > +#endif > > > + > > > VMXNET3_RXQ_LOCK_ASSERT(rxq); > > > > > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > > @@ -2401,6 +2430,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_softc *sc) > > > struct vmxnet3_txqueue *txq; > > > int i; > > > > > > +#ifdef DEV_NETMAP > > > + netmap_disable_all_rings(sc->vmx_ifp); > > > +#endif > > > + > > > for (i = 0; i < sc->vmx_nrxqueues; i++) { > > > rxq = &sc->vmx_rxq[i]; > > > VMXNET3_RXQ_LOCK(rxq); > > > @@ -2454,6 +2487,10 @@ vmxnet3_txinit(struct vmxnet3_softc *sc, struct > > vmxnet > > > bzero(txr->vxtxr_txd, > > > txr->vxtxr_ndesc * sizeof(struct vmxnet3_txdesc)); > > > > > > +#ifdef DEV_NETMAP > > > + vmxnet3_netmap_txq_init(sc, txq); > > > +#endif > > > + > > > txc = &txq->vxtxq_comp_ring; > > > txc->vxcr_next = 0; > > > txc->vxcr_gen = VMXNET3_INIT_GEN; > > > @@ -2468,6 +2505,10 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct > > vmxnet > > > struct vmxnet3_rxring *rxr; > > > struct vmxnet3_comp_ring *rxc; > > > int i, populate, idx, frame_size, error; > > > +#ifdef DEV_NETMAP > > > + struct netmap_adapter *na; > > > + struct netmap_slot *slot; > > > +#endif > > > > > > ifp = sc->vmx_ifp; > > > frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) + > > > @@ -2498,12 +2539,24 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct > > vmxnet > > > else > > > populate = VMXNET3_RXRINGS_PERQ; > > > > > > +#ifdef DEV_NETMAP > > > + na = NA(ifp); > > > + slot = netmap_reset(na, NR_RX, rxq - sc->vmx_rxq, 0); > > > +#endif > > > + > > > for (i = 0; i < populate; i++) { > > > rxr = &rxq->vxrxq_cmd_ring[i]; > > > rxr->vxrxr_fill = 0; > > > rxr->vxrxr_gen = VMXNET3_INIT_GEN; > > > bzero(rxr->vxrxr_rxd, > > > rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); > > > +#ifdef DEV_NETMAP > > > + if (slot != NULL) { > > > + vmxnet3_netmap_rxq_init(sc, rxq, rxr, slot); > > > + i = populate; > > > + break; > > > + } > > > +#endif > > > > > > for (idx = 0; idx < rxr->vxrxr_ndesc; idx++) { > > > error = vmxnet3_newbuf(sc, rxr); > > > @@ -2625,6 +2678,10 @@ vmxnet3_init_locked(struct vmxnet3_softc *sc) > > > > > > ifp->if_drv_flags |= IFF_DRV_RUNNING; > > > vmxnet3_link_status(sc); > > > + > > > +#ifdef DEV_NETMAP > > > + netmap_enable_all_rings(ifp); > > > +#endif > > > > > > vmxnet3_enable_all_intrs(sc); > > > callout_reset(&sc->vmx_tick, hz, vmxnet3_tick, sc); > > > > > > Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h > > > > > ============================================================================== > > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > +++ stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h Tue Feb 19 > > 10:07:48 2019 (r344272) > > > @@ -0,0 +1,376 @@ > > > +/* > > > + * Copyright (C) 2019 Universita` di Pisa. > > > + * Sponsored by Sunny Valley Networks. > > > + * > > > + * 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. > > > + */ > > > + > > > +/* $FreeBSD$ */ > > > + > > > +#include > > > +#include > > > + > > > +static int > > > +vmxnet3_netmap_reg(struct netmap_adapter *na, int onoff) > > > +{ > > > + struct ifnet *ifp = na->ifp; > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > + > > > + VMXNET3_CORE_LOCK(sc); > > > + vmxnet3_stop(sc); > > > + if (onoff) { > > > + nm_set_native_flags(na); > > > + } else { > > > + nm_clear_native_flags(na); > > > + } > > > + vmxnet3_init_locked(sc); > > > + VMXNET3_CORE_UNLOCK(sc); > > > + return 0; > > > +} > > > + > > > +static void > > > +vmxnet3_netmap_rxq_init(struct vmxnet3_softc *sc, struct > > vmxnet3_rxqueue *rxq, > > > + struct vmxnet3_rxring *rxr, struct netmap_slot *slot) > > > +{ > > > + struct ifnet *ifp = sc->vmx_ifp; > > > + struct netmap_adapter *na = NA(ifp); > > > + struct vmxnet3_rxdesc *rxd; > > > + int q, i; > > > + > > > + q = rxq - sc->vmx_rxq; > > > + > > > + for (i = 0; ; i++) { > > > + int idx = rxr->vxrxr_fill; > > > + int si = netmap_idx_n2k(na->rx_rings[q], idx); > > > + struct vmxnet3_rxbuf *rxb = &rxr->vxrxr_rxbuf[idx]; > > > + uint64_t paddr; > > > + void *addr; > > > + > > > + addr = PNMB(na, slot + si, &paddr); > > > + netmap_load_map(na, rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > > addr); > > > + > > > + rxd = &rxr->vxrxr_rxd[idx]; > > > + rxd->addr = paddr; > > > + rxd->len = NETMAP_BUF_SIZE(na); > > > + rxd->gen = rxr->vxrxr_gen ^ 1; > > > + rxd->btype = VMXNET3_BTYPE_HEAD; > > > + nm_prdis("%d: addr %lx len %u btype %u gen %u", > > > + idx, rxd->addr, rxd->len, rxd->btype, rxd->gen); > > > + > > > + if (i == rxr->vxrxr_ndesc -1) > > > + break; > > > + > > > + rxd->gen ^= 1; > > > + vmxnet3_rxr_increment_fill(rxr); > > > + } > > > +} > > > + > > > +static void > > > +vmxnet3_netmap_txq_init(struct vmxnet3_softc *sc, struct > > vmxnet3_txqueue *txq) > > > +{ > > > + struct ifnet *ifp = sc->vmx_ifp; > > > + struct netmap_adapter *na; > > > + struct netmap_slot *slot; > > > + struct vmxnet3_txring *txr; > > > + int i, gen, q; > > > + > > > + q = txq - sc->vmx_txq; > > > + > > > + na = NA(ifp); > > > + > > > + slot = netmap_reset(na, NR_TX, q, 0); > > > + if (slot == NULL) > > > + return; > > > + > > > + txr = &txq->vxtxq_cmd_ring; > > > + gen = txr->vxtxr_gen ^ 1; > > > + > > > + for (i = 0; i < txr->vxtxr_ndesc; i++) { > > > + int si = netmap_idx_n2k(na->tx_rings[q], i); > > > + struct vmxnet3_txdesc *txd = &txr->vxtxr_txd[i]; > > > + uint64_t paddr; > > > + void *addr; > > > + > > > + addr = PNMB(na, slot + si, &paddr); > > > + > > > + txd->addr = paddr; > > > + txd->len = 0; > > > + txd->gen = gen; > > > + txd->dtype = 0; > > > + txd->offload_mode = VMXNET3_OM_NONE; > > > + txd->offload_pos = 0; > > > + txd->hlen = 0; > > > + txd->eop = 0; > > > + txd->compreq = 0; > > > + txd->vtag_mode = 0; > > > + txd->vtag = 0; > > > + > > > + netmap_load_map(na, txr->vxtxr_txtag, > > > + txr->vxtxr_txbuf[i].vtxb_dmamap, addr); > > > + } > > > +} > > > + > > > +static int > > > +vmxnet3_netmap_txsync(struct netmap_kring *kring, int flags) > > > +{ > > > + struct netmap_adapter *na = kring->na; > > > + struct ifnet *ifp = na->ifp; > > > + struct netmap_ring *ring = kring->ring; > > > + u_int nm_i; > > > + u_int nic_i; > > > + u_int n; > > > + u_int const lim = kring->nkr_num_slots - 1; > > > + u_int const head = kring->rhead; > > > + > > > + /* > > > + * interrupts on every tx packet are expensive so request > > > + * them every half ring, or where NS_REPORT is set > > > + */ > > > + u_int report_frequency = kring->nkr_num_slots >> 1; > > > + /* device specific */ > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > + struct vmxnet3_txqueue *txq = &sc->vmx_txq[kring->ring_id]; > > > + struct vmxnet3_txring *txr = &txq->vxtxq_cmd_ring; > > > + struct vmxnet3_comp_ring *txc = &txq->vxtxq_comp_ring; > > > + struct vmxnet3_txcompdesc *txcd = txc->vxcr_u.txcd; > > > + int gen = txr->vxtxr_gen; > > > + > > > + /* no need to dma-sync the ring; memory barriers are sufficient */ > > > + > > > + nm_i = kring->nr_hwcur; > > > + if (nm_i != head) { > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > + for (n = 0; nm_i != head; n++) { > > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > > + u_int len = slot->len; > > > + uint64_t paddr; > > > + void *addr = PNMB(na, slot, &paddr); > > > + int compreq = !!(slot->flags & NS_REPORT || > > > + nic_i == 0 || nic_i == report_frequency); > > > + > > > + /* device specific */ > > > + struct vmxnet3_txdesc *curr = > > &txr->vxtxr_txd[nic_i]; > > > + struct vmxnet3_txbuf *txbuf = > > &txr->vxtxr_txbuf[nic_i]; > > > + > > > + NM_CHECK_ADDR_LEN(na, addr, len); > > > + > > > + /* fill the slot in the NIC ring */ > > > + curr->len = len; > > > + curr->eop = 1; /* NS_MOREFRAG not supported */ > > > + curr->compreq = compreq; > > > + > > > + if (slot->flags & NS_BUF_CHANGED) { > > > + curr->addr = paddr; > > > + netmap_reload_map(na, txr->vxtxr_txtag, > > > + txbuf->vtxb_dmamap, addr); > > > + } > > > + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); > > > + > > > + /* make sure changes to the buffer are synced */ > > > + bus_dmamap_sync(txr->vxtxr_txtag, > > txbuf->vtxb_dmamap, > > > + BUS_DMASYNC_PREWRITE); > > > + > > > + /* pass ownership */ > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > > > + curr->gen = gen; > > > + > > > + nm_i = nm_next(nm_i, lim); > > > + nic_i++; > > > + if (unlikely(nic_i == lim + 1)) { > > > + nic_i = 0; > > > + gen = txr->vxtxr_gen ^= 1; > > > + } > > > + } > > > + > > > + vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), > > nic_i); > > > + } > > > + kring->nr_hwcur = nm_i; > > > + > > > + /* reclaim completed packets */ > > > + for (;;) { > > > + u_int sop; > > > + struct vmxnet3_txbuf *txb; > > > + > > > + txcd = &txc->vxcr_u.txcd[txc->vxcr_next]; > > > + if (txcd->gen != txc->vxcr_gen) > > > + break; > > > + > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > > + > > > + if (++txc->vxcr_next == txc->vxcr_ndesc) { > > > + txc->vxcr_next = 0; > > > + txc->vxcr_gen ^= 1; > > > + } > > > + > > > + sop = txr->vxtxr_next; > > > + txb = &txr->vxtxr_txbuf[sop]; > > > + > > > + bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, > > > + BUS_DMASYNC_POSTWRITE); > > > + > > > + txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; > > > + } > > > + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, txr->vxtxr_next), > > lim); > > > + > > > + return 0; > > > +} > > > + > > > +static int > > > +vmxnet3_netmap_rxsync(struct netmap_kring *kring, int flags) > > > +{ > > > + struct netmap_adapter *na = kring->na; > > > + struct netmap_ring *ring = kring->ring; > > > + u_int nm_i; > > > + u_int nic_i; > > > + u_int const lim = kring->nkr_num_slots - 1; > > > + u_int const head = kring->rhead; > > > + int force_update = (flags & NAF_FORCE_READ); > > > + > > > + struct ifnet *ifp = na->ifp; > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > + struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[kring->ring_id]; > > > + struct vmxnet3_rxring *rxr; > > > + struct vmxnet3_comp_ring *rxc; > > > + > > > + if (head > lim) > > > + return netmap_ring_reinit(kring); > > > + > > > + rxr = &rxq->vxrxq_cmd_ring[0]; > > > + > > > + /* no need to dma-sync the ring; memory barriers are sufficient */ > > > + > > > + /* first part: import newly received packets */ > > > + if (netmap_no_pendintr || force_update) { > > > + rxc = &rxq->vxrxq_comp_ring; > > > + nm_i = kring->nr_hwtail; > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > + for (;;) { > > > + struct vmxnet3_rxcompdesc *rxcd; > > > + struct vmxnet3_rxbuf *rxb; > > > + > > > + rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; > > > + > > > + if (rxcd->gen != rxc->vxcr_gen) > > > + break; > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > > + > > > + while (__predict_false(rxcd->rxd_idx != nic_i)) { > > > + nm_prlim(1, "%u skipped! idx %u", nic_i, > > rxcd->rxd_idx); > > > + /* to shelter the application from this we > > > + * would need to rotate the kernel-owned > > > + * portion of the netmap and nic rings. We > > > + * return len=0 for now and hope for the > > best. > > > + */ > > > + ring->slot[nm_i].len = 0; > > > + nic_i = nm_next(nm_i, lim); > > > + nm_i = nm_next(nm_i, lim); > > > + } > > > + > > > + rxb = &rxr->vxrxr_rxbuf[nic_i]; > > > + > > > + ring->slot[nm_i].len = rxcd->len; > > > + ring->slot[nm_i].flags = 0; > > > + > > > + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > > > + BUS_DMASYNC_POSTREAD); > > > + > > > + nic_i = nm_next(nm_i, lim); > > > + nm_i = nm_next(nm_i, lim); > > > + > > > + rxc->vxcr_next++; > > > + if (__predict_false(rxc->vxcr_next == > > rxc->vxcr_ndesc)) { > > > + rxc->vxcr_next = 0; > > > + rxc->vxcr_gen ^= 1; > > > + } > > > + } > > > + kring->nr_hwtail = nm_i; > > > + } > > > + /* second part: skip past packets that userspace has released */ > > > + nm_i = kring->nr_hwcur; > > > + if (nm_i != head) { > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > + while (nm_i != head) { > > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > > + struct vmxnet3_rxdesc *rxd_fill; > > > + struct vmxnet3_rxbuf *rxbuf; > > > + > > > + if (slot->flags & NS_BUF_CHANGED) { > > > + uint64_t paddr; > > > + void *addr = PNMB(na, slot, &paddr); > > > + struct vmxnet3_rxdesc *rxd = > > &rxr->vxrxr_rxd[nic_i]; > > > + > > > + > > > + if (addr == NETMAP_BUF_BASE(na)) > > > + return netmap_ring_reinit(kring); > > > + > > > + rxd->addr = paddr; > > > + rxbuf = &rxr->vxrxr_rxbuf[nic_i]; > > > + netmap_reload_map(na, rxr->vxrxr_rxtag, > > > + rxbuf->vrxb_dmamap, addr); > > > + slot->flags &= ~NS_BUF_CHANGED; > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > > > + } > > > + > > > + rxd_fill = &rxr->vxrxr_rxd[rxr->vxrxr_fill]; > > > + rxbuf = &rxr->vxrxr_rxbuf[rxr->vxrxr_fill]; > > > + > > > + bus_dmamap_sync(rxr->vxrxr_rxtag, > > rxbuf->vrxb_dmamap, > > > + BUS_DMASYNC_PREREAD); > > > + > > > + rxd_fill->gen = rxr->vxrxr_gen; > > > + vmxnet3_rxr_increment_fill(rxr); > > > + > > > + nm_i = nm_next(nm_i, lim); > > > + nic_i = nm_next(nic_i, lim); > > > + } > > > + kring->nr_hwcur = head; > > > + if (__predict_false(rxq->vxrxq_rs->update_rxhead)) { > > > + vmxnet3_write_bar0(sc, > > > + VMXNET3_BAR0_RXH1(kring->ring_id), > > rxr->vxrxr_fill); > > > + } > > > + } > > > + return 0; > > > +} > > > + > > > +static void > > > +vmxnet3_netmap_attach(struct vmxnet3_softc *sc) > > > +{ > > > + struct netmap_adapter na; > > > + int enable = 0; > > > + > > > + if (getenv_int("vmxnet3.netmap_native", &enable) < 0 || !enable) { > > > + return; > > > + } > > > + > > > + bzero(&na, sizeof(na)); > > > + > > > + na.ifp = sc->vmx_ifp; > > > + na.na_flags = NAF_BDG_MAYSLEEP; > > > + na.num_tx_desc = sc->vmx_ntxdescs; > > > + na.num_rx_desc = sc->vmx_nrxdescs; > > > + na.num_tx_rings = sc->vmx_ntxqueues; > > > + na.num_rx_rings = sc->vmx_nrxqueues; > > > + na.nm_register = vmxnet3_netmap_reg; > > > + na.nm_txsync = vmxnet3_netmap_txsync; > > > + na.nm_rxsync = vmxnet3_netmap_rxsync; > > > + netmap_attach(&na); > > > +} > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > > -- > Vincenzo -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Feb 19 14:49: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 2E0B214F2C2E; Tue, 19 Feb 2019 14:49:46 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27C989F63; Tue, 19 Feb 2019 14:49:45 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-qk1-x743.google.com with SMTP id a15so12192655qkc.1; Tue, 19 Feb 2019 06:49:45 -0800 (PST) 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=VT8EqFX07PERfpLNJpIUIKzFwSP5cV0a5gkJUvrUFYg=; b=BOVE4mebe9ADLHliCNAdlug3mVeW5f3gtPRI3d1i+jsmrE6HAf1lZoN1UPXwTt+d6B sZcD551wlFECMSX6J0AM/MYa8L9WqEGMbkHWiYzVj3uWk/5mFZYt8Y8cCLW5t2bXujvJ La6cZsTDWCmwlKoT+mYoaQwZ7VPoYp/WxAgznco/ltNaUVPi+nevvugjo4nphjfDunZf 0FN73AOgNS4s//k6pKsVGDsNDMLBkhWinCIkCzJxNoqAeJvhnyu9tniYhuWND2Km2KNf Ta7W6LITLGZKzXDoIQj5Udg6TDtPQseTNMhC0veCBHHgE90/1DLuq6+o02jD7jF9CbrD f5vg== 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=VT8EqFX07PERfpLNJpIUIKzFwSP5cV0a5gkJUvrUFYg=; b=txYx0QBH4LuGfsLGe45W/J+8OYGe40YIWTjpCoXFG3wNC1AiB0+fd1ASuVwQKDpdwU 0GwU5WzZP5CEgG/9Fh6eyYGm7RrzuIWf/uLXypMaP3eXv/oRG7fG5ROB2bkq7z5k0sat TOXwSGg+EGg7vK6oSxnmZXYbAs6+cSh+JfhpkgWLnvFsxog/JTwWhf9fTWgr8lsmUpgO WVpi5viKMbrBj3jTy3TWBoMJqOB/nWEJv0CUINDLqA7x6Sog7w/qDyCCpCnzPkOWLnJp /BvbjXM0lUKAZde9SugYrtgrfClyHOzTIwHrETmBHLGH/d8W1HROPk31flIKkl9pQedn eK/g== X-Gm-Message-State: AHQUAuZLNwu5sCjuWVYGUGUOJb7iOMAgRiJ6gqWhzwylecTk0Bg10nAi rCrRf2PLQxBFYzeBqdF3/8wfboLb+oLrgAmw5e1l7btJ X-Google-Smtp-Source: AHgI3IZKZjBt50D6zqKCf2mlToPINkyH3A6AuALEY+o77qsEVktIZUeZyVgM93j6QoXgvgznOca2NDpVBX2etnA9kX4= X-Received: by 2002:a37:7d82:: with SMTP id y124mr7208466qkc.127.1550587784628; Tue, 19 Feb 2019 06:49:44 -0800 (PST) MIME-Version: 1.0 References: <201902191447.x1JElBXa010843@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902191447.x1JElBXa010843@pdx.rh.CN85.dnsmgr.net> From: Vincenzo Maffione Date: Tue, 19 Feb 2019 15:49:32 +0100 Message-ID: Subject: Re: svn commit: r344272 - stable/11/sys/dev/vmware/vmxnet3 To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Rspamd-Queue-Id: A27C989F63 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.84 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.84)[-0.841,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] 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, 19 Feb 2019 14:49:46 -0000 Il giorno mar 19 feb 2019 alle ore 15:47 Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> ha scritto: > > Hi Rodney, > > > > > > Il giorno mar 19 feb 2019 alle ore 15:36 Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> ha scritto: > > > > > > Author: vmaffione > > > > Date: Tue Feb 19 10:07:48 2019 > > > > New Revision: 344272 > > > > URL: https://svnweb.freebsd.org/changeset/base/344272 > > > > > > > > Log: > > > > vmx(4): add native netmap support > > > > > > > > This change adds native netmap support for the vmx(4) adapter > > > > (vmxnet3). Native support comes for free in 12, since the driver > has > > > been > > > ^^^ > > > This commit is to stable/11 > > > > > > > Yes, this commit is meant for stable/11. Since in head vmx(4) has been > > ported to iflib, netmap support form vmx(4) > > is already available there through iflib. > > In stable/11, on the other hand, vmx(4) is not using iflib, thus explicit > > netmap support is needed (hence this commit). > > > > > > > > > > > ported to iflib. To make it minimally intrusive, the native > support is > > > > only enabled if vmxnet3.netmap_native is set at boot (e.g., in > > > loader.conf). > > > > > > > > Tested on stable/11 running inside vmplayer. > > > > > > > > Submitted by: Giuseppe Lettieri > > > > Reviewed by: vmaffione, bryanv > > > > Sponsored by: Sunny Valley Networks > > > > Differential Revision: https://reviews.freebsd.org/D19104 > > > > > > Huh? When did the vmx driver in stable/11 become iflib'ed? > > > > > > > It didn't. The vmx driver has been ported to iflib in head. > > Ok, the wording of this commit message was very confusing, > first it should of had a line: > Direct commit to stable/11 as this code no longer exists in head. > Sorry, I did not know about this. > > Second, > It would of been much clearer to not even mention the iflib > in head and stable/12. > > Your first line and the one following sentance with out > any additional details other than the fact this is a direct > commit would of been clearer. > > Log: > vmx(4): add native netmap support > > This change adds native netmap support for the vmx(4) > adapter > (vmxnet3). > > This is a direct commit to stable/11, > this code does not exist in ^/head due to iflib > converstion of vmx(4). > > Sounds reasonable, thanks for the feedback! Cheers, Vincenzo > > > > Cheers, > > Vincenzo > > > > > > > > > > > > > > > Added: > > > > stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h (contents, props > > > changed) > > > > Modified: > > > > stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > > > > > > Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c > > > > > > > > ============================================================================== > > > > --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 03:46:32 > 2019 > > > (r344271) > > > > +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Tue Feb 19 10:07:48 > 2019 > > > (r344272) > > > > @@ -239,6 +239,10 @@ typedef enum { > > > > > > > > static void vmxnet3_barrier(struct vmxnet3_softc *, > vmxnet3_barrier_t); > > > > > > > > +#ifdef DEV_NETMAP > > > > +#include "vmx_netmap.h" > > > > +#endif > > > > + > > > > /* Tunables. */ > > > > static int vmxnet3_mq_disable = 0; > > > > TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); > > > > @@ -270,6 +274,9 @@ DRIVER_MODULE(vmx, pci, vmxnet3_driver, > > > vmxnet3_devcla > > > > > > > > MODULE_DEPEND(vmx, pci, 1, 1, 1); > > > > MODULE_DEPEND(vmx, ether, 1, 1, 1); > > > > +#ifdef DEV_NETMAP > > > > +MODULE_DEPEND(vmx, netmap, 1, 1, 1); > > > > +#endif > > > > > > > > #define VMXNET3_VMWARE_VENDOR_ID 0x15AD > > > > #define VMXNET3_VMWARE_DEVICE_ID 0x07B0 > > > > @@ -347,6 +354,10 @@ vmxnet3_attach(device_t dev) > > > > vmxnet3_start_taskqueue(sc); > > > > #endif > > > > > > > > +#ifdef DEV_NETMAP > > > > + vmxnet3_netmap_attach(sc); > > > > +#endif > > > > + > > > > fail: > > > > if (error) > > > > vmxnet3_detach(dev); > > > > @@ -390,6 +401,10 @@ vmxnet3_detach(device_t dev) > > > > #endif > > > > vmxnet3_free_interrupts(sc); > > > > > > > > +#ifdef DEV_NETMAP > > > > + netmap_detach(ifp); > > > > +#endif > > > > + > > > > if (ifp != NULL) { > > > > if_free(ifp); > > > > sc->vmx_ifp = NULL; > > > > @@ -1846,6 +1861,11 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue *txq) > > > > txr = &txq->vxtxq_cmd_ring; > > > > txc = &txq->vxtxq_comp_ring; > > > > > > > > +#ifdef DEV_NETMAP > > > > + if (netmap_tx_irq(sc->vmx_ifp, txq - sc->vmx_txq) != > NM_IRQ_PASS) > > > > + return; > > > > +#endif > > > > + > > > > VMXNET3_TXQ_LOCK_ASSERT(txq); > > > > > > > > for (;;) { > > > > @@ -2111,6 +2131,15 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) > > > > ifp = sc->vmx_ifp; > > > > rxc = &rxq->vxrxq_comp_ring; > > > > > > > > +#ifdef DEV_NETMAP > > > > + { > > > > + int dummy; > > > > + if (netmap_rx_irq(ifp, rxq - sc->vmx_rxq, &dummy) != > > > > + NM_IRQ_PASS) > > > > + return; > > > > + } > > > > +#endif > > > > + > > > > VMXNET3_RXQ_LOCK_ASSERT(rxq); > > > > > > > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > > > @@ -2401,6 +2430,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_softc > *sc) > > > > struct vmxnet3_txqueue *txq; > > > > int i; > > > > > > > > +#ifdef DEV_NETMAP > > > > + netmap_disable_all_rings(sc->vmx_ifp); > > > > +#endif > > > > + > > > > for (i = 0; i < sc->vmx_nrxqueues; i++) { > > > > rxq = &sc->vmx_rxq[i]; > > > > VMXNET3_RXQ_LOCK(rxq); > > > > @@ -2454,6 +2487,10 @@ vmxnet3_txinit(struct vmxnet3_softc *sc, > struct > > > vmxnet > > > > bzero(txr->vxtxr_txd, > > > > txr->vxtxr_ndesc * sizeof(struct vmxnet3_txdesc)); > > > > > > > > +#ifdef DEV_NETMAP > > > > + vmxnet3_netmap_txq_init(sc, txq); > > > > +#endif > > > > + > > > > txc = &txq->vxtxq_comp_ring; > > > > txc->vxcr_next = 0; > > > > txc->vxcr_gen = VMXNET3_INIT_GEN; > > > > @@ -2468,6 +2505,10 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, > struct > > > vmxnet > > > > struct vmxnet3_rxring *rxr; > > > > struct vmxnet3_comp_ring *rxc; > > > > int i, populate, idx, frame_size, error; > > > > +#ifdef DEV_NETMAP > > > > + struct netmap_adapter *na; > > > > + struct netmap_slot *slot; > > > > +#endif > > > > > > > > ifp = sc->vmx_ifp; > > > > frame_size = ETHER_ALIGN + sizeof(struct ether_vlan_header) + > > > > @@ -2498,12 +2539,24 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, > struct > > > vmxnet > > > > else > > > > populate = VMXNET3_RXRINGS_PERQ; > > > > > > > > +#ifdef DEV_NETMAP > > > > + na = NA(ifp); > > > > + slot = netmap_reset(na, NR_RX, rxq - sc->vmx_rxq, 0); > > > > +#endif > > > > + > > > > for (i = 0; i < populate; i++) { > > > > rxr = &rxq->vxrxq_cmd_ring[i]; > > > > rxr->vxrxr_fill = 0; > > > > rxr->vxrxr_gen = VMXNET3_INIT_GEN; > > > > bzero(rxr->vxrxr_rxd, > > > > rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); > > > > +#ifdef DEV_NETMAP > > > > + if (slot != NULL) { > > > > + vmxnet3_netmap_rxq_init(sc, rxq, rxr, slot); > > > > + i = populate; > > > > + break; > > > > + } > > > > +#endif > > > > > > > > for (idx = 0; idx < rxr->vxrxr_ndesc; idx++) { > > > > error = vmxnet3_newbuf(sc, rxr); > > > > @@ -2625,6 +2678,10 @@ vmxnet3_init_locked(struct vmxnet3_softc *sc) > > > > > > > > ifp->if_drv_flags |= IFF_DRV_RUNNING; > > > > vmxnet3_link_status(sc); > > > > + > > > > +#ifdef DEV_NETMAP > > > > + netmap_enable_all_rings(ifp); > > > > +#endif > > > > > > > > vmxnet3_enable_all_intrs(sc); > > > > callout_reset(&sc->vmx_tick, hz, vmxnet3_tick, sc); > > > > > > > > Added: stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h > > > > > > > > ============================================================================== > > > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > > +++ stable/11/sys/dev/vmware/vmxnet3/vmx_netmap.h Tue Feb 19 > > > 10:07:48 2019 (r344272) > > > > @@ -0,0 +1,376 @@ > > > > +/* > > > > + * Copyright (C) 2019 Universita` di Pisa. > > > > + * Sponsored by Sunny Valley Networks. > > > > + * > > > > + * 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. > > > > + */ > > > > + > > > > +/* $FreeBSD$ */ > > > > + > > > > +#include > > > > +#include > > > > + > > > > +static int > > > > +vmxnet3_netmap_reg(struct netmap_adapter *na, int onoff) > > > > +{ > > > > + struct ifnet *ifp = na->ifp; > > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > > + > > > > + VMXNET3_CORE_LOCK(sc); > > > > + vmxnet3_stop(sc); > > > > + if (onoff) { > > > > + nm_set_native_flags(na); > > > > + } else { > > > > + nm_clear_native_flags(na); > > > > + } > > > > + vmxnet3_init_locked(sc); > > > > + VMXNET3_CORE_UNLOCK(sc); > > > > + return 0; > > > > +} > > > > + > > > > +static void > > > > +vmxnet3_netmap_rxq_init(struct vmxnet3_softc *sc, struct > > > vmxnet3_rxqueue *rxq, > > > > + struct vmxnet3_rxring *rxr, struct netmap_slot *slot) > > > > +{ > > > > + struct ifnet *ifp = sc->vmx_ifp; > > > > + struct netmap_adapter *na = NA(ifp); > > > > + struct vmxnet3_rxdesc *rxd; > > > > + int q, i; > > > > + > > > > + q = rxq - sc->vmx_rxq; > > > > + > > > > + for (i = 0; ; i++) { > > > > + int idx = rxr->vxrxr_fill; > > > > + int si = netmap_idx_n2k(na->rx_rings[q], idx); > > > > + struct vmxnet3_rxbuf *rxb = &rxr->vxrxr_rxbuf[idx]; > > > > + uint64_t paddr; > > > > + void *addr; > > > > + > > > > + addr = PNMB(na, slot + si, &paddr); > > > > + netmap_load_map(na, rxr->vxrxr_rxtag, rxb->vrxb_dmamap, > > > addr); > > > > + > > > > + rxd = &rxr->vxrxr_rxd[idx]; > > > > + rxd->addr = paddr; > > > > + rxd->len = NETMAP_BUF_SIZE(na); > > > > + rxd->gen = rxr->vxrxr_gen ^ 1; > > > > + rxd->btype = VMXNET3_BTYPE_HEAD; > > > > + nm_prdis("%d: addr %lx len %u btype %u gen %u", > > > > + idx, rxd->addr, rxd->len, rxd->btype, > rxd->gen); > > > > + > > > > + if (i == rxr->vxrxr_ndesc -1) > > > > + break; > > > > + > > > > + rxd->gen ^= 1; > > > > + vmxnet3_rxr_increment_fill(rxr); > > > > + } > > > > +} > > > > + > > > > +static void > > > > +vmxnet3_netmap_txq_init(struct vmxnet3_softc *sc, struct > > > vmxnet3_txqueue *txq) > > > > +{ > > > > + struct ifnet *ifp = sc->vmx_ifp; > > > > + struct netmap_adapter *na; > > > > + struct netmap_slot *slot; > > > > + struct vmxnet3_txring *txr; > > > > + int i, gen, q; > > > > + > > > > + q = txq - sc->vmx_txq; > > > > + > > > > + na = NA(ifp); > > > > + > > > > + slot = netmap_reset(na, NR_TX, q, 0); > > > > + if (slot == NULL) > > > > + return; > > > > + > > > > + txr = &txq->vxtxq_cmd_ring; > > > > + gen = txr->vxtxr_gen ^ 1; > > > > + > > > > + for (i = 0; i < txr->vxtxr_ndesc; i++) { > > > > + int si = netmap_idx_n2k(na->tx_rings[q], i); > > > > + struct vmxnet3_txdesc *txd = &txr->vxtxr_txd[i]; > > > > + uint64_t paddr; > > > > + void *addr; > > > > + > > > > + addr = PNMB(na, slot + si, &paddr); > > > > + > > > > + txd->addr = paddr; > > > > + txd->len = 0; > > > > + txd->gen = gen; > > > > + txd->dtype = 0; > > > > + txd->offload_mode = VMXNET3_OM_NONE; > > > > + txd->offload_pos = 0; > > > > + txd->hlen = 0; > > > > + txd->eop = 0; > > > > + txd->compreq = 0; > > > > + txd->vtag_mode = 0; > > > > + txd->vtag = 0; > > > > + > > > > + netmap_load_map(na, txr->vxtxr_txtag, > > > > + txr->vxtxr_txbuf[i].vtxb_dmamap, addr); > > > > + } > > > > +} > > > > + > > > > +static int > > > > +vmxnet3_netmap_txsync(struct netmap_kring *kring, int flags) > > > > +{ > > > > + struct netmap_adapter *na = kring->na; > > > > + struct ifnet *ifp = na->ifp; > > > > + struct netmap_ring *ring = kring->ring; > > > > + u_int nm_i; > > > > + u_int nic_i; > > > > + u_int n; > > > > + u_int const lim = kring->nkr_num_slots - 1; > > > > + u_int const head = kring->rhead; > > > > + > > > > + /* > > > > + * interrupts on every tx packet are expensive so request > > > > + * them every half ring, or where NS_REPORT is set > > > > + */ > > > > + u_int report_frequency = kring->nkr_num_slots >> 1; > > > > + /* device specific */ > > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > > + struct vmxnet3_txqueue *txq = &sc->vmx_txq[kring->ring_id]; > > > > + struct vmxnet3_txring *txr = &txq->vxtxq_cmd_ring; > > > > + struct vmxnet3_comp_ring *txc = &txq->vxtxq_comp_ring; > > > > + struct vmxnet3_txcompdesc *txcd = txc->vxcr_u.txcd; > > > > + int gen = txr->vxtxr_gen; > > > > + > > > > + /* no need to dma-sync the ring; memory barriers are > sufficient */ > > > > + > > > > + nm_i = kring->nr_hwcur; > > > > + if (nm_i != head) { > > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > > + for (n = 0; nm_i != head; n++) { > > > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > > > + u_int len = slot->len; > > > > + uint64_t paddr; > > > > + void *addr = PNMB(na, slot, &paddr); > > > > + int compreq = !!(slot->flags & NS_REPORT || > > > > + nic_i == 0 || nic_i == > report_frequency); > > > > + > > > > + /* device specific */ > > > > + struct vmxnet3_txdesc *curr = > > > &txr->vxtxr_txd[nic_i]; > > > > + struct vmxnet3_txbuf *txbuf = > > > &txr->vxtxr_txbuf[nic_i]; > > > > + > > > > + NM_CHECK_ADDR_LEN(na, addr, len); > > > > + > > > > + /* fill the slot in the NIC ring */ > > > > + curr->len = len; > > > > + curr->eop = 1; /* NS_MOREFRAG not supported */ > > > > + curr->compreq = compreq; > > > > + > > > > + if (slot->flags & NS_BUF_CHANGED) { > > > > + curr->addr = paddr; > > > > + netmap_reload_map(na, txr->vxtxr_txtag, > > > > + txbuf->vtxb_dmamap, > addr); > > > > + } > > > > + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); > > > > + > > > > + /* make sure changes to the buffer are synced > */ > > > > + bus_dmamap_sync(txr->vxtxr_txtag, > > > txbuf->vtxb_dmamap, > > > > + BUS_DMASYNC_PREWRITE); > > > > + > > > > + /* pass ownership */ > > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); > > > > + curr->gen = gen; > > > > + > > > > + nm_i = nm_next(nm_i, lim); > > > > + nic_i++; > > > > + if (unlikely(nic_i == lim + 1)) { > > > > + nic_i = 0; > > > > + gen = txr->vxtxr_gen ^= 1; > > > > + } > > > > + } > > > > + > > > > + vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), > > > nic_i); > > > > + } > > > > + kring->nr_hwcur = nm_i; > > > > + > > > > + /* reclaim completed packets */ > > > > + for (;;) { > > > > + u_int sop; > > > > + struct vmxnet3_txbuf *txb; > > > > + > > > > + txcd = &txc->vxcr_u.txcd[txc->vxcr_next]; > > > > + if (txcd->gen != txc->vxcr_gen) > > > > + break; > > > > + > > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > > > + > > > > + if (++txc->vxcr_next == txc->vxcr_ndesc) { > > > > + txc->vxcr_next = 0; > > > > + txc->vxcr_gen ^= 1; > > > > + } > > > > + > > > > + sop = txr->vxtxr_next; > > > > + txb = &txr->vxtxr_txbuf[sop]; > > > > + > > > > + bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, > > > > + BUS_DMASYNC_POSTWRITE); > > > > + > > > > + txr->vxtxr_next = (txcd->eop_idx + 1) % > txr->vxtxr_ndesc; > > > > + } > > > > + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, > txr->vxtxr_next), > > > lim); > > > > + > > > > + return 0; > > > > +} > > > > + > > > > +static int > > > > +vmxnet3_netmap_rxsync(struct netmap_kring *kring, int flags) > > > > +{ > > > > + struct netmap_adapter *na = kring->na; > > > > + struct netmap_ring *ring = kring->ring; > > > > + u_int nm_i; > > > > + u_int nic_i; > > > > + u_int const lim = kring->nkr_num_slots - 1; > > > > + u_int const head = kring->rhead; > > > > + int force_update = (flags & NAF_FORCE_READ); > > > > + > > > > + struct ifnet *ifp = na->ifp; > > > > + struct vmxnet3_softc *sc = ifp->if_softc; > > > > + struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[kring->ring_id]; > > > > + struct vmxnet3_rxring *rxr; > > > > + struct vmxnet3_comp_ring *rxc; > > > > + > > > > + if (head > lim) > > > > + return netmap_ring_reinit(kring); > > > > + > > > > + rxr = &rxq->vxrxq_cmd_ring[0]; > > > > + > > > > + /* no need to dma-sync the ring; memory barriers are > sufficient */ > > > > + > > > > + /* first part: import newly received packets */ > > > > + if (netmap_no_pendintr || force_update) { > > > > + rxc = &rxq->vxrxq_comp_ring; > > > > + nm_i = kring->nr_hwtail; > > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > > + for (;;) { > > > > + struct vmxnet3_rxcompdesc *rxcd; > > > > + struct vmxnet3_rxbuf *rxb; > > > > + > > > > + rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; > > > > + > > > > + if (rxcd->gen != rxc->vxcr_gen) > > > > + break; > > > > + vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); > > > > + > > > > + while (__predict_false(rxcd->rxd_idx != > nic_i)) { > > > > + nm_prlim(1, "%u skipped! idx %u", > nic_i, > > > rxcd->rxd_idx); > > > > + /* to shelter the application from > this we > > > > + * would need to rotate the > kernel-owned > > > > + * portion of the netmap and nic > rings. We > > > > + * return len=0 for now and hope for > the > > > best. > > > > + */ > > > > + ring->slot[nm_i].len = 0; > > > > + nic_i = nm_next(nm_i, lim); > > > > + nm_i = nm_next(nm_i, lim); > > > > + } > > > > + > > > > + rxb = &rxr->vxrxr_rxbuf[nic_i]; > > > > + > > > > + ring->slot[nm_i].len = rxcd->len; > > > > + ring->slot[nm_i].flags = 0; > > > > + > > > > + bus_dmamap_sync(rxr->vxrxr_rxtag, > rxb->vrxb_dmamap, > > > > + BUS_DMASYNC_POSTREAD); > > > > + > > > > + nic_i = nm_next(nm_i, lim); > > > > + nm_i = nm_next(nm_i, lim); > > > > + > > > > + rxc->vxcr_next++; > > > > + if (__predict_false(rxc->vxcr_next == > > > rxc->vxcr_ndesc)) { > > > > + rxc->vxcr_next = 0; > > > > + rxc->vxcr_gen ^= 1; > > > > + } > > > > + } > > > > + kring->nr_hwtail = nm_i; > > > > + } > > > > + /* second part: skip past packets that userspace has released > */ > > > > + nm_i = kring->nr_hwcur; > > > > + if (nm_i != head) { > > > > + nic_i = netmap_idx_k2n(kring, nm_i); > > > > + while (nm_i != head) { > > > > + struct netmap_slot *slot = &ring->slot[nm_i]; > > > > + struct vmxnet3_rxdesc *rxd_fill; > > > > + struct vmxnet3_rxbuf *rxbuf; > > > > + > > > > + if (slot->flags & NS_BUF_CHANGED) { > > > > + uint64_t paddr; > > > > + void *addr = PNMB(na, slot, &paddr); > > > > + struct vmxnet3_rxdesc *rxd = > > > &rxr->vxrxr_rxd[nic_i]; > > > > + > > > > + > > > > + if (addr == NETMAP_BUF_BASE(na)) > > > > + return > netmap_ring_reinit(kring); > > > > + > > > > + rxd->addr = paddr; > > > > + rxbuf = &rxr->vxrxr_rxbuf[nic_i]; > > > > + netmap_reload_map(na, rxr->vxrxr_rxtag, > > > > + rxbuf->vrxb_dmamap, > addr); > > > > + slot->flags &= ~NS_BUF_CHANGED; > > > > + vmxnet3_barrier(sc, > VMXNET3_BARRIER_WR); > > > > + } > > > > + > > > > + rxd_fill = &rxr->vxrxr_rxd[rxr->vxrxr_fill]; > > > > + rxbuf = &rxr->vxrxr_rxbuf[rxr->vxrxr_fill]; > > > > + > > > > + bus_dmamap_sync(rxr->vxrxr_rxtag, > > > rxbuf->vrxb_dmamap, > > > > + BUS_DMASYNC_PREREAD); > > > > + > > > > + rxd_fill->gen = rxr->vxrxr_gen; > > > > + vmxnet3_rxr_increment_fill(rxr); > > > > + > > > > + nm_i = nm_next(nm_i, lim); > > > > + nic_i = nm_next(nic_i, lim); > > > > + } > > > > + kring->nr_hwcur = head; > > > > + if (__predict_false(rxq->vxrxq_rs->update_rxhead)) { > > > > + vmxnet3_write_bar0(sc, > > > > + VMXNET3_BAR0_RXH1(kring->ring_id), > > > rxr->vxrxr_fill); > > > > + } > > > > + } > > > > + return 0; > > > > +} > > > > + > > > > +static void > > > > +vmxnet3_netmap_attach(struct vmxnet3_softc *sc) > > > > +{ > > > > + struct netmap_adapter na; > > > > + int enable = 0; > > > > + > > > > + if (getenv_int("vmxnet3.netmap_native", &enable) < 0 || > !enable) { > > > > + return; > > > > + } > > > > + > > > > + bzero(&na, sizeof(na)); > > > > + > > > > + na.ifp = sc->vmx_ifp; > > > > + na.na_flags = NAF_BDG_MAYSLEEP; > > > > + na.num_tx_desc = sc->vmx_ntxdescs; > > > > + na.num_rx_desc = sc->vmx_nrxdescs; > > > > + na.num_tx_rings = sc->vmx_ntxqueues; > > > > + na.num_rx_rings = sc->vmx_nrxqueues; > > > > + na.nm_register = vmxnet3_netmap_reg; > > > > + na.nm_txsync = vmxnet3_netmap_txsync; > > > > + na.nm_rxsync = vmxnet3_netmap_rxsync; > > > > + netmap_attach(&na); > > > > +} > > > > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > > > -- > > Vincenzo > > -- > Rod Grimes > rgrimes@freebsd.org > -- Vincenzo From owner-svn-src-all@freebsd.org Tue Feb 19 15:46: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 449B214F41EA; Tue, 19 Feb 2019 15:46:44 +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 D67128BC7A; Tue, 19 Feb 2019 15:46: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 C9CC41FCF6; Tue, 19 Feb 2019 15:46:43 +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 x1JFkhnC032337; Tue, 19 Feb 2019 15:46:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JFkhZq032336; Tue, 19 Feb 2019 15:46:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902191546.x1JFkhZq032336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 15:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344278 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D67128BC7A 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)[-0.999,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, 19 Feb 2019 15:46:44 -0000 Author: markj Date: Tue Feb 19 15:46:43 2019 New Revision: 344278 URL: https://svnweb.freebsd.org/changeset/base/344278 Log: Move a racy assertion in filt_pipewrite(). EVFILT_WRITE knotes for pipes live on the knlist for the other end of the pipe. Since they do not hold a reference on the corresponding file structure, they may be removed from the knlist by pipeclose() while still remaining active. In this case, there is no knlist lock acquired before filt_pipewrite() is called, so the assertion fails. Fix the problem by first checking whether that end of the pipe has been closed. These checks are memory safe since the knote holds a reference on one end of the pipe, and the pipe structure is not freed until both ends are closed. The checks are not racy since PIPE_EOF is never cleared after being set, and pipe_present is never set back to PIPE_ACTIVE after pipeclose() has been called. PR: 235640 Reported and tested by: pho Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19224 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Feb 19 12:45:37 2019 (r344277) +++ head/sys/kern/sys_pipe.c Tue Feb 19 15:46:43 2019 (r344278) @@ -1741,15 +1741,19 @@ static int filt_pipewrite(struct knote *kn, long hint) { struct pipe *wpipe; - + + /* + * If this end of the pipe is closed, the knote was removed from the + * knlist and the list lock (i.e., the pipe lock) is therefore not held. + */ wpipe = kn->kn_hook; - PIPE_LOCK_ASSERT(wpipe, MA_OWNED); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_data = 0; kn->kn_flags |= EV_EOF; return (1); } + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); kn->kn_data = (wpipe->pipe_buffer.size > 0) ? (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; if (wpipe->pipe_state & PIPE_DIRECTW) From owner-svn-src-all@freebsd.org Tue Feb 19 17:03: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 EC0C714F5B05; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@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 872D48E3AE; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@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 751BD20B2D; Tue, 19 Feb 2019 17:03:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JH3Z8d073847; Tue, 19 Feb 2019 17:03:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JH3ZC8073846; Tue, 19 Feb 2019 17:03:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902191703.x1JH3ZC8073846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 Feb 2019 17:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344279 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 872D48E3AE 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.975,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)[-0.999,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, 19 Feb 2019 17:03:36 -0000 Author: andrew Date: Tue Feb 19 17:03:34 2019 New Revision: 344279 URL: https://svnweb.freebsd.org/changeset/base/344279 Log: Create a common function to handle freeing the kcov info struct. Both places that may free the kcov info struct are identical. Create a new common function to hold the code. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Tue Feb 19 15:46:43 2019 (r344278) +++ head/sys/kern/kern_kcov.c Tue Feb 19 17:03:34 2019 (r344279) @@ -136,6 +136,7 @@ static d_mmap_single_t kcov_mmap_single; static d_ioctl_t kcov_ioctl; static int kcov_alloc(struct kcov_info *info, size_t entries); +static void kcov_free(struct kcov_info *info); static void kcov_init(const void *unused); static struct cdevsw kcov_cdevsw = { @@ -288,14 +289,7 @@ kcov_mmap_cleanup(void *arg) * The KCOV_STATE_DYING stops new threads from using it. * The lack of a thread means nothing is currently using the buffers. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static int @@ -398,6 +392,19 @@ kcov_alloc(struct kcov_info *info, size_t entries) return (0); } +static void +kcov_free(struct kcov_info *info) +{ + + if (info->kvaddr != 0) { + pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); + kva_free(info->kvaddr, info->bufsize); + } + if (info->bufobj != NULL && !info->mmap) + vm_object_deallocate(info->bufobj); + free(info, M_KCOV_INFO); +} + static int kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag __unused, struct thread *td) @@ -531,14 +538,7 @@ kcov_thread_dtor(void *arg __unused, struct thread *td * The KCOV_STATE_DYING stops new threads from using it. * It also stops the current thread from trying to use the info struct. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static void From owner-svn-src-all@freebsd.org Tue Feb 19 17:38: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 76D7914F688E; Tue, 19 Feb 2019 17:38:25 +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 1D6448FA42; Tue, 19 Feb 2019 17:38:25 +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 11F1221043; Tue, 19 Feb 2019 17:38:25 +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 x1JHcOj3089951; Tue, 19 Feb 2019 17:38:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JHcOBS089949; Tue, 19 Feb 2019 17:38:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902191738.x1JHcOBS089949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Feb 2019 17:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344280 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 344280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D6448FA42 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,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, 19 Feb 2019 17:38:25 -0000 Author: emaste Date: Tue Feb 19 17:38:24 2019 New Revision: 344280 URL: https://svnweb.freebsd.org/changeset/base/344280 Log: freebsd-update: Clarify help text Improve help text to include example release numbers for reference and clarify the -F option. PR: 231185, 214619 Submitted by: Gerald Aryeetey Reviewed by: delphij, rgrimes MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18944 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:03:34 2019 (r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:38:24 2019 (r344280) @@ -89,13 +89,13 @@ Read configuration options from .It Fl F Force .Nm Cm fetch -to proceed where it normally would not, such as an unfinished upgrade +to proceed in the case of an unfinished upgrade. .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release to which +Specify the new release (e.g. 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:03:34 2019 (r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:38:24 2019 (r344280) @@ -45,7 +45,8 @@ Options: (default: /var/db/freebsd-update/) -f conffile -- Read configuration options from conffile (default: /etc/freebsd-update.conf) - -F -- Force a fetch operation to proceed + -F -- Force a fetch operation to proceed in the + case of an unfinished upgrade -k KEY -- Trust an RSA key with SHA256 hash of KEY -r release -- Target for upgrade (e.g., 11.1-RELEASE) -s server -- Server from which to fetch updates From owner-svn-src-all@freebsd.org Tue Feb 19 18:22: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 A4DE514F79FB; Tue, 19 Feb 2019 18:22:56 +0000 (UTC) (envelope-from kp@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 4A2CD6AA5C; Tue, 19 Feb 2019 18:22:56 +0000 (UTC) (envelope-from kp@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 3E1DD21959; Tue, 19 Feb 2019 18:22:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JIMuB8015354; Tue, 19 Feb 2019 18:22:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIMuRV015353; Tue, 19 Feb 2019 18:22:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201902191822.x1JIMuRV015353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 19 Feb 2019 18:22: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: r344281 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 344281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A2CD6AA5C 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 18:22:56 -0000 Author: kp Date: Tue Feb 19 18:22:55 2019 New Revision: 344281 URL: https://svnweb.freebsd.org/changeset/base/344281 Log: MFC r344061: garp: Fix vnet related panic for gratuitous arp Gratuitous ARP packets are sent from a timer, which means we don't have a vnet context set. As a result we panic trying to send the packet. Set the vnet context based on the interface associated with the interface address. To reproduce: sysctl net.link.ether.inet.garp_rexmit_count=2 ifconfig vtnet1 10.0.0.1/24 up PR: 235699 Reviewed by: vangyzen@ Modified: stable/12/sys/netinet/if_ether.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/if_ether.c ============================================================================== --- stable/12/sys/netinet/if_ether.c Tue Feb 19 17:38:24 2019 (r344280) +++ stable/12/sys/netinet/if_ether.c Tue Feb 19 18:22:55 2019 (r344281) @@ -1345,6 +1345,8 @@ garp_rexmit(void *arg) return; } + CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet); + /* * Drop lock while the ARP request is generated. */ @@ -1372,6 +1374,8 @@ garp_rexmit(void *arg) ifa_free(&ia->ia_ifa); } } + + CURVNET_RESTORE(); } /* From owner-svn-src-all@freebsd.org Tue Feb 19 18:22: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 5BF7D14F7A09; Tue, 19 Feb 2019 18:22:58 +0000 (UTC) (envelope-from kp@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 F211D6AA6D; Tue, 19 Feb 2019 18:22:57 +0000 (UTC) (envelope-from kp@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 E41F22195B; Tue, 19 Feb 2019 18:22:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JIMvY3015415; Tue, 19 Feb 2019 18:22:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIMv5E015414; Tue, 19 Feb 2019 18:22:57 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201902191822.x1JIMv5E015414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 19 Feb 2019 18:22:57 +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: r344282 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 344282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F211D6AA6D 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.998,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)[-0.999,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, 19 Feb 2019 18:22:58 -0000 Author: kp Date: Tue Feb 19 18:22:57 2019 New Revision: 344282 URL: https://svnweb.freebsd.org/changeset/base/344282 Log: MFC r344061: garp: Fix vnet related panic for gratuitous arp Gratuitous ARP packets are sent from a timer, which means we don't have a vnet context set. As a result we panic trying to send the packet. Set the vnet context based on the interface associated with the interface address. To reproduce: sysctl net.link.ether.inet.garp_rexmit_count=2 ifconfig vtnet1 10.0.0.1/24 up PR: 235699 Reviewed by: vangyzen@ Modified: stable/11/sys/netinet/if_ether.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/if_ether.c ============================================================================== --- stable/11/sys/netinet/if_ether.c Tue Feb 19 18:22:55 2019 (r344281) +++ stable/11/sys/netinet/if_ether.c Tue Feb 19 18:22:57 2019 (r344282) @@ -1351,6 +1351,8 @@ garp_rexmit(void *arg) return; } + CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet); + /* * Drop lock while the ARP request is generated. */ @@ -1378,6 +1380,8 @@ garp_rexmit(void *arg) ifa_free(&ia->ia_ifa); } } + + CURVNET_RESTORE(); } /* From owner-svn-src-all@freebsd.org Tue Feb 19 18:28: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 5FB9514F8381; Tue, 19 Feb 2019 18:28: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 EC3506B579; Tue, 19 Feb 2019 18:28:32 +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 937DF21981; Tue, 19 Feb 2019 18:28:32 +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 x1JISWcC015704; Tue, 19 Feb 2019 18:28:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JISWK3015703; Tue, 19 Feb 2019 18:28:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191828.x1JISWK3015703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:28:32 +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: r344283 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 344283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC3506B579 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.998,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)[-0.999,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, 19 Feb 2019 18:28:33 -0000 Author: kevans Date: Tue Feb 19 18:28:32 2019 New Revision: 344283 URL: https://svnweb.freebsd.org/changeset/base/344283 Log: MFC r330757: stand/interp_lua: correct errorr => error Modified: stable/11/stand/common/interp_lua.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/interp_lua.c ============================================================================== --- stable/11/stand/common/interp_lua.c Tue Feb 19 18:22:57 2019 (r344282) +++ stable/11/stand/common/interp_lua.c Tue Feb 19 18:28:32 2019 (r344283) @@ -123,7 +123,7 @@ interp_init(void) if (interp_include(filename) != 0) { const char *errstr = lua_tostring(luap, -1); errstr = errstr == NULL ? "unknown" : errstr; - printf("Startup errorr in %s:\nLUA ERROR: %s.\n", filename, errstr); + printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); lua_pop(luap, 1); } } From owner-svn-src-all@freebsd.org Tue Feb 19 18:30: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 9654014F858A; Tue, 19 Feb 2019 18:30:38 +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 1FD136B885; Tue, 19 Feb 2019 18:30:38 +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 136542198D; Tue, 19 Feb 2019 18:30:38 +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 x1JIUbeU016821; Tue, 19 Feb 2019 18:30:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIUbuT016820; Tue, 19 Feb 2019 18:30:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191830.x1JIUbuT016820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:30:37 +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: r344284 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 344284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FD136B885 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.998,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)[-0.999,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, 19 Feb 2019 18:30:38 -0000 Author: kevans Date: Tue Feb 19 18:30:37 2019 New Revision: 344284 URL: https://svnweb.freebsd.org/changeset/base/344284 Log: MFC r332270, r332272, r332275, r332413: nop r332270: loader: include efi.4th only if we do have uefi Also simplify efi.4th. r332272: loader: 332270 did use wrong path for efi.4th The correct path is still /boot/efi.4th r332275: loader: 332270 did left out stand/i386/loader/loader.rc we have 2 instances of loader.rc... r332413: Revert r332275, r332272, r332270 There's problems with them. The order of efi stuff isn't quite right, and there's various problems. Revert until thos problems can be fixed. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Tue Feb 19 18:32: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 725F014F8862; Tue, 19 Feb 2019 18:32:06 +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 D8C0A6BE4C; Tue, 19 Feb 2019 18:32:05 +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 CB23921B1D; Tue, 19 Feb 2019 18:32:05 +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 x1JIW5KB020801; Tue, 19 Feb 2019 18:32:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIW5O6020800; Tue, 19 Feb 2019 18:32:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191832.x1JIW5O6020800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:32:05 +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: r344285 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 344285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8C0A6BE4C 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.998,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)[-0.999,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, 19 Feb 2019 18:32:07 -0000 Author: kevans Date: Tue Feb 19 18:32:05 2019 New Revision: 344285 URL: https://svnweb.freebsd.org/changeset/base/344285 Log: MFC r332555: loader: provide values in help_getnext() With r328289 we attempt to make sure we free the resources allocated in help_getnext(), however, it is possible that we get no resources allocated and help_getnext() will return early. Make sure we have pointers set to NULL early in help_getnext(). Modified: stable/11/stand/common/commands.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/commands.c ============================================================================== --- stable/11/stand/common/commands.c Tue Feb 19 18:30:37 2019 (r344284) +++ stable/11/stand/common/commands.c Tue Feb 19 18:32:05 2019 (r344285) @@ -64,7 +64,9 @@ static int help_getnext(int fd, char **topic, char **subtopic, char **desc) { char line[81], *cp, *ep; - + + /* Make sure we provide sane values. */ + *topic = *subtopic = *desc = NULL; for (;;) { if (fgetstr(line, 80, fd) < 0) return(0); From owner-svn-src-all@freebsd.org Tue Feb 19 18:34: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 A102014F89DE; Tue, 19 Feb 2019 18:34:01 +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 5019C6C09F; Tue, 19 Feb 2019 18:34:01 +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 35B7F21B40; Tue, 19 Feb 2019 18:34:01 +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 x1JIY1Vw020956; Tue, 19 Feb 2019 18:34:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIY0wu020954; Tue, 19 Feb 2019 18:34:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191834.x1JIY0wu020954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:34:00 +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: r344286 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 344286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5019C6C09F 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2019 18:34:01 -0000 Author: kevans Date: Tue Feb 19 18:34:00 2019 New Revision: 344286 URL: https://svnweb.freebsd.org/changeset/base/344286 Log: MFC r332557-r332558, r332560, r332565: loader command cleanup-lite r332557: loader: make sure we use snprintf() in commands.c Safeguard against memory corruptions. r332558: loader: command_errmsg should be const Use const char * for command_errmsg. r332560: loader: make sure we do not return garbage from help_getnext Since we do free subtopic and desc in help_getnext(), we need to set them also NULL, so we make sure we dont get double free(). r332565: loader: cstyle cleanup of command.c just clean it up. no functional changes intended. Modified: stable/11/stand/common/bootstrap.h stable/11/stand/common/commands.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Tue Feb 19 18:32:05 2019 (r344285) +++ stable/11/stand/common/bootstrap.h Tue Feb 19 18:34:00 2019 (r344286) @@ -36,7 +36,7 @@ /* Commands and return values; nonzero return sets command_errmsg != NULL */ typedef int (bootblk_cmd_t)(int argc, char *argv[]); #define COMMAND_ERRBUFSZ (256) -extern char *command_errmsg; +extern const char *command_errmsg; extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_OK 0 #define CMD_WARN 1 Modified: stable/11/stand/common/commands.c ============================================================================== --- stable/11/stand/common/commands.c Tue Feb 19 18:32:05 2019 (r344285) +++ stable/11/stand/common/commands.c Tue Feb 19 18:34:00 2019 (r344286) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" -char *command_errmsg; +const char *command_errmsg; /* XXX should have procedural interface for setting, size limit? */ char command_errbuf[COMMAND_ERRBUFSZ]; @@ -61,155 +61,160 @@ here COMMAND_SET(help, "help", "detailed help", command_help); static int -help_getnext(int fd, char **topic, char **subtopic, char **desc) +help_getnext(int fd, char **topic, char **subtopic, char **desc) { - char line[81], *cp, *ep; + char line[81], *cp, *ep; - /* Make sure we provide sane values. */ - *topic = *subtopic = *desc = NULL; - for (;;) { - if (fgetstr(line, 80, fd) < 0) - return(0); - - if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' ')) - continue; - + /* Make sure we provide sane values. */ *topic = *subtopic = *desc = NULL; - cp = line + 2; - while((cp != NULL) && (*cp != 0)) { - ep = strchr(cp, ' '); - if ((*cp == 'T') && (*topic == NULL)) { - if (ep != NULL) - *ep++ = 0; - *topic = strdup(cp + 1); - } else if ((*cp == 'S') && (*subtopic == NULL)) { - if (ep != NULL) - *ep++ = 0; - *subtopic = strdup(cp + 1); - } else if (*cp == 'D') { - *desc = strdup(cp + 1); - ep = NULL; - } - cp = ep; + for (;;) { + if (fgetstr(line, 80, fd) < 0) + return (0); + + if (strlen(line) < 3 || line[0] != '#' || line[1] != ' ') + continue; + + cp = line + 2; + while (cp != NULL && *cp != 0) { + ep = strchr(cp, ' '); + if (*cp == 'T' && *topic == NULL) { + if (ep != NULL) + *ep++ = 0; + *topic = strdup(cp + 1); + } else if (*cp == 'S' && *subtopic == NULL) { + if (ep != NULL) + *ep++ = 0; + *subtopic = strdup(cp + 1); + } else if (*cp == 'D') { + *desc = strdup(cp + 1); + ep = NULL; + } + cp = ep; + } + if (*topic == NULL) { + free(*subtopic); + free(*desc); + *subtopic = *desc = NULL; + continue; + } + return (1); } - if (*topic == NULL) { - free(*subtopic); - free(*desc); - continue; - } - return(1); - } } static int help_emitsummary(char *topic, char *subtopic, char *desc) { - int i; - - pager_output(" "); - pager_output(topic); - i = strlen(topic); - if (subtopic != NULL) { - pager_output(" "); - pager_output(subtopic); - i += strlen(subtopic) + 1; - } - if (desc != NULL) { - do { - pager_output(" "); - } while (i++ < 30); - pager_output(desc); - } - return (pager_output("\n")); + int i; + + pager_output(" "); + pager_output(topic); + i = strlen(topic); + if (subtopic != NULL) { + pager_output(" "); + pager_output(subtopic); + i += strlen(subtopic) + 1; + } + if (desc != NULL) { + do { + pager_output(" "); + } while (i++ < 30); + pager_output(desc); + } + return (pager_output("\n")); } - + static int -command_help(int argc, char *argv[]) +command_help(int argc, char *argv[]) { - char buf[81]; /* XXX buffer size? */ - int hfd, matched, doindex; - char *topic, *subtopic, *t, *s, *d; + char buf[81]; /* XXX buffer size? */ + int hfd, matched, doindex; + char *topic, *subtopic, *t, *s, *d; - /* page the help text from our load path */ - snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); - if ((hfd = open(buf, O_RDONLY)) < 0) { - printf("Verbose help not available, use '?' to list commands\n"); - return(CMD_OK); - } + /* page the help text from our load path */ + snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); + if ((hfd = open(buf, O_RDONLY)) < 0) { + printf("Verbose help not available, " + "use '?' to list commands\n"); + return (CMD_OK); + } - /* pick up request from arguments */ - topic = subtopic = NULL; - switch(argc) { - case 3: - subtopic = strdup(argv[2]); - case 2: - topic = strdup(argv[1]); - break; - case 1: - topic = strdup("help"); - break; - default: - command_errmsg = "usage is 'help []"; - close(hfd); - return(CMD_ERROR); - } + /* pick up request from arguments */ + topic = subtopic = NULL; + switch (argc) { + case 3: + subtopic = strdup(argv[2]); + /* FALLTHROUGH */ + case 2: + topic = strdup(argv[1]); + break; + case 1: + topic = strdup("help"); + break; + default: + command_errmsg = "usage is 'help []"; + close(hfd); + return(CMD_ERROR); + } - /* magic "index" keyword */ - doindex = !strcmp(topic, "index"); - matched = doindex; - - /* Scan the helpfile looking for help matching the request */ - pager_open(); - while(help_getnext(hfd, &t, &s, &d)) { + /* magic "index" keyword */ + doindex = strcmp(topic, "index") == 0? 1 : 0; + matched = doindex; - if (doindex) { /* dink around formatting */ - if (help_emitsummary(t, s, d)) - break; + /* Scan the helpfile looking for help matching the request */ + pager_open(); + while (help_getnext(hfd, &t, &s, &d)) { - } else if (strcmp(topic, t)) { - /* topic mismatch */ - if (matched) /* nothing more on this topic, stop scanning */ - break; + if (doindex) { /* dink around formatting */ + if (help_emitsummary(t, s, d)) + break; - } else { - /* topic matched */ - matched = 1; - if (((subtopic == NULL) && (s == NULL)) || - ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) { - /* exact match, print text */ - while ((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) { - if (pager_output(buf)) - break; - if (pager_output("\n")) - break; + } else if (strcmp(topic, t)) { + /* topic mismatch */ + if (matched) { + /* nothing more on this topic, stop scanning */ + break; + } + } else { + /* topic matched */ + matched = 1; + if ((subtopic == NULL && s == NULL) || + (subtopic != NULL && s != NULL && + strcmp(subtopic, s) == 0)) { + /* exact match, print text */ + while (fgetstr(buf, 80, hfd) >= 0 && + buf[0] != '#') { + if (pager_output(buf)) + break; + if (pager_output("\n")) + break; + } + } else if (subtopic == NULL && s != NULL) { + /* topic match, list subtopics */ + if (help_emitsummary(t, s, d)) + break; + } } - } else if ((subtopic == NULL) && (s != NULL)) { - /* topic match, list subtopics */ - if (help_emitsummary(t, s, d)) - break; - } + free(t); + free(s); + free(d); + t = s = d = NULL; } free(t); free(s); free(d); - t = s = d = NULL; - } - free(t); - free(s); - free(d); - pager_close(); - close(hfd); - if (!matched) { - snprintf(command_errbuf, sizeof(command_errbuf), - "no help available for '%s'", topic); + pager_close(); + close(hfd); + if (!matched) { + snprintf(command_errbuf, sizeof(command_errbuf), + "no help available for '%s'", topic); + free(topic); + free(subtopic); + return (CMD_ERROR); + } free(topic); free(subtopic); - return(CMD_ERROR); - } - free(topic); - free(subtopic); - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(commandlist, "?", "list commands", command_commandlist); @@ -223,27 +228,28 @@ COMMAND_SET(commandlist, "?", "list commands", command * fixing it. */ static int -command_commandlist(int argc, char *argv[]) +command_commandlist(int argc __unused, char *argv[] __unused) { - struct bootblk_command **cmdp; - int res; - char name[20]; + struct bootblk_command **cmdp; + int res; + char name[20]; - res = 0; - pager_open(); - res = pager_output("Available commands:\n"); - SET_FOREACH(cmdp, Xcommand_set) { - if (res) - break; - if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) { - sprintf(name, " %-15s ", (*cmdp)->c_name); - pager_output(name); - pager_output((*cmdp)->c_desc); - res = pager_output("\n"); + res = 0; + pager_open(); + res = pager_output("Available commands:\n"); + SET_FOREACH(cmdp, Xcommand_set) { + if (res) + break; + if ((*cmdp)->c_name != NULL && (*cmdp)->c_desc != NULL) { + snprintf(name, sizeof(name), " %-15s ", + (*cmdp)->c_name); + pager_output(name); + pager_output((*cmdp)->c_desc); + res = pager_output("\n"); + } } - } - pager_close(); - return(CMD_OK); + pager_close(); + return (CMD_OK); } /* @@ -256,35 +262,35 @@ COMMAND_SET(show, "show", "show variable(s)", command_ static int command_show(int argc, char *argv[]) { - struct env_var *ev; - char *cp; + struct env_var *ev; + char *cp; - if (argc < 2) { - /* - * With no arguments, print everything. - */ - pager_open(); - for (ev = environ; ev != NULL; ev = ev->ev_next) { - pager_output(ev->ev_name); - cp = getenv(ev->ev_name); - if (cp != NULL) { - pager_output("="); - pager_output(cp); - } - if (pager_output("\n")) - break; - } - pager_close(); - } else { - if ((cp = getenv(argv[1])) != NULL) { - printf("%s\n", cp); + if (argc < 2) { + /* + * With no arguments, print everything. + */ + pager_open(); + for (ev = environ; ev != NULL; ev = ev->ev_next) { + pager_output(ev->ev_name); + cp = getenv(ev->ev_name); + if (cp != NULL) { + pager_output("="); + pager_output(cp); + } + if (pager_output("\n")) + break; + } + pager_close(); } else { - snprintf(command_errbuf, sizeof(command_errbuf), - "variable '%s' not found", argv[1]); - return(CMD_ERROR); + if ((cp = getenv(argv[1])) != NULL) { + printf("%s\n", cp); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "variable '%s' not found", argv[1]); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(set, "set", "set a variable", command_set); @@ -292,37 +298,37 @@ COMMAND_SET(set, "set", "set a variable", command_set) static int command_set(int argc, char *argv[]) { - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return(CMD_ERROR); - } else { - if ((err = putenv(argv[1])) != 0) { - command_errmsg = strerror(err); - return(CMD_ERROR); + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } else { + if ((err = putenv(argv[1])) != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(unset, "unset", "unset a variable", command_unset); static int -command_unset(int argc, char *argv[]) +command_unset(int argc, char *argv[]) { - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return(CMD_ERROR); - } else { - if ((err = unsetenv(argv[1])) != 0) { - command_errmsg = strerror(err); - return(CMD_ERROR); + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } else { + if ((err = unsetenv(argv[1])) != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(echo, "echo", "echo arguments", command_echo); @@ -330,34 +336,34 @@ COMMAND_SET(echo, "echo", "echo arguments", command_ec static int command_echo(int argc, char *argv[]) { - char *s; - int nl, ch; - - nl = 0; - optind = 1; - optreset = 1; - while ((ch = getopt(argc, argv, "n")) != -1) { - switch(ch) { - case 'n': - nl = 1; - break; - case '?': - default: - /* getopt has already reported an error */ - return(CMD_OK); + char *s; + int nl, ch; + + nl = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "n")) != -1) { + switch (ch) { + case 'n': + nl = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); + argv += (optind); + argc -= (optind); - s = unargv(argc, argv); - if (s != NULL) { - printf("%s", s); - free(s); - } - if (!nl) - printf("\n"); - return(CMD_OK); + s = unargv(argc, argv); + if (s != NULL) { + printf("%s", s); + free(s); + } + if (!nl) + printf("\n"); + return (CMD_OK); } /* @@ -369,55 +375,55 @@ COMMAND_SET(read, "read", "read input from the termina static int command_read(int argc, char *argv[]) { - char *prompt; - int timeout; - time_t when; - char *cp; - char *name; - char buf[256]; /* XXX size? */ - int c; + char *prompt; + int timeout; + time_t when; + char *cp; + char *name; + char buf[256]; /* XXX size? */ + int c; - timeout = -1; - prompt = NULL; - optind = 1; - optreset = 1; - while ((c = getopt(argc, argv, "p:t:")) != -1) { - switch(c) { - - case 'p': - prompt = optarg; - break; - case 't': - timeout = strtol(optarg, &cp, 0); - if (cp == optarg) { - snprintf(command_errbuf, sizeof(command_errbuf), - "bad timeout '%s'", optarg); - return(CMD_ERROR); - } - break; - default: - return(CMD_OK); + timeout = -1; + prompt = NULL; + optind = 1; + optreset = 1; + while ((c = getopt(argc, argv, "p:t:")) != -1) { + switch (c) { + case 'p': + prompt = optarg; + break; + case 't': + timeout = strtol(optarg, &cp, 0); + if (cp == optarg) { + snprintf(command_errbuf, + sizeof(command_errbuf), + "bad timeout '%s'", optarg); + return (CMD_ERROR); + } + break; + default: + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); - name = (argc > 0) ? argv[0]: NULL; - - if (prompt != NULL) - printf("%s", prompt); - if (timeout >= 0) { - when = time(NULL) + timeout; - while (!ischar()) - if (time(NULL) >= when) - return(CMD_OK); /* is timeout an error? */ - } + argv += (optind); + argc -= (optind); + name = (argc > 0) ? argv[0]: NULL; - ngets(buf, sizeof(buf)); + if (prompt != NULL) + printf("%s", prompt); + if (timeout >= 0) { + when = time(NULL) + timeout; + while (!ischar()) + if (time(NULL) >= when) + return (CMD_OK); /* is timeout an error? */ + } - if (name != NULL) - setenv(name, buf, 1); - return(CMD_OK); + ngets(buf, sizeof(buf)); + + if (name != NULL) + setenv(name, buf, 1); + return (CMD_OK); } /* @@ -428,44 +434,46 @@ COMMAND_SET(more, "more", "show contents of a file", c static int command_more(int argc, char *argv[]) { - int i; - int res; - char line[80]; + int i; + int res; + char line[80]; - res=0; - pager_open(); - for (i = 1; (i < argc) && (res == 0); i++) { - sprintf(line, "*** FILE %s BEGIN ***\n", argv[i]); - if (pager_output(line)) - break; - res = page_file(argv[i]); - if (!res) { - sprintf(line, "*** FILE %s END ***\n", argv[i]); - res = pager_output(line); + res = 0; + pager_open(); + for (i = 1; (i < argc) && (res == 0); i++) { + snprintf(line, sizeof(line), "*** FILE %s BEGIN ***\n", + argv[i]); + if (pager_output(line)) + break; + res = page_file(argv[i]); + if (!res) { + snprintf(line, sizeof(line), "*** FILE %s END ***\n", + argv[i]); + res = pager_output(line); + } } - } - pager_close(); + pager_close(); - if (res == 0) - return CMD_OK; - else - return CMD_ERROR; + if (res == 0) + return (CMD_OK); + else + return (CMD_ERROR); } static int page_file(char *filename) { - int result; + int result; - result = pager_file(filename); + result = pager_file(filename); - if (result == -1) { - snprintf(command_errbuf, sizeof(command_errbuf), - "error showing %s", filename); - } + if (result == -1) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error showing %s", filename); + } - return result; -} + return (result); +} /* * List all disk-like devices @@ -475,38 +483,38 @@ COMMAND_SET(lsdev, "lsdev", "list all devices", comman static int command_lsdev(int argc, char *argv[]) { - int verbose, ch, i; - char line[80]; - - verbose = 0; - optind = 1; - optreset = 1; - while ((ch = getopt(argc, argv, "v")) != -1) { - switch(ch) { - case 'v': - verbose = 1; - break; - case '?': - default: - /* getopt has already reported an error */ - return(CMD_OK); + int verbose, ch, i; + char line[80]; + + verbose = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + verbose = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); + argv += (optind); + argc -= (optind); - pager_open(); - for (i = 0; devsw[i] != NULL; i++) { - if (devsw[i]->dv_print != NULL){ - if (devsw[i]->dv_print(verbose)) - break; - } else { - sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name); - if (pager_output(line)) - break; + pager_open(); + for (i = 0; devsw[i] != NULL; i++) { + if (devsw[i]->dv_print != NULL) { + if (devsw[i]->dv_print(verbose)) + break; + } else { + snprintf(line, sizeof(line), "%s: (unknown)\n", + devsw[i]->dv_name); + if (pager_output(line)) + break; + } } - } - pager_close(); - return(CMD_OK); + pager_close(); + return (CMD_OK); } - From owner-svn-src-all@freebsd.org Tue Feb 19 18:35: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 8170514F8AD5; Tue, 19 Feb 2019 18:35:50 +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 25FF66C297; Tue, 19 Feb 2019 18:35:50 +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 0C5EC21B42; Tue, 19 Feb 2019 18:35:50 +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 x1JIZnE2021085; Tue, 19 Feb 2019 18:35:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIZnnl021084; Tue, 19 Feb 2019 18:35:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191835.x1JIZnnl021084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:35:49 +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: r344287 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 344287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25FF66C297 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 18:35:50 -0000 Author: kevans Date: Tue Feb 19 18:35:49 2019 New Revision: 344287 URL: https://svnweb.freebsd.org/changeset/base/344287 Log: MFC r333365, r333471: r333365: We don't use f_devdata, so don't set it. Should that need to change later, we can. This leaves ZFS as the only irregular f_devdata user in the tree. r333471: Revert r333365 Even though we don't use it, it appears something else requires it to be != 0 to work. This breaks tftp boot in loader.efi, so revert until that can be sorted out. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Tue Feb 19 18: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 3CC2314F8C27; Tue, 19 Feb 2019 18:37:46 +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 D0B566C45F; Tue, 19 Feb 2019 18:37:45 +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 BE67B21B43; Tue, 19 Feb 2019 18:37:45 +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 x1JIbj80021214; Tue, 19 Feb 2019 18:37:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIbjSo021213; Tue, 19 Feb 2019 18:37:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191837.x1JIbjSo021213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:37: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: r344288 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 344288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0B566C45F 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 18:37:46 -0000 Author: kevans Date: Tue Feb 19 18:37:45 2019 New Revision: 344288 URL: https://svnweb.freebsd.org/changeset/base/344288 Log: MFC r334868: Add st_mtime, st_ino and st_dev for ufs_stat Modified: stable/11/stand/libsa/ufs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/ufs.c ============================================================================== --- stable/11/stand/libsa/ufs.c Tue Feb 19 18:35:49 2019 (r344287) +++ stable/11/stand/libsa/ufs.c Tue Feb 19 18:37:45 2019 (r344288) @@ -124,6 +124,7 @@ struct file { ufs2_daddr_t f_buf_blkno; /* block number of data block */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ + int f_inumber; /* inumber */ }; #define DIP(fp, field) \ ((fp)->f_fs->fs_magic == FS_UFS1_MAGIC ? \ @@ -185,6 +186,7 @@ read_inode(inumber, f) fp->f_buf_blkno = -1; } fp->f_seekp = 0; + fp->f_inumber = inumber; out: free(buf); return (rc); @@ -831,6 +833,20 @@ ufs_stat(f, sb) sb->st_uid = DIP(fp, di_uid); sb->st_gid = DIP(fp, di_gid); sb->st_size = DIP(fp, di_size); + sb->st_mtime = DIP(fp, di_mtime); + /* + * The items below are ufs specific! + * Other fs types will need their own solution + * if these fields are needed. + */ + sb->st_ino = fp->f_inumber; + /* + * We need something to differentiate devs. + * fs_id is unique but 64bit, we xor the two + * halves to squeeze it into 32bits. + */ + sb->st_dev = (dev_t)(fp->f_fs->fs_id[0] ^ fp->f_fs->fs_id[1]); + return (0); } From owner-svn-src-all@freebsd.org Tue Feb 19 18: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 C0EEF14F90DE; Tue, 19 Feb 2019 18:45:42 +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 645966CB99; Tue, 19 Feb 2019 18:45:42 +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 581CC21CE8; Tue, 19 Feb 2019 18:45:42 +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 x1JIjgCo026560; Tue, 19 Feb 2019 18:45:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIjfpZ026554; Tue, 19 Feb 2019 18:45:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191845.x1JIjfpZ026554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:45:41 +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: r344289 - in stable/11/stand: . efi/loader libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . efi/loader libsa X-SVN-Commit-Revision: 344289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 645966CB99 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 18:45:43 -0000 Author: kevans Date: Tue Feb 19 18:45:40 2019 New Revision: 344289 URL: https://svnweb.freebsd.org/changeset/base/344289 Log: MFC r335069-r335071, r335110, r335116: stand housecleaning r335069: Remove fail: label. It's unused. r335070: Remove unused variables. [kevans@: removed ufs.c modifications; those depend on ufs rewrite bits] r335071: Initialize variables we later free so they aren't used uninitialized in the error path. Remove unused variables. r335110: Remove redundant defs.mk includes. They aren't needed. r335116: Use bool for vargood, since it's a boolean. Modified: stable/11/stand/efi/loader/main.c stable/11/stand/ficl.mk stable/11/stand/libsa/nfs.c stable/11/stand/libsa/open.c stable/11/stand/libsa/tftp.c stable/11/stand/loader.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/efi/loader/main.c Tue Feb 19 18:45:40 2019 (r344289) @@ -415,7 +415,8 @@ main(int argc, CHAR16 *argv[]) { char var[128]; EFI_GUID *guid; - int i, j, vargood, howto; + int i, j, howto; + bool vargood; UINTN k; int has_kbd; char *s; @@ -532,14 +533,14 @@ main(int argc, CHAR16 *argv[]) } } } else { - vargood = 0; + vargood = false; for (j = 0; argv[i][j] != 0; j++) { if (j == sizeof(var)) { - vargood = 0; + vargood = false; break; } if (j > 0 && argv[i][j] == '=') - vargood = 1; + vargood = true; var[j] = (char)argv[i][j]; } if (vargood) { Modified: stable/11/stand/ficl.mk ============================================================================== --- stable/11/stand/ficl.mk Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/ficl.mk Tue Feb 19 18:45:40 2019 (r344289) @@ -2,8 +2,6 @@ # Common flags to build FICL related files -.include "defs.mk" - .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 FICL_CPUARCH= i386 .elif ${MACHINE_ARCH:Mmips64*} != "" Modified: stable/11/stand/libsa/nfs.c ============================================================================== --- stable/11/stand/libsa/nfs.c Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/libsa/nfs.c Tue Feb 19 18:45:40 2019 (r344289) @@ -249,7 +249,7 @@ int nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd) { void *pkt = NULL; - int len, rlen, pos; + int len, pos; struct args { uint32_t fhsize; uint32_t fhplusname[1 + @@ -465,14 +465,13 @@ int nfs_open(const char *upath, struct open_file *f) { struct iodesc *desc; - struct nfs_iodesc *currfd; + struct nfs_iodesc *currfd = NULL; char buf[2 * NFS_V3MAXFHSIZE + 3]; u_char *fh; char *cp; int i; #ifndef NFS_NOSYMLINK - struct nfs_iodesc *newfd; - struct nfsv3_fattrs *fa; + struct nfs_iodesc *newfd = NULL; char *ncp; int c; char namebuf[NFS_MAXPATHLEN + 1]; @@ -480,7 +479,7 @@ nfs_open(const char *upath, struct open_file *f) int nlinks = 0; #endif int error; - char *path; + char *path = NULL; if (netproto != NET_NFS) return (EINVAL); Modified: stable/11/stand/libsa/open.c ============================================================================== --- stable/11/stand/libsa/open.c Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/libsa/open.c Tue Feb 19 18:45:40 2019 (r344289) @@ -141,7 +141,6 @@ open(const char *fname, int mode) } error = besterror; - fail: if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) f->f_dev->dv_close(f); if (error) Modified: stable/11/stand/libsa/tftp.c ============================================================================== --- stable/11/stand/libsa/tftp.c Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/libsa/tftp.c Tue Feb 19 18:45:40 2019 (r344289) @@ -186,7 +186,6 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct tftprecv_extra *extra; struct tftp_handle *h; struct tftphdr *t; - unsigned short *rtype; void *ptr = NULL; ssize_t len; Modified: stable/11/stand/loader.mk ============================================================================== --- stable/11/stand/loader.mk Tue Feb 19 18:37:45 2019 (r344288) +++ stable/11/stand/loader.mk Tue Feb 19 18:45:40 2019 (r344289) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include "defs.mk" - .PATH: ${LDRSRC} ${BOOTSRC}/libsa CFLAGS+=-I${LDRSRC} From owner-svn-src-all@freebsd.org Tue Feb 19 18:48: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 B2FD614F921E; Tue, 19 Feb 2019 18:48:20 +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 2A9C86CDCE; Tue, 19 Feb 2019 18:48:20 +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 1DF5521CFB; Tue, 19 Feb 2019 18:48:20 +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 x1JImKj9026739; Tue, 19 Feb 2019 18:48:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JImIhh026730; Tue, 19 Feb 2019 18:48:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191848.x1JImIhh026730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:48:18 +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: r344290 - in stable/11/stand: common efi/loader i386/loader mips/beri/loader pc98/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common userboot/userboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: common efi/loader i386/loader mips/beri/loader pc98/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common userboot/userboot X-SVN-Commit-Revision: 344290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A9C86CDCE 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2019 18:48:21 -0000 Author: kevans Date: Tue Feb 19 18:48:17 2019 New Revision: 344290 URL: https://svnweb.freebsd.org/changeset/base/344290 Log: MFC r335117: stand bootprog_info consolidation bootprog_info is generated in vers.c. Move it's definition to bootstrap.h and remove all the redundant copies. Modified: stable/11/stand/common/bootstrap.h stable/11/stand/efi/loader/main.c stable/11/stand/i386/loader/main.c stable/11/stand/mips/beri/loader/loader.h stable/11/stand/pc98/loader/main.c stable/11/stand/powerpc/kboot/main.c stable/11/stand/powerpc/ofw/main.c stable/11/stand/sparc64/loader/main.c stable/11/stand/uboot/common/main.c stable/11/stand/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/common/bootstrap.h Tue Feb 19 18:48:17 2019 (r344290) @@ -161,6 +161,11 @@ char *pnp_eisaformat(uint8_t *data); extern int isapnp_readport; /* + * Version information + */ +extern char bootprog_info[]; + +/* * Preloaded file metadata header. * * Metadata are allocated on our heap, and copied into kernel space Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/efi/loader/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" -extern char bootprog_info[]; - struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; Modified: stable/11/stand/i386/loader/main.c ============================================================================== --- stable/11/stand/i386/loader/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/i386/loader/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -79,9 +79,6 @@ struct zfs_boot_args *zargs; static void i386_zfs_probe(void); #endif -/* from vers.c */ -extern char bootprog_info[]; - /* XXX debugging */ extern char end[]; Modified: stable/11/stand/mips/beri/loader/loader.h ============================================================================== --- stable/11/stand/mips/beri/loader/loader.h Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/mips/beri/loader/loader.h Tue Feb 19 18:48:17 2019 (r344290) @@ -58,7 +58,4 @@ extern struct bootinfo boot2_bootinfo; /* metadata.c */ int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); -/* vers.c */ -extern char bootprog_info[]; - #endif /* !_BOOT_LOADER_H_ */ Modified: stable/11/stand/pc98/loader/main.c ============================================================================== --- stable/11/stand/pc98/loader/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/pc98/loader/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -65,9 +65,6 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); -/* from vers.c */ -extern char bootprog_info[]; - /* XXX debugging */ extern char end[]; Modified: stable/11/stand/powerpc/kboot/main.c ============================================================================== --- stable/11/stand/powerpc/kboot/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/powerpc/kboot/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_info[]; - int kboot_getdev(void **vdev, const char *devspec, const char **path); ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t kboot_copyout(vm_offset_t src, void *dest, const size_t len); Modified: stable/11/stand/powerpc/ofw/main.c ============================================================================== --- stable/11/stand/powerpc/ofw/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/powerpc/ofw/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; -extern char bootprog_info[]; uint32_t acells, scells; Modified: stable/11/stand/sparc64/loader/main.c ============================================================================== --- stable/11/stand/sparc64/loader/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/sparc64/loader/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -extern char bootprog_info[]; - enum { HEAPVA = 0x800000, HEAPSZ = 0x3000000, Modified: stable/11/stand/uboot/common/main.c ============================================================================== --- stable/11/stand/uboot/common/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/uboot/common/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -66,7 +66,6 @@ struct device_type { }; extern char end[]; -extern char bootprog_info[]; extern unsigned char _etext[]; extern unsigned char _edata[]; Modified: stable/11/stand/userboot/userboot/main.c ============================================================================== --- stable/11/stand/userboot/userboot/main.c Tue Feb 19 18:45:40 2019 (r344289) +++ stable/11/stand/userboot/userboot/main.c Tue Feb 19 18:48:17 2019 (r344290) @@ -52,7 +52,6 @@ static int userboot_zfs_found; struct loader_callbacks *callbacks; void *callbacks_arg; -extern char bootprog_info[]; static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */ From owner-svn-src-all@freebsd.org Tue Feb 19 18:50: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 4685C14F92F4; Tue, 19 Feb 2019 18:50:22 +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 E4A606CF8C; Tue, 19 Feb 2019 18:50:21 +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 CF76F21D0F; Tue, 19 Feb 2019 18:50:21 +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 x1JIoL6N026912; Tue, 19 Feb 2019 18:50:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JIoL8j026906; Tue, 19 Feb 2019 18:50:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191850.x1JIoL8j026906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 18:50: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: r344291 - in stable/11/stand: arm/loader libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: arm/loader libsa X-SVN-Commit-Revision: 344291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4A606CF8C 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 19 Feb 2019 18:50:22 -0000 Author: kevans Date: Tue Feb 19 18:50:20 2019 New Revision: 344291 URL: https://svnweb.freebsd.org/changeset/base/344291 Log: MFC r335125-r335127, r335148, r335224 r335125: libsa: cstyle cleanup for open/close/read/write sources r335126: libsa: f_rabuf could be NULL It is possible that we will not get RA buffer from open(), therefore we must validate RA. r335127: libsa: remobe unneeded check before free() free() is checking for NULL, remove duplicate check. r335148: libsa: open() should use NULL instead of typecasted 0 r335224: Remove empty directory Deleted: stable/11/stand/arm/loader/ Modified: stable/11/stand/libsa/close.c stable/11/stand/libsa/open.c stable/11/stand/libsa/read.c stable/11/stand/libsa/write.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/close.c ============================================================================== --- stable/11/stand/libsa/close.c Tue Feb 19 18:48:17 2019 (r344290) +++ stable/11/stand/libsa/close.c Tue Feb 19 18:50:20 2019 (r344291) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)close.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -68,31 +68,30 @@ __FBSDID("$FreeBSD$"); int close(int fd) { - struct open_file *f = &files[fd]; - int err1 = 0, err2 = 0; + struct open_file *f = &files[fd]; + int err1 = 0, err2 = 0; - if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) { - errno = EBADF; - return (-1); - } - if (f->f_rabuf != NULL) { + if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) { + errno = EBADF; + return (-1); + } free(f->f_rabuf); f->f_rabuf = NULL; - } - if (!(f->f_flags & F_RAW) && f->f_ops) - err1 = (f->f_ops->fo_close)(f); - if (!(f->f_flags & F_NODEV) && f->f_dev) - err2 = (f->f_dev->dv_close)(f); - if (f->f_devdata != NULL) - devclose(f); - f->f_flags = 0; - if (err1) { - errno = err1; - return (-1); - } - if (err2) { - errno = err2; - return (-1); - } - return (0); + + if (!(f->f_flags & F_RAW) && f->f_ops) + err1 = (f->f_ops->fo_close)(f); + if (!(f->f_flags & F_NODEV) && f->f_dev) + err2 = (f->f_dev->dv_close)(f); + if (f->f_devdata != NULL) + devclose(f); + f->f_flags = 0; + if (err1) { + errno = err1; + return (-1); + } + if (err2) { + errno = err2; + return (-1); + } + return (0); } Modified: stable/11/stand/libsa/open.c ============================================================================== --- stable/11/stand/libsa/open.c Tue Feb 19 18:48:17 2019 (r344290) +++ stable/11/stand/libsa/open.c Tue Feb 19 18:50:20 2019 (r344291) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)open.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -70,89 +70,89 @@ struct fs_ops *exclusive_file_system; struct open_file files[SOPEN_MAX]; static int -o_gethandle(void) +o_gethandle(void) { - int fd; - - for (fd = 0; fd < SOPEN_MAX; fd++) - if (files[fd].f_flags == 0) - return(fd); - return(-1); + int fd; + + for (fd = 0; fd < SOPEN_MAX; fd++) + if (files[fd].f_flags == 0) + return (fd); + return (-1); } static void o_rainit(struct open_file *f) { - f->f_rabuf = malloc(SOPEN_RASIZE); - f->f_ralen = 0; - f->f_raoffset = 0; + f->f_rabuf = malloc(SOPEN_RASIZE); + f->f_ralen = 0; + f->f_raoffset = 0; } int open(const char *fname, int mode) { - struct fs_ops *fs; - struct open_file *f; - int fd, i, error, besterror; - const char *file; + struct fs_ops *fs; + struct open_file *f; + int fd, i, error, besterror; + const char *file; - if ((fd = o_gethandle()) == -1) { - errno = EMFILE; - return(-1); - } + if ((fd = o_gethandle()) == -1) { + errno = EMFILE; + return (-1); + } - f = &files[fd]; - f->f_flags = mode + 1; - f->f_dev = (struct devsw *)0; - f->f_ops = (struct fs_ops *)0; - f->f_offset = 0; - f->f_devdata = NULL; - file = (char *)0; + f = &files[fd]; + f->f_flags = mode + 1; + f->f_dev = NULL; + f->f_ops = NULL; + f->f_offset = 0; + f->f_devdata = NULL; + file = NULL; - if (exclusive_file_system != NULL) { - fs = exclusive_file_system; - error = (fs->fo_open)(fname, f); - if (error == 0) - goto ok; - goto err; - } + if (exclusive_file_system != NULL) { + fs = exclusive_file_system; + error = (fs->fo_open)(fname, f); + if (error == 0) + goto ok; + goto err; + } - error = devopen(f, fname, &file); - if (error || - (((f->f_flags & F_NODEV) == 0) && f->f_dev == (struct devsw *)0)) - goto err; + error = devopen(f, fname, &file); + if (error || + (((f->f_flags & F_NODEV) == 0) && f->f_dev == NULL)) + goto err; - /* see if we opened a raw device; otherwise, 'file' is the file name. */ - if (file == (char *)0 || *file == '\0') { - f->f_flags |= F_RAW; - f->f_rabuf = NULL; - return (fd); - } + /* see if we opened a raw device; otherwise, 'file' is the file name. */ + if (file == NULL || *file == '\0') { + f->f_flags |= F_RAW; + f->f_rabuf = NULL; + return (fd); + } - /* pass file name to the different filesystem open routines */ - besterror = ENOENT; - for (i = 0; file_system[i] != NULL; i++) { - fs = file_system[i]; - error = (fs->fo_open)(file, f); - if (error == 0) - goto ok; - if (error != EINVAL) - besterror = error; - } - error = besterror; + /* pass file name to the different filesystem open routines */ + besterror = ENOENT; + for (i = 0; file_system[i] != NULL; i++) { + fs = file_system[i]; + error = (fs->fo_open)(file, f); + if (error == 0) + goto ok; + if (error != EINVAL) + besterror = error; + } + error = besterror; - if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) - f->f_dev->dv_close(f); - if (error) - devclose(f); + if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) + f->f_dev->dv_close(f); + if (error) + devclose(f); - err: - f->f_flags = 0; - errno = error; - return (-1); +err: + f->f_flags = 0; + errno = error; + return (-1); - ok: - f->f_ops = fs; - o_rainit(f); - return (fd); +ok: + f->f_ops = fs; + o_rainit(f); + return (fd); } Modified: stable/11/stand/libsa/read.c ============================================================================== --- stable/11/stand/libsa/read.c Tue Feb 19 18:48:17 2019 (r344290) +++ stable/11/stand/libsa/read.c Tue Feb 19 18:50:20 2019 (r344291) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)read.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -69,59 +69,65 @@ __FBSDID("$FreeBSD$"); ssize_t read(int fd, void *dest, size_t bcount) { - struct open_file *f = &files[fd]; - size_t resid; + struct open_file *f = &files[fd]; + size_t resid; - if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) { - errno = EBADF; - return (-1); - } - if (f->f_flags & F_RAW) { - twiddle(4); - errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - btodb(f->f_offset), bcount, dest, &resid); - if (errno) - return (-1); - f->f_offset += resid; - return (resid); - } - - /* - * Optimise reads from regular files using a readahead buffer. - * If the request can't be satisfied from the current buffer contents, - * check to see if it should be bypassed, or refill the buffer and complete - * the request. - */ - resid = bcount; - for (;;) { - size_t ccount, cresid; - /* how much can we supply? */ - ccount = imin(f->f_ralen, resid); - if (ccount > 0) { - bcopy(f->f_rabuf + f->f_raoffset, dest, ccount); - f->f_raoffset += ccount; - f->f_ralen -= ccount; - resid -= ccount; - if (resid == 0) - return(bcount); - dest = (char *)dest + ccount; + if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) { + errno = EBADF; + return (-1); } - - /* will filling the readahead buffer again not help? */ - if (resid >= SOPEN_RASIZE) { - /* bypass the rest of the request and leave the buffer empty */ - if ((errno = (f->f_ops->fo_read)(f, dest, resid, &cresid))) - return (-1); - return(bcount - cresid); + if (f->f_flags & F_RAW) { + twiddle(4); + errno = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, + btodb(f->f_offset), bcount, dest, &resid); + if (errno) + return (-1); + f->f_offset += resid; + return (resid); } - /* fetch more data */ - if ((errno = (f->f_ops->fo_read)(f, f->f_rabuf, SOPEN_RASIZE, &cresid))) - return (-1); - f->f_raoffset = 0; - f->f_ralen = SOPEN_RASIZE - cresid; - /* no more data, return what we had */ - if (f->f_ralen == 0) - return(bcount - resid); - } + /* + * Optimise reads from regular files using a readahead buffer. + * If the request can't be satisfied from the current buffer contents, + * check to see if it should be bypassed, or refill the buffer and + * complete the request. + */ + resid = bcount; + for (;;) { + size_t ccount, cresid; + /* how much can we supply? */ + ccount = imin(f->f_ralen, resid); + if (ccount > 0) { + bcopy(f->f_rabuf + f->f_raoffset, dest, ccount); + f->f_raoffset += ccount; + f->f_ralen -= ccount; + resid -= ccount; + if (resid == 0) + return (bcount); + dest = (char *)dest + ccount; + } + + /* will filling the readahead buffer again not help? */ + if (f->f_rabuf == NULL || resid >= SOPEN_RASIZE) { + /* + * bypass the rest of the request and leave the + * buffer empty + */ + errno = (f->f_ops->fo_read)(f, dest, resid, &cresid); + if (errno != 0) + return (-1); + return (bcount - cresid); + } + + /* fetch more data */ + errno = (f->f_ops->fo_read)(f, f->f_rabuf, SOPEN_RASIZE, + &cresid); + if (errno != 0) + return (-1); + f->f_raoffset = 0; + f->f_ralen = SOPEN_RASIZE - cresid; + /* no more data, return what we had */ + if (f->f_ralen == 0) + return (bcount - resid); + } } Modified: stable/11/stand/libsa/write.c ============================================================================== --- stable/11/stand/libsa/write.c Tue Feb 19 18:48:17 2019 (r344290) +++ stable/11/stand/libsa/write.c Tue Feb 19 18:50:20 2019 (r344291) @@ -32,30 +32,30 @@ * SUCH DAMAGE. * * @(#)write.c 8.1 (Berkeley) 6/11/93 - * * + * * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University * All Rights Reserved. * * Author: Alessandro Forin - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -67,10 +67,7 @@ __FBSDID("$FreeBSD$"); #include "stand.h" ssize_t -write(fd, dest, bcount) - int fd; - const void *dest; - size_t bcount; +write(int fd, const void *dest, size_t bcount) { struct open_file *f = &files[fd]; size_t resid; @@ -82,8 +79,8 @@ write(fd, dest, bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - btodb(f->f_offset), bcount, __DECONST(void *, dest), - &resid); + btodb(f->f_offset), bcount, __DECONST(void *, dest), + &resid); if (errno) return (-1); f->f_offset += resid; From owner-svn-src-all@freebsd.org Tue Feb 19 19:04: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 3145214F9BE5; Tue, 19 Feb 2019 19:04:53 +0000 (UTC) (envelope-from thj@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 B31786DBD2; Tue, 19 Feb 2019 19:04:52 +0000 (UTC) (envelope-from thj@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 A5D712207A; Tue, 19 Feb 2019 19:04:52 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJ4qiL036880; Tue, 19 Feb 2019 19:04:52 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJ4qIh036879; Tue, 19 Feb 2019 19:04:52 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201902191904.x1JJ4qIh036879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Tue, 19 Feb 2019 19:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344292 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 344292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B31786DBD2 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)[-0.999,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, 19 Feb 2019 19:04:53 -0000 Author: thj Date: Tue Feb 19 19:04:52 2019 New Revision: 344292 URL: https://svnweb.freebsd.org/changeset/base/344292 Log: Fix style after r340832 Reported by: jhb Reviewed by: jhb, jtl Approved by: jtl (mentor) MFC after: 3 days Differential Revision: https://reviews/freebsd.org/D18354 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * Be sure we can get various info from the battery. */ if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) continue; /* If a battery is not installed, we sometimes get strange values. */ From owner-svn-src-all@freebsd.org Tue Feb 19 19:13: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 BA4FB14F9F8A; Tue, 19 Feb 2019 19:13:49 +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 5A21D6E111; Tue, 19 Feb 2019 19:13:49 +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 476BC22233; Tue, 19 Feb 2019 19:13:49 +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 x1JJDnf1042270; Tue, 19 Feb 2019 19:13:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJDnTW042269; Tue, 19 Feb 2019 19:13:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902191913.x1JJDnTW042269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 19:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344293 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 344293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A21D6E111 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)[-0.999,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, 19 Feb 2019 19:13:49 -0000 Author: kib Date: Tue Feb 19 19:13:48 2019 New Revision: 344293 URL: https://svnweb.freebsd.org/changeset/base/344293 Log: Add definition for %cr4 PKRU enable bit. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Feb 19 19:04:52 2019 (r344292) +++ head/sys/x86/include/specialreg.h Tue Feb 19 19:13:48 2019 (r344293) @@ -77,6 +77,7 @@ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ #define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ #define CR4_SMAP 0x00200000 /* Supervisor-Mode Access Prevention */ +#define CR4_PKE 0x00400000 /* Protection Keys Enable */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From owner-svn-src-all@freebsd.org Tue Feb 19 19: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 17A7B14FA00D; Tue, 19 Feb 2019 19:15:16 +0000 (UTC) (envelope-from sef@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 B011E6E291; Tue, 19 Feb 2019 19:15:15 +0000 (UTC) (envelope-from sef@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 9BE702223D; Tue, 19 Feb 2019 19:15:15 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJFF1S042391; Tue, 19 Feb 2019 19:15:15 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJFFlt042390; Tue, 19 Feb 2019 19:15:15 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902191915.x1JJFFlt042390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 19 Feb 2019 19:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344294 - head/lib/libc/posix1e X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/lib/libc/posix1e X-SVN-Commit-Revision: 344294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B011E6E291 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)[-0.999,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, 19 Feb 2019 19:15:16 -0000 Author: sef Date: Tue Feb 19 19:15:15 2019 New Revision: 344294 URL: https://svnweb.freebsd.org/changeset/base/344294 Log: Remove some redundant code in _posix1e_acl_strip_np This was discovered through examination -- acl_copy_entry() copies the tag type and permset fields. Reviewed by: trasz, pfg Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D19240 Modified: head/lib/libc/posix1e/acl_strip.c Modified: head/lib/libc/posix1e/acl_strip.c ============================================================================== --- head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:13:48 2019 (r344293) +++ head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:15:15 2019 (r344294) @@ -70,7 +70,6 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat { acl_t acl_new, acl_old; acl_entry_t entry, entry_new; - acl_permset_t perm; acl_tag_t tag; int entry_id, have_mask_entry; @@ -104,15 +103,7 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat case ACL_USER_OBJ: case ACL_GROUP_OBJ: case ACL_OTHER: - if (acl_get_tag_type(entry, &tag) == -1) - goto fail; - if (acl_get_permset(entry, &perm) == -1) - goto fail; if (acl_create_entry(&acl_new, &entry_new) == -1) - goto fail; - if (acl_set_tag_type(entry_new, tag) == -1) - goto fail; - if (acl_set_permset(entry_new, perm) == -1) goto fail; if (acl_copy_entry(entry_new, entry) == -1) goto fail; From owner-svn-src-all@freebsd.org Tue Feb 19 19:16: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 D092B14FA097; Tue, 19 Feb 2019 19:16:29 +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 6F10E6E425; Tue, 19 Feb 2019 19:16:29 +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 5C6582224C; Tue, 19 Feb 2019 19:16:29 +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 x1JJGTB9042490; Tue, 19 Feb 2019 19:16:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJGSU3042487; Tue, 19 Feb 2019 19:16:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902191916.x1JJGSU3042487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Feb 2019 19:16:28 +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: r344295 - in stable/11/stand: common i386/libi386 i386/zfsboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: common i386/libi386 i386/zfsboot X-SVN-Commit-Revision: 344295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F10E6E425 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 19 Feb 2019 19:16:30 -0000 Author: kevans Date: Tue Feb 19 19:16:28 2019 New Revision: 344295 URL: https://svnweb.freebsd.org/changeset/base/344295 Log: MFC r335245-r335248, r335254, r335276, r335298, r335398, r335868, r335883 r335245: Correct logic error in biosdisk.c:bd_realstrategy() The wrong condition is used when evaluating the return of disk_ioctl() This results in reaching the 'We should not get here' branch in most casts r335246: biosdisk.c remove redundant variable `rdev` and `disk` serve the same purpose, read the partition table without the `d_offset` or `d_slice` set, so the read is relative to the start of the disk. Reuse the already initialized `disk` instead of making another copy later. r335247: biosdisk.c: add missing \n to error message r335248: biosdisk.c: fix type in debug printf r335254: Avoid reading past the end of the disk in zfsboot.c and biosdisk.c The GELI boot code rounds reads up to 4k, since the encrypted sectors are 4k, and must be decrypted as a unit. With oddball sized disks (almost always virtual), this can lead to reading past the end of the disk. r335276: gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early Normally the serial console is not enabled until /boot.config is read and we know how the serial console should be configured. Initialize the consoles early in 'dual' mode (serial & keyboard) with a default serial rate of 115200. Then serial is re-initialized once the disk is decrypted and the /boot.config file can be read. This allows the GELIBoot passphrase to be provided via the serial console. r335298: stand/common/disk.c: Update debug printf This was missed in r330809 because it is compiled out by default r335398: Revert r335276 This was causing issues for people booting. I will likely bring this back as an optional feature, similar to boot0sio, like gptboot-serial or something. r335868: stand/common/disk.c: Read partition table relative to the start of the disk If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh, when disk_open() is called on a GELI encrypted partition, attempts to read the partition table fail, as they pass through the decryption process which turns the already plaintext data into jibberish. When reading the partition table, always pass a slice and partition setting of -1, and an offset of 0. Setting the slice to -1 prevents a false positive when checking the slice against the cache of GELI encrypted slices. r335883: stand/common/disk.c: dev->d_offset still needs to be set to 0 With r335868, I thought this was no longer necessary. I was wrong. Modified: stable/11/stand/common/disk.c stable/11/stand/i386/libi386/biosdisk.c stable/11/stand/i386/zfsboot/zfsboot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/disk.c ============================================================================== --- stable/11/stand/common/disk.c Tue Feb 19 19:15:15 2019 (r344294) +++ stable/11/stand/common/disk.c Tue Feb 19 19:16:28 2019 (r344295) @@ -219,20 +219,13 @@ disk_ioctl(struct disk_devdesc *dev, u_long cmd, void int disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize) { + struct disk_devdesc partdev; struct open_disk *od; struct ptable *table; struct ptable_entry part; int rc, slice, partition; rc = 0; - /* - * While we are reading disk metadata, make sure we do it relative - * to the start of the disk - */ - dev->d_offset = 0; - table = NULL; - slice = dev->d_slice; - partition = dev->d_partition; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) { DEBUG("no memory"); @@ -242,11 +235,25 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->entrysize = 0; od->mediasize = mediasize; od->sectorsize = sectorsize; + /* + * While we are reading disk metadata, make sure we do it relative + * to the start of the disk + */ + memcpy(&partdev, dev, sizeof(partdev)); + partdev.d_offset = 0; + partdev.d_slice = -1; + partdev.d_partition = -1; + + dev->d_offset = 0; + table = NULL; + slice = dev->d_slice; + partition = dev->d_partition; + DEBUG("%s unit %d, slice %d, partition %d => %p", - disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition, od); + disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, od); /* Determine disk layout. */ - od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, + od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize, ptblread); if (od->table == NULL) { DEBUG("Can't read partition table"); Modified: stable/11/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/11/stand/i386/libi386/biosdisk.c Tue Feb 19 19:15:15 2019 (r344294) +++ stable/11/stand/i386/libi386/biosdisk.c Tue Feb 19 19:16:28 2019 (r344295) @@ -379,7 +379,7 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - struct disk_devdesc *dev, rdev; + struct disk_devdesc *dev; struct disk_devdesc disk; int err, g_err; va_list ap; @@ -445,11 +445,8 @@ bd_open(struct open_file *f, ...) dskp.part = dev->d_partition; dskp.start = dev->d_offset; - memcpy(&rdev, dev, sizeof(rdev)); - /* to read the GPT table, we need to read the first sector */ - rdev.d_offset = 0; /* We need the LBA of the end of the partition */ - table = ptable_open(&rdev, BD(dev).bd_sectors, + table = ptable_open(&disk, BD(dev).bd_sectors, BD(dev).bd_sectorsize, ptblread); if (table == NULL) { DEBUG("Can't read partition table"); @@ -594,8 +591,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s *rsize = 0; /* Get disk blocks, this value is either for whole disk or for partition */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks)) { - /* DIOCGMEDIASIZE does return bytes. */ + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE returns bytes. */ disk_blocks /= BD(dev).bd_sectorsize; } else { /* We should not get here. Just try to survive. */ @@ -622,7 +619,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (blks && (rc = bd_read(dev, dblk, blks, buf))) { /* Filter out floppy controller errors */ if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x", blks, dblk, + printf("read %d from %lld to %p, error: 0x%x\n", blks, dblk, buf, rc); } return (EIO); @@ -638,7 +635,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s #endif break; case F_WRITE : - DEBUG("write %d from %d to %p", blks, dblk, buf); + DEBUG("write %d from %lld to %p", blks, dblk, buf); if (blks && bd_write(dev, dblk, blks, buf)) { DEBUG("write error"); @@ -883,6 +880,12 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl if (tmpbuf == NULL) { return (-1); } + } + + if (alignlba + alignblks > BD(dev).bd_sectors) { + DEBUG("Shorted read at %llu from %d to %llu blocks", + alignlba, alignblks, BD(dev).bd_sectors - alignlba); + alignblks = BD(dev).bd_sectors - alignlba; } err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); Modified: stable/11/stand/i386/zfsboot/zfsboot.c ============================================================================== --- stable/11/stand/i386/zfsboot/zfsboot.c Tue Feb 19 19:15:15 2019 (r344294) +++ stable/11/stand/i386/zfsboot/zfsboot.c Tue Feb 19 19:16:28 2019 (r344295) @@ -209,6 +209,12 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu alignnb = roundup2(nb * DEV_BSIZE + diff, DEV_GELIBOOT_BSIZE) / DEV_BSIZE; + if (dsk->size > 0 && alignlba + alignnb > dsk->size + dsk->start) { + printf("Shortening read at %lld from %d to %lld\n", alignlba, + alignnb, (dsk->size + dsk->start) - alignlba); + alignnb = (dsk->size + dsk->start) - alignlba; + } + if (drvread(dsk, dmadat->rdbuf, alignlba, alignnb)) return -1; #ifdef LOADER_GELI_SUPPORT @@ -694,7 +700,7 @@ main(void) dsk->slice = *(uint8_t *)PTOV(ARGS + 1) + 1; dsk->part = 0; dsk->start = 0; - dsk->size = 0; + dsk->size = drvsize_ext(dsk); bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); @@ -745,7 +751,7 @@ main(void) dsk->slice = 0; dsk->part = 0; dsk->start = 0; - dsk->size = 0; + dsk->size = drvsize_ext(dsk); probe_drive(dsk); } From owner-svn-src-all@freebsd.org Tue Feb 19 19:17: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 AE44914FA0FD; Tue, 19 Feb 2019 19:17:21 +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 531706E596; Tue, 19 Feb 2019 19:17:21 +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 0FC622225D; Tue, 19 Feb 2019 19:17:21 +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 x1JJHKQ4042579; Tue, 19 Feb 2019 19:17:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJHK4m042577; Tue, 19 Feb 2019 19:17:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902191917.x1JJHK4m042577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 19:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344296 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 344296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 531706E596 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)[-0.999,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, 19 Feb 2019 19:17:21 -0000 Author: kib Date: Tue Feb 19 19:17:20 2019 New Revision: 344296 URL: https://svnweb.freebsd.org/changeset/base/344296 Log: Provide convenience C wrappers for RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Feb 19 19:16:28 2019 (r344295) +++ head/sys/amd64/include/cpufunc.h Tue Feb 19 19:17:20 2019 (r344296) @@ -627,6 +627,22 @@ cpu_mwait(u_long extensions, u_int hints) __asm __volatile("mwait" : : "a" (hints), "c" (extensions)); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #ifdef _KERNEL /* This is defined in but is too painful to get to */ #ifndef MSR_FSBASE Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Tue Feb 19 19:16:28 2019 (r344295) +++ head/sys/i386/include/cpufunc.h Tue Feb 19 19:17:20 2019 (r344296) @@ -726,6 +726,22 @@ intr_restore(register_t eflags) write_eflags(eflags); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); From owner-svn-src-all@freebsd.org Tue Feb 19 19:36: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 4FF4C14FAA61; Tue, 19 Feb 2019 19:36:45 +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 E53B86F319; Tue, 19 Feb 2019 19:36:44 +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 D6F65225FD; Tue, 19 Feb 2019 19:36:44 +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 x1JJai51052886; Tue, 19 Feb 2019 19:36:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJai3M052883; Tue, 19 Feb 2019 19:36:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191936.x1JJai3M052883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344297 - in head/sys: conf dev/drm modules modules/drm modules/drm/drm modules/drm/mach64 modules/drm/mga modules/drm/r128 modules/drm/savage modules/drm/sis modules/drm/tdfx modules/d... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/drm modules modules/drm modules/drm/drm modules/drm/mach64 modules/drm/mga modules/drm/r128 modules/drm/savage modules/drm/sis modules/drm/tdfx modules/drm/via X-SVN-Commit-Revision: 344297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E53B86F319 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 19:36:45 -0000 Author: imp Date: Tue Feb 19 19:36:43 2019 New Revision: 344297 URL: https://svnweb.freebsd.org/changeset/base/344297 Log: Per discussions on arch@ and elsewhere, retire drm module / drives. Retire the drm modules / drivers. These are now handled by the drm-legacy-kmod port and/or the drm-kmod port. All future development and maintanace will be handled there. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm.h head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_agpsupport.c head/sys/dev/drm/drm_atomic.h head/sys/dev/drm/drm_auth.c head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_context.c head/sys/dev/drm/drm_dma.c head/sys/dev/drm/drm_drawable.c head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_fops.c head/sys/dev/drm/drm_hashtab.c head/sys/dev/drm/drm_hashtab.h head/sys/dev/drm/drm_internal.h head/sys/dev/drm/drm_ioctl.c head/sys/dev/drm/drm_irq.c head/sys/dev/drm/drm_linux_list.h head/sys/dev/drm/drm_lock.c head/sys/dev/drm/drm_memory.c head/sys/dev/drm/drm_mm.c head/sys/dev/drm/drm_mm.h head/sys/dev/drm/drm_pci.c head/sys/dev/drm/drm_pciids.h head/sys/dev/drm/drm_sarea.h head/sys/dev/drm/drm_scatter.c head/sys/dev/drm/drm_sman.c head/sys/dev/drm/drm_sman.h head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm/drm_vm.c head/sys/dev/drm/mach64_dma.c head/sys/dev/drm/mach64_drm.h head/sys/dev/drm/mach64_drv.c head/sys/dev/drm/mach64_drv.h head/sys/dev/drm/mach64_irq.c head/sys/dev/drm/mach64_state.c head/sys/dev/drm/mga_dma.c head/sys/dev/drm/mga_drm.h head/sys/dev/drm/mga_drv.c head/sys/dev/drm/mga_drv.h head/sys/dev/drm/mga_irq.c head/sys/dev/drm/mga_state.c head/sys/dev/drm/mga_ucode.h head/sys/dev/drm/mga_warp.c head/sys/dev/drm/r128_cce.c head/sys/dev/drm/r128_drm.h head/sys/dev/drm/r128_drv.c head/sys/dev/drm/r128_drv.h head/sys/dev/drm/r128_irq.c head/sys/dev/drm/r128_state.c head/sys/dev/drm/savage_bci.c head/sys/dev/drm/savage_drm.h head/sys/dev/drm/savage_drv.c head/sys/dev/drm/savage_drv.h head/sys/dev/drm/savage_state.c head/sys/dev/drm/sis_drm.h head/sys/dev/drm/sis_drv.c head/sys/dev/drm/sis_drv.h head/sys/dev/drm/sis_ds.c head/sys/dev/drm/sis_ds.h head/sys/dev/drm/sis_mm.c head/sys/dev/drm/tdfx_drv.c head/sys/dev/drm/tdfx_drv.h head/sys/dev/drm/via_3d_reg.h head/sys/dev/drm/via_dma.c head/sys/dev/drm/via_dmablit.c head/sys/dev/drm/via_dmablit.h head/sys/dev/drm/via_drm.h head/sys/dev/drm/via_drv.c head/sys/dev/drm/via_drv.h head/sys/dev/drm/via_irq.c head/sys/dev/drm/via_map.c head/sys/dev/drm/via_mm.c head/sys/dev/drm/via_verifier.c head/sys/dev/drm/via_verifier.h head/sys/dev/drm/via_video.c head/sys/modules/drm/Makefile head/sys/modules/drm/Makefile.inc head/sys/modules/drm/drm/Makefile head/sys/modules/drm/mach64/Makefile head/sys/modules/drm/mga/Makefile head/sys/modules/drm/r128/Makefile head/sys/modules/drm/savage/Makefile head/sys/modules/drm/sis/Makefile head/sys/modules/drm/tdfx/Makefile head/sys/modules/drm/via/Makefile Modified: head/sys/conf/files head/sys/conf/kern.opts.mk head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/conf/files Tue Feb 19 19:36:43 2019 (r344297) @@ -1541,55 +1541,6 @@ dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme -dev/drm/ati_pcigart.c optional drm -dev/drm/drm_agpsupport.c optional drm -dev/drm/drm_auth.c optional drm -dev/drm/drm_bufs.c optional drm -dev/drm/drm_context.c optional drm -dev/drm/drm_dma.c optional drm -dev/drm/drm_drawable.c optional drm -dev/drm/drm_drv.c optional drm -dev/drm/drm_fops.c optional drm -dev/drm/drm_hashtab.c optional drm -dev/drm/drm_ioctl.c optional drm -dev/drm/drm_irq.c optional drm -dev/drm/drm_lock.c optional drm -dev/drm/drm_memory.c optional drm -dev/drm/drm_mm.c optional drm -dev/drm/drm_pci.c optional drm -dev/drm/drm_scatter.c optional drm -dev/drm/drm_sman.c optional drm -dev/drm/drm_sysctl.c optional drm -dev/drm/drm_vm.c optional drm -dev/drm/mach64_dma.c optional mach64drm -dev/drm/mach64_drv.c optional mach64drm -dev/drm/mach64_irq.c optional mach64drm -dev/drm/mach64_state.c optional mach64drm -dev/drm/mga_dma.c optional mgadrm -dev/drm/mga_drv.c optional mgadrm -dev/drm/mga_irq.c optional mgadrm -dev/drm/mga_state.c optional mgadrm -dev/drm/mga_warp.c optional mgadrm -dev/drm/r128_cce.c optional r128drm \ - compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" -dev/drm/r128_drv.c optional r128drm -dev/drm/r128_irq.c optional r128drm -dev/drm/r128_state.c optional r128drm -dev/drm/savage_bci.c optional savagedrm -dev/drm/savage_drv.c optional savagedrm -dev/drm/savage_state.c optional savagedrm -dev/drm/sis_drv.c optional sisdrm -dev/drm/sis_ds.c optional sisdrm -dev/drm/sis_mm.c optional sisdrm -dev/drm/tdfx_drv.c optional tdfxdrm -dev/drm/via_dma.c optional viadrm -dev/drm/via_dmablit.c optional viadrm -dev/drm/via_drv.c optional viadrm -dev/drm/via_irq.c optional viadrm -dev/drm/via_map.c optional viadrm -dev/drm/via_mm.c optional viadrm -dev/drm/via_verifier.c optional viadrm -dev/drm/via_video.c optional viadrm dev/drm2/drm_agpsupport.c optional drm2 dev/drm2/drm_auth.c optional drm2 dev/drm2/drm_bufs.c optional drm2 Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/conf/kern.opts.mk Tue Feb 19 19:36:43 2019 (r344297) @@ -50,7 +50,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ - MODULE_DRM \ MODULE_DRM2 \ NAND \ OFED \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Feb 19 19:17:20 2019 (r344296) +++ head/sys/modules/Makefile Tue Feb 19 19:36:43 2019 (r344297) @@ -109,7 +109,6 @@ SUBDIR= \ dcons_crom \ de \ ${_dpms} \ - ${_drm} \ ${_drm2} \ dummynet \ ${_ed} \ @@ -582,9 +581,6 @@ _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs _dpms= dpms -.if ${MK_MODULE_DRM} != "no" -_drm= drm -.endif .if ${MK_MODULE_DRM2} != "no" _drm2= drm2 .endif @@ -776,9 +772,6 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq -.if ${MK_MODULE_DRM} != "no" -_drm= drm -.endif _exca= exca _ffec= ffec _nvd= nvd From owner-svn-src-all@freebsd.org Tue Feb 19 19:37: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 DF36E14FAADA; Tue, 19 Feb 2019 19:37:00 +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 CCD506F41F; Tue, 19 Feb 2019 19:36:58 +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 E194B225FE; Tue, 19 Feb 2019 19:36: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 x1JJauOc052946; Tue, 19 Feb 2019 19:36:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJauRP052944; Tue, 19 Feb 2019 19:36:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191936.x1JJauRP052944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344298 - in head/sys: conf modules modules/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms modules/drm2/radeonkmsfw modules/drm2/radeonkmsfw/ARUBA_me modules/drm2/ra... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf modules modules/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms modules/drm2/radeonkmsfw modules/drm2/radeonkmsfw/ARUBA_me modules/drm2/radeonkmsfw/ARUBA_pfp modul... X-SVN-Commit-Revision: 344298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCD506F41F 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)[-0.999,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, 19 Feb 2019 19:37:01 -0000 Author: imp Date: Tue Feb 19 19:36:56 2019 New Revision: 344298 URL: https://svnweb.freebsd.org/changeset/base/344298 Log: Remove drm2 modules. Remove support for compiling drm2 as a module. This has transitioned to the drm-kmod or drm-legacy-kmodw ports. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/modules/drm2/Makefile head/sys/modules/drm2/Makefile.inc head/sys/modules/drm2/drm2/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_me/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_me/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/BTC_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_me/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_me/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile.inc head/sys/modules/drm2/radeonkmsfw/OLAND_ce/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_mc/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_me/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_me/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_me/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R100_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R200_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R300_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R420_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R520_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_me/Makefile head/sys/modules/drm2/radeonkmsfw/R600_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R700_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_me/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/RS600_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS690_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_me/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_ce/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_mc/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_me/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/TAHITI_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_me/Makefile head/sys/modules/drm2/radeonkmsfw/TURKS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_ce/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_mc/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_me/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/VERDE_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/gen-makefiles Modified: head/sys/conf/kern.opts.mk head/sys/modules/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Feb 19 19:36:43 2019 (r344297) +++ head/sys/conf/kern.opts.mk Tue Feb 19 19:36:56 2019 (r344298) @@ -50,7 +50,6 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ - MODULE_DRM2 \ NAND \ OFED \ RATELIMIT Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Feb 19 19:36:43 2019 (r344297) +++ head/sys/modules/Makefile Tue Feb 19 19:36:56 2019 (r344298) @@ -109,7 +109,6 @@ SUBDIR= \ dcons_crom \ de \ ${_dpms} \ - ${_drm2} \ dummynet \ ${_ed} \ ${_efirt} \ @@ -581,9 +580,6 @@ _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs _dpms= dpms -.if ${MK_MODULE_DRM2} != "no" -_drm2= drm2 -.endif _ed= ed _em= em _ena= ena @@ -781,9 +777,6 @@ _wi= wi .endif .if ${MACHINE_ARCH} == "powerpc64" -.if ${MK_MODULE_DRM2} != "no" -_drm2= drm2 -.endif _ipmi= ipmi .endif .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" From owner-svn-src-all@freebsd.org Tue Feb 19 19:37: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 1B4A914FAB3E; Tue, 19 Feb 2019 19:37: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 9DAAD6F480; Tue, 19 Feb 2019 19:37:03 +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 5790522601; Tue, 19 Feb 2019 19:37:03 +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 x1JJb3BP053004; Tue, 19 Feb 2019 19:37:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJb3Ma053003; Tue, 19 Feb 2019 19:37:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191937.x1JJb3Ma053003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344299 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/radeon/reg_srcs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/radeon/reg_srcs X-SVN-Commit-Revision: 344299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DAAD6F480 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.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 19:37:04 -0000 Author: imp Date: Tue Feb 19 19:37:02 2019 New Revision: 344299 URL: https://svnweb.freebsd.org/changeset/base/344299 Log: Remove the i915 and radeon drivers. Per discussions on arch@ and elsewhere, the maintenance of this code has moved to the drm-kmod and drm-legacy-kmod ports. Remove the i915 and radeon drivers from the tree. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm2/ati_pcigart.c head/sys/dev/drm2/i915/dvo.h head/sys/dev/drm2/i915/dvo_ch7017.c head/sys/dev/drm2/i915/dvo_ch7xxx.c head/sys/dev/drm2/i915/dvo_ivch.c head/sys/dev/drm2/i915/dvo_ns2501.c head/sys/dev/drm2/i915/dvo_sil164.c head/sys/dev/drm2/i915/dvo_tfp410.c head/sys/dev/drm2/i915/i915_debug.c head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_context.c head/sys/dev/drm2/i915/i915_gem_evict.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_stolen.c head/sys/dev/drm2/i915/i915_gem_tiling.c head/sys/dev/drm2/i915/i915_ioc32.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/i915_suspend.c head/sys/dev/drm2/i915/intel_acpi.c head/sys/dev/drm2/i915/intel_bios.c head/sys/dev/drm2/i915/intel_bios.h head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_ddi.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_dvo.c head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/drm2/i915/intel_hdmi.c head/sys/dev/drm2/i915/intel_iic.c head/sys/dev/drm2/i915/intel_lvds.c head/sys/dev/drm2/i915/intel_modes.c head/sys/dev/drm2/i915/intel_opregion.c head/sys/dev/drm2/i915/intel_overlay.c head/sys/dev/drm2/i915/intel_panel.c head/sys/dev/drm2/i915/intel_pm.c head/sys/dev/drm2/i915/intel_ringbuffer.c head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/dev/drm2/i915/intel_sdvo.c head/sys/dev/drm2/i915/intel_sdvo_regs.h head/sys/dev/drm2/i915/intel_sprite.c head/sys/dev/drm2/i915/intel_tv.c head/sys/dev/drm2/radeon/ObjectID.h head/sys/dev/drm2/radeon/README head/sys/dev/drm2/radeon/atom-bits.h head/sys/dev/drm2/radeon/atom-names.h head/sys/dev/drm2/radeon/atom-types.h head/sys/dev/drm2/radeon/atom.c head/sys/dev/drm2/radeon/atom.h head/sys/dev/drm2/radeon/atombios.h head/sys/dev/drm2/radeon/atombios_crtc.c head/sys/dev/drm2/radeon/atombios_dp.c head/sys/dev/drm2/radeon/atombios_encoders.c head/sys/dev/drm2/radeon/atombios_i2c.c head/sys/dev/drm2/radeon/avivod.h head/sys/dev/drm2/radeon/cayman_blit_shaders.c head/sys/dev/drm2/radeon/cayman_blit_shaders.h head/sys/dev/drm2/radeon/cayman_reg_safe.h head/sys/dev/drm2/radeon/evergreen.c head/sys/dev/drm2/radeon/evergreen_blit_kms.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.h head/sys/dev/drm2/radeon/evergreen_cs.c head/sys/dev/drm2/radeon/evergreen_hdmi.c head/sys/dev/drm2/radeon/evergreen_reg.h head/sys/dev/drm2/radeon/evergreen_reg_safe.h head/sys/dev/drm2/radeon/evergreend.h head/sys/dev/drm2/radeon/ni.c head/sys/dev/drm2/radeon/ni_reg.h head/sys/dev/drm2/radeon/nid.h head/sys/dev/drm2/radeon/r100.c head/sys/dev/drm2/radeon/r100_reg_safe.h head/sys/dev/drm2/radeon/r100_track.h head/sys/dev/drm2/radeon/r100d.h head/sys/dev/drm2/radeon/r200.c head/sys/dev/drm2/radeon/r200_reg_safe.h head/sys/dev/drm2/radeon/r300.c head/sys/dev/drm2/radeon/r300_reg.h head/sys/dev/drm2/radeon/r300_reg_safe.h head/sys/dev/drm2/radeon/r300d.h head/sys/dev/drm2/radeon/r420.c head/sys/dev/drm2/radeon/r420_reg_safe.h head/sys/dev/drm2/radeon/r420d.h head/sys/dev/drm2/radeon/r500_reg.h head/sys/dev/drm2/radeon/r520.c head/sys/dev/drm2/radeon/r520d.h head/sys/dev/drm2/radeon/r600.c head/sys/dev/drm2/radeon/r600_audio.c head/sys/dev/drm2/radeon/r600_blit_kms.c head/sys/dev/drm2/radeon/r600_blit_shaders.c head/sys/dev/drm2/radeon/r600_blit_shaders.h head/sys/dev/drm2/radeon/r600_cp.h head/sys/dev/drm2/radeon/r600_cs.c head/sys/dev/drm2/radeon/r600_cs.h head/sys/dev/drm2/radeon/r600_hdmi.c head/sys/dev/drm2/radeon/r600_reg.h head/sys/dev/drm2/radeon/r600_reg_safe.h head/sys/dev/drm2/radeon/r600d.h head/sys/dev/drm2/radeon/radeon.h head/sys/dev/drm2/radeon/radeon_acpi.c head/sys/dev/drm2/radeon/radeon_acpi.h head/sys/dev/drm2/radeon/radeon_agp.c head/sys/dev/drm2/radeon/radeon_asic.c head/sys/dev/drm2/radeon/radeon_asic.h head/sys/dev/drm2/radeon/radeon_atombios.c head/sys/dev/drm2/radeon/radeon_benchmark.c head/sys/dev/drm2/radeon/radeon_bios.c head/sys/dev/drm2/radeon/radeon_blit_common.h head/sys/dev/drm2/radeon/radeon_clocks.c head/sys/dev/drm2/radeon/radeon_combios.c head/sys/dev/drm2/radeon/radeon_connectors.c head/sys/dev/drm2/radeon/radeon_cs.c head/sys/dev/drm2/radeon/radeon_cursor.c head/sys/dev/drm2/radeon/radeon_device.c head/sys/dev/drm2/radeon/radeon_display.c head/sys/dev/drm2/radeon/radeon_drm.h head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/drm2/radeon/radeon_drv.h head/sys/dev/drm2/radeon/radeon_encoders.c head/sys/dev/drm2/radeon/radeon_family.h head/sys/dev/drm2/radeon/radeon_fb.c head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_gart.c head/sys/dev/drm2/radeon/radeon_gem.c head/sys/dev/drm2/radeon/radeon_gem.h head/sys/dev/drm2/radeon/radeon_i2c.c head/sys/dev/drm2/radeon/radeon_irq.c head/sys/dev/drm2/radeon/radeon_irq_kms.c head/sys/dev/drm2/radeon/radeon_irq_kms.h head/sys/dev/drm2/radeon/radeon_kms.c head/sys/dev/drm2/radeon/radeon_kms.h head/sys/dev/drm2/radeon/radeon_legacy_crtc.c head/sys/dev/drm2/radeon/radeon_legacy_encoders.c head/sys/dev/drm2/radeon/radeon_legacy_tv.c head/sys/dev/drm2/radeon/radeon_mem.c head/sys/dev/drm2/radeon/radeon_mode.h head/sys/dev/drm2/radeon/radeon_object.c head/sys/dev/drm2/radeon/radeon_object.h head/sys/dev/drm2/radeon/radeon_pm.c head/sys/dev/drm2/radeon/radeon_prime.c head/sys/dev/drm2/radeon/radeon_reg.h head/sys/dev/drm2/radeon/radeon_ring.c head/sys/dev/drm2/radeon/radeon_sa.c head/sys/dev/drm2/radeon/radeon_semaphore.c head/sys/dev/drm2/radeon/radeon_test.c head/sys/dev/drm2/radeon/radeon_trace.h head/sys/dev/drm2/radeon/radeon_trace_points.c head/sys/dev/drm2/radeon/radeon_ttm.c head/sys/dev/drm2/radeon/reg_srcs/cayman head/sys/dev/drm2/radeon/reg_srcs/evergreen head/sys/dev/drm2/radeon/reg_srcs/r100 head/sys/dev/drm2/radeon/reg_srcs/r200 head/sys/dev/drm2/radeon/reg_srcs/r300 head/sys/dev/drm2/radeon/reg_srcs/r420 head/sys/dev/drm2/radeon/reg_srcs/r600 head/sys/dev/drm2/radeon/reg_srcs/rn50 head/sys/dev/drm2/radeon/reg_srcs/rs600 head/sys/dev/drm2/radeon/reg_srcs/rv515 head/sys/dev/drm2/radeon/rn50_reg_safe.h head/sys/dev/drm2/radeon/rs100d.h head/sys/dev/drm2/radeon/rs400.c head/sys/dev/drm2/radeon/rs400d.h head/sys/dev/drm2/radeon/rs600.c head/sys/dev/drm2/radeon/rs600_reg_safe.h head/sys/dev/drm2/radeon/rs600d.h head/sys/dev/drm2/radeon/rs690.c head/sys/dev/drm2/radeon/rs690d.h head/sys/dev/drm2/radeon/rv200d.h head/sys/dev/drm2/radeon/rv250d.h head/sys/dev/drm2/radeon/rv350d.h head/sys/dev/drm2/radeon/rv515.c head/sys/dev/drm2/radeon/rv515_reg_safe.h head/sys/dev/drm2/radeon/rv515d.h head/sys/dev/drm2/radeon/rv770.c head/sys/dev/drm2/radeon/rv770d.h head/sys/dev/drm2/radeon/si.c head/sys/dev/drm2/radeon/si_blit_shaders.c head/sys/dev/drm2/radeon/si_blit_shaders.h head/sys/dev/drm2/radeon/si_reg.h head/sys/dev/drm2/radeon/sid.h Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 19 19:36:56 2019 (r344298) +++ head/sys/conf/files Tue Feb 19 19:37:02 2019 (r344299) @@ -1584,7 +1584,6 @@ dev/drm2/ttm/ttm_execbuf_util.c optional drm2 dev/drm2/ttm/ttm_memory.c optional drm2 dev/drm2/ttm/ttm_page_alloc.c optional drm2 dev/drm2/ttm/ttm_bo_vm.c optional drm2 -dev/drm2/ati_pcigart.c optional drm2 agp pci dev/ed/if_ed.c optional ed dev/ed/if_ed_novell.c optional ed dev/ed/if_ed_rtl80x9.c optional ed From owner-svn-src-all@freebsd.org Tue Feb 19 19: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 A90A014FAB82; Tue, 19 Feb 2019 19:37: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 D9C3A6F589; Tue, 19 Feb 2019 19:37:14 +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 0616622602; Tue, 19 Feb 2019 19:37:10 +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 x1JJb9kx053059; Tue, 19 Feb 2019 19:37:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJb9H6053057; Tue, 19 Feb 2019 19:37:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902191937.x1JJb9H6053057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344300 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 344300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9C3A6F589 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)[-0.999,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, 19 Feb 2019 19:37:15 -0000 Author: imp Date: Tue Feb 19 19:37:09 2019 New Revision: 344300 URL: https://svnweb.freebsd.org/changeset/base/344300 Log: Add an UPDATING entry for the removal of drm and drm2 Also bump FreeBSD version to 1300013 since this series is a big change. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 19 19:37:02 2019 (r344299) +++ head/UPDATING Tue Feb 19 19:37:09 2019 (r344300) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190219: + drm and drm2 have been removed from the tree. Please see + https://wiki.freebsd.org/Graphics for the latest information on + migrating to the drm ports. + 20190131: Iflib is no longer unconditionally compiled into the kernel. Drivers using iflib and statically compiled into the kernel, now require Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Feb 19 19:37:02 2019 (r344299) +++ head/sys/sys/param.h Tue Feb 19 19:37:09 2019 (r344300) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Feb 19 19:57: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 8A8A714FB7A5; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@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 2C40A70F83; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@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 1899122982; Tue, 19 Feb 2019 19:57:56 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JJvtGb065455; Tue, 19 Feb 2019 19:57:55 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JJvtdq065454; Tue, 19 Feb 2019 19:57:55 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201902191957.x1JJvtdq065454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Tue, 19 Feb 2019 19:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344301 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 344301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C40A70F83 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)[-0.999,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, 19 Feb 2019 19:57:56 -0000 Author: thj Date: Tue Feb 19 19:57:55 2019 New Revision: 344301 URL: https://svnweb.freebsd.org/changeset/base/344301 Log: When dropping a fragment queue count the number of fragments in the queue When dropping a fragment queue, account for the number of fragments in the queue. This improves accounting between the number of fragments received and the number of fragments dropped. Reviewed by: jtl, bz, transport Approved by: jtl (mentor), bz (mentor) Differential Revision: https://review.freebsd.org/D17521 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Feb 19 19:37:09 2019 (r344300) +++ head/sys/netinet6/frag6.c Tue Feb 19 19:57:55 2019 (r344301) @@ -593,7 +593,7 @@ insert: af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -603,7 +603,7 @@ insert: } if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -861,7 +861,8 @@ frag6_slowtimo(void) --q6->ip6q_ttl; q6 = q6->ip6q_next; if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); + IP6STAT_ADD(ip6s_fragtimeout, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(q6->ip6q_prev, i); } @@ -879,7 +880,8 @@ frag6_slowtimo(void) (V_ip6_maxfragpackets > 0 && V_ip6q[i].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } @@ -896,7 +898,8 @@ frag6_slowtimo(void) IP6Q_LOCK(i); head = IP6Q_HEAD(i); if (head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } From owner-svn-src-all@freebsd.org Tue Feb 19 20:12: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 4437414FBC2B; Tue, 19 Feb 2019 20:12:13 +0000 (UTC) (envelope-from mckusick@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 D895A71928; Tue, 19 Feb 2019 20:12:12 +0000 (UTC) (envelope-from mckusick@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 C82EB22CC0; Tue, 19 Feb 2019 20:12:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JKCCMj071558; Tue, 19 Feb 2019 20:12:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JKCC6m071557; Tue, 19 Feb 2019 20:12:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201902192012.x1JKCC6m071557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 19 Feb 2019 20:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344302 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 344302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D895A71928 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)[-0.999,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, 19 Feb 2019 20:12:13 -0000 Author: mckusick Date: Tue Feb 19 20:12:12 2019 New Revision: 344302 URL: https://svnweb.freebsd.org/changeset/base/344302 Log: Ensure that inode updates are properly flushed out during the first pass of fsck_ffs. Some changes, such as check-hash corrections were being lost. Reported by: Michael Tuexen (tuexen@) Tested by: Michael Tuexen (tuexen@) MFC after: 3 days Modified: head/sbin/fsck_ffs/inode.c Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Tue Feb 19 19:57:55 2019 (r344301) +++ head/sbin/fsck_ffs/inode.c Tue Feb 19 20:12:12 2019 (r344302) @@ -349,9 +349,11 @@ getnextinode(ino_t inumber, int rebuildcg) lastinum += fullcnt; } /* + * Flush old contents in case they have been updated. * If getblk encounters an error, it will already have zeroed * out the buffer, so we do not need to do so here. */ + flush(fswritefd, &inobuf); getblk(&inobuf, blk, size); nextinop = inobuf.b_un.b_buf; } @@ -461,6 +463,10 @@ void freeinodebuf(void) { + /* + * Flush old contents in case they have been updated. + */ + flush(fswritefd, &inobuf); if (inobuf.b_un.b_buf != NULL) free((char *)inobuf.b_un.b_buf); inobuf.b_un.b_buf = NULL; From owner-svn-src-all@freebsd.org Tue Feb 19 20:26: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 D58C014D70B8; Tue, 19 Feb 2019 20:26:04 +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 6EB6E71FF3; Tue, 19 Feb 2019 20:26:04 +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 5D80D22E95; Tue, 19 Feb 2019 20:26:04 +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 x1JKQ4A5080779; Tue, 19 Feb 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JKQ4Kn080778; Tue, 19 Feb 2019 20:26:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902192026.x1JKQ4Kn080778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Feb 2019 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344303 - head/usr.bin/mkuzip X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/mkuzip X-SVN-Commit-Revision: 344303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EB6E71FF3 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)[-0.999,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, 19 Feb 2019 20:26:05 -0000 Author: kib Date: Tue Feb 19 20:26:03 2019 New Revision: 344303 URL: https://svnweb.freebsd.org/changeset/base/344303 Log: Minor cleanup for mkuzip(8) man page. List all single-letter options in summary. Order options alphabetically. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/usr.bin/mkuzip/mkuzip.8 Modified: head/usr.bin/mkuzip/mkuzip.8 ============================================================================== --- head/usr.bin/mkuzip/mkuzip.8 Tue Feb 19 20:12:12 2019 (r344302) +++ head/usr.bin/mkuzip/mkuzip.8 Tue Feb 19 20:26:03 2019 (r344303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2006 +.Dd February 19, 2019 .Dt MKUZIP 8 .Os .Sh NAME @@ -35,10 +35,10 @@ class .Sh SYNOPSIS .Nm -.Op Fl v +.Op Fl dLSsvZ +.Op Fl j Ar compression_jobs .Op Fl o Ar outfile .Op Fl s Ar cluster_size -.Op Fl j Ar compression_jobs .Ar infile .Sh DESCRIPTION The @@ -68,6 +68,33 @@ locating each individual cluster is written to the out .Pp The options are: .Bl -tag -width indent +.It Fl j Ar compression_jobs +Specify the number of compression jobs that +.Nm +runs in parallel to speed up compression. +When option is not specified the number of jobs set to be equal +to the value of +.Va hw.ncpu +.Xr sysctl 8 +variable. +.It Fl d +Enable de-duplication. +When the option is enabled the +.Nm +detects identical blocks in the input and replaces each subsequent occurence +of such block with pointer to the very first one in the output. +Setting this option results is moderate decrease of compressed image size, +typically around 3-5% of a final size of the compressed image. +.It Fl L +Use +.Xr lzma 3 +compression algorithm instead of the default +.Xr zlib 3 . +The +.Xr lzma 3 +provides noticeable better compression levels on the same data set +at the expense of much slower compression speed (10-20x) and somewhat slower +decompression (2-3x). .It Fl o Ar outfile Name of the output file .Ar outfile . @@ -79,16 +106,9 @@ compression or .Pa .ulzma for the .Xr lzma 3 . -.It Fl L -Use -.Xr lzma 3 -compression algorithm instead of the default -.Xr zlib 3 . -The -.Xr lzma 3 -provides noticeable better compression levels on the same data set -at the expense of much slower compression speed (10-20x) and somewhat slower -decompression (2-3x). +.It Fl S +Print summary about the compression ratio as well as output +file size after file has been processed. .It Fl s Ar cluster_size Split the image into clusters of .Ar cluster_size @@ -111,26 +131,6 @@ Setting .Fl Z results is slight increase of compressed image size, typically less than 0.1% of a final size of the compressed image. -.It Fl d -Enable de-duplication. -When the option is enabled the -.Nm -detects identical blocks in the input and replaces each subsequent occurence -of such block with pointer to the very first one in the output. -Setting this option results is moderate decrease of compressed image size, -typically around 3-5% of a final size of the compressed image. -.It Fl S -Print summary about the compression ratio as well as output -file size after file has been processed. -.It Fl j Ar compression_jobs -Specify the number of compression jobs that -.Nm -runs in parallel to speed up compression. -When option is not specified the number of jobs set to be equal -to the value of -.Va hw.ncpu -.Xr sysctl 8 -variable. .El .Sh NOTES The compression ratio largely depends on the cluster size used. From owner-svn-src-all@freebsd.org Tue Feb 19 21:20: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 607D214D9DE6; Tue, 19 Feb 2019 21:20:51 +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 078EB744F9; Tue, 19 Feb 2019 21:20:51 +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 EE276236F3; Tue, 19 Feb 2019 21:20: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 x1JLKod7009112; Tue, 19 Feb 2019 21:20:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLKoLb009111; Tue, 19 Feb 2019 21:20:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902192120.x1JLKoLb009111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Feb 2019 21:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344304 - in head/sys: amd64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 344304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 078EB744F9 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)[-0.999,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, 19 Feb 2019 21:20:51 -0000 Author: imp Date: Tue Feb 19 21:20:50 2019 New Revision: 344304 URL: https://svnweb.freebsd.org/changeset/base/344304 Log: Remove drm from LINT kernels drm was accidentally left in the LINT kernels. Pointy hat to: imp Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Feb 19 20:26:03 2019 (r344303) +++ head/sys/amd64/conf/NOTES Tue Feb 19 21:20:50 2019 (r344304) @@ -286,17 +286,6 @@ options ACPI_DEBUG # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -options DRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Feb 19 20:26:03 2019 (r344303) +++ head/sys/i386/conf/NOTES Tue Feb 19 21:20:50 2019 (r344304) @@ -489,17 +489,6 @@ device aibs # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -options DRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # From owner-svn-src-all@freebsd.org Tue Feb 19 21:22: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 7402914D9FD4; Tue, 19 Feb 2019 21:22:23 +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 16F63748BD; Tue, 19 Feb 2019 21:22:23 +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 D15A023876; Tue, 19 Feb 2019 21:22:22 +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 x1JLMMrt012401; Tue, 19 Feb 2019 21:22:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLMMPM012400; Tue, 19 Feb 2019 21:22:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902192122.x1JLMMPM012400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 21:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344305 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16F63748BD 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)[-0.999,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, 19 Feb 2019 21:22:23 -0000 Author: markj Date: Tue Feb 19 21:22:22 2019 New Revision: 344305 URL: https://svnweb.freebsd.org/changeset/base/344305 Log: Impose a limit on the number of GEOM_CTL arguments. Otherwise a privileged user can trigger a memory allocation of unbounded size, or an integer overflow in the subsequent geom_alloc_copyin() call, leading to out-of-bounds accesses. Hard-code a large limit to circumvent this problem. admbug: 854 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: ae MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19251 Modified: head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; + if (req->narg > 2048) { + gctl_error(req, "too many arguments"); + req->arg = NULL; + return; + } + ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { gctl_error(req, "bad control request"); From owner-svn-src-all@freebsd.org Tue Feb 19 21:27: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 7EDD814DA17D; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@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 22F0774BC3; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@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 0454723894; Tue, 19 Feb 2019 21:27:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLRUP3012639; Tue, 19 Feb 2019 21:27:30 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLRUD3012636; Tue, 19 Feb 2019 21:27:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201902192127.x1JLRUD3012636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 19 Feb 2019 21:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344306 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 344306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22F0774BC3 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)[-0.999,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, 19 Feb 2019 21:27:31 -0000 Author: jilles Date: Tue Feb 19 21:27:30 2019 New Revision: 344306 URL: https://svnweb.freebsd.org/changeset/base/344306 Log: sh: Send normal output from bind builtin to stdout PR: 233343 Submitted by: Yuichiro NAITO (original version) Modified: head/bin/sh/histedit.c head/bin/sh/output.c head/bin/sh/output.h Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/histedit.c Tue Feb 19 21:27:30 2019 (r344306) @@ -472,10 +472,31 @@ str_to_event(const char *str, int last) int bindcmd(int argc, char **argv) { + int ret; + FILE *old; + FILE *out; if (el == NULL) error("line editing is disabled"); - return (el_parse(el, argc, __DECONST(const char **, argv))); + + INTOFF; + + out = out1fp(); + if (out == NULL) + error("Out of space"); + + el_get(el, EL_GETFP, 1, &old); + el_set(el, EL_SETFP, 1, out); + + ret = el_parse(el, argc, __DECONST(const char **, argv)); + + el_set(el, EL_SETFP, 1, old); + + fclose(out); + + INTON; + + return ret; } #else Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/output.c Tue Feb 19 21:27:30 2019 (r344306) @@ -340,6 +340,12 @@ doformat(struct output *dest, const char *f, va_list a } } +FILE * +out1fp(void) +{ + return fwopen(out1, doformat_wr); +} + /* * Version of write which resumes after a signal is caught. */ Modified: head/bin/sh/output.h ============================================================================== --- head/bin/sh/output.h Tue Feb 19 21:22:22 2019 (r344305) +++ head/bin/sh/output.h Tue Feb 19 21:27:30 2019 (r344306) @@ -39,6 +39,7 @@ #include #include +#include struct output { char *nextc; @@ -75,6 +76,7 @@ void out1fmt(const char *, ...) __printflike(1, 2); void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); +FILE *out1fp(void); int xwrite(int, const char *, int); #define outc(c, file) ((file)->nextc == (file)->bufend ? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) From owner-svn-src-all@freebsd.org Tue Feb 19 21:33: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 314FC14DA588; Tue, 19 Feb 2019 21:33:03 +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 C96CF751A7; Tue, 19 Feb 2019 21:33:02 +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 BCA8E23A43; Tue, 19 Feb 2019 21:33:02 +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 x1JLX27Q017462; Tue, 19 Feb 2019 21:33:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLX20V017461; Tue, 19 Feb 2019 21:33:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902192133.x1JLX20V017461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Feb 2019 21:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344307 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96CF751A7 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)[-0.999,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, 19 Feb 2019 21:33:03 -0000 Author: markj Date: Tue Feb 19 21:33:02 2019 New Revision: 344307 URL: https://svnweb.freebsd.org/changeset/base/344307 Log: Limit the number of entries allocated for a REPORT_ZONES command. The DIOCGETZONE ioctl can be used to fetch the zone list of an SMR drive, and the caller specifies the number of entries it wants to fetch. Clamp the caller's request to a sane limit so that a user cannot attempt large allocations. Callers already need to invoke the ioctl multiple times to fetch the full list in general, so there's no harm in limiting the number of entries returned. Fix style while here. admbug: 807 Reported by: Ilja Van Sprundel Reviewed by: asomers, ken Tested by: ken MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19249 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Feb 19 21:27:30 2019 (r344306) +++ head/sys/geom/geom_dev.c Tue Feb 19 21:33:02 2019 (r344307) @@ -677,8 +677,10 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data alloc_size = 0; if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) { - rep = &zone_args->zone_params.report; +#define MAXENTRIES (MAXPHYS / sizeof(struct disk_zone_rep_entry)) + if (rep->entries_allocated > MAXENTRIES) + rep->entries_allocated = MAXENTRIES; alloc_size = rep->entries_allocated * sizeof(struct disk_zone_rep_entry); if (alloc_size != 0) @@ -688,15 +690,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data rep->entries = new_entries; } error = g_io_zonecmd(zone_args, cp); - if ((zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) - && (alloc_size != 0) - && (error == 0)) { + if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES && + alloc_size != 0 && error == 0) error = copyout(new_entries, old_entries, alloc_size); - } - if ((old_entries != NULL) - && (rep != NULL)) + if (old_entries != NULL && rep != NULL) rep->entries = old_entries; - if (new_entries != NULL) g_free(new_entries); break; From owner-svn-src-all@freebsd.org Tue Feb 19 21:49: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 6045C14DAD5B; Tue, 19 Feb 2019 21:49:49 +0000 (UTC) (envelope-from ed@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 0229D75ADC; Tue, 19 Feb 2019 21:49:49 +0000 (UTC) (envelope-from ed@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 E9EDA23C1B; Tue, 19 Feb 2019 21:49:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLnmGX023151; Tue, 19 Feb 2019 21:49:48 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLnmFf023150; Tue, 19 Feb 2019 21:49:48 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201902192149.x1JLnmFf023150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 19 Feb 2019 21:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344308 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0229D75ADC 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,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, 19 Feb 2019 21:49:49 -0000 Author: ed Date: Tue Feb 19 21:49:48 2019 New Revision: 344308 URL: https://svnweb.freebsd.org/changeset/base/344308 Log: Add missing __unused attributes to unused function arguments. This fixes the userspace build of libteken. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Tue Feb 19 21:33:02 2019 (r344307) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019 (r344308) @@ -372,7 +372,7 @@ teken_subr_cursor_up(teken_t *t, unsigned int nrows) } static void -teken_subr_set_cursor_style(teken_t *t, unsigned int style) +teken_subr_set_cursor_style(teken_t *t __unused, unsigned int style __unused) { /* TODO */ From owner-svn-src-all@freebsd.org Tue Feb 19 21:58: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 7D09414DB4EE; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@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 1E451762A2; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@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 0C51123DBD; Tue, 19 Feb 2019 21:58:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JLwNBX028388; Tue, 19 Feb 2019 21:58:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JLwNVo028387; Tue, 19 Feb 2019 21:58:23 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201902192158.x1JLwNVo028387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 19 Feb 2019 21:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344309 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E451762A2 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.95)[-0.945,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)[-0.999,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, 19 Feb 2019 21:58:24 -0000 Author: ed Date: Tue Feb 19 21:58:23 2019 New Revision: 344309 URL: https://svnweb.freebsd.org/changeset/base/344309 Log: Place an upper bound on the number of iterations for REP. Right now it's possible to invoke the REP escape sequence with a maximum of tens of millions of iterations. In practice, there is never any need to do this. Calling it more frequently than the number of cells in the terminal hardly makes any sense. By placing a limit on it, we can prevent users from exhausting resources in inside the terminal emulator. As support for this escape sequence is not present in any of the stable branches, there is no need to MFC. Reported by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11255 Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019 (r344308) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:58:23 2019 (r344309) @@ -1337,8 +1337,11 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi static void teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts) { + unsigned int max_repetitions; + max_repetitions = t->t_winsize.tp_row * t->t_winsize.tp_col; + if (rpts > max_repetitions) + rpts = max_repetitions; for (; t->t_last != 0 && rpts > 0; rpts--) teken_subr_regular_character(t, t->t_last); } - From owner-svn-src-all@freebsd.org Tue Feb 19 22:19: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 120CA14DBD3C; Tue, 19 Feb 2019 22:19:33 +0000 (UTC) (envelope-from ngie@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 A022276EAB; Tue, 19 Feb 2019 22:19:32 +0000 (UTC) (envelope-from ngie@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 8B05924152; Tue, 19 Feb 2019 22:19:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JMJW1S038903; Tue, 19 Feb 2019 22:19:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JMJW7x038902; Tue, 19 Feb 2019 22:19:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201902192219.x1JMJW7x038902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 19 Feb 2019 22:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344310 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 344310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A022276EAB 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)[-0.999,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: Tue, 19 Feb 2019 22:19:33 -0000 Author: ngie Date: Tue Feb 19 22:19:31 2019 New Revision: 344310 URL: https://svnweb.freebsd.org/changeset/base/344310 Log: Make `server_cat(..)` handle short receives In short, the prior code was far too simplistic when it came to calling recv(2) and failed intermittently (or in the case of Jenkins, deterministically). Handle short recv(2)s by checking the return code and incrementing the window into the buffer by the number of received bytes. If the number of received bytes <= 0, then bail out of the loop, and test the total number of received bytes vs the expected number of bytes sent for equality, and base whether or not the test passes/fails on that fact. Remove the expected failure, now that the hdtr testcases deterministically pass on my host after this change [1]. PR: 234809 [1], 235200 Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19188 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 21:58:23 2019 (r344309) +++ head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 22:19:31 2019 (r344310) @@ -156,6 +156,8 @@ setup_client(int domain, int type, int port) "Will try to connect to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); freeaddrinfo(res); @@ -187,6 +189,8 @@ setup_server(int domain, int type, int port) "Will try to bind socket to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); error = bind(sock, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); ATF_REQUIRE_EQ_MSG(error, 0, "bind failed: %s", strerror(errno)); @@ -204,11 +208,17 @@ setup_server(int domain, int type, int port) static void server_cat(const char *dest_filename, int server_sock, size_t len) { - char *buffer; + char *buffer, *buf_window_ptr; int recv_sock; - ssize_t received_bytes; + size_t buffer_size; + ssize_t received_bytes, recv_ret; - buffer = calloc(len + 1, sizeof(char)); + /* + * Ensure that there isn't excess data sent across the wire by + * capturing 10 extra bytes (plus 1 for nul). + */ + buffer_size = len + 10 + 1; + buffer = calloc(buffer_size, sizeof(char)); if (buffer == NULL) err(1, "malloc failed"); @@ -216,32 +226,26 @@ server_cat(const char *dest_filename, int server_sock, if (recv_sock == -1) err(1, "accept failed"); - /* - * XXX: this assumes the simplest case where all data is received in a - * single recv(2) call. - */ - if (recv(recv_sock, buffer, len, 0) == -1) - err(1, "recv failed"); + buf_window_ptr = buffer; + received_bytes = 0; + do { + recv_ret = recv(recv_sock, buf_window_ptr, + buffer_size - received_bytes, 0); + if (recv_ret <= 0) + break; + buf_window_ptr += recv_ret; + received_bytes += recv_ret; + } while (received_bytes < buffer_size); atf_utils_create_file(dest_filename, "%s", buffer); - /* - * This recv(2) call helps ensure the amount of sent data is exactly - * what was specified by `len`. - */ - received_bytes = recv(recv_sock, buffer, len, 0); - switch (received_bytes) { - case -1: - err(1, "recv failed"); - case 0: - break; - default: - errx(1, "received unexpected data: %s", buffer); - } - (void)close(recv_sock); (void)close(server_sock); free(buffer); + + if (received_bytes != len) + errx(1, "received unexpected data: %zd != %zd", received_bytes, + len); } static int @@ -666,10 +670,6 @@ hdtr_positive_test(int domain) trailers[0].iov_len = strlen(trailers[0].iov_base); offset = 0; nbytes = 0; - - atf_tc_expect_fail( - "The header/trailer testcases fail today with a data mismatch; " - "bug # 234809"); for (i = 0; i < nitems(testcases); i++) { struct sf_hdtr hdtr; From owner-svn-src-all@freebsd.org Tue Feb 19 23:22: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 A2E8C14DD968; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@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 4433281203; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@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 34CA424D6D; Tue, 19 Feb 2019 23:22:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNMdt2075453; Tue, 19 Feb 2019 23:22:39 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNMdgm075452; Tue, 19 Feb 2019 23:22:39 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192322.x1JNMdgm075452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344314 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4433281203 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)[-0.999,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, 19 Feb 2019 23:22:40 -0000 Author: pjd Date: Tue Feb 19 23:22:39 2019 New Revision: 344314 URL: https://svnweb.freebsd.org/changeset/base/344314 Log: In the vdev_geom_open_by_path() function we assume that vdev path starts with "/dev/". Make sure this is the case. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 22:46:50 2019 (r344313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:22:39 2019 (r344314) @@ -794,7 +794,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t * /* * We must have a pathname, and it must be absolute. */ - if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { + if (vd->vdev_path == NULL || strncmp(vd->vdev_path, "/dev/", 5) != 0) { vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; return (EINVAL); } From owner-svn-src-all@freebsd.org Tue Feb 19 23:24: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 9A78714DDA73; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@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 3FA87813F3; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@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 2EA1E24D70; Tue, 19 Feb 2019 23:24:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNOexl075572; Tue, 19 Feb 2019 23:24:40 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNOe2o075571; Tue, 19 Feb 2019 23:24:40 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201902192324.x1JNOe2o075571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 19 Feb 2019 23:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344315 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 344315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FA87813F3 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)[-0.999,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, 19 Feb 2019 23:24:40 -0000 Author: cperciva Date: Tue Feb 19 23:24:39 2019 New Revision: 344315 URL: https://svnweb.freebsd.org/changeset/base/344315 Log: Fix sed script to insert Amazon NTP server into ntp.conf once rather than twice. Reported by: Rafal Lukawiecki MFC after: 1 week Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Tue Feb 19 23:22:39 2019 (r344314) +++ head/release/tools/ec2.conf Tue Feb 19 23:24:39 2019 (r344315) @@ -96,7 +96,7 @@ vm_extra_pre_umount() { # Use the NTP service provided by Amazon sed -i '' -e 's/^pool/#pool/' \ - -e 's/^#server.*/server 169.254.169.123 iburst/' \ + -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ ${DESTDIR}/etc/ntp.conf # The first time the AMI boots, the installed "first boot" scripts From owner-svn-src-all@freebsd.org Tue Feb 19 23: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 1694914DDE6A; Tue, 19 Feb 2019 23:35:57 +0000 (UTC) (envelope-from pjd@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 77C088197E; Tue, 19 Feb 2019 23:35:56 +0000 (UTC) (envelope-from pjd@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 6404524F1D; Tue, 19 Feb 2019 23:35:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNZuK6080579; Tue, 19 Feb 2019 23:35:56 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNZu53080578; Tue, 19 Feb 2019 23:35:56 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192335.x1JNZu53080578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77C088197E 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,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, 19 Feb 2019 23:35:57 -0000 Author: pjd Date: Tue Feb 19 23:35:55 2019 New Revision: 344316 URL: https://svnweb.freebsd.org/changeset/base/344316 Log: The way ZFS searches for its vdevs is the following: first it looks for a vdev that has the same name as the one stored in metadata and that has all VDEV labels in place. If it cannot find a GEOM provider with the given name and all VDEV labels it will scan all GEOM providers for the best match (the most VDEV labels available), but here the name is ignored. In case the ZFS pool is created, eg. using GPT partition label: # zpool create tank /dev/gpt/tank everything works, and on every import ZFS will pick /dev/gpt/tank and not /dev/da0p4. The problem occurs when da0p4 is extended and ZFS is unable to find all VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end of the partition are now somewhere else). In this case it will scan all GEOM providers and will pick the first one with the best match, ie. da0p4. Fix this problem by checking the VDEV/provider name even if we get the same match. If the name is the same as the one we have in pool's metadata, prefer this GEOM provider. Reported by: oshogbo, Michal Mroz Tested by: Michal Mroz Obtained from: Fudo Security Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:24:39 2019 (r344315) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:35:55 2019 (r344316) @@ -692,10 +692,12 @@ vdev_geom_attach_by_guids(vdev_t *vd) struct g_geom *gp; struct g_provider *pp, *best_pp; struct g_consumer *cp; + const char *vdpath; enum match match, best_match; g_topology_assert(); + vdpath = vd->vdev_path + sizeof("/dev/") - 1; cp = NULL; best_pp = NULL; best_match = NO_MATCH; @@ -710,6 +712,10 @@ vdev_geom_attach_by_guids(vdev_t *vd) if (match > best_match) { best_match = match; best_pp = pp; + } else if (match == best_match) { + if (strcmp(pp->name, vdpath) == 0) { + best_pp = pp; + } } if (match == FULL_MATCH) goto out; From owner-svn-src-all@freebsd.org Tue Feb 19 23:41: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 D080014DDFD4; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@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 629E781DA5; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@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 5595524F7D; Tue, 19 Feb 2019 23:41:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNfObW082378; Tue, 19 Feb 2019 23:41:24 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNfOD8082377; Tue, 19 Feb 2019 23:41:24 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192341.x1JNfOD8082377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344317 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 629E781DA5 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.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 23:41:25 -0000 Author: pjd Date: Tue Feb 19 23:41:23 2019 New Revision: 344317 URL: https://svnweb.freebsd.org/changeset/base/344317 Log: Grabage-collect no longer used variable. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:35:55 2019 (r344316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:41:23 2019 (r344317) @@ -270,7 +270,6 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = 0; c < rm->rm_firstdatacol; c++) { if (rm->rm_col[c].rc_abd != NULL) @@ -281,11 +280,9 @@ vdev_raidz_map_free(raidz_map_t *rm) rm->rm_col[c].rc_size); } - size = 0; for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) { if (rm->rm_col[c].rc_abd != NULL) abd_put(rm->rm_col[c].rc_abd); - size += rm->rm_col[c].rc_size; } if (rm->rm_abd_copy != NULL) From owner-svn-src-all@freebsd.org Tue Feb 19 23:43: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 2631D14DE1C6; Tue, 19 Feb 2019 23:43:16 +0000 (UTC) (envelope-from pjd@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 B598582192; Tue, 19 Feb 2019 23:43:15 +0000 (UTC) (envelope-from pjd@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 A8898250EC; Tue, 19 Feb 2019 23:43:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNhFDO085717; Tue, 19 Feb 2019 23:43:15 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNhFGa085716; Tue, 19 Feb 2019 23:43:15 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192343.x1JNhFGa085716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344318 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B598582192 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.96)[-0.957,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)[-0.999,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, 19 Feb 2019 23:43:16 -0000 Author: pjd Date: Tue Feb 19 23:43:15 2019 New Revision: 344318 URL: https://svnweb.freebsd.org/changeset/base/344318 Log: Change assertion to log the incorrect io_type we've got. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:41:23 2019 (r344317) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:43:15 2019 (r344318) @@ -2020,7 +2020,7 @@ vdev_raidz_io_start(zio_t *zio) return; } - ASSERT(zio->io_type == ZIO_TYPE_READ); + ASSERT3U(zio->io_type, ==, ZIO_TYPE_READ); /* * Iterate over the columns in reverse order so that we hit the parity From owner-svn-src-all@freebsd.org Tue Feb 19 23:44: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 426FA14DE232; Tue, 19 Feb 2019 23:44:01 +0000 (UTC) (envelope-from pjd@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 D8619822F0; Tue, 19 Feb 2019 23:44:00 +0000 (UTC) (envelope-from pjd@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 CB4D2250EE; Tue, 19 Feb 2019 23:44:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNi0E3085814; Tue, 19 Feb 2019 23:44:00 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNi0ND085813; Tue, 19 Feb 2019 23:44:00 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192344.x1JNi0ND085813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344319 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8619822F0 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.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 19 Feb 2019 23:44:01 -0000 Author: pjd Date: Tue Feb 19 23:44:00 2019 New Revision: 344319 URL: https://svnweb.freebsd.org/changeset/base/344319 Log: Correct typo in the comment. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:43:15 2019 (r344318) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Tue Feb 19 23:44:00 2019 (r344319) @@ -2558,7 +2558,7 @@ vdev_raidz_io_done(zio_t *zio) /* * We're here because either: * - * total_errors == rm_first_datacol, or + * total_errors == rm_firstdatacol, or * vdev_raidz_combrec() failed * * In either case, there is enough bad data to prevent From owner-svn-src-all@freebsd.org Tue Feb 19 23:44: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 9B9FB14DE294 for ; Tue, 19 Feb 2019 23:44:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE9B823FE for ; Tue, 19 Feb 2019 23:44:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-ed1-x543.google.com with SMTP id x7so18305447eds.8 for ; Tue, 19 Feb 2019 15:44:15 -0800 (PST) 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=rRdePG8ulxpGCBjn+lw9ZxrSQ5OcB+N6eVtttSTlUjI=; b=Z+2wGS+5+0Nxxn2E+AVg2kfAJ3RrEw9ujamdDfEz5bxgucbf4QDbmZb5jrJO1DDBgj 93yInAEcFuHM08M4J0XxgpnTg8VLjEoQfR2Djb9eCRBRvZ4f1Q9DnEdmuHExyOHc/aSe mPxysahD5lyReP5032szYR3viOnOVE3LxWawcK/VN8YO39jEFC5KEG1QUcNzq/ZR8Ag/ pG7yykaI/Z3Hx9cEkrqXxO0eiwDQJXjmvhaaaTIMEfRNLu8el98qPtX16l+r/FPujgcX aSq4g95IT2EP8V2OqRdmZ1n23PES3HOeMPDIYi+4uWs5GnaWk8KarRVKdZVJRJaxYEMg vcDw== 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=rRdePG8ulxpGCBjn+lw9ZxrSQ5OcB+N6eVtttSTlUjI=; b=kzw6XTNZb+5RsONd/2SksFVWmM9wrlLdAg1HahYiJoQJ8nJDJXfDFK4R/bxgkcq2pH kjPKIutxZ2f1nbv3ffFOrfaoDTML5IM0NZLH5w0HckefQXWJwf4QFIWawCsP3FSxY53u Nsj21cypc2co3zlwOvWzPFV4t0iREOHJn/2PaMXPwpZl8pUMp9yQyH+VLQyJUvBbI8YI ejzYEDunHP++9V/RtkJ9BTpwFYSIL45qoBHvC4rdC6Grr4DtMv7+NC4rbaZHH3CigOaM 0kAWG8koQj5NI53ioqhoE1v+a6lQM5a7wE8mPQO6MehtcXq0ONGfg719qJ/5n+8/ZJDn 2JjA== X-Gm-Message-State: AHQUAuaxGoHrZZkhvDecbR9Y1TUQLMe3HIgIRp47ZiIJ7HLhMn5a8kHs yC4WeJhedJH8KXtJifVqk3LMOQ== X-Google-Smtp-Source: AHgI3IZM9U4pcRAmxypnGp7dyYCZOWbar5ctJziPF6VH7G3KVaGCM6th0myrMkoAD0uVco0JZul8mA== X-Received: by 2002:a50:92d0:: with SMTP id l16mr25242386eda.153.1550619853021; Tue, 19 Feb 2019 15:44:13 -0800 (PST) Received: from mutt-hbsd ([185.165.169.165]) by smtp.gmail.com with ESMTPSA id o13sm4920289edq.57.2019.02.19.15.44.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 15:44:12 -0800 (PST) Date: Tue, 19 Feb 2019 18:43:28 -0500 From: Shawn Webb To: Pawel Jakub Dawidek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> References: <201902192335.x1JNZu53080578@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hnirbtvcopw34t5o" Content-Disposition: inline In-Reply-To: <201902192335.x1JNZu53080578@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD e44da5b3ebd(hardened/current/master) HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 0EE9B823FE 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_SHORT(-0.97)[-0.971,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, 19 Feb 2019 23:44:15 -0000 --hnirbtvcopw34t5o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 19, 2019 at 11:35:56PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Feb 19 23:35:55 2019 > New Revision: 344316 > URL: https://svnweb.freebsd.org/changeset/base/344316 >=20 > Log: > The way ZFS searches for its vdevs is the following: first it looks for > a vdev that has the same name as the one stored in metadata and that has > all VDEV labels in place. If it cannot find a GEOM provider with the gi= ven > name and all VDEV labels it will scan all GEOM providers for the best m= atch > (the most VDEV labels available), but here the name is ignored. > =20 > In case the ZFS pool is created, eg. using GPT partition label: > =20 > # zpool create tank /dev/gpt/tank > =20 > everything works, and on every import ZFS will pick /dev/gpt/tank and > not /dev/da0p4. > =20 > The problem occurs when da0p4 is extended and ZFS is unable to find all > VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end > of the partition are now somewhere else). In this case it will scan all > GEOM providers and will pick the first one with the best match, ie. da0= p4. > =20 > Fix this problem by checking the VDEV/provider name even if we get the = same > match. If the name is the same as the one we have in pool's metadata, p= refer > this GEOM provider. > =20 > Reported by: oshogbo, Michal Mroz > Tested by: Michal Mroz > Obtained from: Fudo Security >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c At the risk of painting a bikeshed a lovely color of neon purple, I'm curious about if/how these types of commits get merged upstream to (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very confused|is anyone else confused where upstream is?). Who is upstream? Is work like this going to remain as a downstream patch to ZFS? Or is FreeBSD going to work to upstream this type of work? I hope my curiousity doesn't offend anyone. ;) Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --hnirbtvcopw34t5o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlxslJwACgkQaoRlj1JF bu5s9A//alw1McK6fXYjINgJ6OhifqC+AxXBvmjNSUAETHX8RTGt+zUfG5eAan81 UX/T7tXSR2nn1yDy5tUxCpNiKajTG1KDIkw3gr5JLMOxyVCdCUoqrwKcVR2hk2yK Cg9+6MVUfDPeRb1c2qCxdRFExUWRG7eApLuCYuTCqsJgrGvURtrmV8hpPXALuli7 +7vsqIvXCIiiemwbl8gC5F96zVBefn8tJEJ1HTmPTajNR9BvmY+4I7W3q/JMlN8N hBvRgy1agyt6Krf2uGqE3O6zXvHL6XebGYESFdR34/hvRQ+T54IKQ3fXxa+XXQjp r3VNVx7G5ky+z5Cly0isYwdF8nqFGlEPNEVqYtckXG9qbYUPnNgU2AyBR0rlM3Xc KHwbKo48Bb9a9l7nDE6qmzW83ENd2V/GK2u7zxFIHWBth9plC6NLTu15aU6np/4L 1szowoMI05xHjIsVFQkwdUd89Oe1ijoNFWd2NM66b9nLQWF5GPMQM0NP5x/wbK2N 8h0zLXJXacDm9XhZPMgHKfRFVyCdx24jF45EmV00DFbM2lrAkwRXGZRGxbvajq9p tJ21POlVmFx2bWN8uRRZ/04LnqzLu0mExGocPZ0EMvK3WngT3vDxLmSee6ZPVC/O wTJ60T90VpEqPuKRO+tQSvoPF2FkiVKf/EQZU7zj1M1wzzxgPLk= =igqV -----END PGP SIGNATURE----- --hnirbtvcopw34t5o-- From owner-svn-src-all@freebsd.org Tue Feb 19 23:53: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 774F214DE5E1; Tue, 19 Feb 2019 23:53:34 +0000 (UTC) (envelope-from pjd@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 0EEC08292E; Tue, 19 Feb 2019 23:53:34 +0000 (UTC) (envelope-from pjd@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 F115225291; Tue, 19 Feb 2019 23:53:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1JNrX38090830; Tue, 19 Feb 2019 23:53:33 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1JNrX3a090829; Tue, 19 Feb 2019 23:53:33 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902192353.x1JNrX3a090829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 19 Feb 2019 23:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EEC08292E 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.96)[-0.957,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)[-0.999,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, 19 Feb 2019 23:53:34 -0000 Author: pjd Date: Tue Feb 19 23:53:33 2019 New Revision: 344320 URL: https://svnweb.freebsd.org/changeset/base/344320 Log: Simplify the code. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:44:00 2019 (r344319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:53:33 2019 (r344320) @@ -360,16 +360,13 @@ trim_map_write_start(zio_t *zio) return (B_FALSE); } - ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL); - if (ts != NULL) { - /* - * Loop until all overlapping segments are removed. - */ - do { - trim_map_segment_remove(tm, ts, start, end); - ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL); - } while (ts != NULL); + /* + * Loop until all overlapping segments are removed. + */ + while ((ts = avl_find(&tm->tm_queued_frees, &tsearch, NULL)) != NULL) { + trim_map_segment_remove(tm, ts, start, end); } + avl_add(&tm->tm_inflight_writes, zio); mutex_exit(&tm->tm_lock); From owner-svn-src-all@freebsd.org Wed Feb 20 00:25: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 A7D3614DF5B6; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@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 28F4F83C93; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@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 157A3257B0; Wed, 20 Feb 2019 00:25:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K0PjHO006820; Wed, 20 Feb 2019 00:25:45 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K0PjnA006819; Wed, 20 Feb 2019 00:25:45 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201902200025.x1K0PjnA006819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 20 Feb 2019 00:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344325 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28F4F83C93 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.96)[-0.957,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)[-0.999,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, 20 Feb 2019 00:25:46 -0000 Author: pjd Date: Wed Feb 20 00:25:45 2019 New Revision: 344325 URL: https://svnweb.freebsd.org/changeset/base/344325 Log: Simplify the code. No functional changes. Reviewed by: rpokala Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Feb 20 00:19:11 2019 (r344324) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Feb 20 00:25:45 2019 (r344325) @@ -568,10 +568,7 @@ vdev_raidz_map_alloc(abd_t *abd, uint64_t size, uint64 abd_alloc_linear(rm->rm_col[c].rc_size, B_TRUE); } - rm->rm_col[c].rc_abd = abd_get_offset(abd, 0); - off = rm->rm_col[c].rc_size; - - for (c = c + 1; c < acols; c++) { + for (off = 0; c < acols; c++) { rm->rm_col[c].rc_abd = abd_get_offset(abd, off); off += rm->rm_col[c].rc_size; } From owner-svn-src-all@freebsd.org Wed Feb 20 01:56: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 EB54614E16BB; Wed, 20 Feb 2019 01:56:54 +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 6D2D98672E; Wed, 20 Feb 2019 01:56:54 +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 2C58A432FAD; Wed, 20 Feb 2019 12:56:43 +1100 (AEDT) Date: Wed, 20 Feb 2019 12:56:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tom Jones cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344292 - head/sys/dev/acpica In-Reply-To: <201902191904.x1JJ4qIh036879@repo.freebsd.org> Message-ID: <20190220123807.E1184@besplex.bde.org> References: <201902191904.x1JJ4qIh036879@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 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=pcXBGyXzM1LMojfo2MEA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 6D2D98672E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,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, 20 Feb 2019 01:56:55 -0000 On Tue, 19 Feb 2019, Tom Jones wrote: > Log: > Fix style after r340832 > > Reported by: jhb > Reviewed by: jhb, jtl > Approved by: jtl (mentor) Unfortunately, acpi (even the FreeBSD dev/acpica part) has a very non-KNF style. It is unclear even what this style is, so it is hard to write changes consistent with it. But it is clear that this style isn't the one one used in the line after the one touched by this commit. > Modified: head/sys/dev/acpica/acpi_battery.c > ============================================================================== > --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) > +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) > @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba > * Be sure we can get various info from the battery. > */ > if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || > - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > continue; > > /* If a battery is not installed, we sometimes get strange values. */ acpica uses 4-column indents, especially in this file, so the 'continue' line is clearly misindented here. acpica's indentation for continued lines is unclear. The KNF 4-column continuation indent works very badly when the main indent is also 4-column. But it is used in similar code (including a 'continue' just 5 lines after here). So it is consistently bad here. Elsewhere, acpica seems to use gnu style (-lp). Here and 5 lines later, that accidentally gives the 4-column indent by lining up with the parentheses of 'if (', A quick look at some other files shows many examples of gnu style (-lp) for long function parameter lists, and many similar regressions towards KNF style. Bruce From owner-svn-src-all@freebsd.org Wed Feb 20 02:14: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 AD9FB14E1F93; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@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 45E09871CF; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@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 3824026A8E; Wed, 20 Feb 2019 02:14:42 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2EgAH064163; Wed, 20 Feb 2019 02:14:42 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2EgNF064162; Wed, 20 Feb 2019 02:14:42 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902200214.x1K2EgNF064162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 20 Feb 2019 02:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344331 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 344331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45E09871CF 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)[-0.999,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, 20 Feb 2019 02:14:42 -0000 Author: bde Date: Wed Feb 20 02:14:41 2019 New Revision: 344331 URL: https://svnweb.freebsd.org/changeset/base/344331 Log: Attempt to complete fixing programmable function keys for syscons. The flag for the driver capability of supporting the fix is independent of the flag for cons25 mode so that it can be managed independently, but I forget to preserve it when resetting the terminal. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Wed Feb 20 01:12:59 2019 (r344330) +++ head/sys/teken/teken_subr.h Wed Feb 20 02:14:41 2019 (r344331) @@ -1000,7 +1000,7 @@ teken_subr_do_reset(teken_t *t) t->t_scrollreg.ts_begin = 0; t->t_scrollreg.ts_end = t->t_winsize.tp_row; t->t_originreg = t->t_scrollreg; - t->t_stateflags &= TS_8BIT|TS_CONS25; + t->t_stateflags &= TS_8BIT | TS_CONS25 | TS_CONS25KEYS; t->t_stateflags |= TS_AUTOWRAP; t->t_scs[0] = teken_scs_us_ascii; From owner-svn-src-all@freebsd.org Wed Feb 20 02: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 7ED5414E2A51; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@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 2104487FB7; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@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 0920E26E6F; Wed, 20 Feb 2019 02:40:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2ecLk075498; Wed, 20 Feb 2019 02:40:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2ec5b075465; Wed, 20 Feb 2019 02:40:38 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902200240.x1K2ec5b075465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 20 Feb 2019 02:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344332 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 344332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2104487FB7 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)[-0.999,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, 20 Feb 2019 02:40:39 -0000 Author: bde Date: Wed Feb 20 02:40:38 2019 New Revision: 344332 URL: https://svnweb.freebsd.org/changeset/base/344332 Log: Fix hangs in r341810 waiting for AP startup. idle_td is dereferenced without thread-locking it to make its contents is invariant, and was accessed without telling the compiler that its contents is invariant. Some compilers optimized accesses to the supposedly invariant contents by moving the critical checks for changes outside of the loop that waits for changes. Fix this using atomic ops. This bug only showed up for the following configuration: a Turion2 system, amd64 kernels, compiled by gcc, and SCHED_4BSD. clang fails to do the optimization with all CFLAGS that I tried, because it doesn't fully optimize the '__asm __volatile' for cpu_spinwait() although this asm has no memory clobber. gcc only does the optimization with most CFLAGS. I mostly used -Os with all compilers. i386 works because gcc -m32 -Os only moves 1 or the 2 accesses outside of the loop. Non-Turion2 systems and SCHED_ULE worked due to different timing (when all APs start before the BP checks them outside of the loop). Reviewed by: kib Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Wed Feb 20 02:14:41 2019 (r344331) +++ head/sys/x86/x86/mp_x86.c Wed Feb 20 02:40:38 2019 (r344332) @@ -1088,8 +1088,8 @@ smp_after_idle_runnable(void *arg __unused) for (cpu = 1; cpu < mp_ncpus; cpu++) { idle_td = pcpu_find(cpu)->pc_idlethread; - while (idle_td->td_lastcpu == NOCPU && - idle_td->td_oncpu == NOCPU) + while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && + atomic_load_int(&idle_td->td_oncpu) == NOCPU) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); From owner-svn-src-all@freebsd.org Wed Feb 20 02:49: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 845E314E2BE8; Wed, 20 Feb 2019 02:49:00 +0000 (UTC) (envelope-from cem@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 2C4388845E; Wed, 20 Feb 2019 02:49:00 +0000 (UTC) (envelope-from cem@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 1C7F327034; Wed, 20 Feb 2019 02:49:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2mxuZ079743; Wed, 20 Feb 2019 02:48:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2mxge079741; Wed, 20 Feb 2019 02:48:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902200248.x1K2mxge079741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Feb 2019 02:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344333 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C4388845E 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.96)[-0.955,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)[-0.999,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, 20 Feb 2019 02:49:00 -0000 Author: cem Date: Wed Feb 20 02:48:59 2019 New Revision: 344333 URL: https://svnweb.freebsd.org/changeset/base/344333 Log: fuse: add descriptions for remaining sysctls (Except reclaim revoked; I don't know what that goal of that one is.) Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:48:59 2019 (r344333) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int fuse_fh_count = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLFLAG_RD, - &fuse_fh_count, 0, ""); + &fuse_fh_count, 0, "number of open FUSE filehandles"); int fuse_filehandle_open(struct vnode *vp, Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:48:59 2019 (r344333) @@ -180,17 +180,17 @@ struct vop_vector fuse_vnops = { static u_long fuse_lookup_cache_hits = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_hits, CTLFLAG_RD, - &fuse_lookup_cache_hits, 0, ""); + &fuse_lookup_cache_hits, 0, "number of positive cache hits in lookup"); static u_long fuse_lookup_cache_misses = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD, - &fuse_lookup_cache_misses, 0, ""); + &fuse_lookup_cache_misses, 0, "number of cache misses in lookup"); int fuse_lookup_cache_enable = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, lookup_cache_enable, CTLFLAG_RW, - &fuse_lookup_cache_enable, 0, ""); + &fuse_lookup_cache_enable, 0, "if non-zero, enable lookup cache"); /* * XXX: This feature is highly experimental and can bring to instabilities, From owner-svn-src-all@freebsd.org Wed Feb 20 02:49: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 BCEC414E2C3A; Wed, 20 Feb 2019 02:49:28 +0000 (UTC) (envelope-from cem@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 69C268859F; Wed, 20 Feb 2019 02:49:28 +0000 (UTC) (envelope-from cem@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 407D827035; Wed, 20 Feb 2019 02:49:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K2nSMZ079812; Wed, 20 Feb 2019 02:49:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K2nQk8079803; Wed, 20 Feb 2019 02:49:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902200249.x1K2nQk8079803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Feb 2019 02:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344334 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69C268859F 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)[-0.999,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, 20 Feb 2019 02:49:29 -0000 Author: cem Date: Wed Feb 20 02:49:26 2019 New Revision: 344334 URL: https://svnweb.freebsd.org/changeset/base/344334 Log: Fuse: whitespace and style(9) cleanup Take a pass through fixing some of the most egregious whitespace issues in fs/fuse. Also fix some style(9) warts while here. Not 100% cleaned up, but somewhat less painful to look at and edit. No functional change. Modified: head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse.h ============================================================================== --- head/sys/fs/fuse/fuse.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse.h Wed Feb 20 02:49:26 2019 (r344334) @@ -197,26 +197,27 @@ do { \ #define FUSE_TRACE 0 #endif -#define DEBUGX(cond, fmt, ...) do { \ - if (((cond))) { \ - printf("%s: " fmt, __func__, ## __VA_ARGS__); \ - } } while (0) +#define DEBUGX(cond, fmt, ...) do { \ + if (((cond))) { \ + printf("%s: " fmt, __func__, ## __VA_ARGS__); \ + } \ +} while (0) -#define fuse_lck_mtx_lock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_lock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - } while (0) +#define fuse_lck_mtx_lock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_lock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) -#define fuse_lck_mtx_unlock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_unlock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - } while (0) +#define fuse_lck_mtx_unlock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_unlock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) void fuse_ipc_init(void); void fuse_ipc_destroy(void); Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:49:26 2019 (r344334) @@ -317,7 +317,7 @@ again: return (err); } -static __inline int +static inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_file.c Wed Feb 20 02:49:26 2019 (r344334) @@ -91,11 +91,8 @@ SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLF &fuse_fh_count, 0, "number of open FUSE filehandles"); int -fuse_filehandle_open(struct vnode *vp, - fufh_type_t fufh_type, - struct fuse_filehandle **fufhp, - struct thread *td, - struct ucred *cred) +fuse_filehandle_open(struct vnode *vp, fufh_type_t fufh_type, + struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_open_in *foi; @@ -114,8 +111,8 @@ fuse_filehandle_open(struct vnode *vp, /* NOTREACHED */ } /* - * Note that this means we are effectively FILTERING OUT open() flags. - */ + * Note that this means we are effectively FILTERING OUT open() flags. + */ oflags = fuse_filehandle_xlate_to_oflags(fufh_type); if (vnode_isdir(vp)) { @@ -159,10 +156,8 @@ out: } int -fuse_filehandle_close(struct vnode *vp, - fufh_type_t fufh_type, - struct thread *td, - struct ucred *cred) +fuse_filehandle_close(struct vnode *vp, fufh_type_t fufh_type, + struct thread *td, struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_release_in *fri; @@ -265,10 +260,8 @@ fuse_filehandle_getrw(struct vnode *vp, fufh_type_t fu } void -fuse_filehandle_init(struct vnode *vp, - fufh_type_t fufh_type, - struct fuse_filehandle **fufhp, - uint64_t fh_id) +fuse_filehandle_init(struct vnode *vp, fufh_type_t fufh_type, + struct fuse_filehandle **fufhp, uint64_t fh_id) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh; Modified: head/sys/fs/fuse/fuse_file.h ============================================================================== --- head/sys/fs/fuse/fuse_file.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_file.h Wed Feb 20 02:49:26 2019 (r344334) @@ -67,75 +67,65 @@ #include typedef enum fufh_type { - FUFH_INVALID = -1, - FUFH_RDONLY = 0, - FUFH_WRONLY = 1, - FUFH_RDWR = 2, - FUFH_MAXTYPE = 3, + FUFH_INVALID = -1, + FUFH_RDONLY = 0, + FUFH_WRONLY = 1, + FUFH_RDWR = 2, + FUFH_MAXTYPE = 3, } fufh_type_t; +_Static_assert(FUFH_RDONLY == O_RDONLY, "RDONLY"); +_Static_assert(FUFH_WRONLY == O_WRONLY, "WRONLY"); +_Static_assert(FUFH_RDWR == O_RDWR, "RDWR"); struct fuse_filehandle { - uint64_t fh_id; - fufh_type_t fh_type; + uint64_t fh_id; + fufh_type_t fh_type; }; #define FUFH_IS_VALID(f) ((f)->fh_type != FUFH_INVALID) -static __inline__ -fufh_type_t +static inline fufh_type_t fuse_filehandle_xlate_from_mmap(int fflags) { - if (fflags & (PROT_READ | PROT_WRITE)) { - return FUFH_RDWR; - } else if (fflags & (PROT_WRITE)) { - return FUFH_WRONLY; - } else if ((fflags & PROT_READ) || (fflags & PROT_EXEC)) { - return FUFH_RDONLY; - } else { - return FUFH_INVALID; - } + if (fflags & (PROT_READ | PROT_WRITE)) + return FUFH_RDWR; + else if (fflags & (PROT_WRITE)) + return FUFH_WRONLY; + else if ((fflags & PROT_READ) || (fflags & PROT_EXEC)) + return FUFH_RDONLY; + else + return FUFH_INVALID; } -static __inline__ -fufh_type_t +static inline fufh_type_t fuse_filehandle_xlate_from_fflags(int fflags) { - if ((fflags & FREAD) && (fflags & FWRITE)) { - return FUFH_RDWR; - } else if (fflags & (FWRITE)) { - return FUFH_WRONLY; - } else if (fflags & (FREAD)) { - return FUFH_RDONLY; - } else { - panic("FUSE: What kind of a flag is this (%x)?", fflags); - } + if ((fflags & FREAD) && (fflags & FWRITE)) + return FUFH_RDWR; + else if (fflags & (FWRITE)) + return FUFH_WRONLY; + else if (fflags & (FREAD)) + return FUFH_RDONLY; + else + panic("FUSE: What kind of a flag is this (%x)?", fflags); } -static __inline__ -int +static inline int fuse_filehandle_xlate_to_oflags(fufh_type_t type) { - int oflags = -1; + int oflags = -1; - switch (type) { + switch (type) { + case FUFH_RDONLY: + case FUFH_WRONLY: + case FUFH_RDWR: + oflags = type; + break; + default: + break; + } - case FUFH_RDONLY: - oflags = O_RDONLY; - break; - - case FUFH_WRONLY: - oflags = O_WRONLY; - break; - - case FUFH_RDWR: - oflags = O_RDWR; - break; - - default: - break; - } - - return oflags; + return oflags; } int fuse_filehandle_valid(struct vnode *vp, fufh_type_t fufh_type); Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_internal.h Wed Feb 20 02:49:26 2019 (r344334) @@ -68,116 +68,114 @@ #include "fuse_ipc.h" #include "fuse_node.h" -static __inline int +static inline bool vfs_isrdonly(struct mount *mp) { - return ((mp->mnt_flag & MNT_RDONLY) != 0 ? 1 : 0); + return ((mp->mnt_flag & MNT_RDONLY) != 0); } -static __inline struct mount * +static inline struct mount * vnode_mount(struct vnode *vp) { return (vp->v_mount); } -static __inline int +static inline bool vnode_mountedhere(struct vnode *vp) { - return (vp->v_mountedhere != NULL ? 1 : 0); + return (vp->v_mountedhere != NULL); } -static __inline enum vtype +static inline enum vtype vnode_vtype(struct vnode *vp) { - return (vp->v_type); + return (vp->v_type); } -static __inline int +static inline bool vnode_isvroot(struct vnode *vp) { - return ((vp->v_vflag & VV_ROOT) != 0 ? 1 : 0); + return ((vp->v_vflag & VV_ROOT) != 0); } -static __inline int +static inline bool vnode_isreg(struct vnode *vp) { - return (vp->v_type == VREG ? 1 : 0); + return (vp->v_type == VREG); } -static __inline int +static inline bool vnode_isdir(struct vnode *vp) { - return (vp->v_type == VDIR ? 1 : 0); + return (vp->v_type == VDIR); } -static __inline int +static inline bool vnode_islnk(struct vnode *vp) { - return (vp->v_type == VLNK ? 1 : 0); + return (vp->v_type == VLNK); } -static __inline ssize_t +static inline ssize_t uio_resid(struct uio *uio) { - return (uio->uio_resid); + return (uio->uio_resid); } -static __inline off_t +static inline off_t uio_offset(struct uio *uio) { - return (uio->uio_offset); + return (uio->uio_offset); } -static __inline void +static inline void uio_setoffset(struct uio *uio, off_t offset) { - uio->uio_offset = offset; + uio->uio_offset = offset; } -static __inline void +static inline void uio_setresid(struct uio *uio, ssize_t resid) { - uio->uio_resid = resid; + uio->uio_resid = resid; } /* miscellaneous */ -static __inline__ -int +static inline bool fuse_isdeadfs(struct vnode *vp) { - struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp)); + struct fuse_data *data = fuse_get_mpdata(vnode_mount(vp)); - return (data->dataflags & FSESS_DEAD); + return (data->dataflags & FSESS_DEAD); } -static __inline__ -int +static inline uint64_t fuse_iosize(struct vnode *vp) { - return vp->v_mount->mnt_stat.f_iosize; + return (vp->v_mount->mnt_stat.f_iosize); } /* access */ -#define FVP_ACCESS_NOOP 0x01 +#define FVP_ACCESS_NOOP 0x01 -#define FACCESS_VA_VALID 0x01 -#define FACCESS_DO_ACCESS 0x02 -#define FACCESS_STICKY 0x04 -#define FACCESS_CHOWN 0x08 -#define FACCESS_NOCHECKSPY 0x10 -#define FACCESS_SETGID 0x12 +#define FACCESS_VA_VALID 0x01 +#define FACCESS_DO_ACCESS 0x02 +#define FACCESS_STICKY 0x04 +#define FACCESS_CHOWN 0x08 +#define FACCESS_NOCHECKSPY 0x10 +#define FACCESS_SETGID 0x12 -#define FACCESS_XQUERIES FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID +#define FACCESS_XQUERIES (FACCESS_STICKY | FACCESS_CHOWN | FACCESS_SETGID) struct fuse_access_param { - uid_t xuid; - gid_t xgid; - uint32_t facc_flags; + uid_t xuid; + gid_t xgid; + uint32_t facc_flags; }; -static __inline int +static inline int fuse_match_cred(struct ucred *basecred, struct ucred *usercred) { if (basecred->cr_uid == usercred->cr_uid && @@ -186,17 +184,13 @@ fuse_match_cred(struct ucred *basecred, struct ucred * basecred->cr_groups[0] == usercred->cr_groups[0] && basecred->cr_groups[0] == usercred->cr_rgid && basecred->cr_groups[0] == usercred->cr_svgid) - return 0; + return (0); - return EPERM; + return (EPERM); } -int -fuse_internal_access(struct vnode *vp, - mode_t mode, - struct fuse_access_param *facp, - struct thread *td, - struct ucred *cred); +int fuse_internal_access(struct vnode *vp, mode_t mode, + struct fuse_access_param *facp, struct thread *td, struct ucred *cred); /* attributes */ @@ -209,186 +203,143 @@ fuse_internal_access(struct vnode *vp, * If the nominal attribute cache TTL is zero, do not cache on the 'vp' (but do * return the result to the caller). */ -static __inline -void -fuse_internal_attr_fat2vat(struct vnode *vp, - struct fuse_attr *fat, - uint64_t attr_valid, - uint32_t attr_valid_nsec, - struct vattr *vap) +static inline void +fuse_internal_attr_fat2vat(struct vnode *vp, struct fuse_attr *fat, + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) { - struct mount *mp; - struct fuse_vnode_data *fvdat; - struct vattr *vp_cache_at; + struct mount *mp; + struct fuse_vnode_data *fvdat; + struct vattr *vp_cache_at; - mp = vnode_mount(vp); - fvdat = VTOFUD(vp); + mp = vnode_mount(vp); + fvdat = VTOFUD(vp); - DEBUGX(FUSE_DEBUG_INTERNAL, - "node #%ju, mode 0%o\n", (uintmax_t)fat->ino, fat->mode); + DEBUGX(FUSE_DEBUG_INTERNAL, "node #%ju, mode 0%o\n", + (uintmax_t)fat->ino, fat->mode); - /* Honor explicit do-not-cache requests from user filesystems. */ - if (attr_valid == 0 && attr_valid_nsec == 0) - fvdat->valid_attr_cache = false; - else - fvdat->valid_attr_cache = true; + /* Honor explicit do-not-cache requests from user filesystems. */ + if (attr_valid == 0 && attr_valid_nsec == 0) + fvdat->valid_attr_cache = false; + else + fvdat->valid_attr_cache = true; - vp_cache_at = VTOVA(vp); + vp_cache_at = VTOVA(vp); - if (vap == NULL && vp_cache_at == NULL) - return; + if (vap == NULL && vp_cache_at == NULL) + return; - if (vap == NULL) - vap = vp_cache_at; + if (vap == NULL) + vap = vp_cache_at; - vattr_null(vap); + vattr_null(vap); - vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; - vap->va_mode = fat->mode & ~S_IFMT; - vap->va_nlink = fat->nlink; - vap->va_uid = fat->uid; - vap->va_gid = fat->gid; - vap->va_rdev = fat->rdev; - vap->va_size = fat->size; - vap->va_atime.tv_sec = fat->atime; /* XXX on some platforms cast from 64 bits to 32 */ - vap->va_atime.tv_nsec = fat->atimensec; - vap->va_mtime.tv_sec = fat->mtime; - vap->va_mtime.tv_nsec = fat->mtimensec; - vap->va_ctime.tv_sec = fat->ctime; - vap->va_ctime.tv_nsec = fat->ctimensec; - vap->va_blocksize = PAGE_SIZE; - vap->va_type = IFTOVT(fat->mode); - vap->va_bytes = fat->blocks * S_BLKSIZE; - vap->va_flags = 0; + vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; + vap->va_fileid = fat->ino; + vap->va_mode = fat->mode & ~S_IFMT; + vap->va_nlink = fat->nlink; + vap->va_uid = fat->uid; + vap->va_gid = fat->gid; + vap->va_rdev = fat->rdev; + vap->va_size = fat->size; + /* XXX on i386, seconds are truncated to 32 bits */ + vap->va_atime.tv_sec = fat->atime; + vap->va_atime.tv_nsec = fat->atimensec; + vap->va_mtime.tv_sec = fat->mtime; + vap->va_mtime.tv_nsec = fat->mtimensec; + vap->va_ctime.tv_sec = fat->ctime; + vap->va_ctime.tv_nsec = fat->ctimensec; + vap->va_blocksize = PAGE_SIZE; + vap->va_type = IFTOVT(fat->mode); + vap->va_bytes = fat->blocks * S_BLKSIZE; + vap->va_flags = 0; - if (vap != vp_cache_at && vp_cache_at != NULL) - memcpy(vp_cache_at, vap, sizeof(*vap)); + if (vap != vp_cache_at && vp_cache_at != NULL) + memcpy(vp_cache_at, vap, sizeof(*vap)); } #define cache_attrs(vp, fuse_out, vap_out) \ - fuse_internal_attr_fat2vat((vp), &(fuse_out)->attr, \ - (fuse_out)->attr_valid, (fuse_out)->attr_valid_nsec, (vap_out)) + fuse_internal_attr_fat2vat((vp), &(fuse_out)->attr, \ + (fuse_out)->attr_valid, (fuse_out)->attr_valid_nsec, (vap_out)) /* fsync */ -int -fuse_internal_fsync(struct vnode *vp, - struct thread *td, - struct ucred *cred, - struct fuse_filehandle *fufh); +int fuse_internal_fsync(struct vnode *vp, struct thread *td, + struct ucred *cred, struct fuse_filehandle *fufh); +int fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio); -int -fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio); - /* readdir */ struct pseudo_dirent { - uint32_t d_namlen; + uint32_t d_namlen; }; -int -fuse_internal_readdir(struct vnode *vp, - struct uio *uio, - struct fuse_filehandle *fufh, - struct fuse_iov *cookediov); +int fuse_internal_readdir(struct vnode *vp, struct uio *uio, + struct fuse_filehandle *fufh, struct fuse_iov *cookediov); +int fuse_internal_readdir_processdata(struct uio *uio, size_t reqsize, + void *buf, size_t bufsize, void *param); -int -fuse_internal_readdir_processdata(struct uio *uio, - size_t reqsize, - void *buf, - size_t bufsize, - void *param); - /* remove */ -int -fuse_internal_remove(struct vnode *dvp, - struct vnode *vp, - struct componentname *cnp, - enum fuse_opcode op); +int fuse_internal_remove(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp, enum fuse_opcode op); /* rename */ -int -fuse_internal_rename(struct vnode *fdvp, - struct componentname *fcnp, - struct vnode *tdvp, - struct componentname *tcnp); +int fuse_internal_rename(struct vnode *fdvp, struct componentname *fcnp, + struct vnode *tdvp, struct componentname *tcnp); + /* revoke */ -void -fuse_internal_vnode_disappear(struct vnode *vp); +void fuse_internal_vnode_disappear(struct vnode *vp); /* strategy */ /* entity creation */ -static __inline -int +static inline int fuse_internal_checkentry(struct fuse_entry_out *feo, enum vtype vtyp) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "feo=%p, vtype=%d\n", feo, vtyp); + DEBUGX(FUSE_DEBUG_INTERNAL, + "feo=%p, vtype=%d\n", feo, vtyp); - if (vtyp != IFTOVT(feo->attr.mode)) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode)); - return EINVAL; - } + if (vtyp != IFTOVT(feo->attr.mode)) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode)); + return (EINVAL); + } - if (feo->nodeid == FUSE_NULL_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is NULL\n"); - return EINVAL; - } + if (feo->nodeid == FUSE_NULL_ID) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- feo->nodeid is NULL\n"); + return (EINVAL); + } - if (feo->nodeid == FUSE_ROOT_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n"); - return EINVAL; - } + if (feo->nodeid == FUSE_ROOT_ID) { + DEBUGX(FUSE_DEBUG_INTERNAL, + "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n"); + return (EINVAL); + } - return 0; + return (0); } -int -fuse_internal_newentry(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - enum fuse_opcode op, - void *buf, - size_t bufsize, - enum vtype vtyp); +int fuse_internal_newentry(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, enum fuse_opcode op, void *buf, size_t bufsize, + enum vtype vtyp); -void -fuse_internal_newentry_makerequest(struct mount *mp, - uint64_t dnid, - struct componentname *cnp, - enum fuse_opcode op, - void *buf, - size_t bufsize, - struct fuse_dispatcher *fdip); +void fuse_internal_newentry_makerequest(struct mount *mp, uint64_t dnid, + struct componentname *cnp, enum fuse_opcode op, void *buf, size_t bufsize, + struct fuse_dispatcher *fdip); -int -fuse_internal_newentry_core(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - enum vtype vtyp, - struct fuse_dispatcher *fdip); +int fuse_internal_newentry_core(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, enum vtype vtyp, struct fuse_dispatcher *fdip); /* entity destruction */ -int -fuse_internal_forget_callback(struct fuse_ticket *tick, struct uio *uio); - -void -fuse_internal_forget_send(struct mount *mp, - struct thread *td, - struct ucred *cred, - uint64_t nodeid, - uint64_t nlookup); +int fuse_internal_forget_callback(struct fuse_ticket *tick, struct uio *uio); +void fuse_internal_forget_send(struct mount *mp, struct thread *td, + struct ucred *cred, uint64_t nodeid, uint64_t nlookup); /* fuse start/stop */ Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_ipc.c Wed Feb 20 02:49:26 2019 (r344334) @@ -91,19 +91,11 @@ static struct fuse_ticket *fticket_alloc(struct fuse_d static void fticket_refresh(struct fuse_ticket *ftick); static void fticket_destroy(struct fuse_ticket *ftick); static int fticket_wait_answer(struct fuse_ticket *ftick); -static __inline__ int +static inline int fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio); static int fuse_body_audit(struct fuse_ticket *ftick, size_t blen); -static __inline__ void -fuse_setup_ihead(struct fuse_in_header *ihead, - struct fuse_ticket *ftick, - uint64_t nid, - enum fuse_opcode op, - size_t blen, - pid_t pid, - struct ucred *cred); static fuse_handler_t fuse_standard_handler; @@ -274,19 +266,19 @@ fticket_fini(void *mem, int size) mtx_destroy(&ftick->tk_aw_mtx); } -static __inline struct fuse_ticket * +static inline struct fuse_ticket * fticket_alloc(struct fuse_data *data) { return uma_zalloc_arg(ticket_zone, data, M_WAITOK); } -static __inline void +static inline void fticket_destroy(struct fuse_ticket *ftick) { return uma_zfree(ticket_zone, ftick); } -static __inline__ +static inline void fticket_refresh(struct fuse_ticket *ftick) { @@ -354,7 +346,7 @@ out: return err; } -static __inline__ +static inline int fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio) { @@ -717,13 +709,9 @@ fuse_body_audit(struct fuse_ticket *ftick, size_t blen return err; } -static void -fuse_setup_ihead(struct fuse_in_header *ihead, - struct fuse_ticket *ftick, - uint64_t nid, - enum fuse_opcode op, - size_t blen, - pid_t pid, +static inline void +fuse_setup_ihead(struct fuse_in_header *ihead, struct fuse_ticket *ftick, + uint64_t nid, enum fuse_opcode op, size_t blen, pid_t pid, struct ucred *cred) { ihead->len = sizeof(*ihead) + blen; @@ -767,12 +755,8 @@ fuse_standard_handler(struct fuse_ticket *ftick, struc } void -fdisp_make_pid(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct mount *mp, - uint64_t nid, - pid_t pid, - struct ucred *cred) +fdisp_make_pid(struct fuse_dispatcher *fdip, enum fuse_opcode op, + struct mount *mp, uint64_t nid, pid_t pid, struct ucred *cred) { struct fuse_data *data = fuse_get_mpdata(mp); @@ -792,12 +776,8 @@ fdisp_make_pid(struct fuse_dispatcher *fdip, } void -fdisp_make(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct mount *mp, - uint64_t nid, - struct thread *td, - struct ucred *cred) +fdisp_make(struct fuse_dispatcher *fdip, enum fuse_opcode op, struct mount *mp, + uint64_t nid, struct thread *td, struct ucred *cred) { RECTIFY_TDCR(td, cred); @@ -805,11 +785,8 @@ fdisp_make(struct fuse_dispatcher *fdip, } void -fdisp_make_vp(struct fuse_dispatcher *fdip, - enum fuse_opcode op, - struct vnode *vp, - struct thread *td, - struct ucred *cred) +fdisp_make_vp(struct fuse_dispatcher *fdip, enum fuse_opcode op, + struct vnode *vp, struct thread *td, struct ucred *cred) { debug_printf("fdip=%p, op=%d, vp=%p\n", fdip, op, vp); RECTIFY_TDCR(td, cred); Modified: head/sys/fs/fuse/fuse_ipc.h ============================================================================== --- head/sys/fs/fuse/fuse_ipc.h Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_ipc.h Wed Feb 20 02:49:26 2019 (r344334) @@ -64,10 +64,10 @@ #include struct fuse_iov { - void *base; - size_t len; - size_t allocated_size; - int credit; + void *base; + size_t len; + size_t allocated_size; + int credit; }; void fiov_init(struct fuse_iov *fiov, size_t size); @@ -75,23 +75,22 @@ void fiov_teardown(struct fuse_iov *fiov); void fiov_refresh(struct fuse_iov *fiov); void fiov_adjust(struct fuse_iov *fiov, size_t size); -#define FUSE_DIMALLOC(fiov, spc1, spc2, amnt) \ -do { \ - fiov_adjust(fiov, (sizeof(*(spc1)) + (amnt))); \ - (spc1) = (fiov)->base; \ - (spc2) = (char *)(fiov)->base + (sizeof(*(spc1))); \ +#define FUSE_DIMALLOC(fiov, spc1, spc2, amnt) do { \ + fiov_adjust(fiov, (sizeof(*(spc1)) + (amnt))); \ + (spc1) = (fiov)->base; \ + (spc2) = (char *)(fiov)->base + (sizeof(*(spc1))); \ } while (0) #define FU_AT_LEAST(siz) max((siz), 160) -#define FUSE_ASSERT_AW_DONE(ftick) \ - KASSERT((ftick)->tk_aw_link.tqe_next == NULL && \ - (ftick)->tk_aw_link.tqe_prev == NULL, \ - ("FUSE: ticket still on answer delivery list %p", (ftick))) \ +#define FUSE_ASSERT_AW_DONE(ftick) \ + KASSERT((ftick)->tk_aw_link.tqe_next == NULL && \ + (ftick)->tk_aw_link.tqe_prev == NULL, \ + ("FUSE: ticket still on answer delivery list %p", (ftick))) -#define FUSE_ASSERT_MS_DONE(ftick) \ - KASSERT((ftick)->tk_ms_link.stqe_next == NULL, \ - ("FUSE: ticket still on message list %p", (ftick))) +#define FUSE_ASSERT_MS_DONE(ftick) \ + KASSERT((ftick)->tk_ms_link.stqe_next == NULL, \ + ("FUSE: ticket still on message list %p", (ftick))) struct fuse_ticket; struct fuse_data; @@ -99,66 +98,62 @@ struct fuse_data; typedef int fuse_handler_t(struct fuse_ticket *ftick, struct uio *uio); struct fuse_ticket { - /* fields giving the identity of the ticket */ - uint64_t tk_unique; - struct fuse_data *tk_data; - int tk_flag; - u_int tk_refcount; + /* fields giving the identity of the ticket */ + uint64_t tk_unique; + struct fuse_data *tk_data; + int tk_flag; + u_int tk_refcount; - /* fields for initiating an upgoing message */ - struct fuse_iov tk_ms_fiov; - void *tk_ms_bufdata; - size_t tk_ms_bufsize; - enum { FT_M_FIOV, FT_M_BUF } tk_ms_type; - STAILQ_ENTRY(fuse_ticket) tk_ms_link; + /* fields for initiating an upgoing message */ + struct fuse_iov tk_ms_fiov; + void *tk_ms_bufdata; + size_t tk_ms_bufsize; + enum { FT_M_FIOV, FT_M_BUF } tk_ms_type; + STAILQ_ENTRY(fuse_ticket) tk_ms_link; - /* fields for handling answers coming from userspace */ - struct fuse_iov tk_aw_fiov; - void *tk_aw_bufdata; - size_t tk_aw_bufsize; - enum { FT_A_FIOV, FT_A_BUF } tk_aw_type; + /* fields for handling answers coming from userspace */ + struct fuse_iov tk_aw_fiov; + void *tk_aw_bufdata; + size_t tk_aw_bufsize; + enum { FT_A_FIOV, FT_A_BUF } tk_aw_type; - struct fuse_out_header tk_aw_ohead; - int tk_aw_errno; - struct mtx tk_aw_mtx; - fuse_handler_t *tk_aw_handler; - TAILQ_ENTRY(fuse_ticket) tk_aw_link; + struct fuse_out_header tk_aw_ohead; + int tk_aw_errno; + struct mtx tk_aw_mtx; + fuse_handler_t *tk_aw_handler; + TAILQ_ENTRY(fuse_ticket) tk_aw_link; }; #define FT_ANSW 0x01 /* request of ticket has already been answered */ #define FT_DIRTY 0x04 /* ticket has been used */ -static __inline__ -struct fuse_iov * +static inline struct fuse_iov * fticket_resp(struct fuse_ticket *ftick) { - return (&ftick->tk_aw_fiov); + return (&ftick->tk_aw_fiov); } -static __inline__ -int +static inline bool fticket_answered(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); - return (ftick->tk_flag & FT_ANSW); + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); + return (ftick->tk_flag & FT_ANSW); } -static __inline__ -void +static inline void fticket_set_answered(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); - ftick->tk_flag |= FT_ANSW; + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + mtx_assert(&ftick->tk_aw_mtx, MA_OWNED); + ftick->tk_flag |= FT_ANSW; } -static __inline__ -enum fuse_opcode +static inline enum fuse_opcode fticket_opcode(struct fuse_ticket *ftick) { - DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); - return (((struct fuse_in_header *)(ftick->tk_ms_fiov.base))->opcode); + DEBUGX(FUSE_DEBUG_IPC, "-> ftick=%p\n", ftick); + return (((struct fuse_in_header *)(ftick->tk_ms_fiov.base))->opcode); } int fticket_pull(struct fuse_ticket *ftick, struct uio *uio); @@ -169,35 +164,35 @@ enum mountpri { FM_NOMOUNTED, FM_PRIMARY, FM_SECONDARY * The data representing a FUSE session. */ struct fuse_data { - struct cdev *fdev; - struct mount *mp; - struct vnode *vroot; - struct ucred *daemoncred; - int dataflags; - int ref; + struct cdev *fdev; + struct mount *mp; + struct vnode *vroot; + struct ucred *daemoncred; + int dataflags; + int ref; - struct mtx ms_mtx; - STAILQ_HEAD(, fuse_ticket) ms_head; + struct mtx ms_mtx; + STAILQ_HEAD(, fuse_ticket) ms_head; - struct mtx aw_mtx; - TAILQ_HEAD(, fuse_ticket) aw_head; + struct mtx aw_mtx; + TAILQ_HEAD(, fuse_ticket) aw_head; - u_long ticketer; + u_long ticketer; - struct sx rename_lock; + struct sx rename_lock; - uint32_t fuse_libabi_major; - uint32_t fuse_libabi_minor; + uint32_t fuse_libabi_major; + uint32_t fuse_libabi_minor; - uint32_t max_write; - uint32_t max_read; - uint32_t subtype; - char volname[MAXPATHLEN]; + uint32_t max_write; + uint32_t max_read; + uint32_t subtype; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 20 03: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 7A2B314E32DA; Wed, 20 Feb 2019 03:00:56 +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 2256388D38; Wed, 20 Feb 2019 03:00: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 17C2F271FC; Wed, 20 Feb 2019 03:00: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 x1K30tVs086047; Wed, 20 Feb 2019 03:00:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K30tug086046; Wed, 20 Feb 2019 03:00:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902200300.x1K30tug086046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Feb 2019 03:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344335 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 344335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2256388D38 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.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 03:00:56 -0000 Author: ian Date: Wed Feb 20 03:00:55 2019 New Revision: 344335 URL: https://svnweb.freebsd.org/changeset/base/344335 Log: Fix the handling of legacy-format devices in the u-boot loaderdev variable. When I added support for the standard loader(8) disk0s2a: type formats, the parsing of legacy format was broken because it also contains a colon, but it comes before the slice and partition. That would cause disk_parsedev() to return success with the slice and partition set to wildcard values. This change examines the string first, and if it contains spaces, dots, or a colon at any position other than the end, it must be a legacy-format string and we don't even try to use disk_parsedev() on it. Reported by: Manuel Stuhn Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Wed Feb 20 02:49:26 2019 (r344334) +++ head/stand/uboot/common/main.c Wed Feb 20 03:00:55 2019 (r344335) @@ -226,16 +226,23 @@ get_load_device(int *type, int *unit, int *slice, int p = get_device_type(devstr, type); /* - * If type is DEV_TYP_STOR we have a disk-like device. If we can parse - * the remainder of the string as a standard unit+slice+partition (e.g., - * 0s2a or 1p12), return those results. Otherwise we'll fall through to - * the code that parses the legacy format. + * If type is DEV_TYP_STOR we have a disk-like device. If the remainder + * of the string contains spaces, dots, or a colon in any location other + * than the last char, it's legacy format. Otherwise it might be + * standard loader(8) format (e.g., disk0s2a or mmc1p12), so try to + * parse the remainder of the string as such, and if it works, return + * those results. Otherwise we'll fall through to the code that parses + * the legacy format. */ - if ((*type & DEV_TYP_STOR) && disk_parsedev(&dev, p, NULL) == 0) { - *unit = dev.dd.d_unit; - *slice = dev.d_slice; - *partition = dev.d_partition; - return; + if (*type & DEV_TYP_STOR) { + size_t len = strlen(p); + if (strcspn(p, " .") == len && strcspn(p, ":") >= len - 1 && + disk_parsedev(&dev, p, NULL) == 0) { + *unit = dev.dd.d_unit; + *slice = dev.d_slice; + *partition = dev.d_partition; + return; + } } /* Ignore optional spaces after the device name. */ From owner-svn-src-all@freebsd.org Wed Feb 20 05:19: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 D702414E6306; Wed, 20 Feb 2019 05:19:17 +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 DF2C38CA25; Wed, 20 Feb 2019 05:19:16 +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 C9710A4C; Wed, 20 Feb 2019 05:19:16 +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 x1K5JG3N058197; Wed, 20 Feb 2019 05:19:16 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K5JGaC058196; Wed, 20 Feb 2019 05:19:16 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201902200519.x1K5JGaC058196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Wed, 20 Feb 2019 05:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344337 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 344337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF2C38CA25 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.967,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)[-0.999,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, 20 Feb 2019 05:19:18 -0000 Author: bcran Date: Wed Feb 20 05:19:16 2019 New Revision: 344337 URL: https://svnweb.freebsd.org/changeset/base/344337 Log: Add the unix path to the output of `efivar --load-option` Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19242 Modified: head/usr.sbin/efivar/efiutil.c Modified: head/usr.sbin/efivar/efiutil.c ============================================================================== --- head/usr.sbin/efivar/efiutil.c Wed Feb 20 03:07:11 2019 (r344336) +++ head/usr.sbin/efivar/efiutil.c Wed Feb 20 05:19:16 2019 (r344337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2019 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -120,6 +120,7 @@ bindump(uint8_t *data, size_t datalen) void efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) { + char *dev, *relpath, *abspath; uint8_t *ep = data + datalen; uint8_t *walker = data; uint32_t attr; @@ -131,6 +132,7 @@ efi_print_load_option(uint8_t *data, size_t datalen, i int len; void *opt; int optlen; + int rv; if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) return; @@ -162,8 +164,15 @@ efi_print_load_option(uint8_t *data, size_t datalen, i free(str); while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); + rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); dp = (efidp)((char *)dp + efidp_size(dp)); printf(" %s\n", buf); + if (rv == 0) { + printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); + free(dev); + free(relpath); + free(abspath); + } } if (optlen == 0) return; From owner-svn-src-all@freebsd.org Wed Feb 20 06:40: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 F37B314E7CED; Wed, 20 Feb 2019 06:40:53 +0000 (UTC) (envelope-from bapt@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 9258F8F1BD; Wed, 20 Feb 2019 06:40:53 +0000 (UTC) (envelope-from bapt@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 869A61920; Wed, 20 Feb 2019 06:40:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K6erDC099804; Wed, 20 Feb 2019 06:40:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K6eqA9099800; Wed, 20 Feb 2019 06:40:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201902200640.x1K6eqA9099800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 20 Feb 2019 06:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344340 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 344340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9258F8F1BD 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)[-0.999,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, 20 Feb 2019 06:40:54 -0000 Author: bapt Date: Wed Feb 20 06:40:52 2019 New Revision: 344340 URL: https://svnweb.freebsd.org/changeset/base/344340 Log: calendar: use iconv to respect the output encoding calendar(1) can have input in various encoding, specifying LANG= to enable calendar(1) to determine which one to use. The problem is the content of the calendar itself is exposed as is making it unreadable in many cases. For example french calendar which is encoded ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment. Using iconv allows to solve this issue. This will also allow to keep only 1 encoding in base for those files without breaking user existing setup Reported by: many MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19221 Modified: head/usr.bin/calendar/Makefile head/usr.bin/calendar/calendar.c head/usr.bin/calendar/calendar.h head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/Makefile Wed Feb 20 06:40:52 2019 (r344340) @@ -13,6 +13,10 @@ INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_F DE_LINKS= de_DE.ISO8859-15 FR_LINKS= fr_FR.ISO8859-15 +.if ${MK_ICONV} == "yes" +CFLAGS+= -DWITH_ICONV +.endif + FILESGROUPS+= CALS CALS= calendars/calendar.all \ calendars/calendar.australia \ Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.c Wed Feb 20 06:40:52 2019 (r344340) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,6 +67,9 @@ static char *DEBUG = NULL; static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; +#ifdef WITH_ICONV +const char *outputEncoding; +#endif static void usage(void) __dead2; @@ -80,6 +84,12 @@ main(int argc, char *argv[]) struct tm tp1, tp2; (void)setlocale(LC_ALL, ""); +#ifdef WITH_ICONV + /* save the information about the encoding used in the terminal */ + outputEncoding = strdup(nl_langinfo(CODESET)); + if (outputEncoding == NULL) + errx(1, "cannot allocate memory"); +#endif while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1) switch (ch) { Modified: head/usr.bin/calendar/calendar.h ============================================================================== --- head/usr.bin/calendar/calendar.h Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.h Wed Feb 20 06:40:52 2019 (r344340) @@ -59,6 +59,9 @@ extern struct fixs neaster, npaskha, ncny, nfullmoon, extern struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; extern double UTCOffset; extern int EastLongitude; +#ifdef WITH_ICONV +extern const char *outputEncoding; +#endif #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) @@ -197,3 +200,7 @@ void fpom(int year, double utcoffset, double *ffms, do void equinoxsolstice(int year, double UTCoffset, int *equinoxdays, int *solsticedays); void fequinoxsolstice(int year, double UTCoffset, double *equinoxdays, double *solsticedays); int calculatesunlongitude30(int year, int degreeGMToffset, int *ichinesemonths); + +#ifdef WITH_ICONV +void set_new_encoding(void); +#endif Modified: head/usr.bin/calendar/events.c ============================================================================== --- head/usr.bin/calendar/events.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/events.c Wed Feb 20 06:40:52 2019 (r344340) @@ -35,10 +35,120 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV +#include +#include +#include +static iconv_t conv = (iconv_t)-1; +static char *currentEncoding = NULL; + +#endif + #include "pathnames.h" #include "calendar.h" +#ifdef WITH_ICONV +void +set_new_encoding(void) +{ + const char *newenc; + + newenc = nl_langinfo(CODESET); + if (currentEncoding == NULL) { + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + return; + } + if (strcmp(currentEncoding, newenc) == 0) + return; + free(currentEncoding); + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + if (conv != (iconv_t) -1) { + iconv_close(conv); + conv = (iconv_t) -1; + } +} +#endif + +static char * +convert(char *input) +{ + char *output; +#ifdef WITH_ICONV + size_t inleft, outleft, converted = 0; + char *outbuf, *tmp; + char *inbuf; + size_t outlen; + + if (currentEncoding == NULL) { + output = strdup(input); + if (output == NULL) + errx(1, "convert: cannot allocate memory"); + return (output); + } + if (conv == (iconv_t)-1) { + conv = iconv_open(outputEncoding, currentEncoding); + if (conv == (iconv_t)-1) { + if (errno == EINVAL) + errx(1, "Conversion is not supported"); + else + err(1, "Initialization failure"); + } + } + + inleft = strlen(input); + inbuf = input; + + outlen = inleft; + if ((output = malloc(outlen + 1)) == NULL) + errx(1, "convert: cannot allocate memory"); + + for (;;) { + errno = 0; + outbuf = output + converted; + outleft = outlen - converted; + + converted = iconv(conv, (char **) &inbuf, &inleft, &outbuf, &outleft); + if (converted != (size_t) -1 || errno == EINVAL) { + /* finished or invalid multibyte, so truncate and ignore */ + break; + } + + if (errno != E2BIG) { + free(output); + err(1, "convert"); + } + + converted = outbuf - output; + outlen += inleft * 2; + + if ((tmp = realloc(output, outlen + 1)) == NULL) { + free(output); + errx(1, "convert: cannot allocate memory"); + } + + output = tmp; + outbuf = output + converted; + } + + /* flush the iconv conversion */ + iconv(conv, NULL, NULL, &outbuf, &outleft); + + /* null terminate the string */ + *outbuf = '\0'; +#else + output = strdup(input); + if (output == NULL) + errx(1, "convert: cannot allocate memory"); +#endif + + return (output); +} + struct event * event_add(int year, int month, int day, char *date, int var, char *txt, char *extra) @@ -58,15 +168,15 @@ event_add(int year, int month, int day, char *date, in e->month = month; e->day = day; e->var = var; - e->date = strdup(date); + e->date = convert(date); if (e->date == NULL) errx(1, "event_add: cannot allocate memory"); - e->text = strdup(txt); + e->text = convert(txt); if (e->text == NULL) errx(1, "event_add: cannot allocate memory"); e->extra = NULL; if (extra != NULL && extra[0] != '\0') - e->extra = strdup(extra); + e->extra = convert(extra); addtodate(e, year, month, day); return (e); } @@ -74,23 +184,17 @@ event_add(int year, int month, int day, char *date, in void event_continue(struct event *e, char *txt) { - char *text; + char *oldtext, *text; - /* - * Adding text to the event: - * - Save a copy of the old text (unknown length, so strdup()) - * - Allocate enough space for old text + \n + new text + 0 - * - Store the old text + \n + new text - * - Destroy the saved copy. - */ - text = strdup(e->text); - if (text == NULL) + text = convert(txt); + oldtext = e->text; + if (oldtext == NULL) errx(1, "event_continue: cannot allocate memory"); - free(e->text); - asprintf(&e->text, "%s\n%s", text, txt); + asprintf(&e->text, "%s\n%s", oldtext, text); if (e->text == NULL) errx(1, "event_continue: cannot allocate memory"); + free(oldtext); free(text); return; Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/io.c Wed Feb 20 06:40:52 2019 (r344340) @@ -294,6 +294,9 @@ cal_parse(FILE *in, FILE *out) if (strncmp(buf, "LANG=", 5) == 0) { (void)setlocale(LC_ALL, buf + 5); d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); +#ifdef WITH_ICONV + set_new_encoding(); +#endif setnnames(); continue; } From owner-svn-src-all@freebsd.org Wed Feb 20 07:10: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 8CCF014E8C07; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@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 3307069E42; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@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 1DFBB1D26; Wed, 20 Feb 2019 07:10:39 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1K7Ac0d017451; Wed, 20 Feb 2019 07:10:38 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K7Acj0017450; Wed, 20 Feb 2019 07:10:38 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902200710.x1K7Acj0017450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 20 Feb 2019 07:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344343 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3307069E42 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)[-0.999,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, 20 Feb 2019 07:10:39 -0000 Author: ganbold Date: Wed Feb 20 07:10:38 2019 New Revision: 344343 URL: https://svnweb.freebsd.org/changeset/base/344343 Log: Clarify notifications when battery capacity ratio reaches warning and shutdown thresholds. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Wed Feb 20 06:54:32 2019 (r344342) +++ head/sys/arm/allwinner/axp81x.c Wed Feb 20 07:10:38 2019 (r344343) @@ -1088,9 +1088,9 @@ axp8xx_intr(void *arg) if (bootverbose) device_printf(dev, "AXP_IRQSTAT4 val: %x\n", val); if (val & AXP_IRQSTAT4_BATLVL_LO0) - devctl_notify("PMU", "Battery", "lower than level 2", NULL); + devctl_notify("PMU", "Battery", "shutdown threshold", NULL); if (val & AXP_IRQSTAT4_BATLVL_LO1) - devctl_notify("PMU", "Battery", "lower than level 1", NULL); + devctl_notify("PMU", "Battery", "warning threshold", NULL); /* Acknowledge */ axp8xx_write(dev, AXP_IRQSTAT4, val); } From owner-svn-src-all@freebsd.org Wed Feb 20 07: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 0A47614E9C33; Wed, 20 Feb 2019 07:56:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4B9D6BD9C; Wed, 20 Feb 2019 07:56:13 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9612ECF42; Wed, 20 Feb 2019 07:56:13 +0000 (UTC) Date: Wed, 20 Feb 2019 07:56:13 +0000 From: Alexey Dokuchaev To: Shawn Webb Cc: Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20190220075613.GC84455@FreeBSD.org> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: A4B9D6BD9C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.907,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, 20 Feb 2019 07:56:14 -0000 On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > At the risk of painting a bikeshed a lovely color of neon purple, I'm > curious about if/how these types of commits get merged upstream to > (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > confused|is anyone else confused where upstream is?). > > Who is upstream? Is work like this going to remain as a downstream > patch to ZFS? Or is FreeBSD going to work to upstream this type of > work? I've always felt that we should've become upstream to everyone else the moment we knew Oracle would eat Sun (20 April 2009), and never understood why it didn't happen and now, ten years later, we're talking about ZFS on fucking Linux becoming our upstream. Something'd got very wrong here and I'd like to know what and why. > I hope my curiousity doesn't offend anyone. ;) Not at all, I'm also confused and curious. ./danfe From owner-svn-src-all@freebsd.org Wed Feb 20 08:10: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 6AA3414EA325 for ; Wed, 20 Feb 2019 08:10:10 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10021101.me.com (pv50p00im-ztdg10021101.me.com [17.58.6.44]) (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 E7F236C60B for ; Wed, 20 Feb 2019 08:10:09 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10021101.me.com (Postfix) with ESMTPSA id AC5E5180150; Wed, 20 Feb 2019 08:10:00 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Toomas Soome In-Reply-To: <20190220075613.GC84455@FreeBSD.org> Date: Wed, 20 Feb 2019 10:09:57 +0200 Cc: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <98312B69-2AC4-461A-8085-D6BAC68D453D@me.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-20_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=426 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902200060 X-Rspamd-Queue-Id: E7F236C60B X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,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, 20 Feb 2019 08:10:10 -0000 > On 20 Feb 2019, at 09:56, Alexey Dokuchaev wrote: >=20 > On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >> At the risk of painting a bikeshed a lovely color of neon purple, I'm >> curious about if/how these types of commits get merged upstream to >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very >> confused|is anyone else confused where upstream is?). >>=20 >> Who is upstream? Is work like this going to remain as a downstream >> patch to ZFS? Or is FreeBSD going to work to upstream this type of >> work? >=20 > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're = talking > about ZFS on fucking Linux becoming our upstream. Something'd got = very > wrong here and I'd like to know what and why. >=20 >> I hope my curiousity doesn't offend anyone. ;) >=20 > Not at all, I'm also confused and curious. >=20 > ./danfe >=20 The genuine lack of developers and development. If the updates do happen = in ZoL (for zfs), it only means the developers find it easier to work = there. rgds, toomas= From owner-svn-src-all@freebsd.org Wed Feb 20 09:38: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 9A94C14EC9C8; Wed, 20 Feb 2019 09:38: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 432046F107; Wed, 20 Feb 2019 09:38:20 +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 1D50C383C; Wed, 20 Feb 2019 09:38:20 +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 x1K9cKet094575; Wed, 20 Feb 2019 09:38:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9cJu2094571; Wed, 20 Feb 2019 09:38:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200938.x1K9cJu2094571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344351 - in head/sys: conf kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf kern sys X-SVN-Commit-Revision: 344351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 432046F107 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)[-0.999,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, 20 Feb 2019 09:38:20 -0000 Author: kib Date: Wed Feb 20 09:38:19 2019 New Revision: 344351 URL: https://svnweb.freebsd.org/changeset/base/344351 Log: Implement rangesets. The data structure implements non-intersecting intervals over the [0, UINT64_MAX] range, and supports fast insert, predicated clearing of subrange, and lookup of an interval containing the specified address. Internally it is a pctrie over the interval start addresses. Implementation provides additional guarantees over the structure state in case of memory allocation failures. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Added: head/sys/kern/subr_rangeset.c (contents, props changed) head/sys/sys/_rangeset.h (contents, props changed) head/sys/sys/rangeset.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 20 09:33:55 2019 (r344350) +++ head/sys/conf/files Wed Feb 20 09:38:19 2019 (r344351) @@ -3861,6 +3861,7 @@ kern/subr_pidctrl.c standard kern/subr_power.c standard kern/subr_prf.c standard kern/subr_prof.c standard +kern/subr_rangeset.c standard kern/subr_rman.c standard kern/subr_rtc.c standard kern/subr_sbuf.c standard Added: head/sys/kern/subr_rangeset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_rangeset.c Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,365 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * 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 + * 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 + +#ifdef DIAGNOSTIC +static void rangeset_check(struct rangeset *rs); +#else +#define rangeset_check(rs) +#endif + +static uma_zone_t rs_node_zone; + +static void +rs_rangeset_init(void *arg __unused) +{ + + rs_node_zone = uma_zcreate("rangeset pctrie nodes", + pctrie_node_size(), NULL, NULL, pctrie_zone_init, NULL, + UMA_ALIGN_PTR, 0); +} +SYSINIT(rs, SI_SUB_LOCK, SI_ORDER_ANY, rs_rangeset_init, NULL); + +static void * +rs_node_alloc(struct pctrie *ptree) +{ + struct rangeset *rs; + + rs = __containerof(ptree, struct rangeset, rs_trie); + return (uma_zalloc(rs_node_zone, rs->rs_alloc_flags)); +} + +static void +rs_node_free(struct pctrie *ptree __unused, void *node) +{ + + uma_zfree(rs_node_zone, node); +} + +void +rangeset_init(struct rangeset *rs, rs_dup_data_t dup_data, + rs_free_data_t free_data, void *data_ctx, u_int alloc_flags) +{ + + pctrie_init(&rs->rs_trie); + rs->rs_dup_data = dup_data; + rs->rs_free_data = free_data; + rs->rs_data_ctx = data_ctx; + rs->rs_alloc_flags = alloc_flags; +} + +void +rangeset_fini(struct rangeset *rs) +{ + + rangeset_check(rs); + rangeset_remove_all(rs); +} + +bool +rangeset_check_empty(struct rangeset *rs, uint64_t start, uint64_t end) +{ + struct rs_el *r; + uint64_t *r1; + + rangeset_check(rs); + r1 = pctrie_lookup_le(&rs->rs_trie, end); + if (r1 != NULL) { + r = __containerof(r1, struct rs_el, re_start); + if (r->re_end > start) + return (false); + } + return (true); +} + +int +rangeset_insert(struct rangeset *rs, uint64_t start, uint64_t end, + void *data) +{ + struct rs_el *r; + int error; + + rangeset_check(rs); + error = rangeset_remove(rs, start, end); + if (error != 0) + return (error); + r = data; + r->re_start = start; + r->re_end = end; + error = pctrie_insert(&rs->rs_trie, &r->re_start, rs_node_alloc); + rangeset_check(rs); + return (error); +} + +int +rangeset_remove_pred(struct rangeset *rs, uint64_t start, uint64_t end, + rs_pred_t pred) +{ + struct rs_el *r, *rn; + uint64_t *r1; + int error; + + rangeset_check(rs); + error = 0; + for (; end > 0 && start < end;) { + r1 = pctrie_lookup_le(&rs->rs_trie, end - 1); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + + /* + * ------============================--|-------|---- + * rs re s e + */ + if (r->re_end <= start) + break; + + if (r->re_end <= end) { + if (r->re_start < start) { + /* + * ------========|==============-------|---- + * rs s re e + */ + if (pred(rs->rs_data_ctx, r)) + r->re_end = start; + break; + } + + /* + * ------|--------===================----------|---- + * s rs re e + */ + end = r->re_start; + if (pred(rs->rs_data_ctx, r)) { + pctrie_remove(&rs->rs_trie, r->re_start, + rs_node_free); + rs->rs_free_data(rs->rs_data_ctx, r); + } + continue; + } + + /* + * ------|--------====================|==========---- + * s rs e re + */ + if (r->re_start >= start) { + if (pred(rs->rs_data_ctx, r)) { + pctrie_remove(&rs->rs_trie, r->re_start, + rs_node_free); + r->re_start = end; + error = pctrie_insert(&rs->rs_trie, + &r->re_start, rs_node_alloc); + /* + * The insert above must succeed + * because rs_node zone is marked + * nofree and we freed one element + * just before. + */ + MPASS(error == 0); + } else { + end = r->re_start; + } + continue; + } + + /* + * ------=========|===================|==========---- + * rs s e re + */ + if (pred(rs->rs_data_ctx, r)) { + /* + * Split. Can only happen once, and then if + * any allocation fails, the rangeset is kept + * intact. + */ + rn = rs->rs_dup_data(rs->rs_data_ctx, r); + if (rn == NULL) { + error = ENOMEM; + break; + } + rn->re_start = end; + rn->re_end = r->re_end; + error = pctrie_insert(&rs->rs_trie, &rn->re_start, + rs_node_alloc); + if (error != 0) { + rs->rs_free_data(rs->rs_data_ctx, rn); + break; + } + r->re_end = start; + } + break; + } + rangeset_check(rs); + return (error); +} + +static bool +rangeset_true_pred(void *ctx __unused, void *r __unused) +{ + + return (true); +} + +int +rangeset_remove(struct rangeset *rs, uint64_t start, uint64_t end) +{ + + return (rangeset_remove_pred(rs, start, end, rangeset_true_pred)); +} + +void +rangeset_remove_all(struct rangeset *rs) +{ + struct rs_el *r; + uint64_t *r1; + + for (;;) { + r1 = pctrie_lookup_ge(&rs->rs_trie, 0); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + pctrie_remove(&rs->rs_trie, r->re_start, rs_node_free); + rs->rs_free_data(rs->rs_data_ctx, r); + } +} + +void * +rangeset_lookup(struct rangeset *rs, uint64_t place) +{ + struct rs_el *r; + uint64_t *r1; + + rangeset_check(rs); + r1 = pctrie_lookup_le(&rs->rs_trie, place); + if (r1 == NULL) + return (NULL); + r = __containerof(r1, struct rs_el, re_start); + if (r->re_end <= place) + return (NULL); + return (r); +} + +int +rangeset_copy(struct rangeset *dst_rs, struct rangeset *src_rs) +{ + struct rs_el *src_r, *dst_r; + uint64_t cursor, *r1; + int error; + + MPASS(pctrie_is_empty(&dst_rs->rs_trie)); + rangeset_check(src_rs); + MPASS(dst_rs->rs_dup_data == src_rs->rs_dup_data); + + error = 0; + for (cursor = 0;; cursor = src_r->re_start + 1) { + r1 = pctrie_lookup_ge(&src_rs->rs_trie, cursor); + if (r1 == NULL) + break; + src_r = __containerof(r1, struct rs_el, re_start); + dst_r = dst_rs->rs_dup_data(dst_rs->rs_data_ctx, src_r); + if (dst_r == NULL) { + error = ENOMEM; + break; + } + error = pctrie_insert(&dst_rs->rs_trie, &dst_r->re_start, + rs_node_alloc); + if (error != 0) + break; + } + if (error != 0) + rangeset_remove_all(dst_rs); + return (error); +} + +#ifdef DIAGNOSTIC +static void +rangeset_check(struct rangeset *rs) +{ + struct rs_el *r, *rp; + uint64_t cursor, *r1; + + for (cursor = 0, rp = NULL;; cursor = r->re_start + 1, rp = r) { + r1 = pctrie_lookup_ge(&rs->rs_trie, cursor); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + KASSERT(r->re_start < r->re_end, + ("invalid interval rs %p elem %p (%#jx, %#jx)", + rs, r, (uintmax_t)r->re_start, (uintmax_t)r->re_end)); + if (rp != NULL) { + KASSERT(rp->re_end <= r->re_start, + ("non-ascending neighbors rs %p " + "prev elem %p (%#jx, %#jx) elem %p (%#jx, %#jx)", + rs, rp, (uintmax_t)rp->re_start, + (uintmax_t)rp->re_end, r, (uintmax_t)r->re_start, + (uintmax_t)r->re_end)); + } + } +} +#endif + +#include "opt_ddb.h" +#ifdef DDB +#include +#include + +DB_SHOW_COMMAND(rangeset, rangeset_show_fn) +{ + struct rangeset *rs; + struct rs_el *r; + uint64_t cursor, *r1; + + if (!have_addr) { + db_printf("show rangeset addr\n"); + return; + } + + rs = (struct rangeset *)addr; + db_printf("rangeset %p\n", rs); + for (cursor = 0;; cursor = r->re_start + 1) { + r1 = pctrie_lookup_ge(&rs->rs_trie, cursor); + if (r1 == NULL) + break; + r = __containerof(r1, struct rs_el, re_start); + db_printf(" el %p start %#jx end %#jx\n", + r, r->re_start, r->re_end); + } +} +#endif Added: head/sys/sys/_rangeset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_rangeset.h Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * 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 + * 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. + * + * $FreeBSD$ + */ + +#ifndef _SYS__RANGESET_H +#define _SYS__RANGESET_H + +#include + +typedef void *(*rs_dup_data_t)(void *ctx, void *data); +typedef void (*rs_free_data_t)(void *ctx, void *data); + +struct rangeset { + struct pctrie rs_trie; + rs_dup_data_t rs_dup_data; + rs_free_data_t rs_free_data; + void *rs_data_ctx; + u_int rs_alloc_flags; +}; + +#endif + Added: head/sys/sys/rangeset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/rangeset.h Wed Feb 20 09:38:19 2019 (r344351) @@ -0,0 +1,88 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * 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 + * 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. + * + * $FreeBSD$ + */ + +#ifndef _SYS_RANGESET_H +#define _SYS_RANGESET_H + +#ifdef _KERNEL + +#include + +typedef bool (*rs_pred_t)(void *ctx, void *r); + +/* + * This structure must be embedded at the start of the rangeset element. + */ +struct rs_el { + uint64_t re_start; /* pctrie key */ + uint64_t re_end; +}; + +void rangeset_init(struct rangeset *rs, rs_dup_data_t dup_data, + rs_free_data_t free_data, void *rs_data_ctx, u_int alloc_flags); +void rangeset_fini(struct rangeset *rs); + +bool rangeset_check_empty(struct rangeset *rs, uint64_t start, + uint64_t end); + +/* + * r point to the app data with struct rs_el at the beginning. + */ +int rangeset_insert(struct rangeset *rs, uint64_t start, uint64_t end, + void *r); + +/* + * Guarantees that on error the rangeset is not modified. Remove + * might need to split element if its start/end completely cover the + * removed range, in which case ENOMEM might be returned. + */ +void rangeset_remove_all(struct rangeset *rs); +int rangeset_remove(struct rangeset *rs, uint64_t start, uint64_t end); +int rangeset_remove_pred(struct rangeset *rs, uint64_t start, + uint64_t end, rs_pred_t pred); + +/* + * Really returns the pointer to the data with struct rs_el embedded + * at the beginning. + */ +void *rangeset_lookup(struct rangeset *rs, uint64_t place); + +/* + * Copies src_rs entries into dst_rs. dst_rs must be empty. + * Leaves dst_rs empty on failure. + */ +int rangeset_copy(struct rangeset *dst_rs, struct rangeset *src_rs); + +#endif + +#endif From owner-svn-src-all@freebsd.org Wed Feb 20 09:46: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 DDC5A14ECE9E; Wed, 20 Feb 2019 09:46: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 7C1666F6F1; Wed, 20 Feb 2019 09:46: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 6C98B3A17; Wed, 20 Feb 2019 09:46: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 x1K9kjA8099741; Wed, 20 Feb 2019 09:46:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9kjNV099740; Wed, 20 Feb 2019 09:46:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200946.x1K9kjNV099740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344352 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 344352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C1666F6F1 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)[-0.999,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, 20 Feb 2019 09:46:46 -0000 Author: kib Date: Wed Feb 20 09:46:44 2019 New Revision: 344352 URL: https://svnweb.freebsd.org/changeset/base/344352 Log: amd64: add defines and decode protection keys and SGX page faults reasons. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Feb 20 09:38:19 2019 (r344351) +++ head/sys/amd64/amd64/trap.c Wed Feb 20 09:46:44 2019 (r344352) @@ -885,10 +885,12 @@ trap_fatal(frame, eva) #endif if (type == T_PAGEFLT) { printf("fault virtual address = 0x%lx\n", eva); - printf("fault code = %s %s %s, %s\n", + printf("fault code = %s %s %s%s%s, %s\n", code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", code & PGEX_I ? "instruction" : "data", + code & PGEX_PK ? " prot key" : " ", + code & PGEX_SGX ? " SGX" : " ", code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); } Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Feb 20 09:38:19 2019 (r344351) +++ head/sys/amd64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) @@ -131,6 +131,8 @@ #define PGEX_U 0x04 /* access from User mode (UPL) */ #define PGEX_RSV 0x08 /* reserved PTE field is non-zero */ #define PGEX_I 0x10 /* during an instruction fetch */ +#define PGEX_PK 0x20 /* protection key violation */ +#define PGEX_SGX 0x40 /* SGX-related */ /* * undef the PG_xx macros that define bits in the regular x86 PTEs that From owner-svn-src-all@freebsd.org Wed Feb 20 09:51: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 C9C7414ED007; Wed, 20 Feb 2019 09:51:16 +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 78FF76FA66; Wed, 20 Feb 2019 09:51:16 +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 6C4E83ABA; Wed, 20 Feb 2019 09:51:16 +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 x1K9pGFq001761; Wed, 20 Feb 2019 09:51:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9pDQs001745; Wed, 20 Feb 2019 09:51:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200951.x1K9pDQs001745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include X-SVN-Commit-Revision: 344353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78FF76FA66 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: Wed, 20 Feb 2019 09:51:17 -0000 Author: kib Date: Wed Feb 20 09:51:13 2019 New Revision: 344353 URL: https://svnweb.freebsd.org/changeset/base/344353 Log: Add kernel support for Intel userspace protection keys feature on Skylake Xeons. See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/pmap.h head/sys/arm/include/pmap.h head/sys/arm64/include/pmap.h head/sys/i386/include/pmap.h head/sys/mips/include/pmap.h head/sys/powerpc/include/pmap.h head/sys/riscv/include/pmap.h head/sys/sparc64/include/pmap.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/x86/include/sysarch.h Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/initcpu.c Wed Feb 20 09:51:13 2019 (r344353) @@ -233,6 +233,9 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) cr4 |= CR4_FSGSBASE; + if (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) + cr4 |= CR4_PKE; + /* * Postpone enabling the SMEP on the boot CPU until the page * tables are switched from the boot loader identity mapping Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/pmap.c Wed Feb 20 09:51:13 2019 (r344353) @@ -48,7 +48,7 @@ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. - * Copyright (c) 2014-2018 The FreeBSD Foundation + * Copyright (c) 2014-2019 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Jake Burkholder, @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -155,6 +156,7 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#include #include static __inline boolean_t @@ -285,6 +287,13 @@ pmap_modified_bit(pmap_t pmap) return (mask); } +static __inline pt_entry_t +pmap_pku_mask_bit(pmap_t pmap) +{ + + return (pmap->pm_type == PT_X86 ? X86_PG_PKU_MASK : 0); +} + #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -424,6 +433,22 @@ static pml4_entry_t *pti_pml4; static vm_pindex_t pti_pg_idx; static bool pti_finalized; +struct pmap_pkru_range { + struct rs_el pkru_rs_el; + u_int pkru_keyidx; + int pkru_flags; +}; + +static uma_zone_t pmap_pkru_ranges_zone; +static bool pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static pt_entry_t pmap_pkru_get(pmap_t pmap, vm_offset_t va); +static void pmap_pkru_on_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static void *pkru_dup_range(void *ctx, void *data); +static void pkru_free_range(void *ctx, void *node); +static int pmap_pkru_copy(pmap_t dst_pmap, pmap_t src_pmap); +static int pmap_pkru_deassign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static void pmap_pkru_deassign_all(pmap_t pmap); + static int pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) { @@ -2846,6 +2871,12 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pcids[i].pm_gen = 1; } pmap_activate_boot(pmap); + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + pmap_pkru_ranges_zone = uma_zcreate("pkru ranges", + sizeof(struct pmap_pkru_range), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + } } void @@ -2934,6 +2965,10 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i pmap_pinit_pml4_pti(pml4pgu); pmap->pm_ucr3 = VM_PAGE_TO_PHYS(pml4pgu); } + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + rangeset_init(&pmap->pm_pkru, pkru_dup_range, + pkru_free_range, pmap, M_NOWAIT); + } } pmap->pm_root.rt_root = 0; @@ -3230,6 +3265,9 @@ pmap_release(pmap_t pmap) vm_page_unwire_noq(m); vm_page_free(m); } + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) + rangeset_fini(&pmap->pm_pkru); } static int @@ -4060,7 +4098,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v { pd_entry_t newpde, oldpde; pt_entry_t *firstpte, newpte; - pt_entry_t PG_A, PG_G, PG_M, PG_RW, PG_V; + pt_entry_t PG_A, PG_G, PG_M, PG_PKU_MASK, PG_RW, PG_V; vm_paddr_t mptepa; vm_page_t mpte; struct spglist free; @@ -4073,6 +4111,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_PTE_CACHE = pmap_cache_mask(pmap, 0); + PG_PKU_MASK = pmap_pku_mask_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); oldpde = *pde; @@ -4505,6 +4544,7 @@ 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_finished(); vm_page_free_pages_toq(&free, true); @@ -4816,7 +4856,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offs { pd_entry_t newpde; pt_entry_t *firstpte, oldpte, pa, *pte; - pt_entry_t PG_G, PG_A, PG_M, PG_RW, PG_V; + pt_entry_t PG_G, PG_A, PG_M, PG_RW, PG_V, PG_PKU_MASK; vm_page_t mpte; int PG_PTE_CACHE; @@ -4825,6 +4865,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offs PG_M = pmap_modified_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); + PG_PKU_MASK = pmap_pku_mask_bit(pmap); PG_PTE_CACHE = pmap_cache_mask(pmap, 0); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -5052,6 +5093,8 @@ retry: origpte = *pte; pv = NULL; + if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) + newpte |= pmap_pkru_get(pmap, va); /* * Is the specified virtual address already mapped? @@ -5271,6 +5314,25 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t " in pmap %p", va, pmap); return (KERN_RESOURCE_SHORTAGE); } + + /* + * If pkru is not same for the whole pde range, return failure + * and let vm_fault() cope. Check after pde allocation, since + * it could sleep. + */ + if (!pmap_pkru_same(pmap, va, va + NBPDR)) { + SLIST_INIT(&free); + if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { + pmap_invalidate_page(pmap, va); + vm_page_free_pages_toq(&free, true); + } + return (KERN_FAILURE); + } + if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { + newpde &= ~X86_PG_PKU_MASK; + newpde |= pmap_pkru_get(pmap, va); + } + pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); pde = &pde[pmap_pde_index(va)]; oldpde = *pde; @@ -5530,7 +5592,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; if (va < VM_MAXUSER_ADDRESS) - newpte |= PG_U; + newpte |= PG_U | pmap_pkru_get(pmap, va); pte_store(pte, newpte); return (mpte); } @@ -5906,6 +5968,36 @@ out: PMAP_UNLOCK(dst_pmap); } +int +pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap) +{ + int error; + + if (dst_pmap->pm_type != src_pmap->pm_type || + dst_pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0) + return (0); + for (;;) { + if (dst_pmap < src_pmap) { + PMAP_LOCK(dst_pmap); + PMAP_LOCK(src_pmap); + } else { + PMAP_LOCK(src_pmap); + PMAP_LOCK(dst_pmap); + } + error = pmap_pkru_copy(dst_pmap, src_pmap); + /* Clean up partial copy on failure due to no memory. */ + if (error == ENOMEM) + pmap_pkru_deassign_all(dst_pmap); + PMAP_UNLOCK(src_pmap); + PMAP_UNLOCK(dst_pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); +} + /* * Zero the specified hardware page. */ @@ -6305,6 +6397,7 @@ pmap_remove_pages(pmap_t pmap) if (lock != NULL) rw_wunlock(lock); pmap_invalidate_all(pmap); + pmap_pkru_deassign_all(pmap); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, true); } @@ -8939,6 +9032,285 @@ pmap_pti_remove_kva(vm_offset_t sva, vm_offset_t eva) } pmap_invalidate_range(kernel_pmap, sva, eva); VM_OBJECT_WUNLOCK(pti_obj); +} + +static void * +pkru_dup_range(void *ctx __unused, void *data) +{ + struct pmap_pkru_range *node, *new_node; + + new_node = uma_zalloc(pmap_pkru_ranges_zone, M_NOWAIT); + if (new_node == NULL) + return (NULL); + node = data; + memcpy(new_node, node, sizeof(*node)); + return (new_node); +} + +static void +pkru_free_range(void *ctx __unused, void *node) +{ + + uma_zfree(pmap_pkru_ranges_zone, node); +} + +static int +pmap_pkru_assign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, + int flags) +{ + struct pmap_pkru_range *ppr; + int error; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + if ((flags & AMD64_PKRU_EXCL) != 0 && + !rangeset_check_empty(&pmap->pm_pkru, sva, eva)) + return (EBUSY); + ppr = uma_zalloc(pmap_pkru_ranges_zone, M_NOWAIT); + if (ppr == NULL) + return (ENOMEM); + ppr->pkru_keyidx = keyidx; + ppr->pkru_flags = flags & AMD64_PKRU_PERSIST; + error = rangeset_insert(&pmap->pm_pkru, sva, eva, ppr); + if (error != 0) + uma_zfree(pmap_pkru_ranges_zone, ppr); + return (error); +} + +static int +pmap_pkru_deassign(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + return (rangeset_remove(&pmap->pm_pkru, sva, eva)); +} + +static void +pmap_pkru_deassign_all(pmap_t pmap) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) + rangeset_remove_all(&pmap->pm_pkru); +} + +static bool +pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + struct pmap_pkru_range *ppr, *prev_ppr; + vm_offset_t va; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0 || + sva >= VM_MAXUSER_ADDRESS) + return (true); + MPASS(eva <= VM_MAXUSER_ADDRESS); + for (va = sva, prev_ppr = NULL; va < eva;) { + ppr = rangeset_lookup(&pmap->pm_pkru, va); + if ((ppr == NULL) ^ (prev_ppr == NULL)) + return (false); + if (ppr == NULL) { + va += PAGE_SIZE; + continue; + } + if (prev_ppr->pkru_keyidx != ppr->pkru_keyidx) + return (false); + va = ppr->pkru_rs_el.re_end; + } + return (true); +} + +static pt_entry_t +pmap_pkru_get(pmap_t pmap, vm_offset_t va) +{ + struct pmap_pkru_range *ppr; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type != PT_X86 || + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0 || + va >= VM_MAXUSER_ADDRESS) + return (0); + ppr = rangeset_lookup(&pmap->pm_pkru, va); + if (ppr != NULL) + return (X86_PG_PKU(ppr->pkru_keyidx)); + return (0); +} + +static bool +pred_pkru_on_remove(void *ctx __unused, void *r) +{ + struct pmap_pkru_range *ppr; + + ppr = r; + return ((ppr->pkru_flags & AMD64_PKRU_PERSIST) == 0); +} + +static void +pmap_pkru_on_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + if (pmap->pm_type == PT_X86 && + (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { + rangeset_remove_pred(&pmap->pm_pkru, sva, eva, + pred_pkru_on_remove); + } +} + +static int +pmap_pkru_copy(pmap_t dst_pmap, pmap_t src_pmap) +{ + + PMAP_LOCK_ASSERT(dst_pmap, MA_OWNED); + PMAP_LOCK_ASSERT(src_pmap, MA_OWNED); + MPASS(dst_pmap->pm_type == PT_X86); + MPASS(src_pmap->pm_type == PT_X86); + MPASS((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0); + if (src_pmap->pm_pkru.rs_data_ctx == NULL) + return (0); + return (rangeset_copy(&dst_pmap->pm_pkru, &src_pmap->pm_pkru)); +} + +static void +pmap_pkru_update_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx) +{ + pml4_entry_t *pml4e; + pdp_entry_t *pdpe; + pd_entry_t newpde, ptpaddr, *pde; + pt_entry_t newpte, *ptep, pte; + vm_offset_t va, va_next; + bool changed; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + MPASS(pmap->pm_type == PT_X86); + MPASS(keyidx <= PMAP_MAX_PKRU_IDX); + + for (changed = false, va = sva; va < eva; va = va_next) { + pml4e = pmap_pml4e(pmap, va); + if ((*pml4e & X86_PG_V) == 0) { + va_next = (va + NBPML4) & ~PML4MASK; + if (va_next < va) + va_next = eva; + continue; + } + + pdpe = pmap_pml4e_to_pdpe(pml4e, va); + if ((*pdpe & X86_PG_V) == 0) { + va_next = (va + NBPDP) & ~PDPMASK; + if (va_next < va) + va_next = eva; + continue; + } + + va_next = (va + NBPDR) & ~PDRMASK; + if (va_next < va) + va_next = eva; + + pde = pmap_pdpe_to_pde(pdpe, va); + ptpaddr = *pde; + if (ptpaddr == 0) + continue; + + MPASS((ptpaddr & X86_PG_V) != 0); + if ((ptpaddr & PG_PS) != 0) { + if (va + NBPDR == va_next && eva >= va_next) { + newpde = (ptpaddr & ~X86_PG_PKU_MASK) | + X86_PG_PKU(keyidx); + if (newpde != ptpaddr) { + *pde = newpde; + changed = true; + } + continue; + } else if (!pmap_demote_pde(pmap, pde, va)) { + continue; + } + } + + if (va_next > eva) + va_next = eva; + + for (ptep = pmap_pde_to_pte(pde, va); va != va_next; + ptep++, va += PAGE_SIZE) { + pte = *ptep; + if ((pte & X86_PG_V) == 0) + continue; + newpte = (pte & ~X86_PG_PKU_MASK) | X86_PG_PKU(keyidx); + if (newpte != pte) { + *ptep = newpte; + changed = true; + } + } + } + if (changed) + pmap_invalidate_range(pmap, sva, eva); +} + +static int +pmap_pkru_check_uargs(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx, int flags) +{ + + if (pmap->pm_type != PT_X86 || keyidx > PMAP_MAX_PKRU_IDX || + (flags & ~(AMD64_PKRU_PERSIST | AMD64_PKRU_EXCL)) != 0) + return (EINVAL); + if (eva <= sva || eva > VM_MAXUSER_ADDRESS) + return (EFAULT); + if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0) + return (ENOTSUP); + return (0); +} + +int +pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, + int flags) +{ + int error; + + sva = trunc_page(sva); + eva = round_page(eva); + error = pmap_pkru_check_uargs(pmap, sva, eva, keyidx, flags); + if (error != 0) + return (error); + for (;;) { + PMAP_LOCK(pmap); + error = pmap_pkru_assign(pmap, sva, eva, keyidx, flags); + if (error == 0) + pmap_pkru_update_range(pmap, sva, eva, keyidx); + PMAP_UNLOCK(pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); +} + +int +pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + int error; + + sva = trunc_page(sva); + eva = round_page(eva); + error = pmap_pkru_check_uargs(pmap, sva, eva, 0, 0); + if (error != 0) + return (error); + for (;;) { + PMAP_LOCK(pmap); + error = pmap_pkru_deassign(pmap, sva, eva); + if (error == 0) + pmap_pkru_update_range(pmap, sva, eva, 0); + PMAP_UNLOCK(pmap); + if (error != ENOMEM) + break; + vm_wait(NULL); + } + return (error); } #include "opt_ddb.h" Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/sys_machdep.c Wed Feb 20 09:51:13 2019 (r344353) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* for kernel_map */ +#include #include #include @@ -170,13 +172,16 @@ update_gdt_fsbase(struct thread *td, uint32_t base) int sysarch(struct thread *td, struct sysarch_args *uap) { - int error = 0; - struct pcb *pcb = curthread->td_pcb; + struct pcb *pcb; + struct vm_map *map; uint32_t i386base; uint64_t a64base; struct i386_ioperm_args iargs; struct i386_get_xfpustate i386xfpu; + struct i386_set_pkru i386pkru; struct amd64_get_xfpustate a64xfpu; + struct amd64_set_pkru a64pkru; + int error; #ifdef CAPABILITY_MODE /* @@ -194,11 +199,15 @@ sysarch(struct thread *td, struct sysarch_args *uap) case I386_GET_GSBASE: case I386_SET_GSBASE: case I386_GET_XFPUSTATE: + case I386_SET_PKRU: + case I386_CLEAR_PKRU: case AMD64_GET_FSBASE: case AMD64_SET_FSBASE: case AMD64_GET_GSBASE: case AMD64_SET_GSBASE: case AMD64_GET_XFPUSTATE: + case AMD64_SET_PKRU: + case AMD64_CLEAR_PKRU: break; case I386_SET_IOPERM: @@ -214,6 +223,10 @@ sysarch(struct thread *td, struct sysarch_args *uap) if (uap->op == I386_GET_LDT || uap->op == I386_SET_LDT) return (sysarch_ldt(td, uap, UIO_USERSPACE)); + + error = 0; + pcb = td->td_pcb; + /* * XXXKIB check that the BSM generation code knows to encode * the op argument. @@ -233,11 +246,27 @@ sysarch(struct thread *td, struct sysarch_args *uap) a64xfpu.addr = (void *)(uintptr_t)i386xfpu.addr; a64xfpu.len = i386xfpu.len; break; + case I386_SET_PKRU: + case I386_CLEAR_PKRU: + if ((error = copyin(uap->parms, &i386pkru, + sizeof(struct i386_set_pkru))) != 0) + return (error); + a64pkru.addr = (void *)(uintptr_t)i386pkru.addr; + a64pkru.len = i386pkru.len; + a64pkru.keyidx = i386pkru.keyidx; + a64pkru.flags = i386pkru.flags; + break; case AMD64_GET_XFPUSTATE: if ((error = copyin(uap->parms, &a64xfpu, sizeof(struct amd64_get_xfpustate))) != 0) return (error); break; + case AMD64_SET_PKRU: + case AMD64_CLEAR_PKRU: + if ((error = copyin(uap->parms, &a64pkru, + sizeof(struct amd64_set_pkru))) != 0) + return (error); + break; default: break; } @@ -324,6 +353,34 @@ sysarch(struct thread *td, struct sysarch_args *uap) fpugetregs(td); error = copyout((char *)(get_pcb_user_save_td(td) + 1), a64xfpu.addr, a64xfpu.len); + break; + + case I386_SET_PKRU: + case AMD64_SET_PKRU: + /* + * Read-lock the map to synchronize with parallel + * pmap_vmspace_copy() on fork. + */ + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock_read(map); + error = pmap_pkru_set(PCPU_GET(curpmap), + (vm_offset_t)a64pkru.addr, (vm_offset_t)a64pkru.addr + + a64pkru.len, a64pkru.keyidx, a64pkru.flags); + vm_map_unlock_read(map); + break; + + case I386_CLEAR_PKRU: + case AMD64_CLEAR_PKRU: + if (a64pkru.flags != 0 || a64pkru.keyidx != 0) { + error = EINVAL; + break; + } + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock_read(map); + error = pmap_pkru_clear(PCPU_GET(curpmap), + (vm_offset_t)a64pkru.addr, + (vm_offset_t)a64pkru.addr + a64pkru.len); + vm_map_unlock(map); break; default: Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/amd64/trap.c Wed Feb 20 09:51:13 2019 (r344353) @@ -808,6 +808,20 @@ trap_pfault(struct trapframe *frame, int usermode) } /* + * User-mode protection key violation (PKU). May happen + * either from usermode or from kernel if copyin accessed + * key-protected mapping. + */ + if ((frame->tf_err & PGEX_PK) != 0) { + if (eva > VM_MAXUSER_ADDRESS) { + trap_fatal(frame, eva); + return (-1); + } + rv = KERN_PROTECTION_FAILURE; + goto after_vmfault; + } + + /* * If nx protection of the usermode portion of kernel page * tables caused trap, panic. */ @@ -842,6 +856,7 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } +after_vmfault: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) { Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/amd64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -66,6 +66,7 @@ #define X86_PG_AVAIL2 0x400 /* < programmers use */ #define X86_PG_AVAIL3 0x800 /* \ */ #define X86_PG_PDE_PAT 0x1000 /* PAT PAT index */ +#define X86_PG_PKU(idx) ((pt_entry_t)idx << 59) #define X86_PG_NX (1ul<<63) /* No-execute */ #define X86_PG_AVAIL(x) (1ul << (x)) @@ -73,6 +74,10 @@ #define X86_PG_PDE_CACHE (X86_PG_PDE_PAT | X86_PG_NC_PWT | X86_PG_NC_PCD) #define X86_PG_PTE_CACHE (X86_PG_PTE_PAT | X86_PG_NC_PWT | X86_PG_NC_PCD) +/* Protection keys indexes */ +#define PMAP_MAX_PKRU_IDX 0xf +#define X86_PG_PKU_MASK X86_PG_PKU(PMAP_MAX_PKRU_IDX) + /* * Intel extended page table (EPT) bit definitions. */ @@ -120,7 +125,7 @@ * (PTE) page mappings have identical settings for the following fields: */ #define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_CACHE | \ - PG_M | PG_A | PG_U | PG_RW | PG_V) + PG_M | PG_A | PG_U | PG_RW | PG_V | PG_PKU_MASK) /* * Page Protection Exception bits @@ -242,6 +247,8 @@ #include #include #include +#include +#include #include @@ -336,6 +343,7 @@ struct pmap { long pm_eptgen; /* EPT pmap generation id */ int pm_flags; struct pmap_pcids pm_pcids[MAXCPU]; + struct rangeset pm_pkru; }; /* flags */ @@ -454,6 +462,10 @@ void pmap_pti_pcid_invalidate(uint64_t ucr3, uint64_t void pmap_pti_pcid_invlpg(uint64_t ucr3, uint64_t kcr3, vm_offset_t va); void pmap_pti_pcid_invlrng(uint64_t ucr3, uint64_t kcr3, vm_offset_t sva, vm_offset_t eva); +int pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + u_int keyidx, int flags); +int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); #endif /* _KERNEL */ /* Return various clipped indexes for a given VA */ Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/arm/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -71,5 +71,12 @@ void pmap_kremove_device(vm_offset_t, vm_size_t); vm_paddr_t pmap_kextract(vm_offset_t); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/arm64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -171,6 +171,13 @@ struct pcb *pmap_switch(struct thread *, struct thread #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/i386/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -244,6 +244,13 @@ extern vm_offset_t virtual_end; #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + struct sf_buf; /* Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/mips/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -185,6 +185,13 @@ int pmap_emulate_modified(pmap_t pmap, vm_offset_t va) void pmap_page_set_memattr(vm_page_t, vm_memattr_t); int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/powerpc/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -288,6 +288,13 @@ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/riscv/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -166,6 +166,13 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/sparc64/include/pmap.h Wed Feb 20 09:51:13 2019 (r344353) @@ -128,4 +128,11 @@ SYSCTL_DECL(_debug_pmap_stats); #endif +static inline int +pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) +{ + + return (0); +} + #endif /* !_MACHINE_PMAP_H_ */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/vm/vm_fault.c Wed Feb 20 09:51:13 2019 (r344353) @@ -481,8 +481,20 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro fault_flags, true); } VM_OBJECT_WUNLOCK(fs->first_object); - pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | (wired ? - PMAP_ENTER_WIRED : 0), psind); + rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | + (wired ? PMAP_ENTER_WIRED : 0), psind); +#if defined(__amd64__) + if (psind > 0 && rv == KERN_FAILURE) { + for (i = 0; i < npages; i++) { + rv = pmap_enter(fs->map->pmap, vaddr + ptoa(i), + &m[i], prot, fault_type | + (wired ? PMAP_ENTER_WIRED : 0), 0); + MPASS(rv == KERN_SUCCESS); + } + } +#else + MPASS(rv == KERN_SUCCESS); +#endif VM_OBJECT_WLOCK(fs->first_object); m_mtx = NULL; for (i = 0; i < npages; i++) { Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/vm/vm_map.c Wed Feb 20 09:51:13 2019 (r344353) @@ -3544,7 +3544,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c vm_map_t new_map, old_map; vm_map_entry_t new_entry, old_entry; vm_object_t object; - int locked; + int error, locked; vm_inherit_t inh; old_map = &vm1->vm_map; @@ -3553,6 +3553,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c pmap_pinit); if (vm2 == NULL) return (NULL); + vm2->vm_taddr = vm1->vm_taddr; vm2->vm_daddr = vm1->vm_daddr; vm2->vm_maxsaddr = vm1->vm_maxsaddr; @@ -3563,7 +3564,17 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c locked = vm_map_trylock(new_map); /* trylock to silence WITNESS */ KASSERT(locked, ("vmspace_fork: lock failed")); + error = pmap_vmspace_copy(new_map->pmap, old_map->pmap); + if (error != 0) { + sx_xunlock(&old_map->lock); + sx_xunlock(&new_map->lock); + vm_map_process_deferred(); + vmspace_free(vm2); + return (NULL); + } + new_map->anon_loc = old_map->anon_loc; + old_entry = old_map->header.next; while (old_entry != &old_map->header) { Modified: head/sys/x86/include/sysarch.h ============================================================================== --- head/sys/x86/include/sysarch.h Wed Feb 20 09:46:44 2019 (r344352) +++ head/sys/x86/include/sysarch.h Wed Feb 20 09:51:13 2019 (r344353) @@ -52,6 +52,8 @@ #define I386_GET_GSBASE 9 #define I386_SET_GSBASE 10 #define I386_GET_XFPUSTATE 11 +#define I386_SET_PKRU 12 +#define I386_CLEAR_PKRU 13 /* Leave space for 0-127 for to avoid translating syscalls */ #define AMD64_GET_FSBASE 128 @@ -59,7 +61,13 @@ #define AMD64_GET_GSBASE 130 #define AMD64_SET_GSBASE 131 #define AMD64_GET_XFPUSTATE 132 +#define AMD64_SET_PKRU 133 +#define AMD64_CLEAR_PKRU 134 +/* Flags for AMD64_SET_PKRU */ +#define AMD64_PKRU_EXCL 0x0001 +#define AMD64_PKRU_PERSIST 0x0002 + struct i386_ioperm_args { unsigned int start; unsigned int length; @@ -94,11 +102,25 @@ struct i386_get_xfpustate { int len; }; +struct i386_set_pkru { + unsigned int addr; + unsigned int len; + unsigned int keyidx; + int flags; +}; + struct amd64_get_xfpustate { void *addr; int len; }; #endif + +struct amd64_set_pkru { + void *addr; + unsigned long len; + unsigned int keyidx; + int flags; +}; #ifndef _KERNEL union descriptor; From owner-svn-src-all@freebsd.org Wed Feb 20 09:56: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 7510E14ED343; Wed, 20 Feb 2019 09:56:25 +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 10C246FD43; Wed, 20 Feb 2019 09:56:25 +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 0529E3C57; Wed, 20 Feb 2019 09:56:25 +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 x1K9uOQD005113; Wed, 20 Feb 2019 09:56:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1K9uNv1005105; Wed, 20 Feb 2019 09:56:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902200956.x1K9uNv1005105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 09:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344354 - in head: lib/libc/amd64 lib/libc/i386 lib/libc/x86/sys sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/amd64 lib/libc/i386 lib/libc/x86/sys sys/x86/include X-SVN-Commit-Revision: 344354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10C246FD43 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)[-0.999,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, 20 Feb 2019 09:56:25 -0000 Author: kib Date: Wed Feb 20 09:56:23 2019 New Revision: 344354 URL: https://svnweb.freebsd.org/changeset/base/344354 Log: Add usermode helpers for for Intel userspace protection keys feature. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Added: head/lib/libc/x86/sys/pkru.c (contents, props changed) Modified: head/lib/libc/amd64/Symbol.map head/lib/libc/i386/Symbol.map head/lib/libc/x86/sys/Makefile.inc head/sys/x86/include/sysarch.h Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/amd64/Symbol.map Wed Feb 20 09:56:23 2019 (r344354) @@ -44,6 +44,13 @@ FBSD_1.0 { vfork; }; +FBSD_1.6 { + x86_pkru_get_perm; + x86_pkru_set_perm; + x86_pkru_protect_range; + x86_pkru_unprotect_range; +}; + /* * * FreeBSD private ABI Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/i386/Symbol.map Wed Feb 20 09:56:23 2019 (r344354) @@ -46,6 +46,13 @@ FBSD_1.0 { ___tls_get_addr; }; +FBSD_1.6 { + x86_pkru_get_perm; + x86_pkru_set_perm; + x86_pkru_protect_range; + x86_pkru_unprotect_range; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ _getlogin; Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:51:13 2019 (r344353) +++ head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:56:23 2019 (r344354) @@ -3,7 +3,8 @@ .PATH: ${LIBC_SRCTOP}/x86/sys SRCS+= \ - __vdso_gettc.c + __vdso_gettc.c \ + pkru.c .if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV Added: head/lib/libc/x86/sys/pkru.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/pkru.c Wed Feb 20 09:56:23 2019 (r344354) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * 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 + * 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 + +#define MAX_PKRU_IDX 0xf +#ifdef __i386__ +#define X86_SET_PKRU I386_SET_PKRU +#define X86_CLEAR_PKRU I386_CLEAR_PKRU +#else +#define X86_SET_PKRU AMD64_SET_PKRU +#define X86_CLEAR_PKRU AMD64_CLEAR_PKRU +#endif + +static int +x86_pkru_get_perm_unsup(u_int keyidx, int *access, int *modify) +{ + + errno = EOPNOTSUPP; + return (-1); +} + +static int +x86_pkru_get_perm_hw(u_int keyidx, int *access, int *modify) +{ + uint32_t pkru; + + if (keyidx > MAX_PKRU_IDX) { + errno = EINVAL; + return (-1); + } + keyidx *= 2; + pkru = rdpkru(); + *access = (pkru & (1 << keyidx)) == 0; + *modify = (pkru & (2 << keyidx)) == 0; + return (0); +} + +DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *), static) +{ + + return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? + x86_pkru_get_perm_unsup : x86_pkru_get_perm_hw); +} + +static int +x86_pkru_set_perm_unsup(u_int keyidx, int access, int modify) +{ + + errno = EOPNOTSUPP; + return (-1); +} + +static int +x86_pkru_set_perm_hw(u_int keyidx, int access, int modify) +{ + uint32_t pkru; + + if (keyidx > MAX_PKRU_IDX) { + errno = EINVAL; + return (-1); + } + keyidx *= 2; + pkru = rdpkru(); + pkru &= ~(3 << keyidx); + if (!access) + pkru |= 1 << keyidx; + if (!modify) + pkru |= 2 << keyidx; + wrpkru(pkru); + return (0); +} + +DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int), static) +{ + + return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? + x86_pkru_set_perm_unsup : x86_pkru_set_perm_hw); +} + +int +x86_pkru_protect_range(void *addr, unsigned long len, u_int keyidx, int flags) +{ + struct amd64_set_pkru a64pkru; + + memset(&a64pkru, 0, sizeof(a64pkru)); + a64pkru.addr = addr; + a64pkru.len = len; + a64pkru.keyidx = keyidx; + a64pkru.flags = flags; + return (sysarch(X86_SET_PKRU, &a64pkru)); +} + +int +x86_pkru_unprotect_range(void *addr, unsigned long len) +{ + struct amd64_set_pkru a64pkru; + + memset(&a64pkru, 0, sizeof(a64pkru)); + a64pkru.addr = addr; + a64pkru.len = len; + return (sysarch(X86_CLEAR_PKRU, &a64pkru)); +} Modified: head/sys/x86/include/sysarch.h ============================================================================== --- head/sys/x86/include/sysarch.h Wed Feb 20 09:51:13 2019 (r344353) +++ head/sys/x86/include/sysarch.h Wed Feb 20 09:56:23 2019 (r344354) @@ -142,6 +142,11 @@ int amd64_get_fsbase(void **); int amd64_get_gsbase(void **); int amd64_set_fsbase(void *); int amd64_set_gsbase(void *); +int x86_pkru_get_perm(unsigned int keyidx, int *access, int *modify); +int x86_pkru_set_perm(unsigned int keyidx, int access, int modify); +int x86_pkru_protect_range(void *addr, unsigned long len, unsigned int keyidx, + int flag); +int x86_pkru_unprotect_range(void *addr, unsigned long len); int sysarch(int, void *); __END_DECLS #else From owner-svn-src-all@freebsd.org Wed Feb 20 10:03: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 B985414ED888; Wed, 20 Feb 2019 10:03:04 +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 54F1370397; Wed, 20 Feb 2019 10:03:04 +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 0BB803DFD; Wed, 20 Feb 2019 10:03:04 +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 x1KA33VO010103; Wed, 20 Feb 2019 10:03:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KA33li010101; Wed, 20 Feb 2019 10:03:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902201003.x1KA33li010101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Feb 2019 10:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344355 - head/lib/libc/x86/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/x86/sys X-SVN-Commit-Revision: 344355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54F1370397 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)[-0.999,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, 20 Feb 2019 10:03:05 -0000 Author: kib Date: Wed Feb 20 10:03:03 2019 New Revision: 344355 URL: https://svnweb.freebsd.org/changeset/base/344355 Log: pkru(3) man page. Reviewed by: alc, markj, jilles With more input from: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19211 Added: head/lib/libc/x86/sys/pkru.3 (contents, props changed) Modified: head/lib/libc/x86/sys/Makefile.inc Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 09:56:23 2019 (r344354) +++ head/lib/libc/x86/sys/Makefile.inc Wed Feb 20 10:03:03 2019 (r344355) @@ -6,6 +6,9 @@ SRCS+= \ __vdso_gettc.c \ pkru.c +MAN+= \ + pkru.3 + .if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV .endif Added: head/lib/libc/x86/sys/pkru.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/pkru.3 Wed Feb 20 10:03:03 2019 (r344355) @@ -0,0 +1,206 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov 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 +.\" 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 AUTHORS 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 AUTHORS 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$ +.\" +.Dd February 16, 2019 +.Dt PKRU 3 +.Os +.Sh NAME +.Nm Protection Key Rights for User pages +.Nd provide fast user-managed key-based access control for pages +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In machine/sysarch.h +.Ft int +.Fn x86_pkru_get_perm "unsigned int keyidx" "int *access" "int *modify" +.Ft int +.Fn x86_pkru_set_perm "unsigned int keyidx" "int access" "int modify" +.Ft int +.Fo x86_pkru_protect_range +.Fa "void *addr" +.Fa "unsigned long len" +.Fa "unsigned int keyidx" +.Fa "int flag" +.Fc +.Ft int +.Fn x86_pkru_unprotect_range "void *addr" "unsigned long len" +.Sh DESCRIPTION +The protection keys feature provides an additional mechanism, besides the +normal page permissions as established by +.Xr mmap 2 +and +.Xr mprotect 2 , +to control access to user-mode addresses. +The mechanism gives safety measures which can be used to avoid +incidental read or modification of sensitive memory, +or as a debugging feature. +It cannot guard against conscious accesses since permissions +are user-controllable. +.Pp +If supported by hardware, each mapped user linear address +has an associated 4-bit protection key. +A new per-thread PKRU hardware register determines, for each protection +key, whether user-mode addresses with that protection key may be +read or written. +.Pp +Only one key may apply to a given range at a time. +The default protection key index is zero, it is used even if no key +was explicitly assigned to the address, or if the key was removed. +.Pp +The protection prevents the system from accessing user addresses as well +as the user applications. +When a system call was unable to read or write user memory due to key +protection, it returns the +.Er EFAULT +error code. +Note that some side effects may have occurred if this error is reported. +.Pp +Protection keys require that the system uses 4-level paging +(also called long mode), +which means that it is only available on amd64 system. +Both 64-bit and 32-bit applications can use protection keys. +More information about the hardware feature is provided in the IA32 Software +Developer's Manual published by Intel Corp. +.Pp +The key indexes written into the page table entries are managed by the +.Fn sysarch +syscall. +Per-key permissions are managed using the user-mode instructions +.Em RDPKRU +and +.Em WRPKRU. +The system provides convenient library helpers for both the syscall and +the instructions, described below. +.Pp +The +.Fn x86_pkru_protect_range +function assigns key +.Fa keyidx +to the range starting at +.Fa addr +and having length +.Fa len . +Starting address is truncated to the page start, +and the end is rounded up to the end of the page. +After a successfull call, the range has the specified key assigned, +even if the key is zero and it did not change the page table entries. +.Pp +The +.Fa flags +argument takes the logical OR of the following values: +.Bl -tag -width +.It Bq Va AMD64_PKRU_EXCL +Only assign the key if the range does not have any other keys assigned +(including the zero key). +You must first remove any existing key with +.Fn x86_pkru_unprotect_range +in order for this request to succeed. +If the +.Va AMD64_PKRU_EXCL +flag is not specified, +.Fn x86_pkru_protect_range +replaces any existing key. +.It Bq Va AMD64_PKRU_PERSIST +The keys assigned to the range are persistent. +They are re-established when the current mapping is destroyed +and a new mapping is created in any sub-range of the specified range. +You must use a +.Fn x86_pkru_unprotect_range +call to forget the key. +.El +.Pp +The +.Fn x86_pkru_unprotect_range +function removes any keys assigned to the specified range. +Existing mappings are changed to use key index zero in page table entries. +Keys are no longer considered installed for all mappings in the range, +for the purposes of +.Fn x86_pkru_protect_range +with the +.Va AMD64_PKRU_EXCL +flag. +.Pp +The +.Fn x86_pkru_get_perm +function returns access rights for the key specified by the +.Fn keyidx +argument. +If the value pointed to by +.Fa access +is zero after the call, no read or write permissions is granted for +mappings which are assigned the key +.Fn keyidx . +If +.Fa access +is not zero, read access is permitted. +The non-zero value of the variable pointed to by the +.Fa modify +argument indicates that write access is permitted. +.Pp +Conversely, the +.Fn x86_pkru_set_perm +establishes the access and modify permissions for the given key index +as specified by its arguments. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EOPNOTSUPP +The hardware does not support protection keys. +.It Bq Er EINVAL +The supplied key index is invalid (greater than 15). +.It Bq Er EINVAL +The supplied +.Fa flags +argument for +.Fn x86_pkru_protect_range +has reserved bits set. +.It Bq Er EFAULT +The supplied address range does not completely fit into the user-managed +address range. +.It Bq Er ENOMEM +The memory shortage prevents the completion of the operation. +.It Bq Er EBUSY +The +.Va AMD64_PKRU_EXCL +flag was specified for +.Fn x86_pkru_protect_range +and the range already has defined protection keys. +.El +.Sh SEE ALSO +.Xr mmap 2 , +.Xr mprotect 2 , +.Xr munmap 2 , +.Xr sysarch 2 . +.Sh STANDARDS +The +.Nm +functions are non-standard and first appeared in +.Fx 13.0 . From owner-svn-src-all@freebsd.org Wed Feb 20 10:22: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 6D3BB14EE3F8; Wed, 20 Feb 2019 10:22:49 +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 0FE8271011; Wed, 20 Feb 2019 10:22:49 +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 F1F5941AD; Wed, 20 Feb 2019 10:22:48 +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 x1KAMmOK022597; Wed, 20 Feb 2019 10:22:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KAMmhh022596; Wed, 20 Feb 2019 10:22:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201902201022.x1KAMmhh022596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 20 Feb 2019 10:22:48 +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: r344356 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 344356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FE8271011 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)[-0.999,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, 20 Feb 2019 10:22:49 -0000 Author: ae Date: Wed Feb 20 10:22:48 2019 New Revision: 344356 URL: https://svnweb.freebsd.org/changeset/base/344356 Log: MFC r344103: In r335015 PCB destroing was made deferred using epoch_call(). But ipsec_delete_pcbpolicy() uses some VNET-virtualized variables, and thus it needs VNET context, that is missing during gtaskqueue executing. Use inp_vnet context to set curvnet in in_pcbfree_deferred(). PR: 235684 Modified: stable/12/sys/netinet/in_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Wed Feb 20 10:03:03 2019 (r344355) +++ stable/12/sys/netinet/in_pcb.c Wed Feb 20 10:22:48 2019 (r344356) @@ -1566,6 +1566,7 @@ in_pcbfree_deferred(epoch_context_t ctx) inp = __containerof(ctx, struct inpcb, inp_epoch_ctx); INP_WLOCK(inp); + CURVNET_SET(inp->inp_vnet); #ifdef INET struct ip_moptions *imo = inp->inp_moptions; inp->inp_moptions = NULL; @@ -1598,6 +1599,7 @@ in_pcbfree_deferred(epoch_context_t ctx) #ifdef INET inp_freemoptions(imo); #endif + CURVNET_RESTORE(); } /* From owner-svn-src-all@freebsd.org Wed Feb 20 11:56: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 DE90E14F135F; Wed, 20 Feb 2019 11:56:30 +0000 (UTC) (envelope-from pluknet@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 7411C74285; Wed, 20 Feb 2019 11:56:30 +0000 (UTC) (envelope-from pluknet@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 68930512D; Wed, 20 Feb 2019 11:56:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KBuUAv069163; Wed, 20 Feb 2019 11:56:30 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KBuULe069162; Wed, 20 Feb 2019 11:56:30 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201902201156.x1KBuULe069162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Wed, 20 Feb 2019 11:56: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: r344357 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: pluknet X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 344357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7411C74285 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2019 11:56:31 -0000 Author: pluknet Date: Wed Feb 20 11:56:30 2019 New Revision: 344357 URL: https://svnweb.freebsd.org/changeset/base/344357 Log: MFC r343945: Document the ENOBUFS errno in setsockopt(2). PR: 200649 Modified: stable/12/lib/libc/sys/getsockopt.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/getsockopt.2 ============================================================================== --- stable/12/lib/libc/sys/getsockopt.2 Wed Feb 20 10:22:48 2019 (r344356) +++ stable/12/lib/libc/sys/getsockopt.2 Wed Feb 20 11:56:30 2019 (r344357) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd August 21, 2018 +.Dd February 10, 2019 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -534,7 +534,11 @@ transfer rate to the given unsigned 32-bit value in by .Sh RETURN VALUES .Rv -std .Sh ERRORS -The call succeeds unless: +The +.Fn getsockopt +and +.Fn setsockopt +system calls succeed unless: .Bl -tag -width Er .It Bq Er EBADF The argument @@ -561,6 +565,15 @@ Installing an on a non-listening socket was attempted. .It Bq Er ENOMEM A memory allocation failed that was required to service the request. +.El +.Pp +The +.Fn setsockopt +system call may also return the following error: +.Bl -tag -width Er +.It Bq Er ENOBUFS +Insufficient resources were available in the system +to perform the operation. .El .Sh SEE ALSO .Xr ioctl 2 , From owner-svn-src-all@freebsd.org Wed Feb 20 11:58: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 84F6414F1442; Wed, 20 Feb 2019 11:58:41 +0000 (UTC) (envelope-from pluknet@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 2310374465; Wed, 20 Feb 2019 11:58:41 +0000 (UTC) (envelope-from pluknet@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 1394A5144; Wed, 20 Feb 2019 11:58:41 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KBweMj069321; Wed, 20 Feb 2019 11:58:40 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KBwed7069320; Wed, 20 Feb 2019 11:58:40 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201902201158.x1KBwed7069320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Wed, 20 Feb 2019 11:58:40 +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: r344358 - stable/12/lib/libc/net X-SVN-Group: stable-12 X-SVN-Commit-Author: pluknet X-SVN-Commit-Paths: stable/12/lib/libc/net X-SVN-Commit-Revision: 344358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2310374465 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2019 11:58:41 -0000 Author: pluknet Date: Wed Feb 20 11:58:40 2019 New Revision: 344358 URL: https://svnweb.freebsd.org/changeset/base/344358 Log: MFC r343967: Sync "struct addrinfo" declaration with netdb.h. PR: 225880 Modified: stable/12/lib/libc/net/getaddrinfo.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/net/getaddrinfo.3 ============================================================================== --- stable/12/lib/libc/net/getaddrinfo.3 Wed Feb 20 11:56:30 2019 (r344357) +++ stable/12/lib/libc/net/getaddrinfo.3 Wed Feb 20 11:58:40 2019 (r344358) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2017 +.Dd February 10, 2019 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -78,14 +78,14 @@ as defined by .Aq Pa netdb.h : .Bd -literal struct addrinfo { - int ai_flags; /* input flags */ - int ai_family; /* address family for socket */ - int ai_socktype; /* socket type */ - int ai_protocol; /* protocol for socket */ - socklen_t ai_addrlen; /* length of socket-address */ - struct sockaddr *ai_addr; /* socket-address for socket */ - char *ai_canonname; /* canonical name for service location */ - struct addrinfo *ai_next; /* pointer to next in list */ + int ai_flags; /* AI_PASSIVE, AI_CANONNAME, .. */ + int ai_family; /* AF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + socklen_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ }; .Ed .Pp From owner-svn-src-all@freebsd.org Wed Feb 20 13: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 437CC14F3E2E; Wed, 20 Feb 2019 13:19:09 +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 DB23A77396; Wed, 20 Feb 2019 13:19:08 +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 CF57F5F3B; Wed, 20 Feb 2019 13:19:08 +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 x1KDJ8Td011376; Wed, 20 Feb 2019 13:19:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDJ82E011375; Wed, 20 Feb 2019 13:19:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201319.x1KDJ82E011375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344359 - head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Commit-Revision: 344359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB23A77396 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.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 13:19:09 -0000 Author: avg Date: Wed Feb 20 13:19:08 2019 New Revision: 344359 URL: https://svnweb.freebsd.org/changeset/base/344359 Log: fix userland illumos taskq code to pass relative timeout to cv_timedwait Unlike illumos, FreeBSD cv_timedwait requires a relative timeout. That applies both to the kernel illumos compatibility code and to the userland "fake kernel" code. MFC after: 2 weeks Sponsored by: Panzura Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Feb 20 11:58:40 2019 (r344358) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Wed Feb 20 13:19:08 2019 (r344359) @@ -79,8 +79,13 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nal * immediately retry the allocation. */ tq->tq_maxalloc_wait++; +#ifdef __FreeBSD__ rv = cv_timedwait(&tq->tq_maxalloc_cv, + &tq->tq_lock, hz); +#else + rv = cv_timedwait(&tq->tq_maxalloc_cv, &tq->tq_lock, ddi_get_lbolt() + hz); +#endif tq->tq_maxalloc_wait--; if (rv > 0) goto again; /* signaled */ From owner-svn-src-all@freebsd.org Wed Feb 20 13:34: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 096E014F461F; Wed, 20 Feb 2019 13:34:17 +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 A1BC577F1A; Wed, 20 Feb 2019 13:34:16 +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 9550162AC; Wed, 20 Feb 2019 13:34:16 +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 x1KDYGs0021297; Wed, 20 Feb 2019 13:34:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDYGLU021296; Wed, 20 Feb 2019 13:34:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201334.x1KDYGLU021296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344360 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 344360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1BC577F1A 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,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, 20 Feb 2019 13:34:17 -0000 Author: avg Date: Wed Feb 20 13:34:16 2019 New Revision: 344360 URL: https://svnweb.freebsd.org/changeset/base/344360 Log: zpool.8: document -D flag for zpool status The description is taken from the illumos manual. Reported by: stilezy@gmail.com MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:19:08 2019 (r344359) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:34:16 2019 (r344360) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2018 +.Dd February 20, 2019 .Dt ZPOOL 8 .Os .Sh NAME @@ -187,7 +187,7 @@ .Op Ar device ... .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1862,7 +1862,7 @@ section, above, for more information on the available .It Xo .Nm .Cm status -.Op Fl vx +.Op Fl Dvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -1891,6 +1891,12 @@ done and the estimated time to completion. Both of the because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent +.It Fl D +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. From owner-svn-src-all@freebsd.org Wed Feb 20 13:37: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 2D51F14F46E7; Wed, 20 Feb 2019 13:37:28 +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 C43E4800A3; Wed, 20 Feb 2019 13:37:27 +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 B821A62AE; Wed, 20 Feb 2019 13:37:27 +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 x1KDbRS4021473; Wed, 20 Feb 2019 13:37:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KDbR8T021472; Wed, 20 Feb 2019 13:37:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201902201337.x1KDbR8T021472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Feb 2019 13:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344361 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 344361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C43E4800A3 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 20 Feb 2019 13:37:28 -0000 Author: avg Date: Wed Feb 20 13:37:27 2019 New Revision: 344361 URL: https://svnweb.freebsd.org/changeset/base/344361 Log: zpool.8: sort zpool status flags in the same order as in illumos manual Just in case, while I was here. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:34:16 2019 (r344360) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Feb 20 13:37:27 2019 (r344361) @@ -1897,14 +1897,6 @@ Display a histogram of deduplication statistics, showi and referenced .Pq logically referenced in the pool block counts and sizes by reference count. -.It Fl x -Only display status for pools that are exhibiting errors or are otherwise -unavailable. -Warnings about pools not using the latest on-disk format, having non-native -block size or disabled features will not be included. -.It Fl v -Displays verbose data error information, printing out a complete list of all -data errors since the last complete pool scrub. .It Fl T Cm d Ns | Ns Cm u Print a timestamp. .Pp @@ -1916,6 +1908,14 @@ Use modifier .Cm u for unixtime .Pq equals Qq Ic date +%s . +.It Fl v +Displays verbose data error information, printing out a complete list of all +data errors since the last complete pool scrub. +.It Fl x +Only display status for pools that are exhibiting errors or are otherwise +unavailable. +Warnings about pools not using the latest on-disk format, having non-native +block size or disabled features will not be included. .El .It Xo .Nm From owner-svn-src-all@freebsd.org Wed Feb 20 14:10: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 B42D814F55CC; Wed, 20 Feb 2019 14:10:47 +0000 (UTC) (envelope-from pfg@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 587C582C47; Wed, 20 Feb 2019 14:10:47 +0000 (UTC) (envelope-from pfg@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 4D3AB67D0; Wed, 20 Feb 2019 14:10:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KEAlxO037238; Wed, 20 Feb 2019 14:10:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KEAk1p037237; Wed, 20 Feb 2019 14:10:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201902201410.x1KEAk1p037237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Feb 2019 14:10: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: r344362 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 344362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 587C582C47 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 14:10:47 -0000 Author: pfg Date: Wed Feb 20 14:10:46 2019 New Revision: 344362 URL: https://svnweb.freebsd.org/changeset/base/344362 Log: MFC r344042: UMA: unsign some variables related to allocation in hash_alloc(). As a followup to r343673, unsign some variables related to allocation since the hashsize cannot be negative. This gives a bit more space to handle bigger allocations and avoid some implicit casting. While here also unsign uh_hashmask, it makes little sense to keep it signed. Differential Revision: https://reviews.freebsd.org/D19148 Modified: stable/12/sys/vm/uma_core.c stable/12/sys/vm/uma_int.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Wed Feb 20 13:37:27 2019 (r344361) +++ stable/12/sys/vm/uma_core.c Wed Feb 20 14:10:46 2019 (r344362) @@ -630,7 +630,7 @@ zone_timeout(uma_zone_t zone) static int hash_alloc(struct uma_hash *hash) { - int oldsize; + u_int oldsize; size_t alloc; oldsize = hash->uh_hashsize; @@ -674,8 +674,8 @@ static int hash_expand(struct uma_hash *oldhash, struct uma_hash *newhash) { uma_slab_t slab; - int hval; - int i; + u_int hval; + u_int idx; if (!newhash->uh_slab_hash) return (0); @@ -688,10 +688,10 @@ hash_expand(struct uma_hash *oldhash, struct uma_hash * full rehash. */ - for (i = 0; i < oldhash->uh_hashsize; i++) - while (!SLIST_EMPTY(&oldhash->uh_slab_hash[i])) { - slab = SLIST_FIRST(&oldhash->uh_slab_hash[i]); - SLIST_REMOVE_HEAD(&oldhash->uh_slab_hash[i], us_hlink); + for (idx = 0; idx < oldhash->uh_hashsize; idx++) + while (!SLIST_EMPTY(&oldhash->uh_slab_hash[idx])) { + slab = SLIST_FIRST(&oldhash->uh_slab_hash[idx]); + SLIST_REMOVE_HEAD(&oldhash->uh_slab_hash[idx], us_hlink); hval = UMA_HASH(newhash, slab->us_data); SLIST_INSERT_HEAD(&newhash->uh_slab_hash[hval], slab, us_hlink); Modified: stable/12/sys/vm/uma_int.h ============================================================================== --- stable/12/sys/vm/uma_int.h Wed Feb 20 13:37:27 2019 (r344361) +++ stable/12/sys/vm/uma_int.h Wed Feb 20 14:10:46 2019 (r344362) @@ -170,8 +170,8 @@ SLIST_HEAD(slabhead, uma_slab); struct uma_hash { struct slabhead *uh_slab_hash; /* Hash table for slabs */ - int uh_hashsize; /* Current size of the hash table */ - int uh_hashmask; /* Mask used during hashing */ + u_int uh_hashsize; /* Current size of the hash table */ + u_int uh_hashmask; /* Mask used during hashing */ }; /* @@ -449,7 +449,7 @@ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data) { uma_slab_t slab; - int hval; + u_int hval; hval = UMA_HASH(hash, data); From owner-svn-src-all@freebsd.org Wed Feb 20 14:12: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 6502214F564C; Wed, 20 Feb 2019 14:12:26 +0000 (UTC) (envelope-from pfg@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 0487382FE8; Wed, 20 Feb 2019 14:12:26 +0000 (UTC) (envelope-from pfg@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 E9AB66963; Wed, 20 Feb 2019 14:12:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KECPO8041368; Wed, 20 Feb 2019 14:12:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KECPA3041366; Wed, 20 Feb 2019 14:12:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201902201412.x1KECPA3041366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Feb 2019 14:12:25 +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: r344363 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 344363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0487382FE8 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 14:12:26 -0000 Author: pfg Date: Wed Feb 20 14:12:25 2019 New Revision: 344363 URL: https://svnweb.freebsd.org/changeset/base/344363 Log: MFC r344042: UMA: unsign some variables related to allocation in hash_alloc(). As a followup to r343673, unsign some variables related to allocation since the hashsize cannot be negative. This gives a bit more space to handle bigger allocations and avoid some implicit casting. While here also unsign uh_hashmask, it makes little sense to keep it signed. Differential Revision: https://reviews.freebsd.org/D19148 Modified: stable/11/sys/vm/uma_core.c stable/11/sys/vm/uma_int.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Wed Feb 20 14:10:46 2019 (r344362) +++ stable/11/sys/vm/uma_core.c Wed Feb 20 14:12:25 2019 (r344363) @@ -537,7 +537,7 @@ zone_timeout(uma_zone_t zone) static int hash_alloc(struct uma_hash *hash) { - int oldsize; + u_int oldsize; size_t alloc; oldsize = hash->uh_hashsize; @@ -581,8 +581,8 @@ static int hash_expand(struct uma_hash *oldhash, struct uma_hash *newhash) { uma_slab_t slab; - int hval; - int i; + u_int hval; + u_int idx; if (!newhash->uh_slab_hash) return (0); @@ -595,10 +595,10 @@ hash_expand(struct uma_hash *oldhash, struct uma_hash * full rehash. */ - for (i = 0; i < oldhash->uh_hashsize; i++) - while (!SLIST_EMPTY(&oldhash->uh_slab_hash[i])) { - slab = SLIST_FIRST(&oldhash->uh_slab_hash[i]); - SLIST_REMOVE_HEAD(&oldhash->uh_slab_hash[i], us_hlink); + for (idx = 0; idx < oldhash->uh_hashsize; idx++) + while (!SLIST_EMPTY(&oldhash->uh_slab_hash[idx])) { + slab = SLIST_FIRST(&oldhash->uh_slab_hash[idx]); + SLIST_REMOVE_HEAD(&oldhash->uh_slab_hash[idx], us_hlink); hval = UMA_HASH(newhash, slab->us_data); SLIST_INSERT_HEAD(&newhash->uh_slab_hash[hval], slab, us_hlink); Modified: stable/11/sys/vm/uma_int.h ============================================================================== --- stable/11/sys/vm/uma_int.h Wed Feb 20 14:10:46 2019 (r344362) +++ stable/11/sys/vm/uma_int.h Wed Feb 20 14:12:25 2019 (r344363) @@ -144,8 +144,8 @@ SLIST_HEAD(slabhead, uma_slab); struct uma_hash { struct slabhead *uh_slab_hash; /* Hash table for slabs */ - int uh_hashsize; /* Current size of the hash table */ - int uh_hashmask; /* Mask used during hashing */ + u_int uh_hashsize; /* Current size of the hash table */ + u_int uh_hashmask; /* Mask used during hashing */ }; /* @@ -386,7 +386,7 @@ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data) { uma_slab_t slab; - int hval; + u_int hval; hval = UMA_HASH(hash, data); From owner-svn-src-all@freebsd.org Wed Feb 20 14: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 75F2714F5F0E; Wed, 20 Feb 2019 14:41:02 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF27B83BCE; Wed, 20 Feb 2019 14:41:01 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x1KEenbR051781 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Feb 2019 15:40:52 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: markj@FreeBSD.org Received: from [10.58.0.4] (dadv@[10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x1KEemeQ053013 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 20 Feb 2019 21:40:48 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r344305 - head/sys/geom To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902192122.x1JLMMPM012400@repo.freebsd.org> From: Eugene Grosbein Message-ID: <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> Date: Wed, 20 Feb 2019 21:40:45 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201902192122.x1JLMMPM012400@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: EF27B83BCE 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.963,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: Wed, 20 Feb 2019 14:41:02 -0000 20.02.2019 4:22, Mark Johnston wrote: > Author: markj > Date: Tue Feb 19 21:22:22 2019 > New Revision: 344305 > URL: https://svnweb.freebsd.org/changeset/base/344305 > > Log: > Impose a limit on the number of GEOM_CTL arguments. > > Otherwise a privileged user can trigger a memory allocation of > unbounded size, or an integer overflow in the subsequent > geom_alloc_copyin() call, leading to out-of-bounds accesses. > > Hard-code a large limit to circumvent this problem. > > admbug: 854 > Reported by: Anonymous of the Shellphish Grill Team > Reviewed by: ae > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D19251 > > Modified: > head/sys/geom/geom_ctl.c > > Modified: head/sys/geom/geom_ctl.c > ============================================================================== > --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) > +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) > @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) > char *p; > u_int i; > > + if (req->narg > 2048) { > + gctl_error(req, "too many arguments"); > + req->arg = NULL; > + return; > + } > + Could you replace magic constant 2048 with #define symbol, please? Something like GEOM_ARG_MAX in sys/sys/limits.h or similar. From owner-svn-src-all@freebsd.org Wed Feb 20 15: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 99AB514F73F8; Wed, 20 Feb 2019 15:49:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12f.google.com (mail-it1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261AE85E38; Wed, 20 Feb 2019 15:49:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12f.google.com with SMTP id m137so16343424ita.0; Wed, 20 Feb 2019 07:49:36 -0800 (PST) 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=fUeKgPvIGKBs5XRqbXsROWyu1zlrXO6f5tx/FXikIPU=; b=Vb3+J5ShX017druqg76Hq+uPWC0yDC983VbdmxqcqyRAarLPipCHXJ/eBAvKGDvuST TUsYkb2rs7euaDdHertAerua3VsKp2BKVojmsUcruOziO4l2kbYQCPU9UpGn5Ajdd1fc rKydqlMp29Puv4nYekvHMwTGLe38FZAO1KuSf9nvdBZUCwAkaboUoCRVIz2hEd/BKd3v hs/FyG/PZjNygngS8HVKSC73tSmk4Dy4HTi4avPv1LPSIaJcehtEeHnmgvxNjUjhLlp6 o2cvfiL/bdMEqVbT5XyjSho9BjwuWm79B6MpZ8komENqyxXODEA36Z5yzZezWSIqgkuA LTsQ== 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=fUeKgPvIGKBs5XRqbXsROWyu1zlrXO6f5tx/FXikIPU=; b=V087tuOBGEUCeu0Wgz/ZN/timjuWSk4Y0s6v6OhfyFXA1AybNglfAS/huvwAkEkN9v xUg3FH3K5uB7//mETcmJ2Wx559+Lmal8EJFkGjchL9yX/8eHGzum8uteBdcQ7dRRgA/F +FOky/QPCnSgBPqpt/a65RsboSXwRPakEdIcLAUYxNzpCwbncgiLhDc/bg2kREx6MVrA hcgugNuKNT7uImZhbo2qMMrVQX7IqjxoyGfvj6OXmM64+1WB1/dNdsoZJSZfyiIPdYvl f4x00IQsb8UWFiofINrNpBClVqvQ9qEzBJXCbnxNZdksuAOF00fT3suA3kNs3xd41/Jw YVHw== X-Gm-Message-State: AHQUAuabhwPvpgR6opG+EcqLiYD6HLgEhUQ5vqZvmjREuzlDdglkOJpF DdwLt521Kzm8czsu2nzJSkQsjyHa X-Google-Smtp-Source: AHgI3IbrPivTML4VqUloWSZZmhSkEFVGqg22o2MiKXWMfvfQ7ZWNvEQOgPyLQPQk4Ri1j3TEduuqIA== X-Received: by 2002:a6b:7405:: with SMTP id s5mr19443018iog.1.1550677775437; Wed, 20 Feb 2019 07:49:35 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-36-102.dsl.bell.ca. [69.159.36.102]) by smtp.gmail.com with ESMTPSA id a16sm2994748itc.27.2019.02.20.07.49.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 07:49:34 -0800 (PST) Sender: Mark Johnston Date: Wed, 20 Feb 2019 10:49:29 -0500 From: Mark Johnston To: Eugene Grosbein Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344305 - head/sys/geom Message-ID: <20190220154929.GA6605@raichu> References: <201902192122.x1JLMMPM012400@repo.freebsd.org> <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002a35c7-3dda-05e5-7768-3e1606871018@grosbein.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 261AE85E38 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.965,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, 20 Feb 2019 15:49:36 -0000 On Wed, Feb 20, 2019 at 09:40:45PM +0700, Eugene Grosbein wrote: > 20.02.2019 4:22, Mark Johnston wrote: > > > Author: markj > > Date: Tue Feb 19 21:22:22 2019 > > New Revision: 344305 > > URL: https://svnweb.freebsd.org/changeset/base/344305 > > > > Log: > > Impose a limit on the number of GEOM_CTL arguments. > > > > Otherwise a privileged user can trigger a memory allocation of > > unbounded size, or an integer overflow in the subsequent > > geom_alloc_copyin() call, leading to out-of-bounds accesses. > > > > Hard-code a large limit to circumvent this problem. > > > > admbug: 854 > > Reported by: Anonymous of the Shellphish Grill Team > > Reviewed by: ae > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D19251 > > > > Modified: > > head/sys/geom/geom_ctl.c > > > > Modified: head/sys/geom/geom_ctl.c > > ============================================================================== > > --- head/sys/geom/geom_ctl.c Tue Feb 19 21:20:50 2019 (r344304) > > +++ head/sys/geom/geom_ctl.c Tue Feb 19 21:22:22 2019 (r344305) > > @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) > > char *p; > > u_int i; > > > > + if (req->narg > 2048) { > > + gctl_error(req, "too many arguments"); > > + req->arg = NULL; > > + return; > > + } > > + > > Could you replace magic constant 2048 with #define symbol, please? > Something like GEOM_ARG_MAX in sys/sys/limits.h or similar. Sure. Here is the proposed diff: https://reviews.freebsd.org/D19271 From owner-svn-src-all@freebsd.org Wed Feb 20 16:09: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 C2FBC14F7AED; Wed, 20 Feb 2019 16:09:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 25CB186957; Wed, 20 Feb 2019 16:09:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1KG93f3015883; Wed, 20 Feb 2019 08:09:03 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1KG92wk015882; Wed, 20 Feb 2019 08:09:02 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902201609.x1KG92wk015882@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev Date: Wed, 20 Feb 2019 08:09:02 -0800 (PST) CC: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@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: 25CB186957 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.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: Wed, 20 Feb 2019 16:09:05 -0000 > On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > > At the risk of painting a bikeshed a lovely color of neon purple, I'm > > curious about if/how these types of commits get merged upstream to > > (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > > confused|is anyone else confused where upstream is?). > > > > Who is upstream? Is work like this going to remain as a downstream > > patch to ZFS? Or is FreeBSD going to work to upstream this type of > > work? > > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're talking > about ZFS on fucking Linux becoming our upstream. Something'd got very > wrong here and I'd like to know what and why. I think to answer why ZoL wins out over ZoF in the upstream selection is that ZoL has many more people working on it than does ZoF so they innovate much faster than us, that makes them a good choose in the since that developement moves faster. I do, like many, have reservations about other aspects perhaps not making this an ideal, but if ZoL develope a good developement model, they well kick ass over anything the FreeBSD project could ever do with ZFS. Like it or not, they have a larger critical mass than us, and that wins in the end game. Also since we did choose to be downstream from illumous that put is in the follow mode in many aspects, so we did not grow a bunch of ZFS developers, where as the ZoL project kinda grabbed the code and went full tilt with it, not totally ignoring upstream, but also not letting upstream stifle there efforts. > > > I hope my curiousity doesn't offend anyone. ;) > Not at all, I'm also confused and curious. Now running a ZoL instance just so I can get use to its look and feel and see how if at all it plays along with ZoF. > ./danfe -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Feb 20 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 2188014F9416; Wed, 20 Feb 2019 17:01:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 895CE88A92; Wed, 20 Feb 2019 17:01:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x642.google.com with SMTP id o6so12507080pls.13; Wed, 20 Feb 2019 09:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3DIvoqLjGNzcOMVoO9eW0jvDwwa9c4MzkdDak4uF3tI=; b=Rqj5zhysFezLIicSBui94V6oizcwwuvoUw3lYlRxQOtaPAeerAGd+nfiThNqUZflVB FGEKBdwESP1VDHyuTv4ZX/Zo7PtSqv12mbfIjTEVi4YC6yi+sHF/TMi//HA5WKxoog6w mczCCpav8kAMgnGw4Cbv0p7CaSsLyAcPCjzSeTcaxpf9ETciL9PN1IiA2BqGnmy4L999 4dOAxOFH4y58tocfA1KqBpqYIrDKRf1FTKvB54VBimblVcp/PoP/fECQ/PcONOkAAnJi PUWE4bNrnVdGN3C5u8pjskayv8+J8OEUvptA20k1B99TOXwsGuFcOM/TVisFvPetxV+x bcmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3DIvoqLjGNzcOMVoO9eW0jvDwwa9c4MzkdDak4uF3tI=; b=ZaRPwdVqdDfjPz42Pb1DRVVTzOeGM+twY+XONp7iBi7G+4AtLN8h/y+GFtdBnQKec2 nK/0sKAARXnEhe3oSFNWT0UjLCPJULpAHIolz7W1JtikNIbK1qK4LRsc7pY5Oe1/tiBW EkmcReBZXI2LShOKFihM52OEVgrUr+wcLBmpNNM2D//bDShH5STTASvSOCA26EA7SPof GYhKgR1kzLGN+d6871heJdo9G5T6ZLTJ2Tq1AAPsXn4YPBqA3EWdrgYUV5whKldTM9IJ +im4mkBnoaGnr2LXq52MecSXvD2PjGjArOX0DVBO3Apw5moBxmnUc0WoYn7IMuR9+nJ6 AT1g== X-Gm-Message-State: AHQUAuaZ69ECGK1zIQGfydIdt7mK3cLdS2QdMS8F19CJMx1nnuvj59UB vgEBaUOfuIv5/zL7guyIp3g9K9SR X-Google-Smtp-Source: AHgI3IZZqQiQNNfoqd7TIIPsZmx/NmZG51Q1yK/HGzaYgrU1lWYQCsm3VEANtJYYd42lfyFgYzIo1w== X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr38535553plk.309.1550682115176; Wed, 20 Feb 2019 09:01:55 -0800 (PST) Received: from [10.0.4.87] (173-160-198-249-Washington.hfc.comcastbusiness.net. [173.160.198.249]) by smtp.gmail.com with ESMTPSA id k7sm13668406pgr.28.2019.02.20.09.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 09:01:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <20190220075613.GC84455@FreeBSD.org> Date: Wed, 20 Feb 2019 09:01:53 -0800 Cc: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> To: Alexey Dokuchaev X-Rspamd-Queue-Id: 895CE88A92 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_SHORT(-0.97)[-0.973,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, 20 Feb 2019 17:01:57 -0000 > On Feb 19, 2019, at 23:56, Alexey Dokuchaev wrote: >=20 >> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >> At the risk of painting a bikeshed a lovely color of neon purple, I'm >> curious about if/how these types of commits get merged upstream to >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very >> confused|is anyone else confused where upstream is?). >>=20 >> Who is upstream? Is work like this going to remain as a downstream >> patch to ZFS? Or is FreeBSD going to work to upstream this type of >> work? >=20 > I've always felt that we should've become upstream to everyone else > the moment we knew Oracle would eat Sun (20 April 2009), and never > understood why it didn't happen and now, ten years later, we're talking > about ZFS on fucking Linux becoming our upstream. Something'd got very > wrong here and I'd like to know what and why. As others have pointed out, FreeBSD has less developer inertia than Linux, a= nd there are (seemingly) less developers or interested parties in running an= openindiana based stack. Also: better OS support for other general purpose infrastructure/usecases wi= th items like multitenancy via containerization/CGroups2, Java, etc, and min= dshare around this and other things. The only thing really holding ZoL back in Linux is the fact that (due to lic= ensing) it won=E2=80=99t ever be in the Linux kernel. -Enji= From owner-svn-src-all@freebsd.org Wed Feb 20 17:05: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 C703B14F95A9; Wed, 20 Feb 2019 17:05:14 +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 65A5288F15; Wed, 20 Feb 2019 17:05:14 +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 51DAB863A; Wed, 20 Feb 2019 17:05:14 +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 x1KH5EVv039925; Wed, 20 Feb 2019 17:05:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KH5E9V039924; Wed, 20 Feb 2019 17:05:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201705.x1KH5E9V039924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 17:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r344364 - vendor/illumos/dist/lib/libdtrace/common X-SVN-Group: vendor X-SVN-Commit-Author: markj X-SVN-Commit-Paths: vendor/illumos/dist/lib/libdtrace/common X-SVN-Commit-Revision: 344364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65A5288F15 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 17:05:15 -0000 Author: markj Date: Wed Feb 20 17:05:13 2019 New Revision: 344364 URL: https://svnweb.freebsd.org/changeset/base/344364 Log: 9058 postmortem DTrace frequently broken under vmware illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f Reviewed by: Tim Kordas Reviewed by: Patrick Mooney Reviewed by: Yuri Pankov Reviewed by: Matthew Ahrens Approved by: Matthew Ahrens Author: Sam Gwydir Modified: vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Modified: vendor/illumos/dist/lib/libdtrace/common/dt_consume.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 14:12:25 2019 (r344363) +++ vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:05:13 2019 (r344364) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -3010,9 +3010,6 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; timestamp = dt_buf_oldest(buf, dtp); - assert(timestamp >= dtp->dt_last_timestamp); - dtp->dt_last_timestamp = timestamp; - if (timestamp == buf->dtbd_timestamp) { /* * We've reached the end of the time covered @@ -3026,6 +3023,8 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; continue; } + assert(timestamp >= dtp->dt_last_timestamp); + dtp->dt_last_timestamp = timestamp; if ((rval = dt_consume_cpu(dtp, fp, buf->dtbd_cpu, buf, B_TRUE, pf, rf, arg)) != 0) From owner-svn-src-all@freebsd.org Wed Feb 20 17:07: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 6F17F14F96ED; Wed, 20 Feb 2019 17:07:09 +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 0BD3A8910F; Wed, 20 Feb 2019 17:07: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 EB72A863C; Wed, 20 Feb 2019 17:07:08 +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 x1KH78oq040263; Wed, 20 Feb 2019 17:07:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KH78nd040260; Wed, 20 Feb 2019 17:07:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201707.x1KH78nd040260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 17:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344365 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 344365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BD3A8910F 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 20 Feb 2019 17:07:09 -0000 Author: markj Date: Wed Feb 20 17:07:08 2019 New Revision: 344365 URL: https://svnweb.freebsd.org/changeset/base/344365 Log: Define a constant for the maximum number of GEOM_CTL arguments. Reviewed by: eugen MFC with: r344305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19271 Modified: head/sys/geom/geom_ctl.c head/sys/geom/geom_ctl.h Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Wed Feb 20 17:05:13 2019 (r344364) +++ head/sys/geom/geom_ctl.c Wed Feb 20 17:07:08 2019 (r344365) @@ -139,7 +139,7 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; - if (req->narg > 2048) { + if (req->narg > GEOM_CTL_ARG_MAX) { gctl_error(req, "too many arguments"); req->arg = NULL; return; Modified: head/sys/geom/geom_ctl.h ============================================================================== --- head/sys/geom/geom_ctl.h Wed Feb 20 17:05:13 2019 (r344364) +++ head/sys/geom/geom_ctl.h Wed Feb 20 17:07:08 2019 (r344365) @@ -78,7 +78,8 @@ struct gctl_req { #define GEOM_CTL _IOW('G', GCTL_VERSION, struct gctl_req) -#define PATH_GEOM_CTL "geom.ctl" +#define GEOM_CTL_ARG_MAX 2048 /* maximum number of parameters */ +#define PATH_GEOM_CTL "geom.ctl" #endif /* _GEOM_GEOM_CTL_H_ */ From owner-svn-src-all@freebsd.org Wed Feb 20 17:10: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 8A75814F985C; Wed, 20 Feb 2019 17:10: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 2804F893EA; Wed, 20 Feb 2019 17:10: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 1893E8643; Wed, 20 Feb 2019 17:10:31 +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 x1KHAUgt040859; Wed, 20 Feb 2019 17:10:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KHAUgP040858; Wed, 20 Feb 2019 17:10:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201710.x1KHAUgP040858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 17:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344366 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 344366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2804F893EA 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 17:10:31 -0000 Author: markj Date: Wed Feb 20 17:10:30 2019 New Revision: 344366 URL: https://svnweb.freebsd.org/changeset/base/344366 Log: MFV r344364: 9058 postmortem DTrace frequently broken under vmware illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:07:08 2019 (r344365) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:10:30 2019 (r344366) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -3040,9 +3040,6 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; timestamp = dt_buf_oldest(buf, dtp); - assert(timestamp >= dtp->dt_last_timestamp); - dtp->dt_last_timestamp = timestamp; - if (timestamp == buf->dtbd_timestamp) { /* * We've reached the end of the time covered @@ -3056,6 +3053,8 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, break; continue; } + assert(timestamp >= dtp->dt_last_timestamp); + dtp->dt_last_timestamp = timestamp; if ((rval = dt_consume_cpu(dtp, fp, buf->dtbd_cpu, buf, B_TRUE, pf, rf, arg)) != 0) From owner-svn-src-all@freebsd.org Wed Feb 20 17:11: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 D2B7A14F9A4C; Wed, 20 Feb 2019 17:11:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 3F8BB89788; Wed, 20 Feb 2019 17:11:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1KHBeLC016159; Wed, 20 Feb 2019 09:11:40 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1KHBeiQ016158; Wed, 20 Feb 2019 09:11:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> To: Enji Cooper Date: Wed, 20 Feb 2019 09:11:40 -0800 (PST) CC: Alexey Dokuchaev , Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@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: 3F8BB89788 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.959,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, 20 Feb 2019 17:11:44 -0000 > > On Feb 19, 2019, at 23:56, Alexey Dokuchaev wrote: > > > >> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > >> At the risk of painting a bikeshed a lovely color of neon purple, I'm > >> curious about if/how these types of commits get merged upstream to > >> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > >> confused|is anyone else confused where upstream is?). > >> > >> Who is upstream? Is work like this going to remain as a downstream > >> patch to ZFS? Or is FreeBSD going to work to upstream this type of > >> work? > > > > I've always felt that we should've become upstream to everyone else > > the moment we knew Oracle would eat Sun (20 April 2009), and never > > understood why it didn't happen and now, ten years later, we're talking > > about ZFS on fucking Linux becoming our upstream. Something'd got very > > wrong here and I'd like to know what and why. > > As others have pointed out, FreeBSD has less developer inertia than Linux, > and there are (seemingly) less developers or interested parties in running > an openindiana based stack. > > Also: better OS support for other general purpose infrastructure/usecases > with items like multitenancy via containerization/CGroups2, Java, etc, > and mindshare around this and other things. > > The only thing really holding ZoL back in Linux is the fact that (due > to licensing) it won?t ever be in the Linux kernel. One can personally link ZoL into your own kernel, and a company/corporate can even do this and run it on 1000's of servers, you just can not distribute it to anyone else, which in the end is not really a big deal, unless your in the Linux distribution business. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Feb 20 17:19: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 8A0E914F9C91; Wed, 20 Feb 2019 17:19:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 D08B189C45; Wed, 20 Feb 2019 17:19:25 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1KHJN2B016176; Wed, 20 Feb 2019 09:19:23 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1KHJNwL016175; Wed, 20 Feb 2019 09:19:23 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902201719.x1KHJNwL016175@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344364 - vendor/illumos/dist/lib/libdtrace/common In-Reply-To: <201902201705.x1KH5E9V039924@repo.freebsd.org> To: Mark Johnston Date: Wed, 20 Feb 2019 09:19:23 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org, patrick.mooney@joyent.com 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: D08B189C45 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.959,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, 20 Feb 2019 17:19:29 -0000 > Author: markj > Date: Wed Feb 20 17:05:13 2019 > New Revision: 344364 > URL: https://svnweb.freebsd.org/changeset/base/344364 > > Log: > 9058 postmortem DTrace frequently broken under vmware > > illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f > > Reviewed by: Tim Kordas > Reviewed by: Patrick Mooney > Reviewed by: Yuri Pankov > Reviewed by: Matthew Ahrens > Approved by: Matthew Ahrens > Author: Sam Gwydir > > Modified: > vendor/illumos/dist/lib/libdtrace/common/dt_consume.c > > Modified: vendor/illumos/dist/lib/libdtrace/common/dt_consume.c > ============================================================================== > --- vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 14:12:25 2019 (r344363) > +++ vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 17:05:13 2019 (r344364) > @@ -24,7 +24,7 @@ > */ > > /* > - * Copyright (c) 2013, Joyent, Inc. All rights reserved. > + * Copyright (c) 2017, Joyent, Inc. All rights reserved. This change to this copyright is very questionable. One should always retain the first date of publication in a copyright statement. I do understand your just importing a change from illumous, but I want it on public record that I have raised issue with this change to a copyright, and this has nothing to do with you personally, or you wanting to bring this code over. > * Copyright (c) 2012 by Delphix. All rights reserved. > */ > > @@ -3010,9 +3010,6 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, > break; > > timestamp = dt_buf_oldest(buf, dtp); > - assert(timestamp >= dtp->dt_last_timestamp); > - dtp->dt_last_timestamp = timestamp; > - > if (timestamp == buf->dtbd_timestamp) { > /* > * We've reached the end of the time covered > @@ -3026,6 +3023,8 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, > break; > continue; > } > + assert(timestamp >= dtp->dt_last_timestamp); > + dtp->dt_last_timestamp = timestamp; > > if ((rval = dt_consume_cpu(dtp, fp, > buf->dtbd_cpu, buf, B_TRUE, pf, rf, arg)) != 0) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Feb 20 17:56: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 15DC114FADC5; Wed, 20 Feb 2019 17:56:40 +0000 (UTC) (envelope-from tuexen@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 AA35C8B555; Wed, 20 Feb 2019 17:56:39 +0000 (UTC) (envelope-from tuexen@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 9EDD18EDC; Wed, 20 Feb 2019 17:56:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KHud6l072524; Wed, 20 Feb 2019 17:56:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KHucYj072518; Wed, 20 Feb 2019 17:56:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902201756.x1KHucYj072518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 20 Feb 2019 17:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344367 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 344367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA35C8B555 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)[-0.999,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, 20 Feb 2019 17:56:40 -0000 Author: tuexen Date: Wed Feb 20 17:56:38 2019 New Revision: 344367 URL: https://svnweb.freebsd.org/changeset/base/344367 Log: Use exponential backoff for retransmitting SYN segments as specified in the TCP RFCs. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18974 Modified: head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_stacks/rack.c Wed Feb 20 17:56:38 2019 (r344367) @@ -2869,7 +2869,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_syn_backoff[tp->t_rxtshift]); + rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_backoff[tp->t_rxtshift]); else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) @@ -155,11 +155,11 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + - * tcp_syn_backoff[2] + - * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, + * TCPTV_RTOBASE * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 @@ -426,7 +426,7 @@ syncache_timeout(struct syncache *sc, struct syncache_ if (sc->sc_rxmits == 0) rexmt = TCPTV_RTOBASE; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_timer.c Wed Feb 20 17:56:38 2019 (r344367) @@ -233,9 +233,6 @@ tcp_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } -int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] = - { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 }; - int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; @@ -671,7 +668,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:10:30 2019 (r344366) +++ head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) @@ -199,7 +199,6 @@ extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; -extern int tcp_syn_backoff[]; extern int tcp_totbackoff; extern int tcp_rexmit_drop_options; From owner-svn-src-all@freebsd.org Wed Feb 20 18:03: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 82CC814FB180; Wed, 20 Feb 2019 18:03:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 814618BB92; Wed, 20 Feb 2019 18:03:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id wWDQgOPHR82YcwWDSg0KX5; Wed, 20 Feb 2019 11:03:31 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=XYtHlOxmKIrviYMon_oA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 0A15DB2B; Wed, 20 Feb 2019 10:03:27 -0800 (PST) Date: Wed, 20 Feb 2019 10:03:04 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> References: <201902192335.x1JNZu53080578@repo.freebsd.org> <20190219234328.wrmteippr6vbg2fr@mutt-hbsd> <20190220075613.GC84455@FreeBSD.org> <1235DF70-2954-4421-9CF3-AA0538B24720@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Enji Cooper ,Alexey Dokuchaev CC: Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Cy Schubert Message-ID: <6CE7079F-5B74-4DCF-AA38-AE2CB5175067@cschubert.com> X-CMAE-Envelope: MS4wfN0oPilJvgHZHJJSAQJ7s2qed9Mk8WWZRi/rS9d5xPwgVM3qYP6LBE1yMF1J+OST/ga4L84dKF7TS8vlf683Rahio2kyx1LrhuCS038N9KAvsNlZPfgi nWS9JY49j3AZUSbJIzHAGUaEx9gpyNM1uHY5bNO3K8IRI6ZifhA946BMsFVojzgXEWqTG6rCave++OR34aVt7mvDfcVGufi4yLg44mpMV79qcOeLCJvJdX6u fUgALiokql2rHmd1Iepjv485EvVRugxZ00Pc8utOEp/tIs8MJrcUzsBBZjVuC/2GE5BAH45yeEd19tu3aTfZt3O9YNVR9RHPUm5tXxwZPRN0tfLzfPZir+b9 qKNylUnl0T3sBQhGBOwj6AFBg07d3VGO649v3O6lv4TEDd92fis= X-Rspamd-Queue-Id: 814618BB92 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: Wed, 20 Feb 2019 18:03:34 -0000 On February 20, 2019 9:01:53 AM PST, Enji Cooper = wrote: > >> On Feb 19, 2019, at 23:56, Alexey Dokuchaev >wrote: >>=20 >>> On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: >>> At the risk of painting a bikeshed a lovely color of neon purple, >I'm >>> curious about if/how these types of commits get merged upstream to >>> (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm >very >>> confused|is anyone else confused where upstream is?)=2E >>>=20 >>> Who is upstream? Is work like this going to remain as a downstream >>> patch to ZFS? Or is FreeBSD going to work to upstream this type of >>> work? >>=20 >> I've always felt that we should've become upstream to everyone else >> the moment we knew Oracle would eat Sun (20 April 2009), and never >> understood why it didn't happen and now, ten years later, we're >talking >> about ZFS on fucking Linux becoming our upstream=2E Something'd got >very >> wrong here and I'd like to know what and why=2E > >As others have pointed out, FreeBSD has less developer inertia than >Linux, and there are (seemingly) less developers or interested parties >in running an openindiana based stack=2E > >Also: better OS support for other general purpose >infrastructure/usecases with items like multitenancy via >containerization/CGroups2, Java, etc, and mindshare around this and >other things=2E > >The only thing really holding ZoL back in Linux is the fact that (due >to licensing) it won=E2=80=99t ever be in the Linux kernel=2E > >-Enji Exactly=2E This and the fact that our user base is considerably smaller, w= e don't have the gravitas and must settle being dictated to=2E POSIX is dea= d=2E I suppose a person could get on top of the soapbox again but =2E=2E=2E A way forward might be two pronged=2E Yes, maintain ZoF based on ZoL, illu= mos, or both, and a Linux KPI layer to allow ZoL (and anything else for tha= t matter) to be imported into ports=2E However maintaining a great shim to = the exclusion of good native support is existential=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-all@freebsd.org Wed Feb 20 18:03: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 6067A14FB1A3; Wed, 20 Feb 2019 18:03:46 +0000 (UTC) (envelope-from tuexen@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 008C68BC71; Wed, 20 Feb 2019 18:03:46 +0000 (UTC) (envelope-from tuexen@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 EC7C190EA; Wed, 20 Feb 2019 18:03:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KI3hiw078570; Wed, 20 Feb 2019 18:03:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KI3haW078567; Wed, 20 Feb 2019 18:03:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902201803.x1KI3haW078567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 20 Feb 2019 18:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344368 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 008C68BC71 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)[-0.999,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, 20 Feb 2019 18:03:46 -0000 Author: tuexen Date: Wed Feb 20 18:03:43 2019 New Revision: 344368 URL: https://svnweb.freebsd.org/changeset/base/344368 Log: Reduce the TCP initial retransmission timeout from 3 seconds to 1 second as allowed by RFC 6298. Reviewed by: kbowling@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18941 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 (r344368) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_backoff[1] + * tcp_backoff[2] + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 (r344368) @@ -77,7 +77,7 @@ #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ From owner-svn-src-all@freebsd.org Wed Feb 20 18:29: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 7FBDB14FB934; Wed, 20 Feb 2019 18:29: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 272D88CA7D; Wed, 20 Feb 2019 18:29: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 1C97B94C9; Wed, 20 Feb 2019 18:29:53 +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 x1KITqEK091971; Wed, 20 Feb 2019 18:29:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KITqwc091970; Wed, 20 Feb 2019 18:29:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902201829.x1KITqwc091970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 Feb 2019 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344369 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 272D88CA7D 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 18:29:53 -0000 Author: markj Date: Wed Feb 20 18:29:52 2019 New Revision: 344369 URL: https://svnweb.freebsd.org/changeset/base/344369 Log: Remove an obsolete comment. MFC after: 3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 20 18:03:43 2019 (r344368) +++ head/sys/kern/kern_descrip.c Wed Feb 20 18:29:52 2019 (r344369) @@ -2439,9 +2439,6 @@ fdcheckstd(struct thread *td) * Internal form of close. Decrement reference count on file structure. * Note: td may be NULL when closing a file that was being passed in a * message. - * - * XXXRW: Giant is not required for the caller, but often will be held; this - * makes it moderately likely the Giant will be recursed in the VFS case. */ int closef(struct file *fp, struct thread *td) From owner-svn-src-all@freebsd.org Wed Feb 20 18:30: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 D0F4614FB9D4; Wed, 20 Feb 2019 18:30:55 +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 4F9778CC89; Wed, 20 Feb 2019 18:30:55 +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 429299517; Wed, 20 Feb 2019 18:30:55 +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 x1KIUt96092225; Wed, 20 Feb 2019 18:30:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KIUskL092224; Wed, 20 Feb 2019 18:30:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201830.x1KIUskL092224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:30:54 +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: r344370 - stable/11/stand/userboot/userboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/userboot/userboot X-SVN-Commit-Revision: 344370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F9778CC89 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.998,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)[-0.999,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, 20 Feb 2019 18:30:56 -0000 Author: kevans Date: Wed Feb 20 18:30:54 2019 New Revision: 344370 URL: https://svnweb.freebsd.org/changeset/base/344370 Log: MFC r334412: userboot: Fix bad type-punning Pass a struct devdesc to the format commands. Use proper type rather than doing weird type-punning that happened to work because the size was right. We copied a zfs devdesc into a disk_devdesc and then after passing through a NULL pointer reinterpreted it as a zfs_devdesc. Instead, pass the base devdesc around and 'upcase' when we know the types are right. This has the happy side effect of fixing a gcc warning about bad type punning. Modified: stable/11/stand/userboot/userboot/devicename.c stable/11/stand/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/userboot/userboot/devicename.c ============================================================================== --- stable/11/stand/userboot/userboot/devicename.c Wed Feb 20 18:29:52 2019 (r344369) +++ stable/11/stand/userboot/userboot/devicename.c Wed Feb 20 18:30:54 2019 (r344370) @@ -175,30 +175,30 @@ userboot_parsedev(struct disk_devdesc **dev, const cha char * userboot_fmtdev(void *vdev) { - struct disk_devdesc *dev = (struct disk_devdesc *)vdev; + struct devdesc *dev = (struct devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->dd.d_dev->dv_type) { + switch(dev->d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; case DEVT_CD: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); break; case DEVT_DISK: return (disk_fmtdev(vdev)); case DEVT_NET: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); break; case DEVT_ZFS: #if defined(USERBOOT_ZFS_SUPPORT) return (zfs_fmtdev(vdev)); #else - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); #endif break; } Modified: stable/11/stand/userboot/userboot/main.c ============================================================================== --- stable/11/stand/userboot/userboot/main.c Wed Feb 20 18:29:52 2019 (r344369) +++ stable/11/stand/userboot/userboot/main.c Wed Feb 20 18:30:54 2019 (r344370) @@ -154,19 +154,18 @@ static void extract_currdev(void) { struct disk_devdesc dev; - - //bzero(&dev, sizeof(dev)); - + struct devdesc *dd; #if defined(USERBOOT_ZFS_SUPPORT) + struct zfs_devdesc zdev; + if (userboot_zfs_found) { - struct zfs_devdesc zdev; /* Leave the pool/root guid's unassigned */ bzero(&zdev, sizeof(zdev)); zdev.dd.d_dev = &zfs_dev; - dev = *(struct disk_devdesc *)&zdev; - init_zfs_bootenv(zfs_fmtdev(&dev)); + init_zfs_bootenv(zfs_fmtdev(&zdev)); + dd = &zdev.dd; } else #endif @@ -183,14 +182,16 @@ extract_currdev(void) dev.d_slice = -1; dev.d_partition = -1; } + dd = &dev.dd; } else { dev.dd.d_dev = &host_dev; dev.dd.d_unit = 0; + dd = &dev.dd; } - env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), + env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(dd), userboot_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev), + env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(dd), env_noset, env_nounset); } From owner-svn-src-all@freebsd.org Wed Feb 20 18:32: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 71F7614FBC1D; Wed, 20 Feb 2019 18:32:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B3D8D083; Wed, 20 Feb 2019 18:32:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x444.google.com with SMTP id s22so12327700pfh.4; Wed, 20 Feb 2019 10:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=URMYHgKhdtfcc4+4VUr/uKCh4Q318W7jx7VVSgfjI1o=; b=OgBhQ5thY/yHD/zxvA4YI1wT5kIxlawfsDw0pL7WQcT8TSC/V8OtZduOaUURLJV6DO KsW6nelEhY7nqhdugMTqZylrmlC8ulRUNmyWGU8VqIrdG/TBoAyoAg3kl/e30bxn8c51 DgdkHRXLr28+sU0Dmd6YXU/RJ78e8T5TXPLwH7oAYMORFAqsz0Ytszpyo3zE7OtyY0ir iDSg/4qKzq0kg6aDwPnggbuixeqT0cuROBB74DnI9BRm3+YwL6Xq4qVZd9ncbWIQS//Z 4UHMYct2zQM44chhCLG3SHN064VxsrCRq3Q9Zg3E59INfEuHjn1z5BRMDyXde0EbhPRD l6uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=URMYHgKhdtfcc4+4VUr/uKCh4Q318W7jx7VVSgfjI1o=; b=EpurT/nLhNff4Hnoy2i5TOpFhvn7ilugidCDrlSQLzdVjmrcDePuEsmxMlAUQSx21A +0edNwZbyQWkOiigTs2MRI2SP9JCr3s93Wr41Rpf12c6b+PDDLnGmzwPSWoE0RhuNhzM ugm21XIVWG38jc4f6jnciavlNF7clVzuYsSaoyzfLu+18ehgwL9Fa0Trj2sO0sNPTpnh 7QEfp6y/F7EWeGTLOCej21BOfXXWSgewRIWGEPff9/q62T4IsyqA3begLdfKqiTsYwxx UqL/lDcCOHwMZcWeRFEP2K+G8y58IXNnOyo/IFyUnllYLPXDjq0D+3+/LROEDKIOr1vD Ur+Q== X-Gm-Message-State: AHQUAuY4cIOrMmkxABuJjBJOsWHhtKJUHg5J2aWueatjdS99lnKyJ1St zmF2OXlpTLeqjomqdWsMlCp+1reC X-Google-Smtp-Source: AHgI3IZRGXV8eV7Gp3pHrucvgoCATJNqbTTL13ujEbOM1P8s1rWoMxKZlFRdz98gY4TfLHA4pk4Yew== X-Received: by 2002:a65:6683:: with SMTP id b3mr30298727pgw.423.1550687567430; Wed, 20 Feb 2019 10:32:47 -0800 (PST) Received: from ?IPv6:2607:fb90:8378:20a7:f9af:9b65:229f:93f7? ([2607:fb90:8378:20a7:f9af:9b65:229f:93f7]) by smtp.gmail.com with ESMTPSA id a1sm14679529pfn.26.2019.02.20.10.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 10:32:46 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> Date: Wed, 20 Feb 2019 10:32:45 -0800 Cc: Alexey Dokuchaev , Shawn Webb , Pawel Jakub Dawidek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2E31FED5-0E0B-4624-AF11-2178C7E84308@gmail.com> References: <201902201711.x1KHBeiQ016158@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Rspamd-Queue-Id: D9B3D8D083 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.90)[-0.896,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, 20 Feb 2019 18:32:49 -0000 On Feb 20, 2019, at 09:11, Rodney W. Grimes = wrote: > One can personally link ZoL into your own kernel, and a company/corporate > can even do this and run it on 1000's of servers, you just can not > distribute it to anyone else, which in the end is not really a big > deal, unless your in the Linux distribution business. Very little organizations roll their own Linux kernels in the grand scheme o= f things (run of the mill sysadmins aren=E2=80=99t hackers), and making Linu= x VFS work with ZFS is a nontrivial job (ZoL might work with a kernel versio= n, but it won=E2=80=99t work with all target kernel versions). Groups like Fa= cebook, Google, Oracle, etc, do it because they have the developer manpower a= nd it=E2=80=99s in their vested interest to run a custom kernel config/kerne= l with backports/enhancements. Plus, they don=E2=80=99t need to release thei= r changes, as their server platforms won=E2=80=99t be productized (thus skat= ing around the GPLv2). I couldn=E2=80=99t find gregkh@=E2=80=98s diatribe about Linux kernel compat= ibility, but it was basically (put nicely), =E2=80=9Cput your code in the ke= rnel tree, cause we won=E2=80=99t necessarily provide backwards compatibilit= y, as we need to break interfaces from time to time.=E2=80=9D Given that zfs is licensed under the CDDL (a viral license to Linux), that c= ode will never, ever, hit the mainline tree. This is one of the code reasons why, over time, btrfs has evolved into the f= ile system that it is: it fills a niche that ext4 couldn=E2=80=99t and zfs d= id, while being licensed under an acceptable kernel license (GPLv2). -Enji= From owner-svn-src-all@freebsd.org Wed Feb 20 18:34: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 4B56814FBCAF; Wed, 20 Feb 2019 18:34:22 +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 DF07E8D1CE; Wed, 20 Feb 2019 18:34:21 +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 C76D996C2; Wed, 20 Feb 2019 18:34:21 +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 x1KIYLTL097781; Wed, 20 Feb 2019 18:34:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KIYLda097779; Wed, 20 Feb 2019 18:34:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201834.x1KIYLda097779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:34: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: r344371 - in stable/11/stand/efi: include libefi loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: include libefi loader X-SVN-Commit-Revision: 344371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF07E8D1CE 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.998,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)[-0.999,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, 20 Feb 2019 18:34:22 -0000 Author: kevans Date: Wed Feb 20 18:34:20 2019 New Revision: 344371 URL: https://svnweb.freebsd.org/changeset/base/344371 Log: MFC r335228-r335231, r335272: stand: efiloader fixes r335228: Migrate has_keyboard to bool. r335229: Provide a more direct interface to tell ZFS what the preferred handle is. We tell the ZFS code now, and it checks rather than having a callback to do the checks. This will allow us to have a more graceful fallback code. In the future, it's anticipated that we may fallback to a more global search (or implement a command to do so) when reqeusted by the user, or we detect a violation of the UEFI Boot Manager protocol severe enough to warrant this backstop. For now, it just allows us to get rid of img as a global. r335230: Move arg parsing into its own routine for possible later reuse. r335231: There's no need to walk through the tables looking for the smbios table if we're just going to ignore it on arm, so expand, slightly, the reach of the ifdef. Move the buffer to the inner block so we don't have a separate #ifdef far away from these lines. The issue on arm is that smbios_detect does unaligned accesses, which in the u-boot implementing EFI context causes a crash. r335272: Many netboot scenarios don't have /boot/defaults/loader.conf. As a fallback, also check /boot/kernel/kernel existing as well, since that's the fallback behavior of the loader. Modified: stable/11/stand/efi/include/efizfs.h stable/11/stand/efi/libefi/efizfs.c stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/include/efizfs.h ============================================================================== --- stable/11/stand/efi/include/efizfs.h Wed Feb 20 18:30:54 2019 (r344370) +++ stable/11/stand/efi/include/efizfs.h Wed Feb 20 18:34:20 2019 (r344371) @@ -44,11 +44,11 @@ typedef struct zfsinfo extern uint64_t pool_guid; -extern void efi_zfs_probe(void); -extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); -extern bool efi_zfs_is_preferred(EFI_HANDLE *h); -extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); -extern bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); +void efi_zfs_probe(void); +EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); +bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); +zfsinfo_list_t *efizfs_get_zfsinfo_list(void); +void efizfs_set_preferred(EFI_HANDLE); #endif Modified: stable/11/stand/efi/libefi/efizfs.c ============================================================================== --- stable/11/stand/efi/libefi/efizfs.c Wed Feb 20 18:30:54 2019 (r344370) +++ stable/11/stand/efi/libefi/efizfs.c Wed Feb 20 18:34:20 2019 (r344371) @@ -45,6 +45,14 @@ static zfsinfo_list_t zfsinfo; uint64_t pool_guid; +static EFI_HANDLE preferred; + +void +efizfs_set_preferred(EFI_HANDLE h) +{ + preferred = h; +} + zfsinfo_list_t * efizfs_get_zfsinfo_list(void) { @@ -110,16 +118,13 @@ efi_zfs_probe(void) */ STAILQ_FOREACH(hd, hdi, pd_link) { STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { - snprintf(devname, sizeof(devname), "%s%dp%d:", efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - - if (zfs_probe_dev(devname, &guid) == 0) { - insert_zfs(pd->pd_handle, guid); - - if (efi_zfs_is_preferred(pd->pd_handle)) - pool_guid = guid; - } + if (zfs_probe_dev(devname, &guid) == 0) { + insert_zfs(pd->pd_handle, guid); + if (pd->pd_handle == preferred) + pool_guid = guid; + } } } Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Wed Feb 20 18:30:54 2019 (r344370) +++ stable/11/stand/efi/loader/main.c Wed Feb 20 18:34:20 2019 (r344371) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #ifdef EFI_ZFS_BOOT #include - #include "efizfs.h" #endif @@ -73,8 +72,6 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; -static EFI_LOADED_IMAGE *img; - /* * Number of seconds to wait for a keystroke before exiting with failure * in the event no currdev is found. -2 means always break, -1 means @@ -84,22 +81,14 @@ static EFI_LOADED_IMAGE *img; */ static int fail_timeout = 5; -#ifdef EFI_ZFS_BOOT -bool -efi_zfs_is_preferred(EFI_HANDLE *h) -{ - return (h == img->DeviceHandle); -} -#endif - -static int +static bool has_keyboard(void) { EFI_STATUS status; EFI_DEVICE_PATH *path; EFI_HANDLE *hin, *hin_end, *walker; UINTN sz; - int retval = 0; + bool retval = false; /* * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and @@ -146,7 +135,7 @@ has_keyboard(void) acpi = (ACPI_HID_DEVICE_PATH *)(void *)path; if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { - retval = 1; + retval = true; goto out; } /* @@ -162,7 +151,7 @@ has_keyboard(void) if (usb->DeviceClass == 3 && /* HID */ usb->DeviceSubClass == 1 && /* Boot devices */ usb->DeviceProtocol == 1) { /* Boot keyboards */ - retval = 1; + retval = true; goto out; } } @@ -231,7 +220,8 @@ sanity_check_currdev(void) { struct stat st; - return (stat("/boot/defaults/loader.conf", &st) == 0); + return (stat("/boot/defaults/loader.conf", &st) == 0 || + stat("/boot/kernel/kernel", &st) == 0); } #ifdef EFI_ZFS_BOOT @@ -408,58 +398,14 @@ interactive_interrupt(const char *msg) return (false); } -EFI_STATUS -main(int argc, CHAR16 *argv[]) +int +parse_args(int argc, CHAR16 *argv[], bool has_kbd) { - char var[128]; - EFI_GUID *guid; int i, j, howto; bool vargood; - UINTN k; - int has_kbd; - char *s; - EFI_DEVICE_PATH *imgpath; - CHAR16 *text; - EFI_STATUS status; - UINT16 boot_current; - size_t sz; - UINT16 boot_order[100]; -#if !defined(__arm__) - char buf[40]; -#endif + char var[128]; - archsw.arch_autoload = efi_autoload; - archsw.arch_getdev = efi_getdev; - archsw.arch_copyin = efi_copyin; - archsw.arch_copyout = efi_copyout; - archsw.arch_readin = efi_readin; -#ifdef EFI_ZFS_BOOT - /* Note this needs to be set before ZFS init. */ - archsw.arch_zfs_probe = efi_zfs_probe; -#endif - - /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&img); - - /* Init the time source */ - efi_time_init(); - - has_kbd = has_keyboard(); - /* - * XXX Chicken-and-egg problem; we want to have console output - * early, but some console attributes may depend on reading from - * eg. the boot device, which we can't do yet. We can use - * printf() etc. once this is done. - */ - cons_probe(); - - /* - * Initialise the block cache. Set the upper limit. - */ - bcache_init(32768, 512); - - /* * Parse the args to set the console settings, etc * boot1.efi passes these in, if it can read /boot.config or /boot/config * or iPXE may be setup to pass these in. Or the optional argument in the @@ -547,7 +493,63 @@ main(int argc, CHAR16 *argv[]) } } } + return (howto); +} + +EFI_STATUS +main(int argc, CHAR16 *argv[]) +{ + EFI_GUID *guid; + int howto, i; + UINTN k; + bool has_kbd; + char *s; + EFI_DEVICE_PATH *imgpath; + CHAR16 *text; + EFI_STATUS status; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + EFI_LOADED_IMAGE *img; + + archsw.arch_autoload = efi_autoload; + archsw.arch_getdev = efi_getdev; + archsw.arch_copyin = efi_copyin; + archsw.arch_copyout = efi_copyout; + archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; +#endif + + /* Get our loaded image protocol interface structure. */ + BS->HandleProtocol(IH, &imgid, (VOID**)&img); + +#ifdef EFI_ZFS_BOOT + /* Tell ZFS probe code where we booted from */ + efizfs_set_preferred(img->DeviceHandle); +#endif + /* Init the time source */ + efi_time_init(); + + has_kbd = has_keyboard(); + + /* + * XXX Chicken-and-egg problem; we want to have console output + * early, but some console attributes may depend on reading from + * eg. the boot device, which we can't do yet. We can use + * printf() etc. once this is done. + */ + cons_probe(); + + /* + * Initialise the block cache. Set the upper limit. + */ + bcache_init(32768, 512); + + howto = parse_args(argc, argv, has_kbd); + bootenv_set(howto); /* @@ -651,18 +653,20 @@ main(int argc, CHAR16 *argv[]) efi_init_environment(); setenv("LINES", "24", 1); /* optional */ +#if !defined(__arm__) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; -#if !defined(__arm__) if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + char buf[40]; + snprintf(buf, sizeof(buf), "%p", ST->ConfigurationTable[k].VendorTable); setenv("hint.smbios.0.mem", buf, 1); smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } -#endif } +#endif interact(); /* doesn't return */ From owner-svn-src-all@freebsd.org Wed Feb 20 18:40: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 29C2A14FBE8E; Wed, 20 Feb 2019 18:40:15 +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 E65668D4E9; Wed, 20 Feb 2019 18:40:14 +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 DC20496C8; Wed, 20 Feb 2019 18:40:14 +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 x1KIeEqt098792; Wed, 20 Feb 2019 18:40:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KIeEZR098790; Wed, 20 Feb 2019 18:40:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201840.x1KIeEZR098790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:40:14 +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: r344372 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 344372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E65668D4E9 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 18:40:15 -0000 Author: kevans Date: Wed Feb 20 18:40:14 2019 New Revision: 344372 URL: https://svnweb.freebsd.org/changeset/base/344372 Log: MFC r335337: Remove stray debugging line. Modified: stable/11/stand/libsa/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Wed Feb 20 18:34:20 2019 (r344371) +++ stable/11/stand/libsa/Makefile Wed Feb 20 18:40:14 2019 (r344372) @@ -103,7 +103,6 @@ STAND_H_INC=ctype.h fcntl.h signal.h stdio.h stdlib.h OTHER_INC=stdarg.h errno.h stdint.h beforedepend: - echo beforedepend; \ mkdir -p ${FAKE_DIRS}; \ for i in ${SAFE_INCS}; do \ ln -sf ${SRCTOP}/include/$$i $$i; \ From owner-svn-src-all@freebsd.org Wed Feb 20 18:44: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 83A3014FC176; Wed, 20 Feb 2019 18:44:12 +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 2B8408D9BF; Wed, 20 Feb 2019 18:44:12 +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 20131986A; Wed, 20 Feb 2019 18:44:12 +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 x1KIiCHV004317; Wed, 20 Feb 2019 18:44:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KIiA6K004307; Wed, 20 Feb 2019 18:44:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201844.x1KIiA6K004307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:44:10 +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: r344373 - in stable/11/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli X-SVN-Commit-Revision: 344373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B8408D9BF 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.998,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)[-0.999,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, 20 Feb 2019 18:44:12 -0000 Author: kevans Date: Wed Feb 20 18:44:09 2019 New Revision: 344373 URL: https://svnweb.freebsd.org/changeset/base/344373 Log: MFC r335321, r335336: stand: move libgeliboot into libsa r335321: stand: move libgeliboot into libsa. Reduce by 1 the number of crazy libraries we need in stand by moving geli into libsa (where architecturally it belonged all along). This just moves things around without any code changes. r335336: Remove now-empty geli directory Added: stable/11/stand/libsa/geli/ - copied from r335321, head/stand/libsa/geli/ Replaced: - copied unchanged from r344372, stable/11/stand/geli/geliboot.c - copied unchanged from r344372, stable/11/stand/geli/pwgets.c Directory Properties: stable/11/stand/libsa/geli/geliboot.c (props changed) stable/11/stand/libsa/geli/pwgets.c (props changed) Deleted: stable/11/stand/geli/ Modified: stable/11/stand/Makefile stable/11/stand/defs.mk stable/11/stand/i386/gptboot/Makefile stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/isoboot/Makefile stable/11/stand/i386/loader/Makefile stable/11/stand/i386/zfsboot/Makefile stable/11/stand/libsa/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile ============================================================================== --- stable/11/stand/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -21,8 +21,6 @@ S.${MK_ZFS}+= zfs S.yes+= defaults S.yes+= man -S.${MK_LOADER_GELI}+= geli - .include S.${MK_EFI}+= efi Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/defs.mk Wed Feb 20 18:44:09 2019 (r344373) @@ -67,8 +67,7 @@ MK_LOADER_GELI=yes .endif .if ${MK_LOADER_GELI} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a +CFLAGS+= -I${SASRC}/geli .endif # MK_LOADER_GELI .endif # HAVE_GELI Modified: stable/11/stand/i386/gptboot/Makefile ============================================================================== --- stable/11/stand/i386/gptboot/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/i386/gptboot/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -64,7 +64,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include Modified: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -75,7 +75,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c Modified: stable/11/stand/i386/isoboot/Makefile ============================================================================== --- stable/11/stand/i386/isoboot/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/i386/isoboot/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -66,6 +66,6 @@ isoboot.bin: isoboot.out ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include Modified: stable/11/stand/i386/loader/Makefile ============================================================================== --- stable/11/stand/i386/loader/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/i386/loader/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} +LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -DLOADER_PREFER_AMD64 Modified: stable/11/stand/i386/zfsboot/Makefile ============================================================================== --- stable/11/stand/i386/zfsboot/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/i386/zfsboot/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -82,7 +82,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} SRCS= zfsboot.c Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Wed Feb 20 18:40:14 2019 (r344372) +++ stable/11/stand/libsa/Makefile Wed Feb 20 18:44:09 2019 (r344373) @@ -146,4 +146,9 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c +# Maybe GELI +.if ${MK_LOADER_GELI} == "yes" +.include "${SASRC}/geli/Makefile.inc" +.endif + .include Copied: stable/11/stand/libsa/geli/geliboot.c (from r344372, stable/11/stand/geli/geliboot.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/libsa/geli/geliboot.c Wed Feb 20 18:44:09 2019 (r344373, copy of r344372, stable/11/stand/geli/geliboot.c) @@ -0,0 +1,437 @@ +/*- + * Copyright (c) 2015 Allan Jude + * Copyright (c) 2005-2011 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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$ + */ + +#include "geliboot_internal.h" +#include "geliboot.h" + +SLIST_HEAD(geli_list, geli_entry) geli_head = SLIST_HEAD_INITIALIZER(geli_head); +struct geli_list *geli_headp; + +typedef u_char geli_ukey[G_ELI_USERKEYLEN]; + +static geli_ukey saved_keys[GELI_MAX_KEYS]; +static unsigned int nsaved_keys = 0; + +/* + * Copy keys from local storage to the keybuf struct. + * Destroy the local storage when finished. + */ +void +geli_fill_keybuf(struct keybuf *fkeybuf) +{ + unsigned int i; + + for (i = 0; i < nsaved_keys; i++) { + fkeybuf->kb_ents[i].ke_type = KEYBUF_TYPE_GELI; + memcpy(fkeybuf->kb_ents[i].ke_data, saved_keys[i], + G_ELI_USERKEYLEN); + } + fkeybuf->kb_nents = nsaved_keys; + explicit_bzero(saved_keys, sizeof(saved_keys)); +} + +/* + * Copy keys from a keybuf struct into local storage. + * Zero out the keybuf. + */ +void +geli_save_keybuf(struct keybuf *skeybuf) +{ + unsigned int i; + + for (i = 0; i < skeybuf->kb_nents && i < GELI_MAX_KEYS; i++) { + memcpy(saved_keys[i], skeybuf->kb_ents[i].ke_data, + G_ELI_USERKEYLEN); + explicit_bzero(skeybuf->kb_ents[i].ke_data, + G_ELI_USERKEYLEN); + skeybuf->kb_ents[i].ke_type = KEYBUF_TYPE_NONE; + } + nsaved_keys = skeybuf->kb_nents; + skeybuf->kb_nents = 0; +} + +static void +save_key(geli_ukey key) +{ + + /* + * If we run out of key space, the worst that will happen is + * it will ask the user for the password again. + */ + if (nsaved_keys < GELI_MAX_KEYS) { + memcpy(saved_keys[nsaved_keys], key, G_ELI_USERKEYLEN); + nsaved_keys++; + } +} + +static int +geli_same_device(struct geli_entry *ge, struct dsk *dskp) +{ + + if (ge->dsk->drive == dskp->drive && + dskp->part == 255 && ge->dsk->part == dskp->slice) { + /* + * Sometimes slice = slice, and sometimes part = slice + * If the incoming struct dsk has part=255, it means look at + * the slice instead of the part number + */ + return (0); + } + + /* Is this the same device? */ + if (ge->dsk->drive != dskp->drive || + ge->dsk->slice != dskp->slice || + ge->dsk->part != dskp->part) { + return (1); + } + + return (0); +} + +static int +geli_findkey(struct geli_entry *ge, struct dsk *dskp, u_char *mkey) +{ + u_int keynum; + int i; + + if (ge->keybuf_slot >= 0) { + if (g_eli_mkey_decrypt(&ge->md, saved_keys[ge->keybuf_slot], + mkey, &keynum) == 0) { + return (0); + } + } + + for (i = 0; i < nsaved_keys; i++) { + if (g_eli_mkey_decrypt(&ge->md, saved_keys[i], mkey, + &keynum) == 0) { + ge->keybuf_slot = i; + return (0); + } + } + + return (1); +} + +void +geli_init(void) +{ + + geli_count = 0; + SLIST_INIT(&geli_head); +} + +/* + * Read the last sector of the drive or partition pointed to by dsk and see + * if it is GELI encrypted + */ +int +geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, + size_t bytes), struct dsk *dskp, daddr_t lastsector) +{ + struct g_eli_metadata md; + u_char buf[DEV_GELIBOOT_BSIZE]; + int error; + off_t alignsector; + + alignsector = rounddown2(lastsector * DEV_BSIZE, DEV_GELIBOOT_BSIZE); + if (alignsector + DEV_GELIBOOT_BSIZE > ((lastsector + 1) * DEV_BSIZE)) { + /* Don't read past the end of the disk */ + alignsector = (lastsector * DEV_BSIZE) + DEV_BSIZE + - DEV_GELIBOOT_BSIZE; + } + error = read_func(NULL, dskp, alignsector, &buf, DEV_GELIBOOT_BSIZE); + if (error != 0) { + return (error); + } + /* Extract the last 4k sector of the disk. */ + error = eli_metadata_decode(buf, &md); + if (error != 0) { + /* Try the last 512 byte sector instead. */ + error = eli_metadata_decode(buf + + (DEV_GELIBOOT_BSIZE - DEV_BSIZE), &md); + if (error != 0) { + return (error); + } + } + + if (!(md.md_flags & G_ELI_FLAG_GELIBOOT)) { + /* The GELIBOOT feature is not activated */ + return (1); + } + if ((md.md_flags & G_ELI_FLAG_ONETIME)) { + /* Swap device, skip it. */ + return (1); + } + if (md.md_iterations < 0) { + /* XXX TODO: Support loading key files. */ + /* Disk does not have a passphrase, skip it. */ + return (1); + } + geli_e = malloc(sizeof(struct geli_entry)); + if (geli_e == NULL) + return (2); + + geli_e->dsk = malloc(sizeof(struct dsk)); + if (geli_e->dsk == NULL) + return (2); + memcpy(geli_e->dsk, dskp, sizeof(struct dsk)); + geli_e->part_end = lastsector; + if (dskp->part == 255) { + geli_e->dsk->part = dskp->slice; + } + geli_e->keybuf_slot = -1; + + geli_e->md = md; + eli_metadata_softc(&geli_e->sc, &md, DEV_BSIZE, + (lastsector + DEV_BSIZE) * DEV_BSIZE); + + SLIST_INSERT_HEAD(&geli_head, geli_e, entries); + geli_count++; + + return (0); +} + +/* + * Attempt to decrypt the device + */ +static int +geli_attach(struct geli_entry *ge, struct dsk *dskp, const char *passphrase, + u_char *mkeyp) +{ + u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN], *mkp; + u_int keynum; + struct hmac_ctx ctx; + int error; + + if (mkeyp != NULL) { + memcpy(&mkey, mkeyp, G_ELI_DATAIVKEYLEN); + explicit_bzero(mkeyp, G_ELI_DATAIVKEYLEN); + } + + if (mkeyp != NULL || geli_findkey(ge, dskp, mkey) == 0) { + goto found_key; + } + + g_eli_crypto_hmac_init(&ctx, NULL, 0); + /* + * Prepare Derived-Key from the user passphrase. + */ + if (geli_e->md.md_iterations < 0) { + /* XXX TODO: Support loading key files. */ + return (1); + } else if (geli_e->md.md_iterations == 0) { + g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, + sizeof(geli_e->md.md_salt)); + g_eli_crypto_hmac_update(&ctx, (const uint8_t *)passphrase, + strlen(passphrase)); + } else if (geli_e->md.md_iterations > 0) { + printf("Calculating GELI Decryption Key disk%dp%d @ %d" + " iterations...\n", dskp->unit, + (dskp->slice > 0 ? dskp->slice : dskp->part), + geli_e->md.md_iterations); + u_char dkey[G_ELI_USERKEYLEN]; + + pkcs5v2_genkey(dkey, sizeof(dkey), geli_e->md.md_salt, + sizeof(geli_e->md.md_salt), passphrase, + geli_e->md.md_iterations); + g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); + explicit_bzero(dkey, sizeof(dkey)); + } + + g_eli_crypto_hmac_final(&ctx, key, 0); + + error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); + if (error == -1) { + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(key, sizeof(key)); + printf("Bad GELI key: bad password?\n"); + return (error); + } else if (error != 0) { + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(key, sizeof(key)); + printf("Failed to decrypt GELI master key: %d\n", error); + return (error); + } else { + /* Add key to keychain */ + save_key(key); + explicit_bzero(&key, sizeof(key)); + } + +found_key: + /* Store the keys */ + bcopy(mkey, geli_e->sc.sc_mkey, sizeof(geli_e->sc.sc_mkey)); + bcopy(mkey, geli_e->sc.sc_ivkey, sizeof(geli_e->sc.sc_ivkey)); + mkp = mkey + sizeof(geli_e->sc.sc_ivkey); + if ((geli_e->sc.sc_flags & G_ELI_FLAG_AUTH) == 0) { + bcopy(mkp, geli_e->sc.sc_ekey, G_ELI_DATAKEYLEN); + } else { + /* + * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) + */ + g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, (const uint8_t *)"\x10", 1, + geli_e->sc.sc_ekey, 0); + } + explicit_bzero(mkey, sizeof(mkey)); + + /* Initialize the per-sector IV. */ + switch (geli_e->sc.sc_ealgo) { + case CRYPTO_AES_XTS: + break; + default: + SHA256_Init(&geli_e->sc.sc_ivctx); + SHA256_Update(&geli_e->sc.sc_ivctx, geli_e->sc.sc_ivkey, + sizeof(geli_e->sc.sc_ivkey)); + break; + } + + return (0); +} + +int +is_geli(struct dsk *dskp) +{ + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) == 0) { + return (0); + } + } + + return (1); +} + +int +geli_read(struct dsk *dskp, off_t offset, u_char *buf, size_t bytes) +{ + u_char iv[G_ELI_IVKEYLEN]; + u_char *pbuf; + int error; + off_t dstoff; + uint64_t keyno; + size_t n, nsec, secsize; + struct g_eli_key gkey; + + pbuf = buf; + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + secsize = geli_e->sc.sc_sectorsize; + nsec = bytes / secsize; + if (nsec == 0) { + /* + * A read of less than the GELI sector size has been + * requested. The caller provided destination buffer may + * not be big enough to boost the read to a full sector, + * so just attempt to decrypt the truncated sector. + */ + secsize = bytes; + nsec = 1; + } + + for (n = 0, dstoff = offset; n < nsec; n++, dstoff += secsize) { + + g_eli_crypto_ivgen(&geli_e->sc, dstoff, iv, + G_ELI_IVKEYLEN); + + /* Get the key that corresponds to this offset. */ + keyno = (dstoff >> G_ELI_KEY_SHIFT) / secsize; + g_eli_key_fill(&geli_e->sc, &gkey, keyno); + + error = geliboot_crypt(geli_e->sc.sc_ealgo, 0, pbuf, + secsize, gkey.gek_key, + geli_e->sc.sc_ekeylen, iv); + + if (error != 0) { + explicit_bzero(&gkey, sizeof(gkey)); + printf("Failed to decrypt in geli_read()!"); + return (error); + } + pbuf += secsize; + } + explicit_bzero(&gkey, sizeof(gkey)); + return (0); + } + + printf("GELI provider not found\n"); + return (1); +} + +int +geli_havekey(struct dsk *dskp) +{ + u_char mkey[G_ELI_DATAIVKEYLEN]; + + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + if (geli_findkey(geli_e, dskp, mkey) == 0) { + if (geli_attach(geli_e, dskp, NULL, mkey) == 0) { + return (0); + } + } + } + explicit_bzero(mkey, sizeof(mkey)); + + return (1); +} + +int +geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp) +{ + int i; + + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + /* TODO: Implement GELI keyfile(s) support */ + for (i = 0; i < 3; i++) { + /* Try cached passphrase */ + if (i == 0 && pw[0] != '\0') { + if (geli_attach(geli_e, dskp, pw, NULL) == 0) { + return (0); + } + } + printf("GELI Passphrase for disk%d%c%d: ", disk, + parttype, part); + pwgets(pw, GELI_PW_MAXLEN, + (geli_e->md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS) == 0); + printf("\n"); + if (geli_attach(geli_e, dskp, pw, NULL) == 0) { + return (0); + } + } + } + + return (1); +} Copied: stable/11/stand/libsa/geli/pwgets.c (from r344372, stable/11/stand/geli/pwgets.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/libsa/geli/pwgets.c Wed Feb 20 18:44:09 2019 (r344373, copy of r344372, stable/11/stand/geli/pwgets.c) @@ -0,0 +1,79 @@ +/* $NetBSD: gets.c,v 1.6 1995/10/11 21:16:57 pk Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * @(#)gets.c 8.1 (Berkeley) 6/11/93 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "stand.h" + +/* gets() with constrained input length, for passwords */ + +void +pwgets(char *buf, int n, int hide) +{ + int c; + char *lp; + + for (lp = buf;;) + switch (c = getchar() & 0177) { + case '\n': + case '\r': + *lp = '\0'; + putchar('\n'); + return; + case '\b': + case '\177': + if (lp > buf) { + lp--; + if (hide == 0) { + putchar('\b'); + putchar(' '); + putchar('\b'); + } + } + break; + case 'u'&037: + case 'w'&037: + lp = buf; + putchar('\n'); + break; + default: + if ((n < 1) || ((lp - buf) < n - 1)) { + *lp++ = c; + if (hide == 0) { + putchar('*'); + } + } + } + /*NOTREACHED*/ +} From owner-svn-src-all@freebsd.org Wed Feb 20 18:46: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 EB15F14FC59A; Wed, 20 Feb 2019 18:46:31 +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 B27A08DDA2; Wed, 20 Feb 2019 18:46:31 +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 A21DB986C; Wed, 20 Feb 2019 18:46:31 +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 x1KIkVsu004486; Wed, 20 Feb 2019 18:46:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KIkV65004485; Wed, 20 Feb 2019 18:46:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201846.x1KIkV65004485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:46: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: r344374 - stable/11/stand/efi/boot1 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/efi/boot1 X-SVN-Commit-Revision: 344374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B27A08DDA2 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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: Wed, 20 Feb 2019 18:46:32 -0000 Author: kevans Date: Wed Feb 20 18:46:31 2019 New Revision: 344374 URL: https://svnweb.freebsd.org/changeset/base/344374 Log: MFC r335773: Revert preference to be an int. While in base we use it as a boolean (of the wrong spelling), there's at least one out of tree user that needs it to be int since priorirty is a small int, not a 0/1. In deference to the time it's wasted me and my team, push this up into FreeBSD for whatever short life boot1 may have in the tree. Modified: stable/11/stand/efi/boot1/boot_module.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/boot1/boot_module.h ============================================================================== --- stable/11/stand/efi/boot1/boot_module.h Wed Feb 20 18:44:09 2019 (r344373) +++ stable/11/stand/efi/boot1/boot_module.h Wed Feb 20 18:46:31 2019 (r344374) @@ -51,7 +51,7 @@ typedef struct dev_info EFI_HANDLE *devhandle; void *devdata; uint64_t partoff; - BOOLEAN preferred; + int preferred; struct dev_info *next; } dev_info_t; From owner-svn-src-all@freebsd.org Wed Feb 20 18:48: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 2914D14FC80B; Wed, 20 Feb 2019 18:48:38 +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 9D8DB8DFF4; Wed, 20 Feb 2019 18:48:37 +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 87521986F; Wed, 20 Feb 2019 18:48:37 +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 x1KImbEa004635; Wed, 20 Feb 2019 18:48:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KImbTe004633; Wed, 20 Feb 2019 18:48:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201848.x1KImbTe004633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 18:48:37 +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: r344375 - in stable/11/stand/uboot: common fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/uboot: common fdt X-SVN-Commit-Revision: 344375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D8DB8DFF4 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.998,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)[-0.999,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, 20 Feb 2019 18:48:38 -0000 Author: kevans Date: Wed Feb 20 18:48:36 2019 New Revision: 344375 URL: https://svnweb.freebsd.org/changeset/base/344375 Log: MFC r335869, r335933: stand: uboot behavioral fixes r335869: stand: uboot: Do not panic if we can't find a boot device It is really anoying to panic when there is no boot device as you cannot see the availables ones. r335933: loader: fdt: Try to load every possible DTB from u-boot U-Boot setup a few variables : - fdt_addr which is the board static dtb (most of the time loaded before u-boot or coming from some hardware like a ROM) - fdt_addr_r which is a location in RAM that holds the DTB loaded by u-boot or before u-boot In the case of u-boot + rpi firmware the DTB is loaded in RAM but the location still end up in the fdt_addr variable and the fdt_addr_r variable exist. Change the behavior so we test that a DTB exists for every possible variable : - fdt_addr_r is checked first as if u-boot needed to modify it the correct DTB will live there. - fdt_addr is checked second as if we run on a hardware with DTB in ROM it means that we what/need to run that - fdtaddr looks like a FreeBSD-ism but since I'm not sure leave it. Modified: stable/11/stand/uboot/common/main.c stable/11/stand/uboot/fdt/uboot_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/uboot/common/main.c ============================================================================== --- stable/11/stand/uboot/common/main.c Wed Feb 20 18:46:31 2019 (r344374) +++ stable/11/stand/uboot/common/main.c Wed Feb 20 18:48:36 2019 (r344375) @@ -444,8 +444,10 @@ main(int argc, char **argv) /* * Enumerate U-Boot devices */ - if ((devs_no = ub_dev_enum()) == 0) - panic("no U-Boot devices found"); + if ((devs_no = ub_dev_enum()) == 0) { + printf("no U-Boot devices found"); + goto do_interact; + } printf("Number of U-Boot devices: %d\n", devs_no); get_load_device(&load_type, &load_unit, &load_slice, &load_partition); @@ -492,6 +494,7 @@ main(int argc, char **argv) env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset); printf("Booting from %s\n", ldev); +do_interact: setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1); Modified: stable/11/stand/uboot/fdt/uboot_fdt.c ============================================================================== --- stable/11/stand/uboot/fdt/uboot_fdt.c Wed Feb 20 18:46:31 2019 (r344374) +++ stable/11/stand/uboot/fdt/uboot_fdt.c Wed Feb 20 18:48:36 2019 (r344375) @@ -39,6 +39,30 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) +static int +fdt_platform_load_from_ubenv(const char *var) +{ + struct fdt_header *hdr; + const char *s; + char *p; + + s = ub_env_get(var); + if (s == NULL || *s == '\0') + return (1); + + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p != '\0') + return (1); + + if (fdt_load_dtb_addr(hdr) == 0) { + printf("Using DTB provided by U-Boot at " + "address %p.\n", hdr); + return (0); + } + + return (1); +} + int fdt_platform_load_dtb(void) { @@ -53,22 +77,12 @@ fdt_platform_load_dtb(void) * variable for fdt data loaded into ram is fdt_addr_r, so try that * first. Board vendors also use both fdtaddr and fdt_addr names. */ - s = ub_env_get("fdt_addr_r"); - if (s == NULL) - s = ub_env_get("fdtaddr"); - if (s == NULL) - s = ub_env_get("fdt_addr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by U-Boot at " - "address %p.\n", hdr); - rv = 0; - goto exit; - } - } - } + if ((rv = fdt_platform_load_from_ubenv("fdt_addr_r")) == 0) + goto exit; + if ((rv = fdt_platform_load_from_ubenv("fdt_addr")) == 0) + goto exit; + if ((rv = fdt_platform_load_from_ubenv("fdtaddr")) == 0) + goto exit; rv = 1; From owner-svn-src-all@freebsd.org Wed Feb 20 19:06: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 5942614FCF2A; Wed, 20 Feb 2019 19:06:00 +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 F049F8EC0D; Wed, 20 Feb 2019 19:05:59 +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 DCD4C9BBF; Wed, 20 Feb 2019 19:05:59 +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 x1KJ5xdn015676; Wed, 20 Feb 2019 19:05:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KJ5wqZ015669; Wed, 20 Feb 2019 19:05:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201905.x1KJ5wqZ015669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 19:05:58 +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: r344376 - in stable/11: stand/libsa sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/libsa sys/ufs/ffs sys/ufs/ufs X-SVN-Commit-Revision: 344376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F049F8EC0D 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 19:06:00 -0000 Author: kevans Date: Wed Feb 20 19:05:58 2019 New Revision: 344376 URL: https://svnweb.freebsd.org/changeset/base/344376 Log: MFC r304850, r305480, r324550-r324551, r324655, r324684: correct mis-merge Some of these commits were improperly MFC'd in the sys/boot => stand mega-MFC, others were simply missed. Correct that mistake now by manually merging the few that were missed and record-only merge on the others. r304850: Unused variables and cstyle fix for loader dosfs r305480: Renumber the advertising clause. r324550: Add $FreeBSD$ to ancient sources that it's missing from. r324551: Move lib/libstand to sys/boot/libsa Move the sources to sys/boot. Make adjustments related to the move. Kill LIBSTAND_SRC since it's no longer needed. r324655: Remove the libstand directory which is now empty. r324684: Remove lib/libstand again, accidentally readded in r324683 Modified: stable/11/stand/libsa/bootparam.h stable/11/stand/libsa/dosfs.c stable/11/stand/libsa/tftp.h stable/11/stand/libsa/ufs.c stable/11/sys/ufs/ffs/fs.h stable/11/sys/ufs/ufs/dir.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/bootparam.h ============================================================================== --- stable/11/stand/libsa/bootparam.h Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/stand/libsa/bootparam.h Wed Feb 20 19:05:58 2019 (r344376) @@ -1,4 +1,5 @@ /* $NetBSD: bootparam.h,v 1.3 1998/01/05 19:19:41 perry Exp $ */ +/* $FreeBSD$ */ int bp_whoami(int sock); int bp_getfile(int sock, char *key, struct in_addr *addrp, char *path); Modified: stable/11/stand/libsa/dosfs.c ============================================================================== --- stable/11/stand/libsa/dosfs.c Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/stand/libsa/dosfs.c Wed Feb 20 19:05:58 2019 (r344376) @@ -426,7 +426,7 @@ dos_readdir(struct open_file *fd, struct dirent *d) u_char fn[261]; DOS_DIR dd; size_t res; - u_int chk, i, x, xdn; + u_int chk, x, xdn; int err; x = chk = 0; @@ -585,7 +585,7 @@ lookup(DOS_FS *fs, u_int clus, const char *name, DOS_D u_char lfn[261]; u_char sfn[13]; u_int nsec, lsec, xdn, chk, sec, ent, x; - int err, ok, i; + int err, ok; if (!clus) for (ent = 0; ent < 2; ent++) Modified: stable/11/stand/libsa/tftp.h ============================================================================== --- stable/11/stand/libsa/tftp.h Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/stand/libsa/tftp.h Wed Feb 20 19:05:58 2019 (r344376) @@ -30,6 +30,7 @@ * (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$ */ Modified: stable/11/stand/libsa/ufs.c ============================================================================== --- stable/11/stand/libsa/ufs.c Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/stand/libsa/ufs.c Wed Feb 20 19:05:58 2019 (r344376) @@ -24,7 +24,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/11/sys/ufs/ffs/fs.h ============================================================================== --- stable/11/sys/ufs/ffs/fs.h Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/sys/ufs/ffs/fs.h Wed Feb 20 19:05:58 2019 (r344376) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/11/sys/ufs/ufs/dir.h ============================================================================== --- stable/11/sys/ufs/ufs/dir.h Wed Feb 20 18:48:36 2019 (r344375) +++ stable/11/sys/ufs/ufs/dir.h Wed Feb 20 19:05:58 2019 (r344376) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-all@freebsd.org Wed Feb 20 19: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 A260514FD1E7; Wed, 20 Feb 2019 19:13:15 +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 3ED208F189; Wed, 20 Feb 2019 19:13:15 +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 29F5D9D78; Wed, 20 Feb 2019 19:13:15 +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 x1KJDFUx022162; Wed, 20 Feb 2019 19:13:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KJD9LO022125; Wed, 20 Feb 2019 19:13:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201913.x1KJD9LO022125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 19:13:09 +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: r344377 - in stable/11/stand: . common efi/boot1 efi/loader i386/gptzfsboot i386/libi386 i386/loader i386/zfsboot i386/zfsloader libsa libsa/zfs ofw/libofw pc98/libpc98 sparc64/loader s... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . common efi/boot1 efi/loader i386/gptzfsboot i386/libi386 i386/loader i386/zfsboot i386/zfsloader libsa libsa/zfs ofw/libofw pc98/libpc98 sparc64/loader sparc64/zfsloader userboot... X-SVN-Commit-Revision: 344377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3ED208F189 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2019 19:13:15 -0000 Author: kevans Date: Wed Feb 20 19:13:09 2019 New Revision: 344377 URL: https://svnweb.freebsd.org/changeset/base/344377 Log: MFC r336084-r336085, r336118: Move zfs impl into libsa r336084: Move ZFS files into libsa Move the libzfs stuff into libsa. There's no need for it to be a separate library. The separate library adds to the issues of build ordering that we see from time to time. Move the filesystem support into libsa, like all the other filesystem support rather than making zfs the odd-duck out. Discussed with: allanjude@ r336085: Stop using ../zfs/libzfs.h but instead use libzfs.h. While ../zfs/libzfs.h mostly works, there are a few situations where it does not. Eliminate the problem by using plain libzfs.h, like we do for ufs support. This fixes the weird cases, and is easier to understand. It also follows the general style convetion of avoiding ../ in #includes. r336118: Remove dirs that git svn should have removed but didn't. Added: stable/11/stand/libsa/zfs/ - copied from r336085, head/stand/libsa/zfs/ Deleted: stable/11/stand/zfs/ stable/11/stand/zfs32/ Modified: stable/11/stand/Makefile stable/11/stand/common/zfs_cmd.c stable/11/stand/defs.mk stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/loader/Makefile stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/libi386/Makefile stable/11/stand/i386/libi386/devicename.c stable/11/stand/i386/loader/Makefile stable/11/stand/i386/loader/conf.c stable/11/stand/i386/loader/main.c stable/11/stand/i386/zfsboot/Makefile stable/11/stand/i386/zfsloader/Makefile stable/11/stand/libsa/Makefile stable/11/stand/loader.mk stable/11/stand/ofw/libofw/Makefile stable/11/stand/ofw/libofw/devicename.c stable/11/stand/pc98/libpc98/Makefile stable/11/stand/sparc64/loader/Makefile stable/11/stand/sparc64/loader/main.c stable/11/stand/sparc64/zfsloader/Makefile stable/11/stand/userboot/userboot/Makefile stable/11/stand/userboot/userboot/conf.c stable/11/stand/userboot/userboot/devicename.c stable/11/stand/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile ============================================================================== --- stable/11/stand/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -6,7 +6,7 @@ # others we don't. LIB32LIST is a list of libraries, which if # included, need to be built 32-bit as well. .if ${MACHINE_ARCH} == "amd64" -LIB32LIST=libsa ficl liblua zfs +LIB32LIST=libsa ficl liblua .endif S.yes+= libsa @@ -17,7 +17,6 @@ S.${MK_LOADER_LUA}+= liblua S.${MK_LOADER_LUA}+= lua S.${MK_FDT}+= fdt S.${MK_LOADER_OFW}+= ofw -S.${MK_ZFS}+= zfs S.yes+= defaults S.yes+= man Modified: stable/11/stand/common/zfs_cmd.c ============================================================================== --- stable/11/stand/common/zfs_cmd.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/common/zfs_cmd.c Wed Feb 20 19:13:09 2019 (r344377) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #ifdef LOADER_ZFS_SUPPORT -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/defs.mk Wed Feb 20 19:13:09 2019 (r344377) @@ -28,7 +28,7 @@ LUASRC= ${SRCTOP}/contrib/lua/src SASRC= ${BOOTSRC}/libsa SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot -ZFSSRC= ${BOOTSRC}/zfs +ZFSSRC= ${SASRC}/zfs BOOTOBJ= ${OBJTOP}/stand Modified: stable/11/stand/efi/boot1/Makefile ============================================================================== --- stable/11/stand/efi/boot1/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/efi/boot1/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -30,7 +30,6 @@ CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein CFLAGS+= -DEFI_ZFS_BOOT -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 @@ -72,8 +71,8 @@ LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA} -LDADD+= ${LIBEFI} ${LIBZFSBOOT} ${LIBSA} +DPADD+= ${LIBEFI} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/efi/loader/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -25,7 +25,6 @@ SRCS= autoload.c \ vers.c .if ${MK_ZFS} != "no" -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes @@ -120,8 +119,7 @@ loader.efi: ${PROG} LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a -DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} \ - ${LDSCRIPT} -LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT} +LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include Modified: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -43,12 +43,6 @@ CFLAGS.clang+= -Wno-tentative-definition-incomplete-ty NO_WCAST_ALIGN= -.if ${MACHINE} == "amd64" -LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a -.endif - CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} @@ -75,7 +69,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c Modified: stable/11/stand/i386/libi386/Makefile ============================================================================== --- stable/11/stand/i386/libi386/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/libi386/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -14,6 +14,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c +CFLAGS+= -I${ZFSSRC} BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} Modified: stable/11/stand/i386/libi386/devicename.c ============================================================================== --- stable/11/stand/i386/libi386/devicename.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/libi386/devicename.c Wed Feb 20 19:13:09 2019 (r344377) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "disk.h" #include "libi386.h" -#include "../zfs/libzfs.h" +#include "libzfs.h" static int i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path); Modified: stable/11/stand/i386/loader/Makefile ============================================================================== --- stable/11/stand/i386/loader/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/loader/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} -LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} +DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} +LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -DLOADER_PREFER_AMD64 Modified: stable/11/stand/i386/loader/conf.c ============================================================================== --- stable/11/stand/i386/loader/conf.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/loader/conf.c Wed Feb 20 19:13:09 2019 (r344377) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include "libi386/libi386.h" #if defined(LOADER_ZFS_SUPPORT) -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif /* Modified: stable/11/stand/i386/loader/main.c ============================================================================== --- stable/11/stand/i386/loader/main.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/loader/main.c Wed Feb 20 19:13:09 2019 (r344377) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "btxv86.h" #ifdef LOADER_ZFS_SUPPORT -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); Modified: stable/11/stand/i386/zfsboot/Makefile ============================================================================== --- stable/11/stand/i386/zfsboot/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/zfsboot/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -37,11 +37,6 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings CFLAGS.gcc+= --param max-inline-insns-single=100 -.if ${MACHINE} == "amd64" -LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a -.endif LD_FLAGS+=${LD_FLAGS_BIN} @@ -82,7 +77,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} SRCS= zfsboot.c Modified: stable/11/stand/i386/zfsloader/Makefile ============================================================================== --- stable/11/stand/i386/zfsloader/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/i386/zfsloader/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -3,5 +3,6 @@ LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 HAVE_ZFS= yes +CFLAGS+= -DBOOTPROG=\"zfsloader\" .include "${.CURDIR}/../loader/Makefile" Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/libsa/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -151,4 +151,9 @@ SRCS+= explicit_bzero.c .include "${SASRC}/geli/Makefile.inc" .endif +# Maybe ZFS +.if ${MK_ZFS} == "yes" +.include "${SASRC}/zfs/Makefile.inc" +.endif + .include Modified: stable/11/stand/loader.mk ============================================================================== --- stable/11/stand/loader.mk Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/loader.mk Wed Feb 20 19:13:09 2019 (r344377) @@ -131,13 +131,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs SRCS+= zfs_cmd.c -.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 -# Have to override to use 32-bit version of zfs library... -# kinda lame to select that there XXX -LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a -.endif .endif LIBFICL= ${BOOTOBJ}/ficl/libficl.a Modified: stable/11/stand/ofw/libofw/Makefile ============================================================================== --- stable/11/stand/ofw/libofw/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/ofw/libofw/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -9,6 +9,7 @@ SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c ofw_time.c openfirm.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c +CFLAGS+= -I${ZFSSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} Modified: stable/11/stand/ofw/libofw/devicename.c ============================================================================== --- stable/11/stand/ofw/libofw/devicename.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/ofw/libofw/devicename.c Wed Feb 20 19:13:09 2019 (r344377) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" -#include "../zfs/libzfs.h" +#include "libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); Modified: stable/11/stand/pc98/libpc98/Makefile ============================================================================== --- stable/11/stand/pc98/libpc98/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/pc98/libpc98/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -12,8 +12,9 @@ SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \ comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c -.PATH: ${BOOTSRC}/zfs +.PATH: ${ZFSSRC} SRCS+= devicename_stubs.c +CFLAGS+= -I${ZFSSRC} BOOT_COMCONSOLE_PORT?= 0x238 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} Modified: stable/11/stand/sparc64/loader/Makefile ============================================================================== --- stable/11/stand/sparc64/loader/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/sparc64/loader/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -44,7 +44,7 @@ LDFLAGS+= -static LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ -DPADD= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} +DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSA} .include Modified: stable/11/stand/sparc64/loader/main.c ============================================================================== --- stable/11/stand/sparc64/loader/main.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/sparc64/loader/main.c Wed Feb 20 19:13:09 2019 (r344377) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef LOADER_ZFS_SUPPORT #include -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif #include Modified: stable/11/stand/sparc64/zfsloader/Makefile ============================================================================== --- stable/11/stand/sparc64/zfsloader/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/sparc64/zfsloader/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -3,5 +3,6 @@ PROG= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 HAVE_ZFS= yes +CFLAGS+= -DBOOTPROG=\"zfsloader\" .include "${.CURDIR}/../loader/Makefile" Modified: stable/11/stand/userboot/userboot/Makefile ============================================================================== --- stable/11/stand/userboot/userboot/Makefile Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/userboot/userboot/Makefile Wed Feb 20 19:13:09 2019 (r344377) @@ -41,14 +41,13 @@ NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a HAVE_ZFS=yes .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. -DPADD+= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBSA} -LDADD+= ${LDR_INTERP} ${LIBZFSBOOT} ${LIBSA} +DPADD+= ${LDR_INTERP} ${LIBSA} +LDADD+= ${LDR_INTERP} ${LIBSA} .include Modified: stable/11/stand/userboot/userboot/conf.c ============================================================================== --- stable/11/stand/userboot/userboot/conf.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/userboot/userboot/conf.c Wed Feb 20 19:13:09 2019 (r344377) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include "libuserboot.h" #if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif /* Modified: stable/11/stand/userboot/userboot/devicename.c ============================================================================== --- stable/11/stand/userboot/userboot/devicename.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/userboot/userboot/devicename.c Wed Feb 20 19:13:09 2019 (r344377) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "libuserboot.h" #if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" +#include "libzfs.h" #endif static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); Modified: stable/11/stand/userboot/userboot/main.c ============================================================================== --- stable/11/stand/userboot/userboot/main.c Wed Feb 20 19:05:58 2019 (r344376) +++ stable/11/stand/userboot/userboot/main.c Wed Feb 20 19:13:09 2019 (r344377) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libuserboot.h" #if defined(USERBOOT_ZFS_SUPPORT) -#include "../zfs/libzfs.h" +#include "libzfs.h" static void userboot_zfs_probe(void); static int userboot_zfs_found; From owner-svn-src-all@freebsd.org Wed Feb 20 19:19: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 349F114FD41F; Wed, 20 Feb 2019 19:19:28 +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 D78A28F4B3; Wed, 20 Feb 2019 19:19:27 +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 C9E739D7A; Wed, 20 Feb 2019 19:19:27 +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 x1KJJRRQ023765; Wed, 20 Feb 2019 19:19:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KJJOij023189; Wed, 20 Feb 2019 19:19:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201919.x1KJJOij023189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 19:19:24 +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: r344378 - in stable/11: stand/common stand/efi/loader stand/i386/libi386 stand/libsa stand/userboot/userboot sys/arm/arm sys/conf sys/kern sys/sys sys/x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/common stand/efi/loader stand/i386/libi386 stand/libsa stand/userboot/userboot sys/arm/arm sys/conf sys/kern sys/sys sys/x86/xen X-SVN-Commit-Revision: 344378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D78A28F4B3 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.998,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)[-0.999,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, 20 Feb 2019 19:19:28 -0000 Author: kevans Date: Wed Feb 20 19:19:24 2019 New Revision: 344378 URL: https://svnweb.freebsd.org/changeset/base/344378 Log: MFC r336244, r336246-r336247: Standardize boot arg parsing r336244: Create helper functions for parsing boot args. boot_parse_arg to parse a single arg boot_parse_cmdline to parse a command line string boot_parse_args to parse all the args in a vector boot_howto_to_env Convert howto bits to env vars boot_env_to_howto Return howto mask mased on what's set in the environment. All these routines return an int that's the bitmask of the args translated to RB_* flags. As a special case, the 'S' flag sets the comconsole_speed env var. Any arg that looks like a=b will set the env key 'a' to value 'b'. If =b is omitted, 'a' is set to '1'. This should help us reduce the number of redundant copies of these routines in the tree. It should also give a more uniform experience between platforms. Also, invent a new flag RB_PROBE that's set when 'P' is parsed. On x86 + BIOS, this means 'probe for the keyboard, and if it's not there set both RB_MULTIPLE and RB_SERIAL (which means show the output on both video and serial consoles, but make serial primary). Others it may be some similar concept of probing, but it's loader dependent what, exactly, it means. These routines are suitable for /boot/loader and/or the kernel, though they may not be suitable for the tightly hand-rolled-for-space environments like boot2. r336246: Eliminate boot loader copies of boot arg parsing. Eliminate 4 of the copies of the arg parsing in /boot/laoder by using boot_parse_cmdline. r336247: Transition to boot_env_to_howto and boot_howto_to_env in the boot loader. Added: stable/11/sys/kern/subr_boot.c - copied unchanged from r336244, head/sys/kern/subr_boot.c Modified: stable/11/stand/common/boot.c stable/11/stand/common/bootstrap.h stable/11/stand/common/metadata.c stable/11/stand/efi/loader/bootinfo.c stable/11/stand/efi/loader/main.c stable/11/stand/i386/libi386/bootinfo.c stable/11/stand/libsa/Makefile stable/11/stand/userboot/userboot/bootinfo.c stable/11/sys/arm/arm/machdep_boot.c stable/11/sys/conf/files stable/11/sys/sys/boot.h stable/11/sys/sys/reboot.h stable/11/sys/x86/xen/pv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/boot.c ============================================================================== --- stable/11/stand/common/boot.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/common/boot.c Wed Feb 20 19:19:24 2019 (r344378) @@ -160,30 +160,6 @@ autoboot_maybe() autoboot(-1, NULL); /* try to boot automatically */ } -int -bootenv_flags() -{ - int i, howto; - char *val; - - for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { - val = getenv(howto_names[i].ev); - if (val != NULL && strcasecmp(val, "no") != 0) - howto |= howto_names[i].mask; - } - return (howto); -} - -void -bootenv_set(int howto) -{ - int i; - - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); -} - static int autoboot(int timeout, char *prompt) { Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/common/bootstrap.h Wed Feb 20 19:19:24 2019 (r344378) @@ -63,8 +63,6 @@ int parse(int *argc, char ***argv, const char *str); /* boot.c */ void autoboot_maybe(void); int getrootmount(char *rootdev); -int bootenv_flags(void); -void bootenv_set(int); /* misc.c */ char *unargv(int argc, char *argv[]); Modified: stable/11/stand/common/metadata.c ============================================================================== --- stable/11/stand/common/metadata.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/common/metadata.c Wed Feb 20 19:19:24 2019 (r344378) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(LOADER_FDT_SUPPORT) #include @@ -96,62 +97,11 @@ md_bootserial(void) static int md_getboothowto(char *kargs) { - char *cp; int howto; - int active; /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) { - active = 1; - } else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } - - howto |= bootenv_flags(); + howto = boot_parse_cmdline(kargs); + howto |= boot_env_to_howto(); #if defined(__sparc64__) if (md_bootserial() != -1) howto |= RB_SERIAL; Modified: stable/11/stand/efi/loader/bootinfo.c ============================================================================== --- stable/11/stand/efi/loader/bootinfo.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/efi/loader/bootinfo.c Wed Feb 20 19:19:24 2019 (r344378) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,12 +60,6 @@ int bi_load(char *args, vm_offset_t *modulep, vm_offse extern EFI_SYSTEM_TABLE *ST; -static const char howto_switches[] = "aCdrgDmphsv"; -static int howto_masks[] = { - RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, - RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE -}; - static int bi_getboothowto(char *kargs) { @@ -73,7 +68,8 @@ bi_getboothowto(char *kargs) char *console; int howto; - howto = bootenv_flags(); + howto = boot_parse_cmdline(kargs); + howto |= boot_env_to_howto(); console = getenv("console"); if (console != NULL) { @@ -81,21 +77,6 @@ bi_getboothowto(char *kargs) howto |= RB_SERIAL; if (strcmp(console, "nullconsole") == 0) howto |= RB_MUTE; - } - - /* Parse kargs */ - if (kargs == NULL) - return (howto); - - opts = strchr(kargs, '-'); - while (opts != NULL) { - while (*(++opts) != '\0') { - sw = strchr(howto_switches, *opts); - if (sw == NULL) - break; - howto |= howto_masks[sw - howto_switches]; - } - opts = strchr(opts, '-'); } return (howto); Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/efi/loader/main.c Wed Feb 20 19:19:24 2019 (r344378) @@ -28,11 +28,13 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include +#include #include -#include #include #include #include @@ -420,79 +422,10 @@ parse_args(int argc, CHAR16 *argv[], bool has_kbd) */ howto = 0; for (i = 1; i < argc; i++) { - if (argv[i][0] == '-') { - for (j = 1; argv[i][j] != 0; j++) { - int ch; - - ch = argv[i][j]; - switch (ch) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'P': - if (!has_kbd) - howto |= RB_SERIAL | RB_MULTIPLE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'S': - if (argv[i][j + 1] == 0) { - if (i + 1 == argc) { - setenv("comconsole_speed", "115200", 1); - } else { - cpy16to8(&argv[i + 1][0], var, - sizeof(var)); - setenv("comconsole_speed", var, 1); - } - i++; - break; - } else { - cpy16to8(&argv[i][j + 1], var, - sizeof(var)); - setenv("comconsole_speed", var, 1); - break; - } - case 'v': - howto |= RB_VERBOSE; - break; - } - } - } else { - vargood = false; - for (j = 0; argv[i][j] != 0; j++) { - if (j == sizeof(var)) { - vargood = false; - break; - } - if (j > 0 && argv[i][j] == '=') - vargood = true; - var[j] = (char)argv[i][j]; - } - if (vargood) { - var[j] = 0; - putenv(var); - } - } + cpy16to8(argv[i], var, sizeof(var)); + howto |= boot_parse_arg(var); } + return (howto); } @@ -550,7 +483,7 @@ main(int argc, CHAR16 *argv[]) howto = parse_args(argc, argv, has_kbd); - bootenv_set(howto); + boot_howto_to_env(howto); /* * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables Modified: stable/11/stand/i386/libi386/bootinfo.c ============================================================================== --- stable/11/stand/i386/libi386/bootinfo.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/i386/libi386/bootinfo.c Wed Feb 20 19:19:24 2019 (r344378) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" #include "libi386.h" @@ -38,63 +39,12 @@ __FBSDID("$FreeBSD$"); int bi_getboothowto(char *kargs) { - char *cp; char *curpos, *next, *string; int howto; - int active; int vidconsole; - /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) { - active = 1; - } else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } - howto |= bootenv_flags(); + howto = boot_parse_cmdline(kargs); + howto |= boot_env_to_howto(); /* Enable selected consoles */ string = next = strdup(getenv("console")); @@ -130,7 +80,7 @@ void bi_setboothowto(int howto) { - bootenv_set(howto); + boot_howto_to_env(howto); } /* Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/libsa/Makefile Wed Feb 20 19:19:24 2019 (r344378) @@ -37,6 +37,10 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ .PATH: ${LIBC_SRC}/stdlib SRCS+= abs.c strtol.c strtoll.c strtoul.c strtoull.c +# common boot code +.PATH: ${SYSDIR}/kern +SRCS+= subr_boot.c + .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC_SRC}/arm/gen Modified: stable/11/stand/userboot/userboot/bootinfo.c ============================================================================== --- stable/11/stand/userboot/userboot/bootinfo.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/stand/userboot/userboot/bootinfo.c Wed Feb 20 19:19:24 2019 (r344378) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" @@ -38,65 +39,13 @@ __FBSDID("$FreeBSD$"); int bi_getboothowto(char *kargs) { - char *cp; char *curpos, *next, *string; int howto; - int active; int vidconsole; - /* Parse kargs */ - howto = 0; - if (kargs != NULL) { - cp = kargs; - active = 0; - while (*cp != 0) { - if (!active && (*cp == '-')) { - active = 1; - } else if (active) - switch (*cp) { - case 'a': - howto |= RB_ASKNAME; - break; - case 'C': - howto |= RB_CDROM; - break; - case 'd': - howto |= RB_KDB; - break; - case 'D': - howto |= RB_MULTIPLE; - break; - case 'm': - howto |= RB_MUTE; - break; - case 'g': - howto |= RB_GDB; - break; - case 'h': - howto |= RB_SERIAL; - break; - case 'p': - howto |= RB_PAUSE; - break; - case 'r': - howto |= RB_DFLTROOT; - break; - case 's': - howto |= RB_SINGLE; - break; - case 'v': - howto |= RB_VERBOSE; - break; - default: - active = 0; - break; - } - cp++; - } - } + howto = boot_parse_cmdline(kargs); + howto |= boot_env_to_howto(); - howto |= bootenv_flags(); - /* Enable selected consoles */ string = next = strdup(getenv("console")); vidconsole = 0; @@ -117,7 +66,8 @@ bi_getboothowto(char *kargs) /* * XXX: Note that until the kernel is ready to respect multiple consoles - * for the boot messages, the first named console is the primary console + * for the messages from /etc/rc, the first named console is the primary + * console */ if (!strcmp(string, "vidconsole")) howto &= ~RB_SERIAL; @@ -131,7 +81,7 @@ void bi_setboothowto(int howto) { - bootenv_set(howto); + boot_howto_to_env(howto); } /* Modified: stable/11/sys/arm/arm/machdep_boot.c ============================================================================== --- stable/11/sys/arm/arm/machdep_boot.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/sys/arm/arm/machdep_boot.c Wed Feb 20 19:19:24 2019 (r344378) @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static char static_kenv[4096]; + extern int *end; static uint32_t board_revision; @@ -146,9 +148,8 @@ arm_print_kenv(void) static void cmdline_set_env(char *cmdline, const char *guard) { - char *cmdline_next, *env; + char *cmdline_next; size_t size, guard_len; - int i; size = strlen(cmdline); /* Skip leading spaces. */ @@ -164,37 +165,27 @@ cmdline_set_env(char *cmdline, const char *guard) size -= guard_len; } - /* Skip leading spaces. */ - for (; isspace(*cmdline) && (size > 0); cmdline++) - size--; - - /* Replace ',' with '\0'. */ - /* TODO: implement escaping for ',' character. */ - cmdline_next = cmdline; - while(strsep(&cmdline_next, ",") != NULL) - ; - init_static_kenv(cmdline, 0); - /* Parse boothowto. */ - for (i = 0; howto_names[i].ev != NULL; i++) { - env = kern_getenv(howto_names[i].ev); - if (env != NULL) { - if (strtoul(env, NULL, 10) != 0) - boothowto |= howto_names[i].mask; - freeenv(env); - } - } + boothowto |= boot_parse_cmdline(); } +/* + * Called for armv6 and newer. + */ void arm_parse_fdt_bootargs(void) { #ifdef FDT if (loader_envp == NULL && fdt_get_chosen_bootargs(linux_command_line, - LBABI_MAX_COMMAND_LINE) == 0) + LBABI_MAX_COMMAND_LINE) == 0) { + init_static_kenv(static_kenv, sizeof(static_kenv)); cmdline_set_env(linux_command_line, CMDLINE_GUARD); + } #endif } +/* + * Called for armv[45]. + */ static vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp) { @@ -271,6 +262,7 @@ linux_parse_boot_param(struct arm_boot_params *abp) (char *)walker - (char *)atag_list + ATAG_SIZE(walker)); lastaddr = fake_preload_metadata(abp, NULL, 0); + init_static_kenv(static_kenv, sizeof(static_kenv)); cmdline_set_env(linux_command_line, CMDLINE_GUARD); return lastaddr; } Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/sys/conf/files Wed Feb 20 19:19:24 2019 (r344378) @@ -3675,6 +3675,7 @@ kern/subr_acl_nfs4.c optional ufs_acl | zfs kern/subr_acl_posix1e.c optional ufs_acl kern/subr_autoconf.c standard kern/subr_blist.c standard +kern/subr_boot.c standard kern/subr_bus.c standard kern/subr_bus_dma.c standard kern/subr_bufring.c standard Copied: stable/11/sys/kern/subr_boot.c (from r336244, head/sys/kern/subr_boot.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/kern/subr_boot.c Wed Feb 20 19:19:24 2019 (r344378, copy of r336244, head/sys/kern/subr_boot.c) @@ -0,0 +1,223 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 1998 Michael Smith + * All Rights Reserved. + * Copyright (c) 1998 Robert Nordier + * All Rights Reserved. + * Copyright (c) 2009, Oleksandr Tymoshenko + * All rights reserved. + * Copyright (c) 2014 Roger Pau Monné + * All Rights Reserved. + * Copyright (c) 2018 Kyle Evans + * Copyright (c) 2018 Netflix + * + * 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 + * in this position and unchanged. + * 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$"); + +/* Note: This is compiled in both the kernel and boot loader contexts */ + +#include +#ifdef _KERNEL +#include +#else +#include +#endif +#include +#include + +#ifdef _KERNEL +#define SETENV(k, v) kern_setenv(k, v) +#define GETENV(k) kern_getenv(k) +#define FREE(v) freeenv(v) +#else /* Boot loader */ +#define SETENV(k, v) setenv(k, v, 1) +#define GETENV(k) getenv(k) +#define FREE(v) +#endif + +static struct +{ + const char *ev; + int mask; +} howto_names[] = { + { "boot_askname", RB_ASKNAME}, + { "boot_cdrom", RB_CDROM}, + { "boot_ddb", RB_KDB}, + { "boot_dfltroot", RB_DFLTROOT}, + { "boot_gdb", RB_GDB}, + { "boot_multicons", RB_MULTIPLE}, + { "boot_mute", RB_MUTE}, + { "boot_pause", RB_PAUSE}, + { "boot_serial", RB_SERIAL}, + { "boot_single", RB_SINGLE}, + { "boot_verbose", RB_VERBOSE}, + { NULL, 0} +}; + +/* + * In the boot environment, we often parse a command line and have to throw away + * its contents. As we do so, we set environment variables that correspond to + * the flags we encounter. Later, to get a howto mask, we grovel through these + * to reconstruct it. This also allows users in their loader.conf to set them + * and have the kernel see them. + */ + +/** + * @brief convert the env vars in howto_names into a howto mask + */ +int +boot_env_to_howto(void) +{ + int i, howto; + char *val; + + for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { + val = GETENV(howto_names[i].ev); + if (val != NULL && strcasecmp(val, "no") != 0) + howto |= howto_names[i].mask; + FREE(val); + } + return (howto); +} + +/** + * @brief Set env vars from howto_names based on howto passed in + */ +void +boot_howto_to_env(int howto) +{ + int i; + + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + SETENV(howto_names[i].ev, "YES"); +} + +/** + * @brief Helper routine to parse a single arg and return its mask + * + * Parse all the - options to create a mask (or a serial speed in the + * case of -S). If the arg doesn't start with '-' assume it's an env + * variable and set that instead. + */ +int +boot_parse_arg(char *v) +{ + char *n; + int howto; + +#if 0 +/* Need to see if this is better or worse than the meat of the #else */ +static const char howto_switches[] = "aCdrgDmphsv"; +static int howto_masks[] = { + RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, + RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE +}; + + opts = strchr(kargs, '-'); + while (opts != NULL) { + while (*(++opts) != '\0') { + sw = strchr(howto_switches, *opts); + if (sw == NULL) + break; + howto |= howto_masks[sw - howto_switches]; + } + opts = strchr(opts, '-'); + } +#else + howto = 0; + if (*v == '-') { + while (*v != '\0') { + v++; + switch (*v) { + case 'a': howto |= RB_ASKNAME; break; + case 'C': howto |= RB_CDROM; break; + case 'd': howto |= RB_KDB; break; + case 'D': howto |= RB_MULTIPLE; break; + case 'm': howto |= RB_MUTE; break; + case 'g': howto |= RB_GDB; break; + case 'h': howto |= RB_SERIAL; break; + case 'p': howto |= RB_PAUSE; break; + case 'P': howto |= RB_PROBE; break; + case 'r': howto |= RB_DFLTROOT; break; + case 's': howto |= RB_SINGLE; break; + case 'S': SETENV("comconsole_speed", v + 1); v += strlen(v); break; + case 'v': howto |= RB_VERBOSE; break; + } + } + } else { + n = strsep(&v, "="); + if (v == NULL) + SETENV(n, "1"); + else + SETENV(n, v); + } +#endif + return (howto); +} + +/** + * @brief breakup the command line into args, and pass to boot_parse_arg + */ +int +boot_parse_cmdline_delim(char *cmdline, const char *delim) +{ + char *v; + int howto; + + howto = 0; + while ((v = strsep(&cmdline, delim)) != NULL) { + if (*v == '\0') + continue; + howto |= boot_parse_arg(v); + } + return (howto); +} + +/** + * @brief Simplified interface for common 'space separated' args + */ +int +boot_parse_cmdline(char *cmdline) +{ + + return (boot_parse_cmdline_delim(cmdline, " \n")); +} + +/** + * @brief Pass a vector of strings to boot_parse_arg + */ +int +boot_parse_args(int argc, char *argv[]) +{ + int i, howto; + + howto = 0; + for (i = 1; i < argc; i++) + howto |= boot_parse_arg(argv[i]); + return (howto); +} Modified: stable/11/sys/sys/boot.h ============================================================================== --- stable/11/sys/sys/boot.h Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/sys/sys/boot.h Wed Feb 20 19:19:24 2019 (r344378) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2018 Netflix * Copyright (c) 2014 Roger Pau Monné * All rights reserved. * @@ -29,27 +30,11 @@ #ifndef _SYS_BOOT_H_ #define _SYS_BOOT_H_ -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - { "boot_askname", RB_ASKNAME}, - { "boot_cdrom", RB_CDROM}, - { "boot_ddb", RB_KDB}, - { "boot_dfltroot", RB_DFLTROOT}, - { "boot_gdb", RB_GDB}, - { "boot_multicons", RB_MULTIPLE}, - { "boot_mute", RB_MUTE}, - { "boot_pause", RB_PAUSE}, - { "boot_serial", RB_SERIAL}, - { "boot_single", RB_SINGLE}, - { "boot_verbose", RB_VERBOSE}, - { NULL, 0} -}; +int boot_env_to_howto(void); +void boot_howto_to_env(int howto); +int boot_parse_arg(char *v); +int boot_parse_cmdline_delim(char *cmdline, const char *delim); +int boot_parse_cmdline(char *cmdline); +int boot_parse_args(int argc, char *argv[]); #endif /* !_SYS_BOOT_H_ */ Modified: stable/11/sys/sys/reboot.h ============================================================================== --- stable/11/sys/sys/reboot.h Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/sys/sys/reboot.h Wed Feb 20 19:19:24 2019 (r344378) @@ -60,6 +60,7 @@ #define RB_RESERVED2 0x80000 /* reserved for internal use of boot blocks */ #define RB_PAUSE 0x100000 /* pause after each output line during probe */ #define RB_REROOT 0x200000 /* unmount the rootfs and mount it again */ +#define RB_PROBE 0x10000000 /* Probe multiple consoles */ #define RB_MULTIPLE 0x20000000 /* use multiple consoles */ #define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */ Modified: stable/11/sys/x86/xen/pv.c ============================================================================== --- stable/11/sys/x86/xen/pv.c Wed Feb 20 19:13:09 2019 (r344377) +++ stable/11/sys/x86/xen/pv.c Wed Feb 20 19:19:24 2019 (r344378) @@ -300,21 +300,6 @@ xen_pv_set_env(void) init_static_kenv(cmd_line, 0); } -static void -xen_pv_set_boothowto(void) -{ - int i; - char *env; - - /* get equivalents from the environment */ - for (i = 0; howto_names[i].ev != NULL; i++) { - if ((env = kern_getenv(howto_names[i].ev)) != NULL) { - boothowto |= howto_names[i].mask; - freeenv(env); - } - } -} - #ifdef DDB /* * The way Xen loads the symtab is different from the native boot loader, @@ -413,7 +398,7 @@ xen_pv_parse_preload_data(u_int64_t modulep) } else { /* Parse the extra boot information given by Xen */ xen_pv_set_env(); - xen_pv_set_boothowto(); + boothowto |= boot_env_to_howto(); kmdp = NULL; } From owner-svn-src-all@freebsd.org Wed Feb 20 19:32: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 D4E8914FD954; Wed, 20 Feb 2019 19:32:03 +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 726C26823A; Wed, 20 Feb 2019 19:32:03 +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 2D6E2A0E7; Wed, 20 Feb 2019 19:32:03 +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 x1KJW3dX034482; Wed, 20 Feb 2019 19:32:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KJW2jK034477; Wed, 20 Feb 2019 19:32:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902201932.x1KJW2jK034477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 19:32:02 +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: r344379 - in stable/11: stand/i386/kgzldr sys/conf sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/i386/kgzldr sys/conf sys/kern X-SVN-Commit-Revision: 344379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 726C26823A 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.998,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)[-0.999,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, 20 Feb 2019 19:32:04 -0000 Author: kevans Date: Wed Feb 20 19:32:02 2019 New Revision: 344379 URL: https://svnweb.freebsd.org/changeset/base/344379 Log: MFC r306681, r336249-r336250, r336261: remove inflate conflict r306681: ANSIfy inflate.c Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8143 r336249: Fix sparc64 builds gcc is complaining about struct infate being defined in a parameter list. It's inclear how long this has been broken, but the fix is simple enough. r336250: There's two files in the sys tree named inflate.c, in addition to it being a common name elsewhere. Rename the old kzip one to subr_inflate.c. This actually fixes the build issues on sparc64 that my inclusion of .PATH ${SYSDIR}/kern created in r336244, so also revert the broken workaround I committed in r336249. This slipped passed me because apparently, I never did a clean build. r336261: Catch up to the inflate renaming. Added: stable/11/sys/kern/subr_inflate.c (contents, props changed) - copied, changed from r344378, stable/11/sys/kern/inflate.c Deleted: stable/11/sys/kern/inflate.c Modified: stable/11/stand/i386/kgzldr/Makefile stable/11/sys/conf/Makefile.arm stable/11/sys/conf/files Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/kgzldr/Makefile ============================================================================== --- stable/11/stand/i386/kgzldr/Makefile Wed Feb 20 19:19:24 2019 (r344378) +++ stable/11/stand/i386/kgzldr/Makefile Wed Feb 20 19:32:02 2019 (r344379) @@ -7,7 +7,7 @@ STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -SRCS= start.s boot.c inflate.c lib.c crt.s sio.s +SRCS= start.s boot.c subr_inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= Modified: stable/11/sys/conf/Makefile.arm ============================================================================== --- stable/11/sys/conf/Makefile.arm Wed Feb 20 19:19:24 2019 (r344378) +++ stable/11/sys/conf/Makefile.arm Wed Feb 20 19:32:02 2019 (r344379) @@ -111,7 +111,7 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S gzip -f9 ${KERNEL_KO}.tmp eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h - ${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/inflate.c -o \ + ${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/subr_inflate.c -o \ inflate-tramp.o ${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker ldscript.$M.tramp \ -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \ Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Feb 20 19:19:24 2019 (r344378) +++ stable/11/sys/conf/files Wed Feb 20 19:32:02 2019 (r344379) @@ -3581,7 +3581,6 @@ kern/imgact_binmisc.c optional imagact_binmisc kern/imgact_elf.c standard kern/imgact_elf32.c optional compat_freebsd32 kern/imgact_shell.c standard -kern/inflate.c optional gzip kern/init_main.c standard kern/init_sysent.c standard kern/ksched.c optional _kposix_priority_scheduling @@ -3690,6 +3689,7 @@ kern/subr_firmware.c optional firmware kern/subr_gtaskqueue.c standard kern/subr_hash.c standard kern/subr_hints.c standard +kern/subr_inflate.c optional gzip kern/subr_kdb.c standard kern/subr_kobj.c standard kern/subr_lock.c standard Copied and modified: stable/11/sys/kern/subr_inflate.c (from r344378, stable/11/sys/kern/inflate.c) ============================================================================== --- stable/11/sys/kern/inflate.c Wed Feb 20 19:19:24 2019 (r344378, copy source) +++ stable/11/sys/kern/subr_inflate.c Wed Feb 20 19:32:02 2019 (r344379) @@ -411,16 +411,19 @@ static const int dbits = 6; /* bits in base distance l The code with value 256 is special, and the tables are constructed so that no bits beyond that code are fetched when that code is decoded. */ +/* + * Arguments: + * b code lengths in bits (all assumed <= BMAX) + * n number of codes (assumed <= N_MAX) + * s number of simple-valued codes (0..s-1) + * d list of base values for non-simple codes + * e list of extra bits for non-simple codes + * t result: starting table + * m maximum lookup bits, returns actual + */ static int -huft_build(glbl, b, n, s, d, e, t, m) - struct inflate *glbl; - unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ - unsigned n; /* number of codes (assumed <= N_MAX) */ - unsigned s; /* number of simple-valued codes (0..s-1) */ - const ush *d; /* list of base values for non-simple codes */ - const ush *e; /* list of extra bits for non-simple codes */ - struct huft **t; /* result: starting table */ - int *m; /* maximum lookup bits, returns actual */ +huft_build(struct inflate *glbl, unsigned *b, unsigned n, unsigned s, + const ush *d, const ush *e, struct huft **t, int *m) { unsigned a; /* counter for codes of length k */ unsigned c[BMAX + 1]; /* bit length count table */ @@ -614,10 +617,12 @@ huft_build(glbl, b, n, s, d, e, t, m) return y != 0 && g != 1; } +/* + * Arguments: + * t table to free + */ static int -huft_free(glbl, t) - struct inflate *glbl; - struct huft *t; /* table to free */ +huft_free(struct inflate *glbl, struct huft *t) /* Free the malloc'ed tables built by huft_build(), which makes a linked list of the tables it made, with the links in a dummy first entry of each table. */ @@ -636,11 +641,14 @@ huft_free(glbl, t) /* inflate (decompress) the codes in a deflated (compressed) block. Return an error code or zero if it all goes ok. */ +/* + * Arguments: + * tl, td literal/length and distance decoder tables + * bl, bd number of bits decoded by tl[] and td[] + */ static int -inflate_codes(glbl, tl, td, bl, bd) - struct inflate *glbl; - struct huft *tl, *td;/* literal/length and distance decoder tables */ - int bl, bd; /* number of bits decoded by tl[] and td[] */ +inflate_codes(struct inflate *glbl, struct huft *tl, struct huft*td, int bl, + int bd) { unsigned e; /* table entry flag/number of extra bits */ unsigned n, d; /* length and index for copy */ @@ -733,8 +741,7 @@ inflate_codes(glbl, tl, td, bl, bd) /* "decompress" an inflated type 0 (stored) block. */ static int -inflate_stored(glbl) - struct inflate *glbl; +inflate_stored(struct inflate *glbl) { unsigned n; /* number of bytes in block */ unsigned w; /* current window position */ @@ -780,8 +787,7 @@ inflate_stored(glbl) either replace this with a custom decoder, or at least precompute the Huffman tables. */ static int -inflate_fixed(glbl) - struct inflate *glbl; +inflate_fixed(struct inflate *glbl) { /* if first time, set up tables for fixed blocks */ if (glbl->gz_fixed_tl == (struct huft *) NULL) { @@ -822,8 +828,7 @@ inflate_fixed(glbl) /* decompress an inflated type 2 (dynamic Huffman codes) block. */ static int -inflate_dynamic(glbl) - struct inflate *glbl; +inflate_dynamic(struct inflate *glbl) { int i; /* temporary variables */ unsigned j; @@ -967,10 +972,12 @@ inflate_dynamic(glbl) } /* decompress an inflated block */ +/* + * Arguments: + * e last block flag + */ static int -inflate_block(glbl, e) - struct inflate *glbl; - int *e; /* last block flag */ +inflate_block(struct inflate *glbl, int *e) { unsigned t; /* block type */ ulg b; /* bit buffer */ @@ -1007,8 +1014,7 @@ inflate_block(glbl, e) /* decompress an inflated entry */ static int -xinflate(glbl) - struct inflate *glbl; +xinflate(struct inflate *glbl) { int e; /* last block flag */ int r; /* result code */ @@ -1040,8 +1046,7 @@ xinflate(glbl) /* Nobody uses this - why not? */ int -inflate(glbl) - struct inflate *glbl; +inflate(struct inflate *glbl) { int i; #ifdef _KERNEL From owner-svn-src-all@freebsd.org Wed Feb 20 20:17: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 9D27714DA555; Wed, 20 Feb 2019 20:17:55 +0000 (UTC) (envelope-from dim@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 31F466B735; Wed, 20 Feb 2019 20:17:55 +0000 (UTC) (envelope-from dim@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 2336EA7D2; Wed, 20 Feb 2019 20:17:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKHtlu062413; Wed, 20 Feb 2019 20:17:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKHtGZ062412; Wed, 20 Feb 2019 20:17:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902202017.x1KKHtGZ062412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 20 Feb 2019 20:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344381 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 344381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31F466B735 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)[-0.999,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, 20 Feb 2019 20:17:55 -0000 Author: dim Date: Wed Feb 20 20:17:54 2019 New Revision: 344381 URL: https://svnweb.freebsd.org/changeset/base/344381 Log: Fix more AddressSanitizer violations in usr.bin/top In line_update(), set lastcol correctly after moving to any non-zero column, so the "overwrite old stuff" part does not attempt to address negative offsets in the current line. Rewrite setup_buffer() to always allocate at least 80 characters, otherwise various calls to summary_format() will overwrite the end of the buffers, if the screen width gets small enough. MFC after: 1 week Modified: head/usr.bin/top/display.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Wed Feb 20 20:09:59 2019 (r344380) +++ head/usr.bin/top/display.c Wed Feb 20 20:17:54 2019 (r344381) @@ -378,13 +378,13 @@ u_procstates(int total, int *brkdn) if (ltotal != total) { /* move and overwrite */ -if (x_procstate == 0) { - Move_to(x_procstate, y_procstate); -} -else { - /* cursor is already there...no motion needed */ - assert(lastline == 1); -} + if (x_procstate == 0) { + Move_to(x_procstate, y_procstate); + } + else { + /* cursor is already there...no motion needed */ + assert(lastline == 1); + } printf("%d", total); /* if number of digits differs, rewrite the label */ @@ -1205,7 +1205,7 @@ line_update(char *old, char *new, int start, int line) cursor_on_line = true; putchar(ch); *old = ch; - lastcol = 1; + lastcol = start + 1; } old++; @@ -1341,33 +1341,27 @@ i_uptime(struct timeval *bt, time_t *tod) } } +#define SETUPBUFFER_MIN_SCREENWIDTH 80 #define SETUPBUFFER_REQUIRED_ADDBUFSIZ 2 static char * setup_buffer(char *buffer, int addlen) { - char *b = NULL; + size_t len; - if (NULL == buffer) { - setup_buffer_bufsiz = screen_width; - b = calloc(setup_buffer_bufsiz + addlen + - SETUPBUFFER_REQUIRED_ADDBUFSIZ, - sizeof(char)); - } else { - if (screen_width > setup_buffer_bufsiz) { - setup_buffer_bufsiz = screen_width; - free(buffer); - b = calloc(setup_buffer_bufsiz + addlen + - SETUPBUFFER_REQUIRED_ADDBUFSIZ, - sizeof(char)); - } else { - b = buffer; - } - } + setup_buffer_bufsiz = screen_width; + if (setup_buffer_bufsiz < SETUPBUFFER_MIN_SCREENWIDTH) + { + setup_buffer_bufsiz = SETUPBUFFER_MIN_SCREENWIDTH; + } - if (NULL == b) { - errx(4, "can't allocate sufficient memory"); - } + free(buffer); + len = setup_buffer_bufsiz + addlen + SETUPBUFFER_REQUIRED_ADDBUFSIZ; + buffer = calloc(len, sizeof(char)); + if (buffer == NULL) + { + errx(4, "can't allocate sufficient memory"); + } - return b; + return buffer; } From owner-svn-src-all@freebsd.org Wed Feb 20 20:28: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 B33E214DA9DE; Wed, 20 Feb 2019 20:28:50 +0000 (UTC) (envelope-from dim@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 583AC6BE95; Wed, 20 Feb 2019 20:28:50 +0000 (UTC) (envelope-from dim@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 4A012A99E; Wed, 20 Feb 2019 20:28:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKSoDt069258; Wed, 20 Feb 2019 20:28:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKSmDq069247; Wed, 20 Feb 2019 20:28:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902202028.x1KKSmDq069247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 20 Feb 2019 20:28:48 +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: r344382 - stable/12/usr.bin/top X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/usr.bin/top X-SVN-Commit-Revision: 344382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 583AC6BE95 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 20:28:51 -0000 Author: dim Date: Wed Feb 20 20:28:48 2019 New Revision: 344382 URL: https://svnweb.freebsd.org/changeset/base/344382 Log: MFC r343165 (by jhibbits): Fix top(1) long options handling getopt_long(3) requires the long options be terminated by a NULL block. Without the terminator, an invalid long option results in a segmentation fault. Reported by: Brandon Bergren MFC r343957: Fix multiple warnings in usr.bin/top about discarded qualifiers from both clang and gcc, by either constifying variables, or when that is not possible, using __DECONST. MFC r343958: Fix multiple warnings in usr.bin/top about variables shadowing global declarations from base gcc, by renaming those variables. MFC r343959: Fix the first couple of AddressSanitizer violations in usr.bin/top. Avoid setting zero bytes beyond the length of the 'thisline' parameters in i_process() and u_process(), and don't attempt to memset a negative number of bytes. Modified: stable/12/usr.bin/top/Makefile stable/12/usr.bin/top/display.c stable/12/usr.bin/top/display.h stable/12/usr.bin/top/machine.c stable/12/usr.bin/top/top.c stable/12/usr.bin/top/username.c stable/12/usr.bin/top/utils.c stable/12/usr.bin/top/utils.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/top/Makefile ============================================================================== --- stable/12/usr.bin/top/Makefile Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/Makefile Wed Feb 20 20:28:48 2019 (r344382) @@ -7,14 +7,5 @@ SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c MAN= top.1 -.if ${COMPILER_TYPE} == "gcc" -.if ${COMPILER_VERSION} >= 50000 -CFLAGS.gcc=-Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types -.else #base gcc -NO_WERROR= -.endif -.endif -CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers - LIBADD= ncursesw m kvm jail util sbuf .include Modified: stable/12/usr.bin/top/display.c ============================================================================== --- stable/12/usr.bin/top/display.c Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/display.c Wed Feb 20 20:28:48 2019 (r344382) @@ -184,7 +184,7 @@ int display_init(struct statics * statics) { int lines; - char **pp; + const char * const *pp; int *ip; int i; @@ -516,8 +516,8 @@ void z_cpustates(void) { int i = 0; - const char **names; - char *thisname; + const char * const *names; + const char *thisname; int cpu, value; for (cpu = 0; cpu < num_cpus; cpu++) { @@ -751,7 +751,7 @@ static int header_length; * allocated area with the trimmed header. */ -const char * +char * trim_header(const char *text) { char *s; @@ -829,7 +829,11 @@ i_process(int line, char *thisline) } /* truncate the line to conform to our current screen width */ - thisline[screen_width] = '\0'; + int len = strlen(thisline); + if (screen_width < len) + { + thisline[screen_width] = '\0'; + } /* write the line out */ fputs(thisline, stdout); @@ -839,7 +843,10 @@ i_process(int line, char *thisline) p = stpcpy(base, thisline); /* zero fill the rest of it */ - memset(p, 0, screen_width - (p - base)); + if (p - base < screen_width) + { + memset(p, 0, screen_width - (p - base)); + } } void @@ -853,7 +860,11 @@ u_process(int line, char *newline) bufferline = &screenbuf[lineindex(line)]; /* truncate the line to conform to our current screen width */ - newline[screen_width] = '\0'; + int len = strlen(newline); + if (screen_width < len) + { + newline[screen_width] = '\0'; + } /* is line higher than we went on the last display? */ if (line >= last_hi) @@ -878,7 +889,10 @@ u_process(int line, char *newline) optr = stpcpy(bufferline, newline); /* zero fill the rest of it */ - memset(optr, 0, screen_width - (optr - bufferline)); + if (optr - bufferline < screen_width) + { + memset(optr, 0, screen_width - (optr - bufferline)); + } } else { Modified: stable/12/usr.bin/top/display.h ============================================================================== --- stable/12/usr.bin/top/display.h Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/display.h Wed Feb 20 20:28:48 2019 (r344382) @@ -27,7 +27,7 @@ void i_timeofday(time_t *tod); void i_uptime(struct timeval *bt, time_t *tod); void new_message(int type, const char *msgfmt, ...); int readline(char *buffer, int size, int numeric); -const char *trim_header(const char *text); +char *trim_header(const char *text); void u_arc(int *stats); void u_carc(int *stats); void u_cpustates(int *states); Modified: stable/12/usr.bin/top/machine.c ============================================================================== --- stable/12/usr.bin/top/machine.c Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/machine.c Wed Feb 20 20:28:48 2019 (r344382) @@ -618,7 +618,7 @@ get_old_proc(struct kinfo_proc *pp) pp->ki_udata = NOPROC; return (NULL); } - pp->ki_udata = oldp; + pp->ki_udata = __DECONST(void *, oldp); return (oldp); } @@ -634,7 +634,7 @@ get_io_stats(const struct kinfo_proc *pp, long *inp, l static struct kinfo_proc dummy; long ret; - oldp = get_old_proc(pp); + oldp = get_old_proc(__DECONST(struct kinfo_proc *, pp)); if (oldp == NULL) { memset(&dummy, 0, sizeof(dummy)); oldp = &dummy; Modified: stable/12/usr.bin/top/top.c ============================================================================== --- stable/12/usr.bin/top/top.c Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/top.c Wed Feb 20 20:28:48 2019 (r344382) @@ -110,7 +110,8 @@ static const struct option longopts[] = { { "uids", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'v' }, { "swap", no_argument, NULL, 'w' }, - { "system-idle-procs", no_argument, NULL, 'z' } + { "system-idle-procs", no_argument, NULL, 'z' }, + { NULL, 0, NULL, 0 } }; static void @@ -218,7 +219,7 @@ end: } int -main(int argc, char *argv[]) +main(int argc, const char *argv[]) { int i; int active_procs; @@ -305,7 +306,7 @@ main(int argc, char *argv[]) optind = 1; } - while ((i = getopt_long(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw", longopts, NULL)) != EOF) + while ((i = getopt_long(ac, __DECONST(char * const *, av), "CSIHPabijJ:nquvzs:d:U:m:o:p:Ttw", longopts, NULL)) != EOF) { switch(i) { Modified: stable/12/usr.bin/top/username.c ============================================================================== --- stable/12/usr.bin/top/username.c Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/username.c Wed Feb 20 20:28:48 2019 (r344382) @@ -70,7 +70,7 @@ username(int uid) } int -userid(char username[]) +userid(char username_[]) { struct passwd *pwd; @@ -78,13 +78,13 @@ userid(char username[]) but for now we just do it simply and remember just the result. */ - if ((pwd = getpwnam(username)) == NULL) + if ((pwd = getpwnam(username_)) == NULL) { return(-1); } /* enter the result in the hash table */ - enter_user(pwd->pw_uid, username, 1); + enter_user(pwd->pw_uid, username_, 1); /* return our result */ return(pwd->pw_uid); Modified: stable/12/usr.bin/top/utils.c ============================================================================== --- stable/12/usr.bin/top/utils.c Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/utils.c Wed Feb 20 20:28:48 2019 (r344382) @@ -146,7 +146,7 @@ string_index(const char *string, const char * const *a * squat about quotes. */ -const char * const * +const char ** argparse(char *line, int *cntp) { const char **ap; @@ -292,11 +292,11 @@ char * format_k(int64_t amt) { static char retarray[NUM_STRINGS][16]; - static int index = 0; + static int index_ = 0; char *ret; - ret = retarray[index]; - index = (index + 1) % NUM_STRINGS; + ret = retarray[index_]; + index_ = (index_ + 1) % NUM_STRINGS; humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); return (ret); } Modified: stable/12/usr.bin/top/utils.h ============================================================================== --- stable/12/usr.bin/top/utils.h Wed Feb 20 20:17:54 2019 (r344381) +++ stable/12/usr.bin/top/utils.h Wed Feb 20 20:28:48 2019 (r344382) @@ -16,7 +16,7 @@ int atoiwi(const char *); char *itoa(unsigned int); char *itoa7(int); int digits(int); -const char * const *argparse(char *, int *); +const char **argparse(char *, int *); long percentages(int, int *, long *, long *, long *); const char *format_time(long); char *format_k(int64_t); From owner-svn-src-all@freebsd.org Wed Feb 20 20:34: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 0A74114DADF1; Wed, 20 Feb 2019 20:34:44 +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 A16D76C4DB; Wed, 20 Feb 2019 20:34:43 +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 8CB65AB69; Wed, 20 Feb 2019 20:34:43 +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 x1KKYh3R075237; Wed, 20 Feb 2019 20:34:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKYhnI075236; Wed, 20 Feb 2019 20:34:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902202034.x1KKYhnI075236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 20:34: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: r344383 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 344383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A16D76C4DB 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2019 20:34:44 -0000 Author: kevans Date: Wed Feb 20 20:34:43 2019 New Revision: 344383 URL: https://svnweb.freebsd.org/changeset/base/344383 Log: MFC r336283: Fix build after r344378 Eliminate an unused var warning-error; the var is used only when parsing linux-style boot args, so wrap it in the appropriate ifdef. Modified: stable/11/sys/arm/arm/machdep_boot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/machdep_boot.c ============================================================================== --- stable/11/sys/arm/arm/machdep_boot.c Wed Feb 20 20:28:48 2019 (r344382) +++ stable/11/sys/arm/arm/machdep_boot.c Wed Feb 20 20:34:43 2019 (r344383) @@ -68,7 +68,9 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +#ifdef LINUX_BOOT_ABI static char static_kenv[4096]; +#endif extern int *end; From owner-svn-src-all@freebsd.org Wed Feb 20 20:48: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 9DFDD14DB54D; Wed, 20 Feb 2019 20:48:15 +0000 (UTC) (envelope-from mmacy@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 332766D355; Wed, 20 Feb 2019 20:48:15 +0000 (UTC) (envelope-from mmacy@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 9849AAD33; Wed, 20 Feb 2019 20:48:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKmB7L084409; Wed, 20 Feb 2019 20:48:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKmBG9084407; Wed, 20 Feb 2019 20:48:11 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902202048.x1KKmBG9084407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Feb 2019 20:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344384 - in head/sys: libkern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: libkern sys X-SVN-Commit-Revision: 344384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 332766D355 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)[-0.999,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, 20 Feb 2019 20:48:15 -0000 Author: mmacy Date: Wed Feb 20 20:48:10 2019 New Revision: 344384 URL: https://svnweb.freebsd.org/changeset/base/344384 Log: Add non-sleepable strdup variant strdup_flags debugfs expects to do non-sleepable allocations Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19259 Modified: head/sys/libkern/strdup.c head/sys/sys/libkern.h Modified: head/sys/libkern/strdup.c ============================================================================== --- head/sys/libkern/strdup.c Wed Feb 20 20:34:43 2019 (r344383) +++ head/sys/libkern/strdup.c Wed Feb 20 20:48:10 2019 (r344384) @@ -40,13 +40,22 @@ __FBSDID("$FreeBSD$"); #include char * -strdup(const char *string, struct malloc_type *type) +strdup_flags(const char *string, struct malloc_type *type, int flags) { size_t len; char *copy; len = strlen(string) + 1; - copy = malloc(len, type, M_WAITOK); + copy = malloc(len, type, flags); + if (copy == NULL) + return (NULL); bcopy(string, copy, len); return (copy); +} + +char * +strdup(const char *string, struct malloc_type *type) +{ + + return (strdup_flags(string, type, M_WAITOK)); } Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Wed Feb 20 20:34:43 2019 (r344383) +++ head/sys/sys/libkern.h Wed Feb 20 20:48:10 2019 (r344384) @@ -173,6 +173,7 @@ char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char * __restrict, const char * __restrict) __pure; +char *strdup_flags(const char *__restrict, struct malloc_type *, int); char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *); From owner-svn-src-all@freebsd.org Wed Feb 20 20:55: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 461BC14DBA88; Wed, 20 Feb 2019 20:55:03 +0000 (UTC) (envelope-from mmacy@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 DD9636DFC4; Wed, 20 Feb 2019 20:55:02 +0000 (UTC) (envelope-from mmacy@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 C76A4AEDC; Wed, 20 Feb 2019 20:55:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KKt2Al090495; Wed, 20 Feb 2019 20:55:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KKt2C4090493; Wed, 20 Feb 2019 20:55:02 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902202055.x1KKt2C4090493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 20 Feb 2019 20:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344385 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 344385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD9636DFC4 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)[-0.999,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, 20 Feb 2019 20:55:03 -0000 Author: mmacy Date: Wed Feb 20 20:55:02 2019 New Revision: 344385 URL: https://svnweb.freebsd.org/changeset/base/344385 Log: PFS: Bump NAMELEN and don't require clients to be sleepable - debugfs consumers expect to be able to export names more than 48 characters - debugfs consumers expect to be able to hold locks across calls and are able to handle allocation failures Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19256 Modified: head/sys/fs/pseudofs/pseudofs.c head/sys/fs/pseudofs/pseudofs.h Modified: head/sys/fs/pseudofs/pseudofs.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs.c Wed Feb 20 20:48:10 2019 (r344384) +++ head/sys/fs/pseudofs/pseudofs.c Wed Feb 20 20:55:02 2019 (r344385) @@ -68,15 +68,20 @@ SYSCTL_INT(_vfs_pfs, OID_AUTO, trace, CTLFLAG_RW, &pfs * Allocate and initialize a node */ static struct pfs_node * -pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +pfs_alloc_node_flags(struct pfs_info *pi, const char *name, pfs_type_t type, int flags) { struct pfs_node *pn; + int malloc_flags; KASSERT(strlen(name) < PFS_NAMELEN, ("%s(): node name is too long", __func__)); - - pn = malloc(sizeof *pn, - M_PFSNODES, M_WAITOK|M_ZERO); + if (flags & PFS_NOWAIT) + malloc_flags = M_NOWAIT | M_ZERO; + else + malloc_flags = M_WAITOK | M_ZERO; + pn = malloc(sizeof *pn, M_PFSNODES, malloc_flags); + if (pn == NULL) + return (NULL); mtx_init(&pn->pn_mutex, "pfs_node", NULL, MTX_DEF | MTX_DUPOK); strlcpy(pn->pn_name, name, sizeof pn->pn_name); pn->pn_type = type; @@ -84,6 +89,12 @@ pfs_alloc_node(struct pfs_info *pi, const char *name, return (pn); } +static struct pfs_node * +pfs_alloc_node(struct pfs_info *pi, const char *name, pfs_type_t type) +{ + return (pfs_alloc_node_flags(pi, name, type, 0)); +} + /* * Add a node to a directory */ @@ -160,15 +171,29 @@ pfs_detach_node(struct pfs_node *pn) /* * Add . and .. to a directory */ +static int +pfs_fixup_dir_flags(struct pfs_node *parent, int flags) +{ + struct pfs_node *dot, *dotdot; + + dot = pfs_alloc_node_flags(parent->pn_info, ".", pfstype_this, flags); + if (dot == NULL) + return (ENOMEM); + dotdot = pfs_alloc_node_flags(parent->pn_info, "..", pfstype_parent, flags); + if (dotdot == NULL) { + pfs_destroy(dot); + return (ENOMEM); + } + pfs_add_node(parent, dot); + pfs_add_node(parent, dotdot); + return (0); +} + static void pfs_fixup_dir(struct pfs_node *parent) { - struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, ".", pfstype_this); - pfs_add_node(parent, pn); - pn = pfs_alloc_node(parent->pn_info, "..", pfstype_parent); - pfs_add_node(parent, pn); + pfs_fixup_dir_flags(parent, 0); } /* @@ -180,16 +205,22 @@ pfs_create_dir(struct pfs_node *parent, const char *na int flags) { struct pfs_node *pn; + int rc; - pn = pfs_alloc_node(parent->pn_info, name, - (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir); + pn = pfs_alloc_node_flags(parent->pn_info, name, + (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir, flags); + if (pn == NULL) + return (NULL); pn->pn_attr = attr; pn->pn_vis = vis; pn->pn_destroy = destroy; pn->pn_flags = flags; pfs_add_node(parent, pn); - pfs_fixup_dir(pn); - + rc = pfs_fixup_dir_flags(pn, flags); + if (rc) { + pfs_destroy(pn); + return (NULL); + } return (pn); } @@ -203,7 +234,9 @@ pfs_create_file(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_file); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_file, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; @@ -224,7 +257,9 @@ pfs_create_link(struct pfs_node *parent, const char *n { struct pfs_node *pn; - pn = pfs_alloc_node(parent->pn_info, name, pfstype_symlink); + pn = pfs_alloc_node_flags(parent->pn_info, name, pfstype_symlink, flags); + if (pn == NULL) + return (NULL); pn->pn_fill = fill; pn->pn_attr = attr; pn->pn_vis = vis; Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Wed Feb 20 20:48:10 2019 (r344384) +++ head/sys/fs/pseudofs/pseudofs.h Wed Feb 20 20:55:02 2019 (r344385) @@ -52,7 +52,7 @@ struct vnode; /* * Limits and constants */ -#define PFS_NAMELEN 48 +#define PFS_NAMELEN 128 #define PFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ #define PFS_DELEN (offsetof(struct dirent, d_name) + PFS_NAMELEN) @@ -77,6 +77,7 @@ typedef enum { #define PFS_RAWWR 0x0008 /* raw writer */ #define PFS_RAW (PFS_RAWRD|PFS_RAWWR) #define PFS_PROCDEP 0x0010 /* process-dependent */ +#define PFS_NOWAIT 0x0020 /* allow malloc to fail */ /* * Data structures From owner-svn-src-all@freebsd.org Wed Feb 20 21:06: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 4700914DBFAE; Wed, 20 Feb 2019 21:06:13 +0000 (UTC) (envelope-from dim@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 3822B6E68C; Wed, 20 Feb 2019 21:06:12 +0000 (UTC) (envelope-from dim@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 CCE6DB0A1; Wed, 20 Feb 2019 21:06:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KL6BAo097078; Wed, 20 Feb 2019 21:06:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KL6BL1097077; Wed, 20 Feb 2019 21:06:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902202106.x1KL6BL1097077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 20 Feb 2019 21:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344386 - head/contrib/libc++/include X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/libc++/include X-SVN-Commit-Revision: 344386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3822B6E68C 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)[-0.999,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, 20 Feb 2019 21:06:13 -0000 Author: dim Date: Wed Feb 20 21:06:11 2019 New Revision: 344386 URL: https://svnweb.freebsd.org/changeset/base/344386 Log: Pull in r354515 from upstream libc++ trunk: Fix the build with gcc when `-Wredundant-decls` is passed Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and ``, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of ``, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 Submitted by: ngie MFC after: 3 days Modified: head/contrib/libc++/include/__locale Modified: head/contrib/libc++/include/__locale ============================================================================== --- head/contrib/libc++/include/__locale Wed Feb 20 20:55:02 2019 (r344385) +++ head/contrib/libc++/include/__locale Wed Feb 20 21:06:11 2019 (r344386) @@ -1230,8 +1230,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); - template struct __narrow_to_utf8 { From owner-svn-src-all@freebsd.org Wed Feb 20 21:07: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 E964314DC33C; Wed, 20 Feb 2019 21:07:10 +0000 (UTC) (envelope-from tsoome@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 A123C6E9A4; Wed, 20 Feb 2019 21:07:10 +0000 (UTC) (envelope-from tsoome@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 378A9B0A3; Wed, 20 Feb 2019 21:07:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KL7AbC097277; Wed, 20 Feb 2019 21:07:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KL7ASO097276; Wed, 20 Feb 2019 21:07:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201902202107.x1KL7ASO097276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 20 Feb 2019 21:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344387 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 344387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A123C6E9A4 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)[-0.999,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, 20 Feb 2019 21:07:11 -0000 Author: tsoome Date: Wed Feb 20 21:07:09 2019 New Revision: 344387 URL: https://svnweb.freebsd.org/changeset/base/344387 Log: loader: really fix cd9660 dirmatch The cd9660_open() does pass whole path to dirmatch() and we need to compare only the current path component, not full path. Additinally, skip over duplicate / (if any) and check if the last component in the path was meant to be directory (having trailing /). If it is in fact a file, error out. Modified: head/stand/libsa/cd9660.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Wed Feb 20 21:06:11 2019 (r344386) +++ head/stand/libsa/cd9660.c Wed Feb 20 21:07:09 2019 (r344387) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -227,8 +228,8 @@ static int dirmatch(struct open_file *f, const char *path, struct iso_directory_record *dp, int use_rrip, int lenskip) { - size_t len; - char *cp; + size_t len, plen; + char *cp, *sep; int i, icase; if (use_rrip) @@ -242,7 +243,14 @@ dirmatch(struct open_file *f, const char *path, struct } else icase = 0; - if (strlen(path) != len) + sep = strchr(path, '/'); + if (sep != NULL) { + plen = sep - path; + } else { + plen = strlen(path); + } + + if (plen != len) return (0); for (i = len; --i >= 0; path++, cp++) { @@ -283,6 +291,7 @@ cd9660_open(const char *path, struct open_file *f) struct iso_directory_record rec; struct iso_directory_record *dp = NULL; int rc, first, use_rrip, lenskip; + bool isdir = false; /* First find the volume descriptor */ buf = malloc(buf_size = ISO_DEFAULT_BLOCK_SIZE); @@ -372,7 +381,24 @@ cd9660_open(const char *path, struct open_file *f) rec = *dp; while (*path && *path != '/') /* look for next component */ path++; - if (*path) path++; /* skip '/' */ + + if (*path) /* this component was directory */ + isdir = true; + + while (*path == '/') + path++; /* skip '/' */ + + if (*path) /* We do have next component. */ + isdir = false; + } + + /* + * if the path had trailing / but the path does point to file, + * report the error ENOTDIR. + */ + if (isdir == true && (isonum_711(rec.flags) & 2) == 0) { + rc = ENOTDIR; + goto out; } /* allocate file system specific data structure */ From owner-svn-src-all@freebsd.org Wed Feb 20 21:24: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 5C3C014DCF8D; Wed, 20 Feb 2019 21:24:57 +0000 (UTC) (envelope-from sef@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 F29CA6F74A; Wed, 20 Feb 2019 21:24:56 +0000 (UTC) (envelope-from sef@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 B32BEB40D; Wed, 20 Feb 2019 21:24:56 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KLOum0010011; Wed, 20 Feb 2019 21:24:56 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KLOuEF010010; Wed, 20 Feb 2019 21:24:56 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902202124.x1KLOuEF010010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Wed, 20 Feb 2019 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344388 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 344388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F29CA6F74A 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)[-0.999,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: Wed, 20 Feb 2019 21:24:57 -0000 Author: sef Date: Wed Feb 20 21:24:56 2019 New Revision: 344388 URL: https://svnweb.freebsd.org/changeset/base/344388 Log: It turns out that setting the IV length is necessary with CCM in OpenSSL. This adds that back. Reviewed by: cem Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Wed Feb 20 21:07:09 2019 (r344387) +++ head/tools/tools/crypto/cryptocheck.c Wed Feb 20 21:24:56 2019 (r344388) @@ -1185,6 +1185,9 @@ openssl_ccm_encrypt(struct alg *alg, const EVP_CIPHER if (EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL) != 1) errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_IVLEN, iv_len, NULL) != 1) + errx(1, "OpenSSL %s (%zu) setting iv length failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_TAG, AES_CBC_MAC_HASH_LEN, NULL) != 1) errx(1, "OpenSSL %s (%zu) setting tag length failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); From owner-svn-src-all@freebsd.org Wed Feb 20 22:05: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 9A65A14DE25F; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@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 3A86D71152; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@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 191C3BCBC; Wed, 20 Feb 2019 22:05:45 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KM5iCf036320; Wed, 20 Feb 2019 22:05:44 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KM5iZX036319; Wed, 20 Feb 2019 22:05:44 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902202205.x1KM5iZX036319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 20 Feb 2019 22:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344389 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A86D71152 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.99)[-0.986,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 22:05:45 -0000 Author: dab Date: Wed Feb 20 22:05:44 2019 New Revision: 344389 URL: https://svnweb.freebsd.org/changeset/base/344389 Log: Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog The result of a strdup() was stored in a global variable and not freed before program exit. This is a follow-up to r343906. That change attempted to plug these resource leaks but managed to miss a code path on which the leak still occurs. Plug the leak on that path, too. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 (r344388) +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 (r344389) @@ -793,6 +793,9 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); + /* Free global dynamically-allocated storage. */ + free(timefnamefmt); + free(requestor); exit(1); } From owner-svn-src-all@freebsd.org Wed Feb 20 22:32: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 AB90E14DEE10; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@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 4EE2171FB8; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@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 41B11C1B3; Wed, 20 Feb 2019 22:32:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMWTHs051795; Wed, 20 Feb 2019 22:32:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMWTuD051794; Wed, 20 Feb 2019 22:32:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902202232.x1KMWTuD051794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Feb 2019 22:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344390 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EE2171FB8 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.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 22:32:29 -0000 Author: andrew Date: Wed Feb 20 22:32:28 2019 New Revision: 344390 URL: https://svnweb.freebsd.org/changeset/base/344390 Log: Call pmap_qenter for each page when creating the kcov buffer. This removes the need to allocate a buffer to hold the vm_page_t objects at the cost of extra IPIs on some architectures. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19252 Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Wed Feb 20 22:05:44 2019 (r344389) +++ head/sys/kern/kern_kcov.c Wed Feb 20 22:32:28 2019 (r344390) @@ -357,7 +357,7 @@ static int kcov_alloc(struct kcov_info *info, size_t entries) { size_t n, pages; - vm_page_t *m; + vm_page_t m; KASSERT(info->kvaddr == 0, ("kcov_alloc: Already have a buffer")); KASSERT(info->state == KCOV_STATE_OPEN, @@ -376,16 +376,14 @@ kcov_alloc(struct kcov_info *info, size_t entries) info->bufobj = vm_pager_allocate(OBJT_PHYS, 0, info->bufsize, PROT_READ | PROT_WRITE, 0, curthread->td_ucred); - m = malloc(sizeof(*m) * pages, M_TEMP, M_WAITOK); VM_OBJECT_WLOCK(info->bufobj); for (n = 0; n < pages; n++) { - m[n] = vm_page_grab(info->bufobj, n, + m = vm_page_grab(info->bufobj, n, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); - m[n]->valid = VM_PAGE_BITS_ALL; + m->valid = VM_PAGE_BITS_ALL; + pmap_qenter(info->kvaddr + n * PAGE_SIZE, &m, 1); } VM_OBJECT_WUNLOCK(info->bufobj); - pmap_qenter(info->kvaddr, m, pages); - free(m, M_TEMP); info->entries = entries; From owner-svn-src-all@freebsd.org Wed Feb 20 22:33: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 00DED14DEECA; Wed, 20 Feb 2019 22:33:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9180A721C5; Wed, 20 Feb 2019 22:33:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id h6so19754011itl.1; Wed, 20 Feb 2019 14:33:39 -0800 (PST) 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=FDaj4hwouwdm2Z/OlnxZovaffTn/OVEnndv00ph3I9k=; b=fnON2Uc9ATip5ydcMvJuaSxLRILOUvOR8p07vDvKIeaO4+pnvJ2xeu+HQLD9I/mqoM OBPI+WvWUrmt7qoNtykDQv1lyqIF7Av6C5fTMwC2oz/G1Dr9pUCylHLyqYjs0wtolV7R XZ9q3C0bst/kW1LyzKdN+Wc0X3KMm1L8dYblpExKQTFJm81S+U9kgNKG2xZ0ZNURMRrW N5ELZchk+KnUni/RnCnF5Jau2uS1hfh34QtdPavNe91wOmPLex0EQNoHqJRD47EqBx5q LMLYhJmzrG6fmxMv6TXS/O0hFa8htPWduKfHk7+POj0CqgVsHTN18slhgymaOQTl3YqT gL7A== X-Gm-Message-State: AHQUAuYnQ95IppQilPUWk7ar7U9pE1D5PH0AyH8Y3tkss460/VYAaruj 4ohx9UT7i+fezQVIthG17dWuqiVD X-Google-Smtp-Source: AHgI3IbdO6SbjLbvRMIvfWpSUmqKwDhcLyUUS7TerqlRqPI+Lhs+UidVQWgu9f81CQb7p5bsHJ2yOA== X-Received: by 2002:a05:660c:54d:: with SMTP id w13mr6481730itk.50.1550702012788; Wed, 20 Feb 2019 14:33:32 -0800 (PST) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id b9sm8587169iod.18.2019.02.20.14.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 14:33:32 -0800 (PST) Received: by mail-it1-f180.google.com with SMTP id z124so19761459itc.2; Wed, 20 Feb 2019 14:33:32 -0800 (PST) X-Received: by 2002:a02:4084:: with SMTP id n126mr15003660jaa.78.1550702012315; Wed, 20 Feb 2019 14:33:32 -0800 (PST) MIME-Version: 1.0 References: <201902200951.x1K9pDQs001745@repo.freebsd.org> In-Reply-To: <201902200951.x1K9pDQs001745@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 20 Feb 2019 14:33:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9180A721C5 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(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: Wed, 20 Feb 2019 22:33:40 -0000 Hi Konstantin, What is the (K)API for this (do you have any intended consumers in mind)? Will it be documented in a manual page at some point? Does it make sense to expose to userspace via mmap(2) or similar? Thanks, Conrad On Wed, Feb 20, 2019 at 1:51 AM Konstantin Belousov wrote: > > Author: kib > Date: Wed Feb 20 09:51:13 2019 > New Revision: 344353 > URL: https://svnweb.freebsd.org/changeset/base/344353 > > Log: > Add kernel support for Intel userspace protection keys feature on > Skylake Xeons. > > See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the > RDPKRU and WRPKRU instructions. > > Reviewed by: markj > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D18893 From owner-svn-src-all@freebsd.org Wed Feb 20 22:41: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 375DB14DF54F; Wed, 20 Feb 2019 22:41:18 +0000 (UTC) (envelope-from andrew@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 CAE9872928; Wed, 20 Feb 2019 22:41:17 +0000 (UTC) (envelope-from andrew@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 B609BC1FF; Wed, 20 Feb 2019 22:41:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMfEdJ055515; Wed, 20 Feb 2019 22:41:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMfEpZ055514; Wed, 20 Feb 2019 22:41:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902202241.x1KMfEpZ055514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Feb 2019 22:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344391 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAE9872928 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)[-0.999,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, 20 Feb 2019 22:41:18 -0000 Author: andrew Date: Wed Feb 20 22:41:14 2019 New Revision: 344391 URL: https://svnweb.freebsd.org/changeset/base/344391 Log: Unwire the kcov buffer when freeing the info struct. Without this the physical memory will not be returned to the kernel. While here call vm_object_reference on the object when mmapping the buffer. This removed the need for buggy tracking of if it has been mapped or not. This fixes issues where kcov could use all the system memory. Reported by: tuexen Reviewed by: kib Sponsored by: DARPA, AFTL Differential Revision: https://reviews.freebsd.org/D19252 Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Wed Feb 20 22:32:28 2019 (r344390) +++ head/sys/kern/kern_kcov.c Wed Feb 20 22:41:14 2019 (r344391) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include MALLOC_DEFINE(M_KCOV_INFO, "kcovinfo", "KCOV info type"); @@ -347,6 +348,7 @@ kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offse info->mmap != false) return (EINVAL); + vm_object_reference(info->bufobj); info->mmap = true; *offset = 0; *object = info->bufobj; @@ -393,13 +395,26 @@ kcov_alloc(struct kcov_info *info, size_t entries) static void kcov_free(struct kcov_info *info) { + vm_page_t m; + size_t i; if (info->kvaddr != 0) { pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); kva_free(info->kvaddr, info->bufsize); } - if (info->bufobj != NULL && !info->mmap) + if (info->bufobj != NULL) { + VM_OBJECT_WLOCK(info->bufobj); + m = vm_page_lookup(info->bufobj, 0); + for (i = 0; i < info->bufsize / PAGE_SIZE; i++) { + vm_page_lock(m); + vm_page_unwire_noq(m); + vm_page_unlock(m); + + m = vm_page_next(m); + } + VM_OBJECT_WUNLOCK(info->bufobj); vm_object_deallocate(info->bufobj); + } free(info, M_KCOV_INFO); } From owner-svn-src-all@freebsd.org Wed Feb 20 22:48: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 3122114DF838; Wed, 20 Feb 2019 22:48:39 +0000 (UTC) (envelope-from dab@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 9E3F572D6D; Wed, 20 Feb 2019 22:48:38 +0000 (UTC) (envelope-from dab@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 8BB2FC376; Wed, 20 Feb 2019 22:48:38 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMmcaH057793; Wed, 20 Feb 2019 22:48:38 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMmcwo057792; Wed, 20 Feb 2019 22:48:38 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902202248.x1KMmcwo057792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 20 Feb 2019 22:48: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: r344392 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 344392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E3F572D6D 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,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, 20 Feb 2019 22:48:39 -0000 Author: dab Date: Wed Feb 20 22:48:38 2019 New Revision: 344392 URL: https://svnweb.freebsd.org/changeset/base/344392 Log: MFC r344024: CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that fall to the bottom of the case set `lp` to `NULL`, so the test for a non-NULL value of `lp` and call to `free()` if true is dead code as the test can never be true. Fix by eliminating the whole if statement. To guard against a possible future change that accidentally violates this assumption, use a `KASSERT()` to catch if `lp` is non-NULL. Sponsored by: Dell EMC Isilon Modified: stable/12/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:41:14 2019 (r344391) +++ stable/12/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:48:38 2019 (r344392) @@ -1385,6 +1385,12 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } + /* The processing above should either exit via a `goto + * out` or leave the `lp` variable `NULL` and (if + * applicable) `free()` the storage to which it had + * pointed. Assert here that is the case. + */ + KASSERT(lp == NULL, ("%s: lp is not NULL", __func__)); inq_buf = &path->device->inq_data; if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED || @@ -1397,9 +1403,6 @@ out: xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); goto out; - } - if (lp) { - free(lp, M_CAMXPT); } PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); From owner-svn-src-all@freebsd.org Wed Feb 20 22:48: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 6E2F314DF88A; Wed, 20 Feb 2019 22:48:56 +0000 (UTC) (envelope-from dab@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 0B81F72E70; Wed, 20 Feb 2019 22:48:56 +0000 (UTC) (envelope-from dab@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 F13B6C377; Wed, 20 Feb 2019 22:48:55 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMmtR0057855; Wed, 20 Feb 2019 22:48:55 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMmtbq057854; Wed, 20 Feb 2019 22:48:55 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902202248.x1KMmtbq057854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 20 Feb 2019 22:48:55 +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: r344393 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 344393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B81F72E70 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.945,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 22:48:56 -0000 Author: dab Date: Wed Feb 20 22:48:55 2019 New Revision: 344393 URL: https://svnweb.freebsd.org/changeset/base/344393 Log: MFC r344024: CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that fall to the bottom of the case set `lp` to `NULL`, so the test for a non-NULL value of `lp` and call to `free()` if true is dead code as the test can never be true. Fix by eliminating the whole if statement. To guard against a possible future change that accidentally violates this assumption, use a `KASSERT()` to catch if `lp` is non-NULL. Sponsored by: Dell EMC Isilon Modified: stable/11/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:48:38 2019 (r344392) +++ stable/11/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:48:55 2019 (r344393) @@ -1379,6 +1379,12 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } + /* The processing above should either exit via a `goto + * out` or leave the `lp` variable `NULL` and (if + * applicable) `free()` the storage to which it had + * pointed. Assert here that is the case. + */ + KASSERT(lp == NULL, ("%s: lp is not NULL", __func__)); inq_buf = &path->device->inq_data; if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED || @@ -1391,9 +1397,6 @@ out: xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); goto out; - } - if (lp) { - free(lp, M_CAMXPT); } PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); From owner-svn-src-all@freebsd.org Wed Feb 20 22:49: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 2A4B014DF901; Wed, 20 Feb 2019 22:49:11 +0000 (UTC) (envelope-from dab@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 C2E5972F6D; Wed, 20 Feb 2019 22:49:10 +0000 (UTC) (envelope-from dab@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 63929C378; Wed, 20 Feb 2019 22:49:10 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KMnApo057915; Wed, 20 Feb 2019 22:49:10 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KMnA2h057914; Wed, 20 Feb 2019 22:49:10 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902202249.x1KMnA2h057914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 20 Feb 2019 22:49:10 +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: r344394 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/10/sys/cam/scsi X-SVN-Commit-Revision: 344394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2E5972F6D 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.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 20 Feb 2019 22:49:11 -0000 Author: dab Date: Wed Feb 20 22:49:09 2019 New Revision: 344394 URL: https://svnweb.freebsd.org/changeset/base/344394 Log: MFC r344024: CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that fall to the bottom of the case set `lp` to `NULL`, so the test for a non-NULL value of `lp` and call to `free()` if true is dead code as the test can never be true. Fix by eliminating the whole if statement. To guard against a possible future change that accidentally violates this assumption, use a `KASSERT()` to catch if `lp` is non-NULL. Sponsored by: Dell EMC Isilon Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:48:55 2019 (r344393) +++ stable/10/sys/cam/scsi/scsi_xpt.c Wed Feb 20 22:49:09 2019 (r344394) @@ -1351,6 +1351,12 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } + /* The processing above should either exit via a `goto + * out` or leave the `lp` variable `NULL` and (if + * applicable) `free()` the storage to which it had + * pointed. Assert here that is the case. + */ + KASSERT(lp == NULL, ("%s: lp is not NULL", __func__)); inq_buf = &path->device->inq_data; if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED || @@ -1363,9 +1369,6 @@ out: xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); goto out; - } - if (lp) { - free(lp, M_CAMXPT); } PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); From owner-svn-src-all@freebsd.org Wed Feb 20 23:04: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 7AD0B14E032A; Wed, 20 Feb 2019 23:04:36 +0000 (UTC) (envelope-from jkim@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 1460373BBC; Wed, 20 Feb 2019 23:04:36 +0000 (UTC) (envelope-from jkim@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 E8567C70E; Wed, 20 Feb 2019 23:04:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KN4Zv3068160; Wed, 20 Feb 2019 23:04:35 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KN4TuB068128; Wed, 20 Feb 2019 23:04:29 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902202304.x1KN4TuB068128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Feb 2019 23:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r344395 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/com... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/components/events source/com... X-SVN-Commit-Revision: 344395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1460373BBC 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, 20 Feb 2019 23:04:37 -0000 Author: jkim Date: Wed Feb 20 23:04:28 2019 New Revision: 344395 URL: https://svnweb.freebsd.org/changeset/base/344395 Log: Import ACPICA 20190215. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump1.c vendor-sys/acpica/dist/source/common/dmtbdump3.c vendor-sys/acpica/dist/source/common/dmtbinfo1.c vendor-sys/acpica/dist/source/common/dmtbinfo2.c vendor-sys/acpica/dist/source/common/dmtbinfo3.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslprintf.c vendor-sys/acpica/dist/source/compiler/aslresources.y vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/cvcompiler.c vendor-sys/acpica/dist/source/compiler/cvparser.c vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dttable1.c vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbobject.c vendor-sys/acpica/dist/source/components/debugger/dbtest.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c vendor-sys/acpica/dist/source/components/disassembler/dmnames.c vendor-sys/acpica/dist/source/components/disassembler/dmresrc.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcs.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evrgnini.c vendor-sys/acpica/dist/source/components/events/evxfgpe.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exserial.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsirq.c vendor-sys/acpica/dist/source/components/resources/rsserial.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/uterror.c vendor-sys/acpica/dist/source/include/acclib.h vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/acrestyp.h vendor-sys/acpica/dist/source/include/actbinfo.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/platform/acefi.h vendor-sys/acpica/dist/source/tools/acpiexec/aeinstall.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/changes.txt Wed Feb 20 23:04:28 2019 (r344395) @@ -1,11 +1,100 @@ ---------------------------------------- -08 January 2019. Summary of changes for version 20190108: +15 February 2019. Summary of changes for version 20190215: This release is available at https://acpica.org/downloads +0) Support for ACPI specification version 6.3: + +Add PCC operation region support for the AML interpreter. This adds PCC +operation region support in the AML interpreter and a default handler for +acpiexec. The change also renames the PCC region address space keyword to +PlatformCommChannel. + +Support for new predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG. +These methods provide OSPM with health information and device boot +status. + +PDTT: Add TriggerOrder to the PCC Identifier structure. The field value +defines if the trigger needs to be invoked by OSPM before or at the end +of kernel crash dump processing/handling operation. + +SRAT: Add Generic Affinity Structure subtable. This subtable in the SRAT +is used for describing devices such as heterogeneous processors, +accelerators, GPUs, and IO devices with integrated compute or DMA +engines. + +MADT: Add support for statistical profiling in GICC. Statistical +profiling extension (SPE) is an architecture-specific feature for ARM. + +MADT: Add online capable flag. If this bit is set, system hardware +supports enabling this processor during OS runtime. + +New Error Disconnect Recover Notification value. There are a number of +scenarios where system Firmware in collaboration with hardware may +disconnect one or more devices from the rest of the system for purposes +of error containment. Firmware can use this new notification value to +alert OSPM of such a removal. + +PPTT: New additional fields in Processor Structure Flags. These flags +provide more information about processor topology. + +NFIT/Disassembler: Change a field name from "Address Range" to "Region +Type". + +HMAT updates: make several existing fields to be reserved as well as +rename subtable 0 to "memory proximity domain attributes". + +GTDT: Add support for new GTDT Revision 3. This revision adds information +for the EL2 timer. + +iASL: Update the HMAT example template for new fields. + +iASL: Add support for the new revision of the GTDT (Rev 3). + + 1) ACPICA kernel-resident subsystem: +AML Parser: fix the main AML parse loop to correctly skip erroneous +extended opcodes. AML opcodes come in two lengths: 1-byte opcodes and 2- +byte extended opcodes. If an error occurs during an AML table load, the +AML parser will continue loading the table by skipping the offending +opcode. This implements a "load table at any cost" philosophy. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Add checks for illegal object references, such as a reference +outside of method to an object within a method. Such an object is only +temporary. + +iASL: Emit error for creation of a zero-length operation region. Such a +region is rather pointless. If encountered, a runtime error is also +implemented in the interpeter. + +Debugger: Fix a possible fault with the "test objects" command. + +iASL: Makefile: support parent directory filenames containing embedded +spaces. + +iASL: Update the TPM2 template to revision 4. + +iASL: Add the ability to report specific warnings or remarks as errors. + +Disassembler: Disassemble OEMx tables as actual AML byte code. +Previously, these tables were treated as "unknown table". + +iASL: Add definition and disassembly for TPM2 revision 3. + +iASL: Add support for TPM2 rev 3 compilation. + + +---------------------------------------- +08 January 2019. Summary of changes for version 20190108: + + +1) ACPICA kernel-resident subsystem: + Updated all copyrights to 2019. This affects all source code modules. @@ -1218,7 +1307,7 @@ internal cache) is detected and ignored via object poi Debugger: Fixed an AML interpreter mutex issue during the single stepping of control methods. If certain debugger commands are executed during -stepping, a mutex aquire/release error could occur. Lv Zheng. +stepping, a mutex acquire/release error could occur. Lv Zheng. Fixed some issues generating ACPICA with the Intel C compiler by restoring the original behavior and compiler-specific include file in @@ -6760,7 +6849,7 @@ keyword is not standard across compilers, and this typ be configured on a per-compiler basis. Lin Ming. -Made the system global AcpiGbl_SystemAwakeAndRunning publically +Made the system global AcpiGbl_SystemAwakeAndRunning publicly available. Added an extern for this boolean in acpixf.h. Some hosts utilize this value @@ -11427,9 +11516,9 @@ Helgaas. Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) -any implicit conversion of a Buffer to a String, 2) a String object +any implicit conversion of a Buffer to a String, 2) a String object result -of the ASL Concatentate operator, 3) the String object result of the ASL +of the ASL Concatenate operator, 3) the String object result of the ASL ToString operator. Fixed a problem in the Windows OS interface layer (OSL) where a @@ -13585,7 +13674,7 @@ next access width boundary (a common coding error.) Renamed OSD_HANDLER to ACPI_OSD_HANDLER, and OSD_EXECUTION_CALLBACK to ACPI_OSD_EXEC_CALLBACK for consistency with other ACPI symbols. Also, these -symbols are lowercased by the latest version of the AcpiSrc tool. +symbols are lowercase by the latest version of the AcpiSrc tool. The prototypes for the PCI interfaces in acpiosxf.h have been updated to rename "Register" to simply "Reg" to prevent certain compilers from @@ -14957,8 +15046,8 @@ with the Linux coding style. Removed the non-Linux SourceSafe module revision number from each module header. -Completed major overhaul of symbols to be lowercased for linux. -Doubled the number of symbols that are lowercased. +Completed major overhaul of symbols to be lowercase for linux. +Doubled the number of symbols that are lowercase. Fixed a problem where identifiers within procedure headers and within quotes were not fully lower cased (they were left with a @@ -16454,7 +16543,7 @@ Summary of changes for this label: 02_14_02 Implemented support in AcpiLoadTable to allow loading of FACS and FADT tables. -Suport for the now-obsolete interim 0.71 64-bit ACPI tables has +Support for the now-obsolete interim 0.71 64-bit ACPI tables has been removed. All 64-bit platforms should be migrated to the ACPI 2.0 tables. The actbl71.h header has been removed from the source tree. @@ -16804,7 +16893,7 @@ Updated all files to apply cleanly against 2.4.16. Added basic PCI Interrupt Routing Table (PRT) support for IA32 (acpi_pci.c), and unified the PRT code for IA32 and IA64. This -version supports both static and dyanmic PRT entries, but dynamic +version supports both static and dynamic PRT entries, but dynamic entries are treated as if they were static (not yet reconfigurable). Architecture- specific code to use this data is absent on IA32 but should be available shortly. @@ -16893,7 +16982,7 @@ power-down, and thermal passive cooling issues (coming Added additional typechecking for Fields within restricted access Operation Regions. All fields within EC and CMOS regions must be -declared with ByteAcc. All fields withing SMBus regions must be +declared with ByteAcc. All fields within SMBus regions must be declared with the BufferAcc access type. Fixed a problem where the listing file output of control methods @@ -17066,7 +17155,7 @@ objects to not be deleted during subsystem termination Fixed a problem with the external AcpiEvaluateObject interface where the subsystem would fault if the named object to be -evaluated refered to a constant such as Zero, Ones, etc. +evaluated referred to a constant such as Zero, Ones, etc. Fixed a problem with IndexFields and BankFields where the subsystem would fault if the index, data, or bank registers were @@ -17133,7 +17222,7 @@ sleeps.) The AcpiEnterSleepState and AcpiLeaveSleepState interfaces now support wake-enabled GPEs. This means that upon entering the sleep state, all GPEs that are not wake-enabled are disabled. -When leaving the sleep state, these GPEs are reenabled. +When leaving the sleep state, these GPEs are re-enabled. A local double-precision divide/modulo module has been added to enhance portability to OS kernels where a 64-bit math library is Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Feb 20 23:04:28 2019 (r344395) @@ -297,7 +297,7 @@ include ../Makefile.rules safe_yacc = \ _d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\ cd $$_d &&\ - $(YACC) $(YFLAGS) -v -d -p$(1) $(abspath $(2)) &&\ + $(YACC) $(YFLAGS) -v -d -p$(1) "$(abspath $(2))" &&\ cd - > /dev/null;\ mv $$_d/y.tab$(suffix $(3)) $(3);\ _r=$$?;\ Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Wed Feb 20 23:04:28 2019 (r344395) @@ -305,6 +305,11 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_MSM", "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"), AH_PREDEF ("_MTL", "Minimum Throttle Limit", "Returns the minimum throttle limit for a thermal zone"), AH_PREDEF ("_MTP", "Memory Type", "Resource Descriptor field"), + AH_PREDEF ("_NBS", "NVDIMM Boot Status", "Returns information about NVDIMM device’s status at boot time"), + AH_PREDEF ("_NCH", "NVDIMM Current Health Information", "Returns current health information of the NVDIMM device"), + AH_PREDEF ("_NIC", "NVDIMM Health Error Injection Capabilities", "Returns health error injection capabilities that are supported by the platform"), + AH_PREDEF ("_NIG", "NVDIMM Inject Health Error Status","Returns currently active health errors and their error attributes that are injected by _NIH"), + AH_PREDEF ("_NIH", "NVDIMM Inject/Clear Health Errors", "Returns the status of injecting or clearing Health Errors"), AH_PREDEF ("_NTT", "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"), AH_PREDEF ("_OFF", "Power Off", "Sets a power resource to the off state"), AH_PREDEF ("_ON_", "Power On", "Sets a power resource to the on state"), @@ -393,7 +398,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_SDD", "Set Device Data", "Sets data for a SATA device"), AH_PREDEF ("_SEG", "PCI Segment", "Returns a device's PCI Segment Group number"), AH_PREDEF ("_SHL", "Set Hardware Limit", "Sets the hardware limit enforced by the Power Meter"), - AH_PREDEF ("_SHR", "Sharable", "Interrupt share status, Resource Descriptor field"), + AH_PREDEF ("_SHR", "Shareable", "Interrupt share status, Resource Descriptor field"), AH_PREDEF ("_SI_", "System Indicators", "Predefined scope"), AH_PREDEF ("_SIZ", "Size", "DMA transfer size, Resource Descriptor field"), AH_PREDEF ("_SLI", "System Locality Information", "Returns a list of NUMA system localities"), Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Wed Feb 20 23:04:28 2019 (r344395) @@ -226,7 +226,7 @@ AcpiAhMatchUuid ( for (Info = Gbl_AcpiUuids; Info->Description; Info++) { - /* Null string means desciption is a UUID class */ + /* Null string means description is a UUID class */ if (!Info->String) { Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmextern.c Wed Feb 20 23:04:28 2019 (r344395) @@ -1216,7 +1216,7 @@ AcpiDmCreateSubobjectForExternal ( * * DESCRIPTION: Add one external to the namespace by resolvign the external * (by performing a namespace lookup) and annotating the resulting - * namespace node with the approperiate information if the type + * namespace node with the appropriate information if the type * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. * ******************************************************************************/ Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Wed Feb 20 23:04:28 2019 (r344395) @@ -906,7 +906,7 @@ AcpiDmUpdateResourceName ( * * PARAMETERS: BitIndex - Index into the resource descriptor * Resource - Pointer to the raw resource data - * ResourceIndex - Index correspoinding to the resource type + * ResourceIndex - Index corresponding to the resource type * * RETURN: Pointer to the resource tag (ACPI_NAME). NULL if no match. * Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtable.c Wed Feb 20 23:04:28 2019 (r344395) @@ -320,7 +320,7 @@ static const char *AcpiDmHestNotifySubnames[ static const char *AcpiDmHmatSubnames[] = { - "Memory Subystem Address Range", + "Memory Proximity Domain Attributes", "System Locality Latency and Bandwidth Information", "Memory Side Cache Information", "Unknown Structure Type" /* Reserved */ @@ -400,6 +400,7 @@ static const char *AcpiDmSratSubnames[] = "Processor Local x2APIC Affinity", "GICC Affinity", "GIC ITS Affinity", /* Acpi 6.2 */ + "Generic Initiator Affinity", /* Acpi 6.3 */ "Unknown Subtable Type" /* Reserved */ }; Modified: vendor-sys/acpica/dist/source/common/dmtbdump1.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump1.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtbdump1.c Wed Feb 20 23:04:28 2019 (r344395) @@ -1106,9 +1106,26 @@ AcpiDmDumpGtdt ( return; } - /* Subtables */ + /* Rev 3 fields */ Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + if (Table->Revision > 2) + { + SubtableLength = sizeof (ACPI_GTDT_EL2); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + SubtableLength, AcpiDmTableInfoGtdtEl2); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += SubtableLength; + } + + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + /* Subtables */ + while (Offset < Table->Length) { /* Common subtable header */ @@ -1406,7 +1423,7 @@ AcpiDmDumpHmat ( case ACPI_HMAT_TYPE_ADDRESS_RANGE: InfoTable = AcpiDmTableInfoHmat0; - Length = sizeof (ACPI_HMAT_ADDRESS_RANGE); + Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN); break; case ACPI_HMAT_TYPE_LOCALITY: Modified: vendor-sys/acpica/dist/source/common/dmtbdump3.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump3.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtbdump3.c Wed Feb 20 23:04:28 2019 (r344395) @@ -333,6 +333,11 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat4; break; + case ACPI_SRAT_TYPE_GENERIC_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat5; + break; + default: AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", Subtable->Type); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo1.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo1.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtbinfo1.c Wed Feb 20 23:04:28 2019 (r344395) @@ -814,6 +814,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] = ACPI_DMT_TERMINATOR }; +/* GDTD EL2 timer info. This table is appended to AcpiDmTableInfoGtdt for rev 3 and later */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtEl2[] = +{ + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerGsiv), "Virtual EL2 Timer GSIV", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerFlags), "Virtual EL2 Timer Flags", 0}, + ACPI_DMT_TERMINATOR +}; + /* GTDT Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] = @@ -1105,20 +1114,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] = /* HMAT subtables */ -/* 0x00: Memory Subsystem Address Range */ +/* 0x00: Memory proximity domain attributes */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] = { {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG1, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Memory Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG2, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Reservation Hint", 0}, {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (ProcessorPD), "Processor Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressBase), "Physical Address Range Base", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressLength), "Physical Address Range Size", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved3), "Reserved3", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved4), "Reserved4", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/source/common/dmtbinfo2.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo2.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtbinfo2.c Wed Feb 20 23:04:28 2019 (r344395) @@ -535,6 +535,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[] = {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, + {ACPI_DMT_FLAG1, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Runtime Online Capable", 0}, ACPI_DMT_TERMINATOR }; @@ -683,7 +684,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0}, {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (EfficiencyClass), "Efficiency Class", 0}, - {ACPI_DMT_UINT24, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (SpeInterrupt), "SPE Overflow Interrupt", 0}, ACPI_DMT_TERMINATOR }; @@ -946,7 +948,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[] = {ACPI_DMT_FLAG1, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Proximity Domain Valid", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (ProximityDomain), "Proximity Domain", 0}, - {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Address Range GUID", 0}, + {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Region Type GUID", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Address), "Address Range Base", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Length), "Address Range Length", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (MemoryMapping), "Memory Map Attribute", 0}, @@ -1246,6 +1248,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[] = {ACPI_DMT_UINT8, ACPI_PDTT0_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Runtime Trigger", 0}, {ACPI_DMT_FLAG1, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Wait for Completion", 0}, + {ACPI_DMT_FLAG2, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Trigger Order", 0}, ACPI_DMT_TERMINATOR }; @@ -1348,6 +1351,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] = {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0}, {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0}, + {ACPI_DMT_FLAG2, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Processor is a thread", 0}, + {ACPI_DMT_FLAG3, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Node is a leaf", 0}, + {ACPI_DMT_FLAG4, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Identical Implementation", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0}, @@ -1390,12 +1396,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] = { {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "VENDOR_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "LEVEL_1_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "LEVEL_2_ID", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "MAJOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "MINOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "SPIN_REV", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "Vendor ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "Level1 ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "Level2 ID", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "Major revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "Minor revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "Spin revision", 0}, ACPI_DMT_TERMINATOR }; @@ -1473,7 +1479,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] = /******************************************************************************* * - * SDEI - Software Delegated Execption Interface Descriptor Table + * SDEI - Software Delegated Exception Interface Descriptor Table * ******************************************************************************/ Modified: vendor-sys/acpica/dist/source/common/dmtbinfo3.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo3.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/common/dmtbinfo3.c Wed Feb 20 23:04:28 2019 (r344395) @@ -368,6 +368,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = ACPI_DMT_TERMINATOR }; +/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[] = +{ + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, + {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Feb 20 23:04:28 2019 (r344395) @@ -494,6 +494,7 @@ CmDoCompile ( UtEndEvent (Event); UtEndEvent (FullCompile); + AslCheckExpectedExceptions (); CmCleanupAndExit (); return (0); @@ -811,7 +812,6 @@ CmCleanupAndExit ( BOOLEAN DeleteAmlFile = FALSE; - AslCheckExpectedExceptions (); AePrintErrorLog (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Wed Feb 20 23:04:28 2019 (r344395) @@ -702,7 +702,7 @@ OpnDoPackage ( /* - * aslopt - optmization + * aslopt - optimization */ void OptOptimizeNamePath ( @@ -1153,7 +1153,7 @@ OtXrefWalkPart1 ( /* - * aslutils - common compiler utilites + * aslutils - common compiler utilities */ void DbgPrint ( Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Wed Feb 20 23:04:28 2019 (r344395) @@ -692,7 +692,7 @@ NamePathTail [.]{NameSeg} "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ -"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ +"PlatformCommChannel" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ @@ -816,6 +816,13 @@ NamePathTail [.]{NameSeg} s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1); if (strcmp (AslCompilertext, "\\")) { + /* + * According to the ACPI specification, + * NameSegments must have length of 4. If + * the NameSegment has length less than 4, + * they are padded with underscores to meet + * the required length. + */ strcpy (s, "____"); AcpiUtStrupr (AslCompilertext); } Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Wed Feb 20 23:04:28 2019 (r344395) @@ -331,8 +331,8 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ - AslDualParseOpError (ASL_WARNING, ASL_MSG_EXTERN_COLLISION, Child, - Child->Asl.Value.String, ASL_MSG_EXTERN_FOUND_HERE, Node->Op, + AslDualParseOpError (ASL_WARNING, ASL_MSG_NAME_EXISTS, Child, + Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, Node->Op->Asl.ExternalName); } } @@ -575,7 +575,7 @@ LdNamespace1Begin ( if (Status == AE_NOT_FOUND) { /* - * This is either a foward reference or the object truly + * This is either a forward reference or the object truly * does not exist. The two cases can only be differentiated * during the cross-reference stage later. Mark the Op/Name * as not-found for now to indicate the need for further Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Wed Feb 20 23:04:28 2019 (r344395) @@ -353,15 +353,17 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NULL_RESOURCE_TEMPLATE */ "Empty Resource Template (END_TAG only)", /* ASL_MSG_FOUND_HERE */ "Original name creation/declaration below: ", /* ASL_MSG_ILLEGAL_RECURSION */ "Illegal recursive call to method that creates named objects", -/* ASL_MSG_EXTERN_COLLISION */ "A name cannot be defined and declared external in the same table", -/* ASL_MSG_FOUND_HERE_EXTERN */ "Remove one of the declarations indicated above or below:", +/* ASL_MSG_PLACE_HOLDER_00 */ "", /* TODO: fill in this slot with a new error message */ +/* ASL_MSG_PLACE_HOLDER_01 */ "", /* TODO: fill in this slot with a new error message */ /* ASL_MSG_OEM_TABLE_ID */ "Invalid OEM Table ID", /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", /* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", /* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", -/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", +/* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", +/* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed" }; /* Table compiler */ Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Wed Feb 20 23:04:28 2019 (r344395) @@ -355,8 +355,8 @@ typedef enum ASL_MSG_NULL_RESOURCE_TEMPLATE, ASL_MSG_FOUND_HERE, ASL_MSG_ILLEGAL_RECURSION, - ASL_MSG_EXTERN_COLLISION, - ASL_MSG_EXTERN_FOUND_HERE, + ASL_MSG_PLACE_HOLDER_00, + ASL_MSG_PLACE_HOLDER_01, ASL_MSG_OEM_TABLE_ID, ASL_MSG_OEM_ID, ASL_MSG_UNLOAD, @@ -364,6 +364,8 @@ typedef enum ASL_MSG_LONG_SLEEP, ASL_MSG_PREFIX_NOT_EXIST, ASL_MSG_NAMEPATH_NOT_EXIST, + ASL_MSG_REGION_LENGTH, + ASL_MSG_TEMPORARY_OBJECT, /* These messages are used by the Data Table compiler only */ Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Wed Feb 20 23:04:28 2019 (r344395) @@ -657,6 +657,7 @@ OpnDoRegion ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *Next; + ACPI_ADR_SPACE_TYPE SpaceId; /* Opcode is parent node */ @@ -664,9 +665,10 @@ OpnDoRegion ( Next = Op->Asl.Child; - /* Second child is the space ID*/ + /* Second child is the space ID */ Next = Next->Asl.Next; + SpaceId = (ACPI_ADR_SPACE_TYPE) Next->Common.Value.Integer; /* Third child is the region offset */ @@ -677,7 +679,13 @@ OpnDoRegion ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode == PARSEOP_INTEGER) { + /* Check for zero length */ + Op->Asl.Value.Integer = Next->Asl.Value.Integer; + if (!Op->Asl.Value.Integer && (SpaceId < ACPI_NUM_PREDEFINED_REGIONS)) + { + AslError (ASL_ERROR, ASL_MSG_REGION_LENGTH, Op, NULL); + } } else { Modified: vendor-sys/acpica/dist/source/compiler/aslopt.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopt.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslopt.c Wed Feb 20 23:04:28 2019 (r344395) @@ -814,7 +814,7 @@ OptOptimizeNamePath ( ACPI_FREE (ExternalNameString); /* - * Attempt an optmization depending on the type of namepath + * Attempt an optimization depending on the type of namepath */ if (Flags & (AML_NAMED | AML_CREATE)) { Modified: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Wed Feb 20 23:04:28 2019 (r344395) @@ -449,7 +449,7 @@ ApCheckPredefinedReturnValue ( * DESCRIPTION: Check for a predefined name for a static object (created via * the ASL Name operator). If it is a predefined ACPI name, ensure * that the name does not require any arguments (which would - * require a control method implemenation of the name), and that + * require a control method implementation of the name), and that * the type of the object is one of the expected types for the * predefined name. * Modified: vendor-sys/acpica/dist/source/compiler/aslprintf.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprintf.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslprintf.c Wed Feb 20 23:04:28 2019 (r344395) @@ -239,7 +239,7 @@ OpcDoFprintf ( * RETURN: None * * DESCRIPTION: Convert printf macro to a Store AML operation. The printf - * macro parse tree is layed out as follows: + * macro parse tree is laid out as follows: * * Op - printf parse op * Op->Child - Format string Modified: vendor-sys/acpica/dist/source/compiler/aslresources.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslresources.y Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslresources.y Wed Feb 20 23:04:28 2019 (r344395) @@ -866,7 +866,7 @@ UartSerialBusTerm OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ @@ -891,7 +891,7 @@ UartSerialBusTermV2 OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ Modified: vendor-sys/acpica/dist/source/compiler/aslsupport.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslsupport.l Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslsupport.l Wed Feb 20 23:04:28 2019 (r344395) @@ -610,7 +610,7 @@ loop: /* * Check for nested comment -- can help catch cases where a previous - * comment was accidently left unterminated + * comment was accidentally left unterminated */ if ((c1 == '/') && (c == '*')) { Modified: vendor-sys/acpica/dist/source/compiler/aslxref.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslxref.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/aslxref.c Wed Feb 20 23:04:28 2019 (r344395) @@ -174,6 +174,12 @@ XfNamespaceLocateEnd ( UINT32 Level, void *Context); +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node); + static ACPI_PARSE_OBJECT * XfGetParentMethod ( ACPI_PARSE_OBJECT *Op); @@ -408,6 +414,7 @@ XfGetParentMethod ( return (NULL); /* No parent method found */ } + /******************************************************************************* * * FUNCTION: XfNamespaceLocateBegin @@ -488,7 +495,7 @@ XfNamespaceLocateBegin ( Node->ArgCount = (UINT8) (((UINT8) NextOp->Asl.Value.Integer) & 0x07); - /* We will track all posible ArgXs */ + /* We will track all possible ArgXs */ for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { @@ -776,6 +783,15 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } + /* Check for an attempt to access an object in another method */ + + if (!XfValidateCrossReference (Op, OpInfo, Node)) + { + AslError (ASL_ERROR, ASL_MSG_TEMPORARY_OBJECT, Op, + Op->Asl.ExternalName); + return_ACPI_STATUS (Status); + } + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) @@ -1233,4 +1249,104 @@ XfNamespaceLocateEnd ( } return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: XfValidateCrossReference + * + * PARAMETERS: Op - Parse Op that references the object + * OpInfo - Parse Op info struct + * Node - Node for the referenced object + * + * RETURN: TRUE if the reference is legal, FALSE otherwise + * + * DESCRIPTION: Determine if a reference to another object is allowed. + * + * EXAMPLE: + * Method (A) {Name (INT1, 1)} Declaration of object INT1 + * Method (B) (Store (2, \A.INT1)} Illegal reference to object INT1 + * (INT1 is temporary, valid only during + * execution of A) + * + * NOTES: + * A null pointer returned by either XfGetParentMethod or + * UtGetParentMethod indicates that the parameter object is not + * within a control method. + * + * Five cases are handled: Case(Op, Node) + * 1) Case(0,0): Op is not within a method, Node is not --> OK + * 2) Case(0,1): Op is not within a method, but Node is --> Illegal + * 3) Case(1,0): Op is within a method, Node is not --> OK + * 4) Case(1,1): Both are within the same method --> OK + * 5) Case(1,1): Both are in methods, but not same method --> Illegal + * + ******************************************************************************/ + +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_PARSE_OBJECT *ReferencingMethodOp; + ACPI_NAMESPACE_NODE *ReferencedMethodNode; + + + /* Ignore actual named (and related) object declarations */ + + if (OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_DEFER | AML_HAS_ARGS)) + { + return (TRUE); + } + + /* + * 1) Search upwards in parse tree for owner of the referencing object + * 2) Search upwards in namespace to find the owner of the referenced object + */ + ReferencingMethodOp = XfGetParentMethod (Op); + ReferencedMethodNode = UtGetParentMethod (Node); + + if (!ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 1) Case (0,0): Both Op and Node are not within methods + * --> OK + */ + return (TRUE); + } + + if (!ReferencingMethodOp && ReferencedMethodNode) + { + /* + * 2) Case (0,1): Op is not in a method, but Node is within a + * method --> illegal + */ + return (FALSE); + } + else if (ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 3) Case (1,0): Op is within a method, but Node is not + * --> OK + */ + return (TRUE); + } + else if (ReferencingMethodOp->Asl.Node == ReferencedMethodNode) + { + /* + * 4) Case (1,1): Both Op and Node are within the same method + * --> OK + */ + return (TRUE); + } + else + { + /* + * 5) Case (1,1), Op and Node are in different methods + * --> Illegal + */ + return (FALSE); + } } Modified: vendor-sys/acpica/dist/source/compiler/cvcompiler.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/cvcompiler.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/cvcompiler.c Wed Feb 20 23:04:28 2019 (r344395) @@ -168,7 +168,7 @@ * * DESCRIPTION: Process a single line comment of a c Style comment. This * function captures a line of a c style comment in a char* and - * places the comment in the approperiate global buffer. + * places the comment in the appropriate global buffer. * ******************************************************************************/ @@ -294,7 +294,7 @@ CvProcessComment ( * RETURN: none * * DESCRIPTION: Process a single line comment. This function captures a comment - * in a char* and places the comment in the approperiate global + * in a char* and places the comment in the appropriate global * buffer through CvPlaceComment * ******************************************************************************/ @@ -333,7 +333,7 @@ CvProcessCommentType2 ( * * would be lexically analyzed as a single comment. * - * Create a new string with the approperiate spaces. Since we need + * Create a new string with the appropriate spaces. Since we need * to account for the proper spacing, the actual comment, * extra 2 spaces so that this comment can be converted to the "/ *" * style and the null terminator, the string would look something @@ -380,7 +380,7 @@ CvProcessCommentType2 ( * RETURN: TotalCommentLength - Length of all comments within this op. * * DESCRIPTION: Calculate the length that the each comment takes up within Op. - * Comments look like the follwoing: [0xA9 OptionBtye comment 0x00] + * Comments look like the following: [0xA9 OptionBtye comment 0x00] * therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual * length of this comment. * @@ -963,7 +963,7 @@ CvAppendInlineComment ( * RETURN: None * * DESCRIPTION: Given type and CommentString, this function places the - * CommentString in the approperiate global comment list or char* + * CommentString in the appropriate global comment list or char* * ******************************************************************************/ Modified: vendor-sys/acpica/dist/source/compiler/cvparser.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/cvparser.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/cvparser.c Wed Feb 20 23:04:28 2019 (r344395) @@ -276,7 +276,7 @@ CvInitFileTree ( AcpiGbl_FileTreeRoot->File = AcpiGbl_OutputFile; /* - * Set this to true because we dont need to output + * Set this to true because we don't need to output * an include statement for the topmost file */ AcpiGbl_FileTreeRoot->IncludeWritten = TRUE; @@ -514,7 +514,7 @@ CvFileAddressLookup( * RETURN: None * * DESCRIPTION: Takes a given parse op, looks up its Op->Common.Aml field - * within the file tree and fills in approperiate file information + * within the file tree and fills in appropriate file information * from a matching node within the tree. * This is referred as ASL_CV_LABEL_FILENODE. * @@ -1005,7 +1005,7 @@ CvCaptureComments ( * * RETURN: None * - * DESCRIPTION: Transfer all of the commments stored in global containers to the + * DESCRIPTION: Transfer all of the comments stored in global containers to the * given Op. This will be invoked shortly after the parser creates * a ParseOp. * This is referred as ASL_CV_TRANSFER_COMMENTS. Modified: vendor-sys/acpica/dist/source/compiler/dtexpress.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtexpress.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/dtexpress.c Wed Feb 20 23:04:28 2019 (r344395) @@ -372,7 +372,7 @@ DtDoOperator ( * * RETURN: Table offset associated with the label * - * DESCRIPTION: Lookup a lable and return its value. + * DESCRIPTION: Lookup a label and return its value. * *****************************************************************************/ Modified: vendor-sys/acpica/dist/source/compiler/dtio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtio.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/dtio.c Wed Feb 20 23:04:28 2019 (r344395) @@ -375,7 +375,7 @@ DtParseLine ( return (AE_OK); } - /* All lines after "Raw Table Data" are ingored */ + /* All lines after "Raw Table Data" are ignored */ if (strstr (LineBuffer, ACPI_RAW_TABLE_DATA_HEADER)) { Modified: vendor-sys/acpica/dist/source/compiler/dttable1.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttable1.c Wed Feb 20 22:49:09 2019 (r344394) +++ vendor-sys/acpica/dist/source/compiler/dttable1.c Wed Feb 20 23:04:28 2019 (r344395) @@ -831,7 +831,7 @@ DtCompileDrtm ( DtInsertSubtable (ParentTable, Subtable); /* - * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care + * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HADER fields. */ #if 0 @@ -1002,13 +1002,35 @@ DtCompileGtdt ( ACPI_SUBTABLE_HEADER *GtdtHeader; ACPI_DMTABLE_INFO *InfoTable; UINT32 GtCount; + ACPI_TABLE_HEADER *Header; + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + + /* Compile the main table */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); + } + + /* GTDT revision 3 later contains 2 extra fields before subtables */ + + if (Header->Revision > 2) + { + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoGtdtEl2, &Subtable); + if (ACPI_FAILURE (Status)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 20 23:05: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 D976E14E0364; Wed, 20 Feb 2019 23:05:18 +0000 (UTC) (envelope-from jkim@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 705CD73CDC; Wed, 20 Feb 2019 23:05:18 +0000 (UTC) (envelope-from jkim@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 40EDDC70F; Wed, 20 Feb 2019 23:05:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KN5I0B068244; Wed, 20 Feb 2019 23:05:18 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KN5I5g068243; Wed, 20 Feb 2019 23:05:18 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902202305.x1KN5I5g068243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Feb 2019 23:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r344396 - vendor-sys/acpica/20190215 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20190215 X-SVN-Commit-Revision: 344396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 705CD73CDC 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)[-0.999,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, 20 Feb 2019 23:05:19 -0000 Author: jkim Date: Wed Feb 20 23:05:17 2019 New Revision: 344396 URL: https://svnweb.freebsd.org/changeset/base/344396 Log: Tag ACPICA 20190215. Added: vendor-sys/acpica/20190215/ - copied from r344395, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Wed Feb 20 23:35: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 4233B14E1255 for ; Wed, 20 Feb 2019 23:35:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFB507516C for ; Wed, 20 Feb 2019 23:35:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id z25so7700008qti.13 for ; Wed, 20 Feb 2019 15:35:08 -0800 (PST) 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=U2Ko2kKTv+d4rgRB5W4bXMJaSPGErsp6WZ/bCvlDPVw=; b=Quhd2FQUOUfqMsn3Rc4ckU2wZw1Py6C9Y3pTEm3j9WQ+m6bx/UvHloT5OyTMqzq9Y8 xqAgW7wFfc5equWMtz2jNfq/qrXJHB58GZkZnulchR/s0S1mU5fKm54faVOYJB0rK92i DAve7a78EAzXs9pq2P7dcTwsgchzN/0U42SMhmfyrdcSO1THwY2A5H//flFI8k6z80+T lald1xhd4pilz9NGkbO1Co80QefrS5n7ufTXLSgjBbcb04FmKo2KhRvpBin2W/PMAN1N bL4m7ThXQe2f760KmX01ZmZ57IBt1Tsl3X/ZB4vDTKp/zz/4ddICiTYL70XjZgQ4u/i8 UtGQ== 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=U2Ko2kKTv+d4rgRB5W4bXMJaSPGErsp6WZ/bCvlDPVw=; b=FIVYeFxin1sm5TbEOKqXlWcYmcfJoXceZ49uQeUqqRMnrkQRjr4vWq7QdTJST9eNED WwPwYwUQBE1MfGUkHUbr44PWQXZmV0I2+Rb3OmSNXNxbKDdmrSQb4QvW1FDyZBGUjr+H 1SjxTkiqQAuHPPi6QuAphv6L+yjoAxoDFFJkCYLzdkCqmye60F+Gxke9tqg4ZdxnzWhw gFvkVPiSn02oy/fgIjws2X+pZWw4CR0r7qpB+oCBnuUoIa3cjWdyXeA4HvwYtnkrU56U mW9TH/+UBpbl5I9cWv8NyLgMSIhUdnNhrP4bGvNBo1ZQiTgwqAIXPgPs092ynSNiuvwe Pk8g== X-Gm-Message-State: AHQUAuaBhaN7H403h2mbSRa5JB6RDDCdjJ2t42FRSheavzZcvT3Aqa/k m87TDEUuOtUcQ7tRfilgOyzs14WN1K6pCvVYn3p+XA== X-Google-Smtp-Source: AHgI3IZNFRO7+/Tgss4x8yFm1Hc+9xuT3LSs3rPTr//o2t3HLMzLVHfIuww5aYP2hzYbClb1vTuP6E6dP5R5hKvV3MU= X-Received: by 2002:ac8:35f8:: with SMTP id l53mr29997235qtb.15.1550705708231; Wed, 20 Feb 2019 15:35:08 -0800 (PST) MIME-Version: 1.0 References: <201902201705.x1KH5E9V039924@repo.freebsd.org> <201902201719.x1KHJNwL016175@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902201719.x1KHJNwL016175@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 20 Feb 2019 16:34:57 -0700 Message-ID: Subject: Re: svn commit: r344364 - vendor/illumos/dist/lib/libdtrace/common To: "Rodney W. Grimes" Cc: Mark Johnston , src-committers , svn-src-all@freebsd.org, svn-src-vendor@freebsd.org, patrick.mooney@joyent.com X-Rspamd-Queue-Id: CFB507516C 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.990,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: Wed, 20 Feb 2019 23:35:09 -0000 On Wed, Feb 20, 2019 at 10:19 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: markj > > Date: Wed Feb 20 17:05:13 2019 > > New Revision: 344364 > > URL: https://svnweb.freebsd.org/changeset/base/344364 > > > > Log: > > 9058 postmortem DTrace frequently broken under vmware > > > > illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f > > > > Reviewed by: Tim Kordas > > Reviewed by: Patrick Mooney > > Reviewed by: Yuri Pankov > > Reviewed by: Matthew Ahrens > > Approved by: Matthew Ahrens > > Author: Sam Gwydir > > > > Modified: > > vendor/illumos/dist/lib/libdtrace/common/dt_consume.c > > > > Modified: vendor/illumos/dist/lib/libdtrace/common/dt_consume.c > > > ============================================================================== > > --- vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 > 14:12:25 2019 (r344363) > > +++ vendor/illumos/dist/lib/libdtrace/common/dt_consume.c Wed Feb 20 > 17:05:13 2019 (r344364) > > @@ -24,7 +24,7 @@ > > */ > > > > /* > > - * Copyright (c) 2013, Joyent, Inc. All rights reserved. > > + * Copyright (c) 2017, Joyent, Inc. All rights reserved. > > This change to this copyright is very questionable. > One should always retain the first date of publication > in a copyright statement. > > I do understand your just importing a change from illumous, > but I want it on public record that I have raised issue > with this change to a copyright, and this has nothing to > do with you personally, or you wanting to bring this code > over. > Joyent is following the old Sun practice of listing the last date only. I've had my company's lawyers tell me in the past this is acceptable. In my research, as layperson, I've found advice going all three ways: list every year, or else; earliest-latest year range; only the latest year. I once asked an IP lawyer that handled a friend's trademark case for clue.com. He said that there is a diversity of legal opinion in the legal community, and that in some specific cases one might be favored over the other. Most of the time, in his opinion, the differences don't matter to open source. He hastened to add he couldn't give any blanket statements on the topic and for proper legal advice he'd need to know more about the specific use. And then we had another beer and chatted about other things. I never followed up. In the years since this, I've seen all three styles used. Warner > * Copyright (c) 2012 by Delphix. All rights reserved. > > */ > > > > @@ -3010,9 +3010,6 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, > > break; > > > > timestamp = dt_buf_oldest(buf, dtp); > > - assert(timestamp >= dtp->dt_last_timestamp); > > - dtp->dt_last_timestamp = timestamp; > > - > > if (timestamp == buf->dtbd_timestamp) { > > /* > > * We've reached the end of the time > covered > > @@ -3026,6 +3023,8 @@ dtrace_consume(dtrace_hdl_t *dtp, FILE *fp, > > break; > > continue; > > } > > + assert(timestamp >= dtp->dt_last_timestamp); > > + dtp->dt_last_timestamp = timestamp; > > > > if ((rval = dt_consume_cpu(dtp, fp, > > buf->dtbd_cpu, buf, B_TRUE, pf, rf, arg)) != 0) > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-all@freebsd.org Wed Feb 20 23:42: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 CE9DF14E130E; Wed, 20 Feb 2019 23:42:05 +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 7ED4F75547; Wed, 20 Feb 2019 23:42:05 +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 654AFCDAA; Wed, 20 Feb 2019 23:42:05 +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 x1KNg5IN086989; Wed, 20 Feb 2019 23:42:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KNg3qP086981; Wed, 20 Feb 2019 23:42:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902202342.x1KNg3qP086981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 23:42:03 +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: r344397 - in stable/11: sbin/geom/class/eli stand/libsa/geli sys/geom/eli X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: sbin/geom/class/eli stand/libsa/geli sys/geom/eli X-SVN-Commit-Revision: 344397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7ED4F75547 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)[-0.999,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, 20 Feb 2019 23:42:06 -0000 Author: kevans Date: Wed Feb 20 23:42:03 2019 New Revision: 344397 URL: https://svnweb.freebsd.org/changeset/base/344397 Log: MFC r316312, r332361, r333438-r333439, r339804: GELI dry-run r316312: sys/geom/eli: Switch bzero() to explicit_bzero() for sensitive data In GELI, anywhere we are zeroing out possibly sensitive data, like the metadata struct, the metadata sector (both contain the encrypted master key), the user key, or the master key, use explicit_bzero. Didn't touch the bzero() used to initialize structs. r332361: Introduce dry run option for attaching the device. This will allow us to verify if passphrase and key is valid without decrypting whole device. r333438: Change option dry-run from 'n' to 'C' in geli attach command. 'n' is used in other commands to define the key index. We should be consistent with that. 'C' option is used by patch(1) to perform dryrun so lets use that. r333439: Introduce the 'n' flag for the geli attach command. If the 'n' flag is provided the provided key number will be used to decrypt device. This can be used combined with dryrun to verify if the key is set correctly. This can be also used to determine which key slot we want to change on already attached device. r339804: Restore backward compatibility for "attach" verb. In r332361 and r333439, two new parameters were added to geli attach verb using gctl_get_paraml, which requires the value to be present. This would prevent old geli(8) binary from attaching geli(4) device as they have no knowledge about the new parameters. Restore backward compatibility by treating the absense of these two values as seeing the default value supplied by userland. Modified: stable/11/sbin/geom/class/eli/geli.8 stable/11/sbin/geom/class/eli/geom_eli.c stable/11/stand/libsa/geli/geliboot.c stable/11/sys/geom/eli/g_eli.c stable/11/sys/geom/eli/g_eli.h stable/11/sys/geom/eli/g_eli_ctl.c stable/11/sys/geom/eli/g_eli_key.c stable/11/sys/geom/eli/g_eli_key_cache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/11/sbin/geom/class/eli/geli.8 Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sbin/geom/class/eli/geli.8 Wed Feb 20 23:42:03 2019 (r344397) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2017 +.Dd May 9, 2018 .Dt GELI 8 .Os .Sh NAME @@ -67,7 +67,8 @@ utility: .Cm init .Nm .Cm attach -.Op Fl dprv +.Op Fl Cdprv +.Op Fl n Ar keyno .Op Fl j Ar passfile .Op Fl k Ar keyfile .Ar prov @@ -393,6 +394,9 @@ suffix. .Pp Additional options include: .Bl -tag -width ".Fl j Ar passfile" +.It Fl C +Do a dry-run decryption. +This is useful to verify passphrase and keyfile without decrypting the device. .It Fl d If specified, a decrypted provider will be detached automatically on last close. This can help with scarce memory so the user does not have to remember to detach the @@ -404,6 +408,9 @@ Probably a better choice is the option for the .Cm detach subcommand. +.It Fl n Ar keyno +Specifies the index number of the Master Key copy to use (could be 0 or 1). +If the index number is not provided all keys will be tested. .It Fl j Ar passfile Specifies a file which contains the passphrase component of the User Key (or part of it). Modified: stable/11/sbin/geom/class/eli/geom_eli.c ============================================================================== --- stable/11/sbin/geom/class/eli/geom_eli.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sbin/geom/class/eli/geom_eli.c Wed Feb 20 23:42:03 2019 (r344397) @@ -86,7 +86,7 @@ static int eli_backup_create(struct gctl_req *req, con * * init [-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov * label - alias for 'init' - * attach [-dprv] [-j passfile] [-k keyfile] prov + * attach [-Cdprv] [-n keyno] [-j passfile] [-k keyfile] prov * detach [-fl] prov ... * stop - alias for 'detach' * onetime [-d] [-a aalgo] [-e ealgo] [-l keylen] prov @@ -145,14 +145,16 @@ struct g_command class_commands[] = { }, { "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main, { + { 'C', "dryrun", NULL, G_TYPE_BOOL }, { 'd', "detach", NULL, G_TYPE_BOOL }, { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'n', "keyno", "-1", G_TYPE_NUMBER }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-dprv] [-j passfile] [-k keyfile] prov" + "[-Cdprv] [-n keyno] [-j passfile] [-k keyfile] prov" }, { "detach", 0, NULL, { @@ -1128,7 +1130,7 @@ eli_setkey_detached(struct gctl_req *req, const char * } /* Decrypt Master Key. */ - error = g_eli_mkey_decrypt(md, key, mkey, &nkey); + error = g_eli_mkey_decrypt_any(md, key, mkey, &nkey); bzero(key, sizeof(key)); if (error != 0) { bzero(md, sizeof(*md)); Modified: stable/11/stand/libsa/geli/geliboot.c ============================================================================== --- stable/11/stand/libsa/geli/geliboot.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/stand/libsa/geli/geliboot.c Wed Feb 20 23:42:03 2019 (r344397) @@ -121,14 +121,14 @@ geli_findkey(struct geli_entry *ge, struct dsk *dskp, int i; if (ge->keybuf_slot >= 0) { - if (g_eli_mkey_decrypt(&ge->md, saved_keys[ge->keybuf_slot], + if (g_eli_mkey_decrypt_any(&ge->md, saved_keys[ge->keybuf_slot], mkey, &keynum) == 0) { return (0); } } for (i = 0; i < nsaved_keys; i++) { - if (g_eli_mkey_decrypt(&ge->md, saved_keys[i], mkey, + if (g_eli_mkey_decrypt_any(&ge->md, saved_keys[i], mkey, &keynum) == 0) { ge->keybuf_slot = i; return (0); @@ -266,7 +266,7 @@ geli_attach(struct geli_entry *ge, struct dsk *dskp, c g_eli_crypto_hmac_final(&ctx, key, 0); - error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); + error = g_eli_mkey_decrypt_any(&geli_e->md, key, mkey, &keynum); if (error == -1) { explicit_bzero(mkey, sizeof(mkey)); explicit_bzero(key, sizeof(key)); Modified: stable/11/sys/geom/eli/g_eli.c ============================================================================== --- stable/11/sys/geom/eli/g_eli.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sys/geom/eli/g_eli.c Wed Feb 20 23:42:03 2019 (r344397) @@ -1086,7 +1086,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, memcpy(key, keybuf->kb_ents[i].ke_data, sizeof(key)); - if (g_eli_mkey_decrypt(&md, key, + if (g_eli_mkey_decrypt_any(&md, key, mkey, &nkey) == 0 ) { explicit_bzero(key, sizeof(key)); goto have_key; @@ -1161,7 +1161,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, /* * Decrypt Master-Key. */ - error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); + error = g_eli_mkey_decrypt_any(&md, key, mkey, &nkey); bzero(key, sizeof(key)); if (error == -1) { if (i == tries) { Modified: stable/11/sys/geom/eli/g_eli.h ============================================================================== --- stable/11/sys/geom/eli/g_eli.h Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sys/geom/eli/g_eli.h Wed Feb 20 23:42:03 2019 (r344397) @@ -686,6 +686,8 @@ void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t void g_eli_mkey_hmac(unsigned char *mkey, const unsigned char *key); int g_eli_mkey_decrypt(const struct g_eli_metadata *md, + const unsigned char *key, unsigned char *mkey, unsigned keyp); +int g_eli_mkey_decrypt_any(const struct g_eli_metadata *md, const unsigned char *key, unsigned char *mkey, unsigned *nkeyp); int g_eli_mkey_encrypt(unsigned algo, const unsigned char *key, unsigned keylen, unsigned char *mkey); Modified: stable/11/sys/geom/eli/g_eli_ctl.c ============================================================================== --- stable/11/sys/geom/eli/g_eli_ctl.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sys/geom/eli/g_eli_ctl.c Wed Feb 20 23:42:03 2019 (r344397) @@ -57,9 +57,9 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class struct g_provider *pp; const char *name; u_char *key, mkey[G_ELI_DATAIVKEYLEN]; - int *nargs, *detach, *readonly; - int keysize, error; - u_int nkey; + int *nargs, *detach, *readonly, *dryrunp; + int keysize, error, nkey, dryrun, dummy; + intmax_t *valp; g_topology_assert(); @@ -79,12 +79,39 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } + /* "keyno" is optional for backward compatibility */ + nkey = -1; + valp = gctl_get_param(req, "keyno", &dummy); + if (valp != NULL) { + valp = gctl_get_paraml(req, "keyno", sizeof(*valp)); + if (valp != NULL) + nkey = *valp; + } + if (nkey < -1 || nkey >= G_ELI_MAXMKEYS) { + gctl_error(req, "Invalid '%s' argument.", "keyno"); + return; + } + readonly = gctl_get_paraml(req, "readonly", sizeof(*readonly)); if (readonly == NULL) { gctl_error(req, "No '%s' argument.", "readonly"); return; } + /* "dryrun" is optional for backward compatibility */ + dryrun = 0; + dryrunp = gctl_get_param(req, "dryrun", &dummy); + if (dryrunp != NULL) { + dryrunp = gctl_get_paraml(req, "dryrun", sizeof(*dryrunp)); + if (dryrunp != NULL) + dryrun = *dryrunp; + } + + if (*detach && *readonly) { + gctl_error(req, "Options -d and -r are mutually exclusive."); + return; + } + name = gctl_get_asciiparam(req, "arg0"); if (name == NULL) { gctl_error(req, "No 'arg%u' argument.", 0); @@ -104,44 +131,43 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } if (md.md_keys == 0x00) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No valid keys on %s.", pp->name); return; } key = gctl_get_param(req, "key", &keysize); if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No '%s' argument.", "key"); return; } - error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); - bzero(key, keysize); + if (nkey == -1) + error = g_eli_mkey_decrypt_any(&md, key, mkey, &nkey); + else + error = g_eli_mkey_decrypt(&md, key, mkey, nkey); + explicit_bzero(key, keysize); if (error == -1) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Wrong key for %s.", pp->name); return; } else if (error > 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot decrypt Master Key for %s (error=%d).", pp->name, error); return; } G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); - if (*detach && *readonly) { - bzero(&md, sizeof(md)); - gctl_error(req, "Options -d and -r are mutually exclusive."); - return; - } if (*detach) md.md_flags |= G_ELI_FLAG_WO_DETACH; if (*readonly) md.md_flags |= G_ELI_FLAG_RO; - g_eli_create(req, mp, pp, &md, mkey, nkey); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + if (!dryrun) + g_eli_create(req, mp, pp, &md, mkey, nkey); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static struct g_eli_softc * @@ -362,8 +388,8 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class } g_eli_create(req, mp, pp, &md, mkey, -1); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static void @@ -582,8 +608,8 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_cla "Cannot store metadata on %s (error=%d).", prov, error); } - bzero(&md, sizeof(md)); - bzero(sector, pp->sectorsize); + explicit_bzero(&md, sizeof(md)); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); } } @@ -607,6 +633,11 @@ g_eli_ctl_setkey(struct gctl_req *req, struct g_class gctl_error(req, "No 'arg%u' argument.", 0); return; } + key = gctl_get_param(req, "key", &keysize); + if (key == NULL || keysize != G_ELI_USERKEYLEN) { + gctl_error(req, "No '%s' argument.", "key"); + return; + } sc = g_eli_find_device(mp, name); if (sc == NULL) { gctl_error(req, "Provider %s is invalid.", name); @@ -662,13 +693,6 @@ g_eli_ctl_setkey(struct gctl_req *req, struct g_class md.md_iterations = *valp; } - key = gctl_get_param(req, "key", &keysize); - if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); - gctl_error(req, "No '%s' argument.", "key"); - return; - } - mkeydst = md.md_mkeys + nkey * G_ELI_MKEYLEN; md.md_keys |= (1 << nkey); @@ -676,9 +700,9 @@ g_eli_ctl_setkey(struct gctl_req *req, struct g_class /* Encrypt Master Key with the new key. */ error = g_eli_mkey_encrypt(md.md_ealgo, key, md.md_keylen, mkeydst); - bzero(key, keysize); + explicit_bzero(key, keysize); if (error != 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot encrypt Master Key (error=%d).", error); return; } @@ -686,10 +710,10 @@ g_eli_ctl_setkey(struct gctl_req *req, struct g_class sector = malloc(pp->sectorsize, M_ELI, M_WAITOK | M_ZERO); /* Store metadata with fresh key. */ eli_metadata_encode(&md, sector); - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector, pp->sectorsize); - bzero(sector, pp->sectorsize); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); if (error != 0) { gctl_error(req, "Cannot store metadata on %s (error=%d).", @@ -787,7 +811,7 @@ g_eli_ctl_delkey(struct gctl_req *req, struct g_class sector = malloc(pp->sectorsize, M_ELI, M_WAITOK | M_ZERO); for (i = 0; i <= g_eli_overwrites; i++) { if (i == g_eli_overwrites) - bzero(mkeydst, keysize); + explicit_bzero(mkeydst, keysize); else arc4rand(mkeydst, keysize, 0); /* Store metadata with destroyed key. */ @@ -804,8 +828,8 @@ g_eli_ctl_delkey(struct gctl_req *req, struct g_class */ (void)g_io_flush(cp); } - bzero(&md, sizeof(md)); - bzero(sector, pp->sectorsize); + explicit_bzero(&md, sizeof(md)); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); if (*all) G_ELI_DEBUG(1, "All keys removed from %s.", pp->name); @@ -852,12 +876,12 @@ g_eli_suspend_one(struct g_eli_softc *sc, struct gctl_ /* * Clear sensitive data on suspend, they will be recovered on resume. */ - bzero(sc->sc_mkey, sizeof(sc->sc_mkey)); + explicit_bzero(sc->sc_mkey, sizeof(sc->sc_mkey)); g_eli_key_destroy(sc); - bzero(sc->sc_akey, sizeof(sc->sc_akey)); - bzero(&sc->sc_akeyctx, sizeof(sc->sc_akeyctx)); - bzero(sc->sc_ivkey, sizeof(sc->sc_ivkey)); - bzero(&sc->sc_ivctx, sizeof(sc->sc_ivctx)); + explicit_bzero(sc->sc_akey, sizeof(sc->sc_akey)); + explicit_bzero(&sc->sc_akeyctx, sizeof(sc->sc_akeyctx)); + explicit_bzero(sc->sc_ivkey, sizeof(sc->sc_ivkey)); + explicit_bzero(&sc->sc_ivctx, sizeof(sc->sc_ivctx)); mtx_unlock(&sc->sc_queue_mtx); G_ELI_DEBUG(0, "Device %s has been suspended.", sc->sc_name); } @@ -950,6 +974,11 @@ g_eli_ctl_resume(struct gctl_req *req, struct g_class gctl_error(req, "No 'arg%u' argument.", 0); return; } + key = gctl_get_param(req, "key", &keysize); + if (key == NULL || keysize != G_ELI_USERKEYLEN) { + gctl_error(req, "No '%s' argument.", "key"); + return; + } sc = g_eli_find_device(mp, name); if (sc == NULL) { gctl_error(req, "Provider %s is invalid.", name); @@ -964,26 +993,19 @@ g_eli_ctl_resume(struct gctl_req *req, struct g_class return; } if (md.md_keys == 0x00) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No valid keys on %s.", pp->name); return; } - key = gctl_get_param(req, "key", &keysize); - if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); - gctl_error(req, "No '%s' argument.", "key"); - return; - } - - error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); - bzero(key, keysize); + error = g_eli_mkey_decrypt_any(&md, key, mkey, &nkey); + explicit_bzero(key, keysize); if (error == -1) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Wrong key for %s.", pp->name); return; } else if (error > 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot decrypt Master Key for %s (error=%d).", pp->name, error); return; @@ -1001,8 +1023,8 @@ g_eli_ctl_resume(struct gctl_req *req, struct g_class wakeup(sc); } mtx_unlock(&sc->sc_queue_mtx); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static int Modified: stable/11/sys/geom/eli/g_eli_key.c ============================================================================== --- stable/11/sys/geom/eli/g_eli_key.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sys/geom/eli/g_eli_key.c Wed Feb 20 23:42:03 2019 (r344397) @@ -69,7 +69,7 @@ g_eli_mkey_verify(const unsigned char *mkey, const uns g_eli_crypto_hmac(hmkey, sizeof(hmkey), mkey, G_ELI_DATAIVKEYLEN, chmac, 0); - bzero(hmkey, sizeof(hmkey)); + explicit_bzero(hmkey, sizeof(hmkey)); /* * Compare calculated HMAC with HMAC from metadata. @@ -97,56 +97,81 @@ g_eli_mkey_hmac(unsigned char *mkey, const unsigned ch g_eli_crypto_hmac(hmkey, sizeof(hmkey), mkey, G_ELI_DATAIVKEYLEN, odhmac, 0); - bzero(hmkey, sizeof(hmkey)); + explicit_bzero(hmkey, sizeof(hmkey)); } /* - * Find and decrypt Master Key encrypted with 'key'. - * Return decrypted Master Key number in 'nkeyp' if not NULL. + * Find and decrypt Master Key encrypted with 'key' at slot 'nkey'. * Return 0 on success, > 0 on failure, -1 on bad key. */ int g_eli_mkey_decrypt(const struct g_eli_metadata *md, const unsigned char *key, - unsigned char *mkey, unsigned *nkeyp) + unsigned char *mkey, unsigned nkey) { unsigned char tmpmkey[G_ELI_MKEYLEN]; unsigned char enckey[SHA512_MDLEN]; /* Key for encryption. */ const unsigned char *mmkey; - int bit, error, nkey; + int bit, error; - if (nkeyp != NULL) - *nkeyp = -1; + if (nkey > G_ELI_MKEYLEN) + return (-1); /* * The key for encryption is: enckey = HMAC_SHA512(Derived-Key, 1) */ g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x01", 1, enckey, 0); - mmkey = md->md_mkeys; - for (nkey = 0; nkey < G_ELI_MAXMKEYS; nkey++, mmkey += G_ELI_MKEYLEN) { - bit = (1 << nkey); - if (!(md->md_keys & bit)) - continue; - bcopy(mmkey, tmpmkey, G_ELI_MKEYLEN); - error = g_eli_crypto_decrypt(md->md_ealgo, tmpmkey, - G_ELI_MKEYLEN, enckey, md->md_keylen); - if (error != 0) { - bzero(tmpmkey, sizeof(tmpmkey)); - bzero(enckey, sizeof(enckey)); - return (error); - } - if (g_eli_mkey_verify(tmpmkey, key)) { - bcopy(tmpmkey, mkey, G_ELI_DATAIVKEYLEN); - bzero(tmpmkey, sizeof(tmpmkey)); - bzero(enckey, sizeof(enckey)); + mmkey = md->md_mkeys + G_ELI_MKEYLEN * nkey; + bit = (1 << nkey); + if (!(md->md_keys & bit)) + return (-1); + bcopy(mmkey, tmpmkey, G_ELI_MKEYLEN); + error = g_eli_crypto_decrypt(md->md_ealgo, tmpmkey, + G_ELI_MKEYLEN, enckey, md->md_keylen); + if (error != 0) { + explicit_bzero(tmpmkey, sizeof(tmpmkey)); + explicit_bzero(enckey, sizeof(enckey)); + return (error); + } + if (g_eli_mkey_verify(tmpmkey, key)) { + bcopy(tmpmkey, mkey, G_ELI_DATAIVKEYLEN); + explicit_bzero(tmpmkey, sizeof(tmpmkey)); + explicit_bzero(enckey, sizeof(enckey)); + return (0); + } + explicit_bzero(enckey, sizeof(enckey)); + explicit_bzero(tmpmkey, sizeof(tmpmkey)); + + return (-1); +} + +/* + * Find and decrypt Master Key encrypted with 'key'. + * Return decrypted Master Key number in 'nkeyp' if not NULL. + * Return 0 on success, > 0 on failure, -1 on bad key. + */ +int +g_eli_mkey_decrypt_any(const struct g_eli_metadata *md, + const unsigned char *key, unsigned char *mkey, unsigned *nkeyp) +{ + int error, nkey; + + if (nkeyp != NULL) + *nkeyp = -1; + + error = -1; + for (nkey = 0; nkey < G_ELI_MAXMKEYS; nkey++) { + error = g_eli_mkey_decrypt(md, key, mkey, nkey); + if (error == 0) { if (nkeyp != NULL) *nkeyp = nkey; - return (0); + break; + } else if (error > 0) { + break; } } - bzero(enckey, sizeof(enckey)); - bzero(tmpmkey, sizeof(tmpmkey)); - return (-1); + + return (error); } /* @@ -175,7 +200,7 @@ g_eli_mkey_encrypt(unsigned algo, const unsigned char */ error = g_eli_crypto_encrypt(algo, mkey, G_ELI_MKEYLEN, enckey, keylen); - bzero(enckey, sizeof(enckey)); + explicit_bzero(enckey, sizeof(enckey)); return (error); } Modified: stable/11/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- stable/11/sys/geom/eli/g_eli_key_cache.c Wed Feb 20 23:05:17 2019 (r344396) +++ stable/11/sys/geom/eli/g_eli_key_cache.c Wed Feb 20 23:42:03 2019 (r344397) @@ -117,7 +117,7 @@ g_eli_key_allocate(struct g_eli_softc *sc, uint64_t ke keysearch.gek_keyno = keyno; ekey = RB_FIND(g_eli_key_tree, &sc->sc_ekeys_tree, &keysearch); if (ekey != NULL) { - bzero(key, sizeof(*key)); + explicit_bzero(key, sizeof(*key)); free(key, M_ELI); key = ekey; TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); @@ -174,7 +174,7 @@ g_eli_key_remove(struct g_eli_softc *sc, struct g_eli_ RB_REMOVE(g_eli_key_tree, &sc->sc_ekeys_tree, key); TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); sc->sc_ekeys_allocated--; - bzero(key, sizeof(*key)); + explicit_bzero(key, sizeof(*key)); free(key, M_ELI); } @@ -239,7 +239,7 @@ g_eli_key_destroy(struct g_eli_softc *sc) mtx_lock(&sc->sc_ekeys_lock); if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) != 0) { - bzero(sc->sc_ekey, sizeof(sc->sc_ekey)); + explicit_bzero(sc->sc_ekey, sizeof(sc->sc_ekey)); } else { struct g_eli_key *key; From owner-svn-src-all@freebsd.org Wed Feb 20 23:52: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 EE9C014E170A for ; Wed, 20 Feb 2019 23:52:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81B2875A7B for ; Wed, 20 Feb 2019 23:52:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id h6so20177650itl.1 for ; Wed, 20 Feb 2019 15:52:53 -0800 (PST) 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:cc; bh=lb8j3J4dEqe0AzuH9DjWIJkvi872JvGn5ShEQWpEMuI=; b=LsZ75u6cQ28nj495SESuee5kuagTwbVpQJhmDpy9+aydvyM4H+X3A4ZOYafkVclU4g ThCbte8FjIltmNSQA8e3K754X3in5FJ3VbF12Ty1Qq8FduE/HCG6E01A/Ylhg+xSRlqz evj0XIWEj1rupejIrCH7CwK2YLmSrkNvWKn3gsayX6O7Zg5ze3htpR+L04SFy4DHzU6Z jIRpOw/LzMtzsNqj1LoBKfhPiioMJ10j1aEjnFRu3A5dT80L+MtFK9e8zsW94d+dH+Fz C7mYlllDVH4c4k1jaVL/k3wE9UJyyk5vAiKpMCCrlRq2MjNotg7fIaK1lpUQzZ0Oimol /LSg== X-Gm-Message-State: AHQUAubt8fdRyA/9zFkaWpw2hMf1Z9rPbdb6EalrzOoofSJdmeRQboAP szEEV5Nxb1g47FuXHjMi+y7Fik/G X-Google-Smtp-Source: AHgI3Ib/nP1R1hm3PMXApGh3IOTC53ukhCnWdDwEJM+cXkHkhGo7f5GD8H28fp1ahE4S4ACXncjVJg== X-Received: by 2002:a24:de8a:: with SMTP id d132mr2678710itg.55.1550706766820; Wed, 20 Feb 2019 15:52:46 -0800 (PST) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id 10sm3429774itm.41.2019.02.20.15.52.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 15:52:46 -0800 (PST) Received: by mail-it1-f174.google.com with SMTP id x131so19785797itc.3 for ; Wed, 20 Feb 2019 15:52:46 -0800 (PST) X-Received: by 2002:a5e:9243:: with SMTP id z3mt22986506iop.107.1550706766253; Wed, 20 Feb 2019 15:52:46 -0800 (PST) MIME-Version: 1.0 References: <201902200951.x1K9pDQs001745@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 20 Feb 2019 15:52:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344353 - in head/sys: amd64/amd64 amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include vm x86/include Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 81B2875A7B 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.990,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: Wed, 20 Feb 2019 23:52:54 -0000 Nevermind, sorry about that. I see the subsequent commits now. On Wed, Feb 20, 2019 at 2:33 PM Conrad Meyer wrote: > > Hi Konstantin, > > What is the (K)API for this (do you have any intended consumers in > mind)? Will it be documented in a manual page at some point? Does it > make sense to expose to userspace via mmap(2) or similar? > > Thanks, > Conrad > > On Wed, Feb 20, 2019 at 1:51 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Wed Feb 20 09:51:13 2019 > > New Revision: 344353 > > URL: https://svnweb.freebsd.org/changeset/base/344353 > > > > Log: > > Add kernel support for Intel userspace protection keys feature on > > Skylake Xeons. > > > > See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the > > RDPKRU and WRPKRU instructions. > > > > Reviewed by: markj > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Differential revision: https://reviews.freebsd.org/D18893 From owner-svn-src-all@freebsd.org Wed Feb 20 23:53: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 8CF3614E176D; Wed, 20 Feb 2019 23:53:47 +0000 (UTC) (envelope-from jkim@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 3C32175BCE; Wed, 20 Feb 2019 23:53:47 +0000 (UTC) (envelope-from jkim@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 13BF1CF65; Wed, 20 Feb 2019 23:53:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1KNrkXJ094385; Wed, 20 Feb 2019 23:53:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KNrewn094353; Wed, 20 Feb 2019 23:53:40 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902202353.x1KNrewn094353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 20 Feb 2019 23:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344398 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/namespace ... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/namespace components/parser compone... X-SVN-Commit-Revision: 344398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C32175BCE 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: Wed, 20 Feb 2019 23:53:48 -0000 Author: jkim Date: Wed Feb 20 23:53:39 2019 New Revision: 344398 URL: https://svnweb.freebsd.org/changeset/base/344398 Log: MFV: r344395 Import ACPICA 20190215. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump1.c head/sys/contrib/dev/acpica/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exserial.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/include/acclib.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/actbinfo.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/changes.txt Wed Feb 20 23:53:39 2019 (r344398) @@ -1,11 +1,100 @@ ---------------------------------------- -08 January 2019. Summary of changes for version 20190108: +15 February 2019. Summary of changes for version 20190215: This release is available at https://acpica.org/downloads +0) Support for ACPI specification version 6.3: + +Add PCC operation region support for the AML interpreter. This adds PCC +operation region support in the AML interpreter and a default handler for +acpiexec. The change also renames the PCC region address space keyword to +PlatformCommChannel. + +Support for new predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG. +These methods provide OSPM with health information and device boot +status. + +PDTT: Add TriggerOrder to the PCC Identifier structure. The field value +defines if the trigger needs to be invoked by OSPM before or at the end +of kernel crash dump processing/handling operation. + +SRAT: Add Generic Affinity Structure subtable. This subtable in the SRAT +is used for describing devices such as heterogeneous processors, +accelerators, GPUs, and IO devices with integrated compute or DMA +engines. + +MADT: Add support for statistical profiling in GICC. Statistical +profiling extension (SPE) is an architecture-specific feature for ARM. + +MADT: Add online capable flag. If this bit is set, system hardware +supports enabling this processor during OS runtime. + +New Error Disconnect Recover Notification value. There are a number of +scenarios where system Firmware in collaboration with hardware may +disconnect one or more devices from the rest of the system for purposes +of error containment. Firmware can use this new notification value to +alert OSPM of such a removal. + +PPTT: New additional fields in Processor Structure Flags. These flags +provide more information about processor topology. + +NFIT/Disassembler: Change a field name from "Address Range" to "Region +Type". + +HMAT updates: make several existing fields to be reserved as well as +rename subtable 0 to "memory proximity domain attributes". + +GTDT: Add support for new GTDT Revision 3. This revision adds information +for the EL2 timer. + +iASL: Update the HMAT example template for new fields. + +iASL: Add support for the new revision of the GTDT (Rev 3). + + 1) ACPICA kernel-resident subsystem: +AML Parser: fix the main AML parse loop to correctly skip erroneous +extended opcodes. AML opcodes come in two lengths: 1-byte opcodes and 2- +byte extended opcodes. If an error occurs during an AML table load, the +AML parser will continue loading the table by skipping the offending +opcode. This implements a "load table at any cost" philosophy. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Add checks for illegal object references, such as a reference +outside of method to an object within a method. Such an object is only +temporary. + +iASL: Emit error for creation of a zero-length operation region. Such a +region is rather pointless. If encountered, a runtime error is also +implemented in the interpeter. + +Debugger: Fix a possible fault with the "test objects" command. + +iASL: Makefile: support parent directory filenames containing embedded +spaces. + +iASL: Update the TPM2 template to revision 4. + +iASL: Add the ability to report specific warnings or remarks as errors. + +Disassembler: Disassemble OEMx tables as actual AML byte code. +Previously, these tables were treated as "unknown table". + +iASL: Add definition and disassembly for TPM2 revision 3. + +iASL: Add support for TPM2 rev 3 compilation. + + +---------------------------------------- +08 January 2019. Summary of changes for version 20190108: + + +1) ACPICA kernel-resident subsystem: + Updated all copyrights to 2019. This affects all source code modules. @@ -1218,7 +1307,7 @@ internal cache) is detected and ignored via object poi Debugger: Fixed an AML interpreter mutex issue during the single stepping of control methods. If certain debugger commands are executed during -stepping, a mutex aquire/release error could occur. Lv Zheng. +stepping, a mutex acquire/release error could occur. Lv Zheng. Fixed some issues generating ACPICA with the Intel C compiler by restoring the original behavior and compiler-specific include file in @@ -6760,7 +6849,7 @@ keyword is not standard across compilers, and this typ be configured on a per-compiler basis. Lin Ming. -Made the system global AcpiGbl_SystemAwakeAndRunning publically +Made the system global AcpiGbl_SystemAwakeAndRunning publicly available. Added an extern for this boolean in acpixf.h. Some hosts utilize this value @@ -11427,9 +11516,9 @@ Helgaas. Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) -any implicit conversion of a Buffer to a String, 2) a String object +any implicit conversion of a Buffer to a String, 2) a String object result -of the ASL Concatentate operator, 3) the String object result of the ASL +of the ASL Concatenate operator, 3) the String object result of the ASL ToString operator. Fixed a problem in the Windows OS interface layer (OSL) where a @@ -13585,7 +13674,7 @@ next access width boundary (a common coding error.) Renamed OSD_HANDLER to ACPI_OSD_HANDLER, and OSD_EXECUTION_CALLBACK to ACPI_OSD_EXEC_CALLBACK for consistency with other ACPI symbols. Also, these -symbols are lowercased by the latest version of the AcpiSrc tool. +symbols are lowercase by the latest version of the AcpiSrc tool. The prototypes for the PCI interfaces in acpiosxf.h have been updated to rename "Register" to simply "Reg" to prevent certain compilers from @@ -14957,8 +15046,8 @@ with the Linux coding style. Removed the non-Linux SourceSafe module revision number from each module header. -Completed major overhaul of symbols to be lowercased for linux. -Doubled the number of symbols that are lowercased. +Completed major overhaul of symbols to be lowercase for linux. +Doubled the number of symbols that are lowercase. Fixed a problem where identifiers within procedure headers and within quotes were not fully lower cased (they were left with a @@ -16454,7 +16543,7 @@ Summary of changes for this label: 02_14_02 Implemented support in AcpiLoadTable to allow loading of FACS and FADT tables. -Suport for the now-obsolete interim 0.71 64-bit ACPI tables has +Support for the now-obsolete interim 0.71 64-bit ACPI tables has been removed. All 64-bit platforms should be migrated to the ACPI 2.0 tables. The actbl71.h header has been removed from the source tree. @@ -16804,7 +16893,7 @@ Updated all files to apply cleanly against 2.4.16. Added basic PCI Interrupt Routing Table (PRT) support for IA32 (acpi_pci.c), and unified the PRT code for IA32 and IA64. This -version supports both static and dyanmic PRT entries, but dynamic +version supports both static and dynamic PRT entries, but dynamic entries are treated as if they were static (not yet reconfigurable). Architecture- specific code to use this data is absent on IA32 but should be available shortly. @@ -16893,7 +16982,7 @@ power-down, and thermal passive cooling issues (coming Added additional typechecking for Fields within restricted access Operation Regions. All fields within EC and CMOS regions must be -declared with ByteAcc. All fields withing SMBus regions must be +declared with ByteAcc. All fields within SMBus regions must be declared with the BufferAcc access type. Fixed a problem where the listing file output of control methods @@ -17066,7 +17155,7 @@ objects to not be deleted during subsystem termination Fixed a problem with the external AcpiEvaluateObject interface where the subsystem would fault if the named object to be -evaluated refered to a constant such as Zero, Ones, etc. +evaluated referred to a constant such as Zero, Ones, etc. Fixed a problem with IndexFields and BankFields where the subsystem would fault if the index, data, or bank registers were @@ -17133,7 +17222,7 @@ sleeps.) The AcpiEnterSleepState and AcpiLeaveSleepState interfaces now support wake-enabled GPEs. This means that upon entering the sleep state, all GPEs that are not wake-enabled are disabled. -When leaving the sleep state, these GPEs are reenabled. +When leaving the sleep state, these GPEs are re-enabled. A local double-precision divide/modulo module has been added to enhance portability to OS kernels where a 64-bit math library is Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 20 23:53:39 2019 (r344398) @@ -305,6 +305,11 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_MSM", "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"), AH_PREDEF ("_MTL", "Minimum Throttle Limit", "Returns the minimum throttle limit for a thermal zone"), AH_PREDEF ("_MTP", "Memory Type", "Resource Descriptor field"), + AH_PREDEF ("_NBS", "NVDIMM Boot Status", "Returns information about NVDIMM device’s status at boot time"), + AH_PREDEF ("_NCH", "NVDIMM Current Health Information", "Returns current health information of the NVDIMM device"), + AH_PREDEF ("_NIC", "NVDIMM Health Error Injection Capabilities", "Returns health error injection capabilities that are supported by the platform"), + AH_PREDEF ("_NIG", "NVDIMM Inject Health Error Status","Returns currently active health errors and their error attributes that are injected by _NIH"), + AH_PREDEF ("_NIH", "NVDIMM Inject/Clear Health Errors", "Returns the status of injecting or clearing Health Errors"), AH_PREDEF ("_NTT", "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"), AH_PREDEF ("_OFF", "Power Off", "Sets a power resource to the off state"), AH_PREDEF ("_ON_", "Power On", "Sets a power resource to the on state"), @@ -393,7 +398,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_SDD", "Set Device Data", "Sets data for a SATA device"), AH_PREDEF ("_SEG", "PCI Segment", "Returns a device's PCI Segment Group number"), AH_PREDEF ("_SHL", "Set Hardware Limit", "Sets the hardware limit enforced by the Power Meter"), - AH_PREDEF ("_SHR", "Sharable", "Interrupt share status, Resource Descriptor field"), + AH_PREDEF ("_SHR", "Shareable", "Interrupt share status, Resource Descriptor field"), AH_PREDEF ("_SI_", "System Indicators", "Predefined scope"), AH_PREDEF ("_SIZ", "Size", "DMA transfer size, Resource Descriptor field"), AH_PREDEF ("_SLI", "System Locality Information", "Returns a list of NUMA system localities"), Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 20 23:53:39 2019 (r344398) @@ -226,7 +226,7 @@ AcpiAhMatchUuid ( for (Info = Gbl_AcpiUuids; Info->Description; Info++) { - /* Null string means desciption is a UUID class */ + /* Null string means description is a UUID class */ if (!Info->String) { Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1216,7 +1216,7 @@ AcpiDmCreateSubobjectForExternal ( * * DESCRIPTION: Add one external to the namespace by resolvign the external * (by performing a namespace lookup) and annotating the resulting - * namespace node with the approperiate information if the type + * namespace node with the appropriate information if the type * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 20 23:53:39 2019 (r344398) @@ -906,7 +906,7 @@ AcpiDmUpdateResourceName ( * * PARAMETERS: BitIndex - Index into the resource descriptor * Resource - Pointer to the raw resource data - * ResourceIndex - Index correspoinding to the resource type + * ResourceIndex - Index corresponding to the resource type * * RETURN: Pointer to the resource tag (ACPI_NAME). NULL if no match. * Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 20 23:53:39 2019 (r344398) @@ -320,7 +320,7 @@ static const char *AcpiDmHestNotifySubnames[ static const char *AcpiDmHmatSubnames[] = { - "Memory Subystem Address Range", + "Memory Proximity Domain Attributes", "System Locality Latency and Bandwidth Information", "Memory Side Cache Information", "Unknown Structure Type" /* Reserved */ @@ -400,6 +400,7 @@ static const char *AcpiDmSratSubnames[] = "Processor Local x2APIC Affinity", "GICC Affinity", "GIC ITS Affinity", /* Acpi 6.2 */ + "Generic Initiator Affinity", /* Acpi 6.3 */ "Unknown Subtable Type" /* Reserved */ }; Modified: head/sys/contrib/dev/acpica/common/dmtbdump1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbdump1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1106,9 +1106,26 @@ AcpiDmDumpGtdt ( return; } - /* Subtables */ + /* Rev 3 fields */ Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + if (Table->Revision > 2) + { + SubtableLength = sizeof (ACPI_GTDT_EL2); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + SubtableLength, AcpiDmTableInfoGtdtEl2); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += SubtableLength; + } + + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + + /* Subtables */ + while (Offset < Table->Length) { /* Common subtable header */ @@ -1406,7 +1423,7 @@ AcpiDmDumpHmat ( case ACPI_HMAT_TYPE_ADDRESS_RANGE: InfoTable = AcpiDmTableInfoHmat0; - Length = sizeof (ACPI_HMAT_ADDRESS_RANGE); + Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN); break; case ACPI_HMAT_TYPE_LOCALITY: Modified: head/sys/contrib/dev/acpica/common/dmtbdump3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump3.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbdump3.c Wed Feb 20 23:53:39 2019 (r344398) @@ -333,6 +333,11 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat4; break; + case ACPI_SRAT_TYPE_GENERIC_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat5; + break; + default: AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", Subtable->Type); Modified: head/sys/contrib/dev/acpica/common/dmtbinfo1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -814,6 +814,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] = ACPI_DMT_TERMINATOR }; +/* GDTD EL2 timer info. This table is appended to AcpiDmTableInfoGtdt for rev 3 and later */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtEl2[] = +{ + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerGsiv), "Virtual EL2 Timer GSIV", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_EL2_OFFSET (VirtualEL2TimerFlags), "Virtual EL2 Timer Flags", 0}, + ACPI_DMT_TERMINATOR +}; + /* GTDT Subtable header (one per Subtable) */ ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] = @@ -1105,20 +1114,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] = /* HMAT subtables */ -/* 0x00: Memory Subsystem Address Range */ +/* 0x00: Memory proximity domain attributes */ ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] = { {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG1, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Memory Proximity Domain Valid", 0}, - {ACPI_DMT_FLAG2, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Reservation Hint", 0}, {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (ProcessorPD), "Processor Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressBase), "Physical Address Range Base", 0}, - {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressLength), "Physical Address Range Size", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved3), "Reserved3", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (Reserved4), "Reserved4", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/common/dmtbinfo2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo2.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo2.c Wed Feb 20 23:53:39 2019 (r344398) @@ -535,6 +535,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[] = {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0}, + {ACPI_DMT_FLAG1, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Runtime Online Capable", 0}, ACPI_DMT_TERMINATOR }; @@ -683,7 +684,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0}, {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0}, {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (EfficiencyClass), "Efficiency Class", 0}, - {ACPI_DMT_UINT24, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_MADT11_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (SpeInterrupt), "SPE Overflow Interrupt", 0}, ACPI_DMT_TERMINATOR }; @@ -946,7 +948,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[] = {ACPI_DMT_FLAG1, ACPI_NFIT0_FLAG_OFFSET (Flags,0), "Proximity Domain Valid", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT0_OFFSET (ProximityDomain), "Proximity Domain", 0}, - {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Address Range GUID", 0}, + {ACPI_DMT_UUID, ACPI_NFIT0_OFFSET (RangeGuid[0]), "Region Type GUID", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Address), "Address Range Base", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (Length), "Address Range Length", 0}, {ACPI_DMT_UINT64, ACPI_NFIT0_OFFSET (MemoryMapping), "Memory Map Attribute", 0}, @@ -1246,6 +1248,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[] = {ACPI_DMT_UINT8, ACPI_PDTT0_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Runtime Trigger", 0}, {ACPI_DMT_FLAG1, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Wait for Completion", 0}, + {ACPI_DMT_FLAG2, ACPI_PDTT0_FLAG_OFFSET (Flags,0), "Trigger Order", 0}, ACPI_DMT_TERMINATOR }; @@ -1348,6 +1351,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] = {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags (decoded below)", 0}, {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0}, {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0}, + {ACPI_DMT_FLAG2, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Processor is a thread", 0}, + {ACPI_DMT_FLAG3, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Node is a leaf", 0}, + {ACPI_DMT_FLAG4, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Identical Implementation", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0}, {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0}, @@ -1390,12 +1396,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] = { {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "VENDOR_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "LEVEL_1_ID", 0}, - {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "LEVEL_2_ID", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "MAJOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "MINOR_REV", 0}, - {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "SPIN_REV", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "Vendor ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "Level1 ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "Level2 ID", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "Major revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "Minor revision", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "Spin revision", 0}, ACPI_DMT_TERMINATOR }; @@ -1473,7 +1479,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] = /******************************************************************************* * - * SDEI - Software Delegated Execption Interface Descriptor Table + * SDEI - Software Delegated Exception Interface Descriptor Table * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/common/dmtbinfo3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo3.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/common/dmtbinfo3.c Wed Feb 20 23:53:39 2019 (r344398) @@ -368,6 +368,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = ACPI_DMT_TERMINATOR }; +/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSrat5[] = +{ + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (Reserved), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_SRAT5_OFFSET (DeviceHandleType), "Device Handle Type", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (ProximityDomain), "Proximity Domain", 0}, + {ACPI_DMT_BUF16, ACPI_SRAT5_OFFSET (DeviceHandle), "Device Handle", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_SRAT5_FLAG_OFFSET (Flags,0), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT5_OFFSET (Reserved1), "Reserved2", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 20 23:53:39 2019 (r344398) @@ -494,6 +494,7 @@ CmDoCompile ( UtEndEvent (Event); UtEndEvent (FullCompile); + AslCheckExpectedExceptions (); CmCleanupAndExit (); return (0); @@ -811,7 +812,6 @@ CmCleanupAndExit ( BOOLEAN DeleteAmlFile = FALSE; - AslCheckExpectedExceptions (); AePrintErrorLog (ASL_FILE_STDERR); if (AslGbl_DebugFlag) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 20 23:53:39 2019 (r344398) @@ -702,7 +702,7 @@ OpnDoPackage ( /* - * aslopt - optmization + * aslopt - optimization */ void OptOptimizeNamePath ( @@ -1153,7 +1153,7 @@ OtXrefWalkPart1 ( /* - * aslutils - common compiler utilites + * aslutils - common compiler utilities */ void DbgPrint ( Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 20 23:53:39 2019 (r344398) @@ -692,7 +692,7 @@ NamePathTail [.]{NameSeg} "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ -"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ +"PlatformCommChannel" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ @@ -816,6 +816,13 @@ NamePathTail [.]{NameSeg} s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1); if (strcmp (AslCompilertext, "\\")) { + /* + * According to the ACPI specification, + * NameSegments must have length of 4. If + * the NameSegment has length less than 4, + * they are padded with underscores to meet + * the required length. + */ strcpy (s, "____"); AcpiUtStrupr (AslCompilertext); } Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Wed Feb 20 23:53:39 2019 (r344398) @@ -331,8 +331,8 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ - AslDualParseOpError (ASL_WARNING, ASL_MSG_EXTERN_COLLISION, Child, - Child->Asl.Value.String, ASL_MSG_EXTERN_FOUND_HERE, Node->Op, + AslDualParseOpError (ASL_WARNING, ASL_MSG_NAME_EXISTS, Child, + Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, Node->Op->Asl.ExternalName); } } @@ -575,7 +575,7 @@ LdNamespace1Begin ( if (Status == AE_NOT_FOUND) { /* - * This is either a foward reference or the object truly + * This is either a forward reference or the object truly * does not exist. The two cases can only be differentiated * during the cross-reference stage later. Mark the Op/Name * as not-found for now to indicate the need for further Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Wed Feb 20 23:53:39 2019 (r344398) @@ -353,15 +353,17 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NULL_RESOURCE_TEMPLATE */ "Empty Resource Template (END_TAG only)", /* ASL_MSG_FOUND_HERE */ "Original name creation/declaration below: ", /* ASL_MSG_ILLEGAL_RECURSION */ "Illegal recursive call to method that creates named objects", -/* ASL_MSG_EXTERN_COLLISION */ "A name cannot be defined and declared external in the same table", -/* ASL_MSG_FOUND_HERE_EXTERN */ "Remove one of the declarations indicated above or below:", +/* ASL_MSG_PLACE_HOLDER_00 */ "", /* TODO: fill in this slot with a new error message */ +/* ASL_MSG_PLACE_HOLDER_01 */ "", /* TODO: fill in this slot with a new error message */ /* ASL_MSG_OEM_TABLE_ID */ "Invalid OEM Table ID", /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", /* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", /* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", -/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", +/* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", +/* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed" }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Feb 20 23:53:39 2019 (r344398) @@ -355,8 +355,8 @@ typedef enum ASL_MSG_NULL_RESOURCE_TEMPLATE, ASL_MSG_FOUND_HERE, ASL_MSG_ILLEGAL_RECURSION, - ASL_MSG_EXTERN_COLLISION, - ASL_MSG_EXTERN_FOUND_HERE, + ASL_MSG_PLACE_HOLDER_00, + ASL_MSG_PLACE_HOLDER_01, ASL_MSG_OEM_TABLE_ID, ASL_MSG_OEM_ID, ASL_MSG_UNLOAD, @@ -364,6 +364,8 @@ typedef enum ASL_MSG_LONG_SLEEP, ASL_MSG_PREFIX_NOT_EXIST, ASL_MSG_NAMEPATH_NOT_EXIST, + ASL_MSG_REGION_LENGTH, + ASL_MSG_TEMPORARY_OBJECT, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Feb 20 23:53:39 2019 (r344398) @@ -657,6 +657,7 @@ OpnDoRegion ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *Next; + ACPI_ADR_SPACE_TYPE SpaceId; /* Opcode is parent node */ @@ -664,9 +665,10 @@ OpnDoRegion ( Next = Op->Asl.Child; - /* Second child is the space ID*/ + /* Second child is the space ID */ Next = Next->Asl.Next; + SpaceId = (ACPI_ADR_SPACE_TYPE) Next->Common.Value.Integer; /* Third child is the region offset */ @@ -677,7 +679,13 @@ OpnDoRegion ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode == PARSEOP_INTEGER) { + /* Check for zero length */ + Op->Asl.Value.Integer = Next->Asl.Value.Integer; + if (!Op->Asl.Value.Integer && (SpaceId < ACPI_NUM_PREDEFINED_REGIONS)) + { + AslError (ASL_ERROR, ASL_MSG_REGION_LENGTH, Op, NULL); + } } else { Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Feb 20 23:53:39 2019 (r344398) @@ -814,7 +814,7 @@ OptOptimizeNamePath ( ACPI_FREE (ExternalNameString); /* - * Attempt an optmization depending on the type of namepath + * Attempt an optimization depending on the type of namepath */ if (Flags & (AML_NAMED | AML_CREATE)) { Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Feb 20 23:53:39 2019 (r344398) @@ -449,7 +449,7 @@ ApCheckPredefinedReturnValue ( * DESCRIPTION: Check for a predefined name for a static object (created via * the ASL Name operator). If it is a predefined ACPI name, ensure * that the name does not require any arguments (which would - * require a control method implemenation of the name), and that + * require a control method implementation of the name), and that * the type of the object is one of the expected types for the * predefined name. * Modified: head/sys/contrib/dev/acpica/compiler/aslprintf.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprintf.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslprintf.c Wed Feb 20 23:53:39 2019 (r344398) @@ -239,7 +239,7 @@ OpcDoFprintf ( * RETURN: None * * DESCRIPTION: Convert printf macro to a Store AML operation. The printf - * macro parse tree is layed out as follows: + * macro parse tree is laid out as follows: * * Op - printf parse op * Op->Child - Format string Modified: head/sys/contrib/dev/acpica/compiler/aslresources.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresources.y Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslresources.y Wed Feb 20 23:53:39 2019 (r344398) @@ -866,7 +866,7 @@ UartSerialBusTerm OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ @@ -891,7 +891,7 @@ UartSerialBusTermV2 OptionalBitsPerByte /* 05: BitsPerByte */ OptionalStopBits /* 06: StopBits */ ',' ByteConstExpr /* 08: LinesInUse */ - OptionalEndian /* 09: Endianess */ + OptionalEndian /* 09: Endianness */ OptionalParityType /* 10: Parity */ OptionalFlowControl /* 11: FlowControl */ ',' WordConstExpr /* 13: Rx BufferSize */ Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Feb 20 23:53:39 2019 (r344398) @@ -610,7 +610,7 @@ loop: /* * Check for nested comment -- can help catch cases where a previous - * comment was accidently left unterminated + * comment was accidentally left unterminated */ if ((c1 == '/') && (c == '*')) { Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Wed Feb 20 23:53:39 2019 (r344398) @@ -174,6 +174,12 @@ XfNamespaceLocateEnd ( UINT32 Level, void *Context); +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node); + static ACPI_PARSE_OBJECT * XfGetParentMethod ( ACPI_PARSE_OBJECT *Op); @@ -408,6 +414,7 @@ XfGetParentMethod ( return (NULL); /* No parent method found */ } + /******************************************************************************* * * FUNCTION: XfNamespaceLocateBegin @@ -488,7 +495,7 @@ XfNamespaceLocateBegin ( Node->ArgCount = (UINT8) (((UINT8) NextOp->Asl.Value.Integer) & 0x07); - /* We will track all posible ArgXs */ + /* We will track all possible ArgXs */ for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { @@ -776,6 +783,15 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } + /* Check for an attempt to access an object in another method */ + + if (!XfValidateCrossReference (Op, OpInfo, Node)) + { + AslError (ASL_ERROR, ASL_MSG_TEMPORARY_OBJECT, Op, + Op->Asl.ExternalName); + return_ACPI_STATUS (Status); + } + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) @@ -1233,4 +1249,104 @@ XfNamespaceLocateEnd ( } return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: XfValidateCrossReference + * + * PARAMETERS: Op - Parse Op that references the object + * OpInfo - Parse Op info struct + * Node - Node for the referenced object + * + * RETURN: TRUE if the reference is legal, FALSE otherwise + * + * DESCRIPTION: Determine if a reference to another object is allowed. + * + * EXAMPLE: + * Method (A) {Name (INT1, 1)} Declaration of object INT1 + * Method (B) (Store (2, \A.INT1)} Illegal reference to object INT1 + * (INT1 is temporary, valid only during + * execution of A) + * + * NOTES: + * A null pointer returned by either XfGetParentMethod or + * UtGetParentMethod indicates that the parameter object is not + * within a control method. + * + * Five cases are handled: Case(Op, Node) + * 1) Case(0,0): Op is not within a method, Node is not --> OK + * 2) Case(0,1): Op is not within a method, but Node is --> Illegal + * 3) Case(1,0): Op is within a method, Node is not --> OK + * 4) Case(1,1): Both are within the same method --> OK + * 5) Case(1,1): Both are in methods, but not same method --> Illegal + * + ******************************************************************************/ + +static BOOLEAN +XfValidateCrossReference ( + ACPI_PARSE_OBJECT *Op, + const ACPI_OPCODE_INFO *OpInfo, + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_PARSE_OBJECT *ReferencingMethodOp; + ACPI_NAMESPACE_NODE *ReferencedMethodNode; + + + /* Ignore actual named (and related) object declarations */ + + if (OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_DEFER | AML_HAS_ARGS)) + { + return (TRUE); + } + + /* + * 1) Search upwards in parse tree for owner of the referencing object + * 2) Search upwards in namespace to find the owner of the referenced object + */ + ReferencingMethodOp = XfGetParentMethod (Op); + ReferencedMethodNode = UtGetParentMethod (Node); + + if (!ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 1) Case (0,0): Both Op and Node are not within methods + * --> OK + */ + return (TRUE); + } + + if (!ReferencingMethodOp && ReferencedMethodNode) + { + /* + * 2) Case (0,1): Op is not in a method, but Node is within a + * method --> illegal + */ + return (FALSE); + } + else if (ReferencingMethodOp && !ReferencedMethodNode) + { + /* + * 3) Case (1,0): Op is within a method, but Node is not + * --> OK + */ + return (TRUE); + } + else if (ReferencingMethodOp->Asl.Node == ReferencedMethodNode) + { + /* + * 4) Case (1,1): Both Op and Node are within the same method + * --> OK + */ + return (TRUE); + } + else + { + /* + * 5) Case (1,1), Op and Node are in different methods + * --> Illegal + */ + return (FALSE); + } } Modified: head/sys/contrib/dev/acpica/compiler/cvcompiler.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/cvcompiler.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/cvcompiler.c Wed Feb 20 23:53:39 2019 (r344398) @@ -168,7 +168,7 @@ * * DESCRIPTION: Process a single line comment of a c Style comment. This * function captures a line of a c style comment in a char* and - * places the comment in the approperiate global buffer. + * places the comment in the appropriate global buffer. * ******************************************************************************/ @@ -294,7 +294,7 @@ CvProcessComment ( * RETURN: none * * DESCRIPTION: Process a single line comment. This function captures a comment - * in a char* and places the comment in the approperiate global + * in a char* and places the comment in the appropriate global * buffer through CvPlaceComment * ******************************************************************************/ @@ -333,7 +333,7 @@ CvProcessCommentType2 ( * * would be lexically analyzed as a single comment. * - * Create a new string with the approperiate spaces. Since we need + * Create a new string with the appropriate spaces. Since we need * to account for the proper spacing, the actual comment, * extra 2 spaces so that this comment can be converted to the "/ *" * style and the null terminator, the string would look something @@ -380,7 +380,7 @@ CvProcessCommentType2 ( * RETURN: TotalCommentLength - Length of all comments within this op. * * DESCRIPTION: Calculate the length that the each comment takes up within Op. - * Comments look like the follwoing: [0xA9 OptionBtye comment 0x00] + * Comments look like the following: [0xA9 OptionBtye comment 0x00] * therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual * length of this comment. * @@ -963,7 +963,7 @@ CvAppendInlineComment ( * RETURN: None * * DESCRIPTION: Given type and CommentString, this function places the - * CommentString in the approperiate global comment list or char* + * CommentString in the appropriate global comment list or char* * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/compiler/cvparser.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/cvparser.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/cvparser.c Wed Feb 20 23:53:39 2019 (r344398) @@ -276,7 +276,7 @@ CvInitFileTree ( AcpiGbl_FileTreeRoot->File = AcpiGbl_OutputFile; /* - * Set this to true because we dont need to output + * Set this to true because we don't need to output * an include statement for the topmost file */ AcpiGbl_FileTreeRoot->IncludeWritten = TRUE; @@ -514,7 +514,7 @@ CvFileAddressLookup( * RETURN: None * * DESCRIPTION: Takes a given parse op, looks up its Op->Common.Aml field - * within the file tree and fills in approperiate file information + * within the file tree and fills in appropriate file information * from a matching node within the tree. * This is referred as ASL_CV_LABEL_FILENODE. * @@ -1005,7 +1005,7 @@ CvCaptureComments ( * * RETURN: None * - * DESCRIPTION: Transfer all of the commments stored in global containers to the + * DESCRIPTION: Transfer all of the comments stored in global containers to the * given Op. This will be invoked shortly after the parser creates * a ParseOp. * This is referred as ASL_CV_TRANSFER_COMMENTS. Modified: head/sys/contrib/dev/acpica/compiler/dtexpress.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtexpress.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dtexpress.c Wed Feb 20 23:53:39 2019 (r344398) @@ -372,7 +372,7 @@ DtDoOperator ( * * RETURN: Table offset associated with the label * - * DESCRIPTION: Lookup a lable and return its value. + * DESCRIPTION: Lookup a label and return its value. * *****************************************************************************/ Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Wed Feb 20 23:53:39 2019 (r344398) @@ -375,7 +375,7 @@ DtParseLine ( return (AE_OK); } - /* All lines after "Raw Table Data" are ingored */ + /* All lines after "Raw Table Data" are ignored */ if (strstr (LineBuffer, ACPI_RAW_TABLE_DATA_HEADER)) { Modified: head/sys/contrib/dev/acpica/compiler/dttable1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable1.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dttable1.c Wed Feb 20 23:53:39 2019 (r344398) @@ -831,7 +831,7 @@ DtCompileDrtm ( DtInsertSubtable (ParentTable, Subtable); /* - * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care + * Using ACPI_SUB_PTR, We needn't define a separate structure. Care * should be taken to avoid accessing ACPI_TABLE_HADER fields. */ #if 0 @@ -1002,13 +1002,35 @@ DtCompileGtdt ( ACPI_SUBTABLE_HEADER *GtdtHeader; ACPI_DMTABLE_INFO *InfoTable; UINT32 GtCount; + ACPI_TABLE_HEADER *Header; + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + + /* Compile the main table */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); + } + + /* GTDT revision 3 later contains 2 extra fields before subtables */ + + if (Header->Revision > 2) + { + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoGtdtEl2, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } ParentTable = DtPeekSubtable (); Modified: head/sys/contrib/dev/acpica/compiler/dttable2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable2.c Wed Feb 20 23:42:03 2019 (r344397) +++ head/sys/contrib/dev/acpica/compiler/dttable2.c Wed Feb 20 23:53:39 2019 (r344398) @@ -1733,6 +1733,11 @@ DtCompileSrat ( InfoTable = AcpiDmTableInfoSrat4; break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 20 23:55: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 33B3414E1840; Wed, 20 Feb 2019 23:55: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 CF19275DE0; Wed, 20 Feb 2019 23:55: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 B258ECF66; Wed, 20 Feb 2019 23:55: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 x1KNte03094564; Wed, 20 Feb 2019 23:55:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1KNtZ3c094540; Wed, 20 Feb 2019 23:55:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902202355.x1KNtZ3c094540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Feb 2019 23:55: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: r344399 - in stable/11: . share/mk stand stand/common stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/boot2 stand/i386/common stand/i386/gptboot stand/i386/gptzf... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . share/mk stand stand/common stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/boot2 stand/i386/common stand/i386/gptboot stand/i386/gptzfsboot stand/i386/isoboot ... X-SVN-Commit-Revision: 344399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF19275DE0 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)[-0.999,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, 20 Feb 2019 23:55:41 -0000 Author: kevans Date: Wed Feb 20 23:55:35 2019 New Revision: 344399 URL: https://svnweb.freebsd.org/changeset/base/344399 Log: MFC GELI Loader Improvements: r336252, r336254, r336256, r336354, r336532-r336534, r336537, r336626, r337326, r337349, r341071, r341160, r341420, r341473, r341651, r342793 Note that this MFC contains some seemingly unrelated zfsloader bits -- this was needed in order to pull in some later fixes for GELI hand-off w/ ZFS bits included. r336252: Extend loader(8) geli support to all architectures and all disk-like devices. This moves the bulk of the geli support from lib386/biosdisk.c into a new geli/gelidev.c which implements a devsw-type device whose dv_strategy() function handles geli decryption. Support for all arches comes from moving the taste-and-attach code to the devopen() function in libsa. After opening any DEVT_DISK device, devopen() calls the new function geli_probe_and_attach(), which will "attach" the geli code to the open_file struct by creating a geli_devdesc instance to replace the disk_devdesc instance in the open_file. That routes all IO for the device through the geli code. A new public geli_add_key() function is added, to allow arch/vendor-specific code to add keys obtained from custom hardware or other sources. With these changes, geli support will be compiled into all variations of loader(8) on all arches because the default is WITH_LOADER_GELI. r336254: Use if rather than case for a simple boolean. gcc thinks blks is undefined sometimes with the case, but enc is always 0 or 1, so and if / else is better anyway. r336256: Fix glitched indentation (and rewrap as needed due to deeper indent). No functional changes. r336354: zfsboot: fix build with WITHOUT_LOADER_GELI r336532: Collapse zfsloader functionality back down into loader. We no longer really need a separate zfsloader. It was useful when we were first supporting ZFS and had limited ability to properly boot off of ZFS without the special boot loader. Now that the boot loader has matured, go the way loader.efi pioneered and just build one binary. Change the name of the loader to load in the secondary boot blocks to be just /boot/loader. Provide a symbolic link from zfsloader to loader so people who have not upgraded their boot blocks are not affected. This has the happy benefit of making coexistence easier as well (fewer binaries in the matrix). r336533: Eliminate zfsloader man page. Remove all cross references to zfsloader.8 and /boot/zfsloader. Move ZFS specific info into loader.8. r336534: NM and OBJCOPY are already defined for all builds. There's no need to conditionally define them here. r336537: Mention zfsloader being folded into loader in UPDATING. r336626: Older zfs boot blocks don't support symlinks. install the link to zfsloader as a hard link. While newer ones do, the whole point of the link was to transition to the new world order smoothly. A hard link is less flexible, but it works and will result in fewer bumps. Adjust UPDATING entry to match. r337326: loader: biosdisk.c has leftover geli header. A small cleanup, remove unneeded #include. r337349: zfsboot: Fix startup crash On a FreeNAS mini XL, with geli encrypted drives the loader crashed in geli_read(). When we iterate over the list of disks and allocate the zfsdsk structures we don’t zero out the gdev pointer. In one case that resulted in geli_read() (called on the bogus pointer) dividing by zero. Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is initialised to NULL. As a side benefit it gets rid of one #ifdef LOADER_GELI_SUPPORT. r341071: Restore the ability to override the disk unit/partition at the boot: prompt in gptboot. When arch-independent geli support was added, a new static 'gdsk' struct was added, but there was still a static 'dsk' struct, and when you typed in an alternate disk/partition, the string was parsed into that struct, which was then never used for anything. Now the string gets parsed into gdsk.dsk, the struct that's actually used. r341160: Add comments describing the bootargs handoff between loader(8) and gptboot or zfsboot, when loader(8) is the BTX loader. No functional changes. r341420: Eliminate duplicated code and struct member definitions in the handoff of args data between gptboot/zfsboot and loader(8). Despite what seems like a lot of changes here, there are no actual changes in behavior, or in the data layout in the structures involved. This is just eliminating identical code pasted into multiple locations. In detail, the changes are... - Move struct zfs_boot_args definition from libsa/zfs/libzfs.h to i386/common/bootargs.h because it is specific to x86 booting and the handoff between zfsboot and loader, and has no relation to the zfs library code in general. - The geli_boot_args and zfs_boot_args structs both contain an identical set of member variables containing geli information. Extract this out to a new geli_boot_data struct, and embed it in the arg-passing structs. - Provide new routines geli_import_boot_data() and geli_export_boot_data() that can be shared between gptboot, zfsboot, and loader instead of pasting identical code into several different .c files. - Remove some checks for a NULL pointer that can never be true because the pointer being tested was set using pointer math (kargs + 1) and that can never result in NULL in this code. r341473: Fix args cross-threading between gptboot(8) and loader(8) with zfs support. When loader(8) is built with zfs support enabled, it assumes that any extarg data present is a zfs_boot_args struct, but if the first-stage loader was gptboot(8) the extarg data is actually a geli_boot_args struct. Luckily, zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the extarg data is a zfs_boot_args struct. To avoid similar problems in the future, gptboot(8) now passes a new KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args. In loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but extarg data is present (which will be the case for gptboot compiled before this change), we now check for the known size of the geli_boot_args struct passed by the older versions of gptboot as a way of confirming what type of extarg data is present. In a semi-related tidying up, since loader's main() has already decided what type of extarg data is present and set the global 'zargs' var accordingly, don't repeat the check in extract_currdev, just check whether zargs is NULL or not. r341651: Don't reference zfs-specific variables if LOADER_ZFS_SUPPORT is undefined because the variables will be undefined too. r342793: MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel ZFS but keep the boot-loaders when using ZoL port. Relnotes: yes (GELI support extended) Relnotes: yes (zfsloader has been collapsed into loader and may be removed after boot blocks have been updated) Added: stable/11/stand/libsa/geli/geli_metadata.c - copied unchanged from r336252, head/stand/libsa/geli/geli_metadata.c stable/11/stand/libsa/geli/gelidev.c - copied unchanged from r336252, head/stand/libsa/geli/gelidev.c stable/11/tools/build/options/WITHOUT_LOADER_ZFS - copied unchanged from r342793, head/tools/build/options/WITHOUT_LOADER_ZFS Deleted: stable/11/stand/i386/zfsloader/Makefile stable/11/stand/man/zfsloader.8 stable/11/stand/sparc64/zfsloader/Makefile Modified: stable/11/.gitattributes stable/11/UPDATING stable/11/share/mk/src.opts.mk stable/11/stand/common/devopen.c stable/11/stand/common/metadata.c stable/11/stand/common/paths.h stable/11/stand/defs.mk stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/libefi/Makefile stable/11/stand/efi/loader/Makefile stable/11/stand/efi/loader/bootinfo.c stable/11/stand/i386/Makefile stable/11/stand/i386/boot2/Makefile stable/11/stand/i386/common/bootargs.h stable/11/stand/i386/gptboot/Makefile stable/11/stand/i386/gptboot/gptboot.c stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/gptzfsboot/gptzfsboot.8 stable/11/stand/i386/isoboot/Makefile stable/11/stand/i386/libi386/Makefile stable/11/stand/i386/libi386/biosdisk.c stable/11/stand/i386/libi386/bootinfo32.c stable/11/stand/i386/libi386/bootinfo64.c stable/11/stand/i386/loader/Makefile stable/11/stand/i386/loader/main.c stable/11/stand/i386/zfsboot/Makefile stable/11/stand/i386/zfsboot/zfsboot.8 stable/11/stand/i386/zfsboot/zfsboot.c stable/11/stand/libsa/Makefile stable/11/stand/libsa/geli/Makefile.inc stable/11/stand/libsa/geli/geliboot.c stable/11/stand/libsa/geli/geliboot.h stable/11/stand/libsa/geli/geliboot_crypto.c stable/11/stand/libsa/geli/geliboot_internal.h stable/11/stand/libsa/zfs/libzfs.h stable/11/stand/loader.mk stable/11/stand/lua/core.lua.8 stable/11/stand/man/Makefile stable/11/stand/man/loader.8 stable/11/stand/sparc64/Makefile stable/11/stand/sparc64/loader/Makefile stable/11/stand/userboot/userboot/Makefile stable/11/stand/userboot/userboot/bootinfo32.c stable/11/tools/build/options/WITHOUT_ZFS Directory Properties: stable/11/ (props changed) Modified: stable/11/.gitattributes ============================================================================== --- stable/11/.gitattributes Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/.gitattributes Wed Feb 20 23:55:35 2019 (r344399) @@ -3,3 +3,4 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python +. svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/UPDATING Wed Feb 20 23:55:35 2019 (r344399) @@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20190220: + zfsloader's functionality has now been folded into loader. + zfsloader is no longer necesasary once you've updated your + boot blocks. For a transition period, we will install a + hardlink for zfsloader to loader to allow a smooth transition + until the boot blocks can be updated (hard link because old + zfs boot blocks don't understand symlinks). + 20190216: Lualoader has been merged to facilitate testing on this branch. It's purely opt-in for now by building WITH_LOADER_LUA and WITHOUT_FORTH in Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/share/mk/src.opts.mk Wed Feb 20 23:55:35 2019 (r344399) @@ -183,6 +183,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ @@ -290,10 +291,6 @@ BROKEN_OPTIONS+=LIBSOFT ${__T:Mriscv*} BROKEN_OPTIONS+=EFI .endif -# GELI isn't supported on !x86 -.if ${__T} != "i386" && ${__T} != "amd64" -BROKEN_OPTIONS+=LOADER_GELI -.endif # OFW is only for powerpc and sparc64, exclude others .if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" BROKEN_OPTIONS+=LOADER_OFW @@ -377,6 +374,7 @@ MK_SOURCELESS_UCODE:= no .if ${MK_CDDL} == "no" MK_ZFS:= no +MK_LOADER_ZFS:= no MK_CTF:= no .endif Modified: stable/11/stand/common/devopen.c ============================================================================== --- stable/11/stand/common/devopen.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/common/devopen.c Wed Feb 20 23:55:35 2019 (r344399) @@ -32,6 +32,10 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" +#endif + int devopen(struct open_file *f, const char *fname, const char **file) { @@ -43,6 +47,7 @@ devopen(struct open_file *f, const char *fname, const return (result); /* point to device-specific data so that device open can use it */ + f->f_dev = dev->d_dev; f->f_devdata = dev; result = dev->d_dev->dv_open(f, dev); if (result != 0) { @@ -51,8 +56,17 @@ devopen(struct open_file *f, const char *fname, const return (result); } - /* reference the devsw entry from the open_file structure */ - f->f_dev = dev->d_dev; +#ifdef LOADER_GELI_SUPPORT + /* + * If f->f_dev is geli-encrypted and we can decrypt it (will prompt for + * pw if needed), this will attach the geli code to the open_file by + * replacing f->f_dev and f_devdata with pointers to a geli_devdesc. + */ + if (f->f_dev->dv_type == DEVT_DISK) { + geli_probe_and_attach(f); + } +#endif + return (0); } Modified: stable/11/stand/common/metadata.c ============================================================================== --- stable/11/stand/common/metadata.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/common/metadata.c Wed Feb 20 23:55:35 2019 (r344399) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" +#endif + #if defined(__sparc64__) #include @@ -355,7 +359,9 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); } - +#ifdef LOADER_GELI_SUPPORT + geli_export_key_metadata(kfp); +#endif #if defined(__sparc64__) file_addmetadata(kfp, MODINFOMD_DTLB_SLOTS, sizeof dtlb_slot, &dtlb_slot); Modified: stable/11/stand/common/paths.h ============================================================================== --- stable/11/stand/common/paths.h Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/common/paths.h Wed Feb 20 23:55:35 2019 (r344399) @@ -33,7 +33,6 @@ #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" #endif /* _PATHS_H_ */ Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/defs.mk Wed Feb 20 23:55:35 2019 (r344399) @@ -56,7 +56,6 @@ CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mc # GELI Support, with backward compat hooks (mostly) -.if defined(HAVE_GELI) .if defined(LOADER_NO_GELI_SUPPORT) MK_LOADER_GELI=no .warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI" @@ -69,7 +68,6 @@ MK_LOADER_GELI=yes CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${SASRC}/geli .endif # MK_LOADER_GELI -.endif # HAVE_GELI # These should be confined to loader.mk, but can't because uboot/lib # also uses it. It's part of loader, but isn't a loader so we can't Modified: stable/11/stand/efi/boot1/Makefile ============================================================================== --- stable/11/stand/efi/boot1/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/efi/boot1/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -24,7 +24,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs @@ -75,9 +75,6 @@ DPADD+= ${LIBEFI} ${LIBSA} LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} - -NM?= nm -OBJCOPY?= objcopy .if ${MACHINE_CPUARCH} == "amd64" EFI_TARGET= efi-app-x86_64 Modified: stable/11/stand/efi/libefi/Makefile ============================================================================== --- stable/11/stand/efi/libefi/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/efi/libefi/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -44,7 +44,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/efi/loader/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -24,7 +24,7 @@ SRCS= autoload.c \ smbios.c \ vers.c -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes @@ -90,9 +90,6 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -share CLEANFILES+= loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} - -NM?= nm -OBJCOPY?= objcopy .if ${MACHINE_CPUARCH} == "amd64" EFI_TARGET= efi-app-x86_64 Modified: stable/11/stand/efi/loader/bootinfo.c ============================================================================== --- stable/11/stand/efi/loader/bootinfo.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/efi/loader/bootinfo.c Wed Feb 20 23:55:35 2019 (r344399) @@ -56,6 +56,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" +#endif + int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); extern EFI_SYSTEM_TABLE *ST; @@ -452,7 +456,9 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof ST, &ST); - +#ifdef LOADER_GELI_SUPPORT + geli_export_key_metadata(kfp); +#endif bi_load_efi_data(kfp); /* Figure out the size and location of the metadata. */ Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -18,6 +18,6 @@ SUBDIR.yes+= pxeldr SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader +SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot .include Modified: stable/11/stand/i386/boot2/Makefile ============================================================================== --- stable/11/stand/i386/boot2/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/boot2/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -4,8 +4,6 @@ FILES= boot boot1 boot2 -NM?= nm - # A value of 0x80 enables LBA support. BOOT_BOOT1_FLAGS?= 0x80 Modified: stable/11/stand/i386/common/bootargs.h ============================================================================== --- stable/11/stand/i386/common/bootargs.h Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/common/bootargs.h Wed Feb 20 23:55:35 2019 (r344399) @@ -18,10 +18,11 @@ #ifndef _BOOT_I386_ARGS_H_ #define _BOOT_I386_ARGS_H_ -#define KARGS_FLAGS_CD 0x1 -#define KARGS_FLAGS_PXE 0x2 -#define KARGS_FLAGS_ZFS 0x4 -#define KARGS_FLAGS_EXTARG 0x8 /* variably sized extended argument */ +#define KARGS_FLAGS_CD 0x0001 /* .bootdev is a bios CD dev */ +#define KARGS_FLAGS_PXE 0x0002 /* .pxeinfo is valid */ +#define KARGS_FLAGS_ZFS 0x0004 /* .zfspool is valid, EXTARG is zfs_boot_args */ +#define KARGS_FLAGS_EXTARG 0x0008 /* variably sized extended argument */ +#define KARGS_FLAGS_GELI 0x0010 /* EXTARG is geli_boot_args */ #define BOOTARGS_SIZE 24 /* sizeof(struct bootargs) */ #define BA_BOOTFLAGS 8 /* offsetof(struct bootargs, bootflags) */ @@ -43,6 +44,24 @@ #ifndef __ASSEMBLER__ +/* + * This struct describes the contents of the stack on entry to btxldr.S. This + * is the data that follows the return address, so it begins at 4(%esp). On + * the sending side, this data is passed as individual args to __exec(). On the + * receiving side, code in btxldr.S copies the data from the entry stack to a + * known fixed location in the new address space. Then, btxcsu.S sets the + * global variable __args to point to that known fixed location before calling + * main(), which casts __args to a struct bootargs pointer to access the data. + * The btxldr.S code is aware of KARGS_FLAGS_EXTARG, and if it's set, the extra + * args data is copied along with the other bootargs from the entry stack to the + * fixed location in the new address space. + * + * The bootinfo field is actually a pointer to a bootinfo struct that has been + * converted to uint32_t using VTOP(). On the receiving side it must be + * converted back to a pointer using PTOV(). Code in btxldr.S is aware of this + * field and if it's non-NULL it copies the data it points to into another known + * fixed location, and adjusts the bootinfo field to point to that new location. + */ struct bootargs { uint32_t howto; @@ -66,11 +85,15 @@ struct bootargs #ifdef LOADER_GELI_SUPPORT #include +#include "geliboot.h" #endif -struct geli_boot_args +/* + * geli_boot_data is embedded in geli_boot_args (passed from gptboot to loader) + * and in zfs_boot_args (passed from zfsboot and gptzfsboot to loader). + */ +struct geli_boot_data { - uint32_t size; union { char gelipw[256]; struct { @@ -86,6 +109,49 @@ struct geli_boot_args #endif }; }; +}; + +#ifdef LOADER_GELI_SUPPORT + +static inline void +export_geli_boot_data(struct geli_boot_data *gbdata) +{ + + gbdata->notapw = '\0'; + gbdata->keybuf_sentinel = KEYBUF_SENTINEL; + gbdata->keybuf = malloc(sizeof(struct keybuf) + + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); + geli_export_key_buffer(gbdata->keybuf); +} + +static inline void +import_geli_boot_data(struct geli_boot_data *gbdata) +{ + + if (gbdata->gelipw[0] != '\0') { + setenv("kern.geom.eli.passphrase", gbdata->gelipw, 1); + explicit_bzero(gbdata->gelipw, sizeof(gbdata->gelipw)); + } else if (gbdata->keybuf_sentinel == KEYBUF_SENTINEL) { + geli_import_key_buffer(gbdata->keybuf); + } +} +#endif /* LOADER_GELI_SUPPORT */ + +struct geli_boot_args +{ + uint32_t size; + struct geli_boot_data gelidata; +}; + +struct zfs_boot_args +{ + uint32_t size; + uint32_t reserved; + uint64_t pool; + uint64_t root; + uint64_t primary_pool; + uint64_t primary_vdev; + struct geli_boot_data gelidata; }; #endif /*__ASSEMBLER__*/ Modified: stable/11/stand/i386/gptboot/Makefile ============================================================================== --- stable/11/stand/i386/gptboot/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/gptboot/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -1,15 +1,11 @@ # $FreeBSD$ -HAVE_GELI= yes - .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} FILES= gptboot MAN= gptboot.8 - -NM?= nm BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 Modified: stable/11/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/11/stand/i386/gptboot/gptboot.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/gptboot/gptboot.c Wed Feb 20 23:55:35 2019 (r344399) @@ -81,7 +81,6 @@ uint32_t opts; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; -static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; @@ -113,11 +112,19 @@ static int vdev_read(void *vdev __unused, void *priv, #include "ufsread.c" #include "gpt.c" #ifdef LOADER_GELI_SUPPORT -#include "geliboot.c" +#include "geliboot.h" static char gelipw[GELI_PW_MAXLEN]; -static struct keybuf *gelibuf; #endif +struct gptdsk { + struct dsk dsk; +#ifdef LOADER_GELI_SUPPORT + struct geli_dev *gdev; +#endif +}; + +static struct gptdsk gdsk; + static inline int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { @@ -225,19 +232,21 @@ static int gptinit(void) { - if (gptread(&freebsd_ufs_uuid, &dsk, dmadat->secbuf) == -1) { + if (gptread(&freebsd_ufs_uuid, &gdsk.dsk, dmadat->secbuf) == -1) { printf("%s: unable to load GPT\n", BOOTPROG); return (-1); } - if (gptfind(&freebsd_ufs_uuid, &dsk, dsk.part) == -1) { + if (gptfind(&freebsd_ufs_uuid, &gdsk.dsk, gdsk.dsk.part) == -1) { printf("%s: no UFS partition was found\n", BOOTPROG); return (-1); } #ifdef LOADER_GELI_SUPPORT - if (geli_taste(vdev_read, &dsk, (gpttable[curent].ent_lba_end - - gpttable[curent].ent_lba_start)) == 0) { - if (geli_havekey(&dsk) != 0 && geli_passphrase(gelipw, - dsk.unit, 'p', curent + 1, &dsk) != 0) { + gdsk.gdev = geli_taste(vdev_read, &gdsk.dsk, + (gpttable[curent].ent_lba_end - gpttable[curent].ent_lba_start), + "disk%up%u:", gdsk.dsk.unit, curent + 1); + if (gdsk.gdev != NULL) { + if (geli_havekey(gdsk.gdev) != 0 && + geli_passphrase(gdsk.gdev, gelipw) != 0) { printf("%s: unable to decrypt GELI key\n", BOOTPROG); return (-1); } @@ -273,21 +282,18 @@ main(void) v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.part = -1; - dsk.start = 0; + gdsk.dsk.drive = *(uint8_t *)PTOV(ARGS); + gdsk.dsk.type = gdsk.dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + gdsk.dsk.unit = gdsk.dsk.drive & DRV_MASK; + gdsk.dsk.part = -1; + gdsk.dsk.start = 0; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); bootinfo.bi_basemem = bios_basemem / 1024; bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; - bootinfo.bi_bios_dev = dsk.drive; + bootinfo.bi_bios_dev = gdsk.dsk.drive; -#ifdef LOADER_GELI_SUPPORT - geli_init(); -#endif /* Process configuration file */ if (gptinit() != 0) @@ -332,8 +338,8 @@ main(void) load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); - gptbootfailed(&dsk); - if (gptfind(&freebsd_ufs_uuid, &dsk, -1) == -1) + gptbootfailed(&gdsk.dsk); + if (gptfind(&freebsd_ufs_uuid, &gdsk.dsk, -1) == -1) break; dsk_meta = 0; } @@ -345,8 +351,8 @@ main(void) printf("\nFreeBSD/x86 boot\n" "Default: %u:%s(%up%u)%s\n" "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - dsk.part, kname); + gdsk.dsk.drive & DRV_MASK, dev_nm[gdsk.dsk.type], + gdsk.dsk.unit, gdsk.dsk.part, kname); } if (ioctrl & IO_SERIAL) sio_flush(); @@ -392,9 +398,9 @@ load(void) if (!(ino = lookup(kname))) { if (!ls) { printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, - kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], - dsk.unit, - dsk.part); + kname, gdsk.dsk.drive & DRV_MASK, + dev_nm[gdsk.dsk.type], gdsk.dsk.unit, + gdsk.dsk.part); } return; } @@ -469,21 +475,22 @@ load(void) } bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; + bootinfo.bi_bios_dev = gdsk.dsk.drive; #ifdef LOADER_GELI_SUPPORT geliargs.size = sizeof(geliargs); explicit_bzero(gelipw, sizeof(gelipw)); - gelibuf = malloc(sizeof(struct keybuf) + - (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); - geli_fill_keybuf(gelibuf); - geliargs.notapw = '\0'; - geliargs.keybuf_sentinel = KEYBUF_SENTINEL; - geliargs.keybuf = gelibuf; + export_geli_boot_data(&geliargs.gelidata); #endif + /* + * Note that the geliargs struct is passed by value, not by pointer. + * Code in btxldr.S copies the values from the entry stack to a fixed + * location within loader(8) at startup due to the presence of the + * KARGS_FLAGS_EXTARG flag. + */ __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), + MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), #ifdef LOADER_GELI_SUPPORT - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs + KARGS_FLAGS_GELI | KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs #else 0, 0, 0, VTOP(&bootinfo) #endif @@ -561,22 +568,22 @@ parse_cmds(char *cmdstr, int *dskupdated) arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) return (-1); - dsk.type = i; + gdsk.dsk.type = i; arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != 'p' || dsk.unit > 9) + gdsk.dsk.unit = *arg - '0'; + if (arg[1] != 'p' || gdsk.dsk.unit > 9) return (-1); arg += 2; - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) + gdsk.dsk.part = *arg - '0'; + if (gdsk.dsk.part < 1 || gdsk.dsk.part > 9) return (-1); arg++; if (arg[0] != ')') return (-1); arg++; if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD + drv = gdsk.dsk.unit; + gdsk.dsk.drive = (gdsk.dsk.type <= TYPE_MAXHARD ? DRV_HARD : 0) + drv; *dskupdated = 1; } @@ -596,12 +603,13 @@ dskread(void *buf, daddr_t lba, unsigned nblk) { int err; - err = drvread(&dsk, buf, lba + dsk.start, nblk); + err = drvread(&gdsk.dsk, buf, lba + gdsk.dsk.start, nblk); #ifdef LOADER_GELI_SUPPORT - if (err == 0 && is_geli(&dsk) == 0) { + if (err == 0 && gdsk.gdev != NULL) { /* Decrypt */ - if (geli_read(&dsk, lba * DEV_BSIZE, buf, nblk * DEV_BSIZE)) + if (geli_read(gdsk.gdev, lba * DEV_BSIZE, buf, + nblk * DEV_BSIZE)) return (err); } #endif @@ -611,8 +619,8 @@ dskread(void *buf, daddr_t lba, unsigned nblk) #ifdef LOADER_GELI_SUPPORT /* - * Read function compartible with the ZFS callback, required to keep the GELI - * Implementation the same for both UFS and ZFS + * Read function compatible with the ZFS callback, required to keep the GELI + * implementation the same for both UFS and ZFS. */ static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, size_t bytes) @@ -620,22 +628,22 @@ vdev_read(void *vdev __unused, void *priv, off_t off, char *p; daddr_t lba; unsigned int nb; - struct dsk *dskp; + struct gptdsk *dskp; - dskp = (struct dsk *)priv; + dskp = (struct gptdsk *)priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) return (-1); p = buf; lba = off / DEV_BSIZE; - lba += dskp->start; + lba += dskp->dsk.start; while (bytes > 0) { nb = bytes / DEV_BSIZE; if (nb > VBLKSIZE / DEV_BSIZE) nb = VBLKSIZE / DEV_BSIZE; - if (drvread(dskp, dmadat->blkbuf, lba, nb)) + if (drvread(&dskp->dsk, dmadat->blkbuf, lba, nb)) return (-1); memcpy(p, dmadat->blkbuf, nb * DEV_BSIZE); p += nb * DEV_BSIZE; Modified: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/gptzfsboot/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -1,7 +1,5 @@ # $FreeBSD$ -HAVE_GELI= yes - .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ @@ -10,8 +8,6 @@ HAVE_GELI= yes FILES= gptzfsboot MAN= gptzfsboot.8 - -NM?= nm BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 Modified: stable/11/stand/i386/gptzfsboot/gptzfsboot.8 ============================================================================== --- stable/11/stand/i386/gptzfsboot/gptzfsboot.8 Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/gptzfsboot/gptzfsboot.8 Wed Feb 20 23:55:35 2019 (r344399) @@ -71,7 +71,7 @@ If the .Cm bootfs property is not set, then the root filesystem of the pool is used as the default. -.Xr zfsloader 8 +.Xr loader 8 is loaded from the boot filesystem. If .Pa /boot.config @@ -83,7 +83,7 @@ in the same way as .Pp The ZFS GUIDs of the first successfully probed device and the first detected pool are made available to -.Xr zfsloader 8 +.Xr loader 8 in the .Cm vfs.zfs.boot.primary_vdev and @@ -104,7 +104,7 @@ accepts all the options that supports. .Pp The filesystem specification and the path to -.Xr zfsloader 8 +.Xr loader 8 are different from .Xr boot 8 . The format is @@ -116,7 +116,7 @@ The format is Both the filesystem and the path can be specified. If only a path is specified, then the default filesystem is used. If only a pool and filesystem are specified, then -.Pa /boot/zfsloader +.Pa /boot/loader is used as a path. .Pp Additionally, the @@ -128,7 +128,7 @@ The output format is similar to that of .Pp The configured or automatically determined ZFS boot filesystem is stored in the -.Xr zfsloader 8 +.Xr loader 8 .Cm loaddev variable, and also set as the initial value of the .Cm currdev @@ -171,7 +171,6 @@ gpart bootcode -p /boot/gptzfsboot -i 1 ada0 .Xr boot 8 , .Xr gpart 8 , .Xr loader 8 , -.Xr zfsloader 8 , .Xr zpool 8 .Sh HISTORY .Nm Modified: stable/11/stand/i386/isoboot/Makefile ============================================================================== --- stable/11/stand/i386/isoboot/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/isoboot/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -1,7 +1,5 @@ # $FreeBSD$ -HAVE_GELI= yes - .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ @@ -9,8 +7,6 @@ HAVE_GELI= yes FILES= isoboot MAN= isoboot.8 - -NM?= nm BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 Modified: stable/11/stand/i386/libi386/Makefile ============================================================================== --- stable/11/stand/i386/libi386/Makefile Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/libi386/Makefile Wed Feb 20 23:55:35 2019 (r344399) @@ -1,7 +1,5 @@ # $FreeBSD$ -HAVE_GELI= yes - .include LIB= i386 Modified: stable/11/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/11/stand/i386/libi386/biosdisk.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/libi386/biosdisk.c Wed Feb 20 23:55:35 2019 (r344399) @@ -50,34 +50,6 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libi386.h" -#ifdef LOADER_GELI_SUPPORT -#include "cons.h" -#include "drv.h" -#include "gpt.h" -#include "part.h" -#include -struct pentry { - struct ptable_entry part; - uint64_t flags; - union { - uint8_t bsd; - uint8_t mbr; - uuid_t gpt; - uint16_t vtoc8; - } type; - STAILQ_ENTRY(pentry) entry; -}; -struct ptable { - enum ptable_type type; - uint16_t sectorsize; - uint64_t sectors; - - STAILQ_HEAD(, pentry) entries; -}; - -#include "geliboot.c" -#endif /* LOADER_GELI_SUPPORT */ - #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) @@ -138,17 +110,6 @@ static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); static int bd_print(int verbose); -#ifdef LOADER_GELI_SUPPORT -enum isgeli { - ISGELI_UNKNOWN, - ISGELI_NO, - ISGELI_YES -}; -static enum isgeli geli_status[MAXBDDEV][MAXTBLENTS]; - -int bios_read(void *, void *, off_t off, void *buf, size_t bytes); -#endif /* LOADER_GELI_SUPPORT */ - struct devsw biosdisk = { "disk", DEVT_DISK, @@ -195,9 +156,6 @@ bd_init(void) { int base, unit, nfd = 0; -#ifdef LOADER_GELI_SUPPORT - geli_init(); -#endif /* sequence 0, 0x80 */ for (base = 0; base <= 0x80; base += 0x80) { for (unit = base; (nbdinfo < MAXBDDEV); unit++) { @@ -379,7 +337,7 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - struct disk_devdesc *dev; + struct disk_devdesc *dev, rdev; struct disk_devdesc disk; int err, g_err; va_list ap; @@ -421,81 +379,6 @@ bd_open(struct open_file *f, ...) err = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize); -#ifdef LOADER_GELI_SUPPORT - static char gelipw[GELI_PW_MAXLEN]; - char *passphrase; - - if (err) - return (err); - - /* if we already know there is no GELI, skip the rest */ - if (geli_status[dev->dd.d_unit][dev->d_slice] != ISGELI_UNKNOWN) - return (err); - - struct dsk dskp; - struct ptable *table = NULL; - struct ptable_entry part; - struct pentry *entry; - int geli_part = 0; - - dskp.drive = bd_unit2bios(dev->dd.d_unit); - dskp.type = dev->dd.d_dev->dv_type; - dskp.unit = dev->dd.d_unit; - dskp.slice = dev->d_slice; - dskp.part = dev->d_partition; - dskp.start = dev->d_offset; - - /* We need the LBA of the end of the partition */ - table = ptable_open(&disk, BD(dev).bd_sectors, - BD(dev).bd_sectorsize, ptblread); - if (table == NULL) { - DEBUG("Can't read partition table"); - /* soft failure, return the exit status of disk_open */ - return (err); - } - - if (table->type == PTABLE_GPT) - dskp.part = 255; - - STAILQ_FOREACH(entry, &table->entries, entry) { - dskp.slice = entry->part.index; - dskp.start = entry->part.start; - if (is_geli(&dskp) == 0) { - geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; - return (0); - } - if (geli_taste(bios_read, &dskp, - entry->part.end - entry->part.start) == 0) { - if (geli_havekey(&dskp) == 0) { - geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; - geli_part++; - continue; - } - if ((passphrase = getenv("kern.geom.eli.passphrase")) - != NULL) { - /* Use the cached passphrase */ - bcopy(passphrase, &gelipw, GELI_PW_MAXLEN); - } - if (geli_passphrase(gelipw, dskp.unit, 'p', - (dskp.slice > 0 ? dskp.slice : dskp.part), - &dskp) == 0) { - setenv("kern.geom.eli.passphrase", gelipw, 1); - bzero(gelipw, sizeof(gelipw)); - geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; - geli_part++; - continue; - } - } else - geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_NO; - } - - /* none of the partitions on this disk have GELI */ - if (geli_part == 0) { - /* found no GELI */ - geli_status[dev->dd.d_unit][dev->d_slice] = ISGELI_NO; - } -#endif /* LOADER_GELI_SUPPORT */ - return (err); } @@ -841,80 +724,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest) { -#ifdef LOADER_GELI_SUPPORT - struct dsk dskp; - off_t p_off, diff; - daddr_t alignlba; - int err, n, alignblks; - char *tmpbuf; - /* if we already know there is no GELI, skip the rest */ - if (geli_status[dev->dd.d_unit][dev->d_slice] != ISGELI_YES) - return (bd_io(dev, dblk, blks, dest, 0)); - - if (geli_status[dev->dd.d_unit][dev->d_slice] == ISGELI_YES) { - /* - * Align reads to DEV_GELIBOOT_BSIZE bytes because partial - * sectors cannot be decrypted. Round the requested LBA down to - * nearest multiple of DEV_GELIBOOT_BSIZE bytes. - */ - alignlba = rounddown2(dblk * BD(dev).bd_sectorsize, - DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize; - /* - * Round number of blocks to read up to nearest multiple of - * DEV_GELIBOOT_BSIZE - */ - diff = (dblk - alignlba) * BD(dev).bd_sectorsize; - alignblks = roundup2(blks * BD(dev).bd_sectorsize + diff, - DEV_GELIBOOT_BSIZE) / BD(dev).bd_sectorsize; - - /* - * If the read is rounded up to a larger size, use a temporary - * buffer here because the buffer provided by the caller may be - * too small. - */ - if (diff == 0) { - tmpbuf = dest; - } else { - tmpbuf = malloc(alignblks * BD(dev).bd_sectorsize); - if (tmpbuf == NULL) { - return (-1); - } - } - - if (alignlba + alignblks > BD(dev).bd_sectors) { - DEBUG("Shorted read at %llu from %d to %llu blocks", - alignlba, alignblks, BD(dev).bd_sectors - alignlba); - alignblks = BD(dev).bd_sectors - alignlba; - } - - err = bd_io(dev, alignlba, alignblks, tmpbuf, 0); - if (err) - return (err); - - dskp.drive = bd_unit2bios(dev->dd.d_unit); - dskp.type = dev->dd.d_dev->dv_type; - dskp.unit = dev->dd.d_unit; - dskp.slice = dev->d_slice; - dskp.part = dev->d_partition; - dskp.start = dev->d_offset; - - /* GELI needs the offset relative to the partition start */ - p_off = alignlba - dskp.start; - - err = geli_read(&dskp, p_off * BD(dev).bd_sectorsize, (u_char *)tmpbuf, - alignblks * BD(dev).bd_sectorsize); - if (err) - return (err); - - if (tmpbuf != dest) { - bcopy(tmpbuf + diff, dest, blks * BD(dev).bd_sectorsize); - free(tmpbuf); - } - return (0); - } -#endif /* LOADER_GELI_SUPPORT */ - return (bd_io(dev, dblk, blks, dest, 0)); } @@ -1009,25 +819,3 @@ bd_getdev(struct i386_devdesc *d) DEBUG("dev is 0x%x\n", rootdev); return(rootdev); } - -#ifdef LOADER_GELI_SUPPORT -int -bios_read(void *vdev __unused, void *xpriv, off_t off, void *buf, size_t bytes) -{ - struct disk_devdesc dev; - struct dsk *priv = xpriv; - - dev.dd.d_dev = &biosdisk; - dev.dd.d_unit = priv->unit; - dev.d_slice = priv->slice; - dev.d_partition = priv->part; - dev.d_offset = priv->start; - - off = off / BD(&dev).bd_sectorsize; - /* GELI gives us the offset relative to the partition start */ - off += dev.d_offset; - bytes = bytes / BD(&dev).bd_sectorsize; - - return (bd_io(&dev, off, bytes, buf, 0)); -} -#endif /* LOADER_GELI_SUPPORT */ Modified: stable/11/stand/i386/libi386/bootinfo32.c ============================================================================== --- stable/11/stand/i386/libi386/bootinfo32.c Wed Feb 20 23:53:39 2019 (r344398) +++ stable/11/stand/i386/libi386/bootinfo32.c Wed Feb 20 23:55:35 2019 (r344399) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #ifdef LOADER_GELI_SUPPORT #include "geliboot.h" - -static const size_t keybuf_size = sizeof(struct keybuf) + - (GELI_MAX_KEYS * sizeof(struct keybuf_ent)); #endif static struct bootinfo bi; @@ -154,10 +151,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_o int bootdevnr, i, howto; char *kernelname; const char *kernelpath; -#ifdef LOADER_GELI_SUPPORT - char buf[keybuf_size]; - struct keybuf *keybuf = (struct keybuf *)buf; -#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 21 00:17: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 6561814E215C; Thu, 21 Feb 2019 00:17: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 0687E76955; Thu, 21 Feb 2019 00:17: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 E7CCFD2C8; Thu, 21 Feb 2019 00:17: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 x1L0HObJ005843; Thu, 21 Feb 2019 00:17:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L0HOfv005842; Thu, 21 Feb 2019 00:17:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902210017.x1L0HOfv005842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 00:17: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: r344400 - stable/12/sys/dev/ioat X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/ioat X-SVN-Commit-Revision: 344400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0687E76955 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 00:17:25 -0000 Author: mav Date: Thu Feb 21 00:17:24 2019 New Revision: 344400 URL: https://svnweb.freebsd.org/changeset/base/344400 Log: MFC r343125 (by cem): ioat(4): Set __result_use_check on ioat_acquire_reserve Even M_WAITOK callers must check for failure. For example, if the device is quiescing, either due to automatic error-recovery induced reset, or due to administrative detach, the routine will return ENXIO and the acquire reference will not be held. So, there is no mode in which it is safe to assume the routine succeeds without checking. Modified: stable/12/sys/dev/ioat/ioat.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ioat/ioat.h ============================================================================== --- stable/12/sys/dev/ioat/ioat.h Wed Feb 20 23:55:35 2019 (r344399) +++ stable/12/sys/dev/ioat/ioat.h Thu Feb 21 00:17:24 2019 (r344400) @@ -173,7 +173,8 @@ void ioat_release(bus_dmaengine_t dmaengine); * * On failure, the caller does not hold the dmaengine. */ -int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags); +int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags) + __result_use_check; /* * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to From owner-svn-src-all@freebsd.org Thu Feb 21 00:44: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 6F56714E32C4; Thu, 21 Feb 2019 00:44:27 +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 1CF9177C9A; Thu, 21 Feb 2019 00:44:27 +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 E7753D7B1; Thu, 21 Feb 2019 00:44:26 +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 x1L0iQk2022374; Thu, 21 Feb 2019 00:44:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L0iQY3022372; Thu, 21 Feb 2019 00:44:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902210044.x1L0iQY3022372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 00:44:26 +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: r344401 - stable/11/sys/dev/ioat X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ioat X-SVN-Commit-Revision: 344401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CF9177C9A 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,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, 21 Feb 2019 00:44:27 -0000 Author: mav Date: Thu Feb 21 00:44:26 2019 New Revision: 344401 URL: https://svnweb.freebsd.org/changeset/base/344401 Log: MFC r302669,302677-302686,303761,304602,304603,305027-305028,305259, 305710,305711,308067-308070,308178,308179,308230,308553,309338,309526, 343125 (by cem): Synchronize ioat(4) with head. Most of these changes are 3 years old, just never got merged. Modified: stable/11/sys/dev/ioat/ioat.c stable/11/sys/dev/ioat/ioat.h stable/11/sys/dev/ioat/ioat_hw.h stable/11/sys/dev/ioat/ioat_internal.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ioat/ioat.c ============================================================================== --- stable/11/sys/dev/ioat/ioat.c Thu Feb 21 00:17:24 2019 (r344400) +++ stable/11/sys/dev/ioat/ioat.c Thu Feb 21 00:44:26 2019 (r344401) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$"); #define BUS_SPACE_MAXADDR_40BIT 0xFFFFFFFFFFULL #endif #define IOAT_REFLK (&ioat->submit_lock) -#define IOAT_SHRINK_PERIOD (10 * hz) static int ioat_probe(device_t device); static int ioat_attach(device_t device); @@ -81,23 +81,14 @@ static void ioat_process_events(struct ioat_softc *ioa static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); static void ioat_free_ring(struct ioat_softc *, uint32_t size, - struct ioat_descriptor **); -static void ioat_free_ring_entry(struct ioat_softc *ioat, - struct ioat_descriptor *desc); -static struct ioat_descriptor *ioat_alloc_ring_entry(struct ioat_softc *, - int mflags); + struct ioat_descriptor *); static int ioat_reserve_space(struct ioat_softc *, uint32_t, int mflags); -static struct ioat_descriptor *ioat_get_ring_entry(struct ioat_softc *ioat, +static union ioat_hw_descriptor *ioat_get_descriptor(struct ioat_softc *, uint32_t index); -static struct ioat_descriptor **ioat_prealloc_ring(struct ioat_softc *, - uint32_t size, boolean_t need_dscr, int mflags); -static int ring_grow(struct ioat_softc *, uint32_t oldorder, - struct ioat_descriptor **); -static int ring_shrink(struct ioat_softc *, uint32_t oldorder, - struct ioat_descriptor **); +static struct ioat_descriptor *ioat_get_ring_entry(struct ioat_softc *, + uint32_t index); static void ioat_halted_debug(struct ioat_softc *, uint32_t); static void ioat_poll_timer_callback(void *arg); -static void ioat_shrink_timer_callback(void *arg); static void dump_descriptor(void *hw_desc); static void ioat_submit_single(struct ioat_softc *ioat); static void ioat_comp_update_map(void *arg, bus_dma_segment_t *seg, int nseg, @@ -134,6 +125,10 @@ int g_ioat_debug_level = 0; SYSCTL_INT(_hw_ioat, OID_AUTO, debug_level, CTLFLAG_RWTUN, &g_ioat_debug_level, 0, "Set log level (0-3) for ioat(4). Higher is more verbose."); +unsigned g_ioat_ring_order = 13; +SYSCTL_UINT(_hw_ioat, OID_AUTO, ring_order, CTLFLAG_RDTUN, &g_ioat_ring_order, + 0, "Set IOAT ring order. (1 << this) == ring size."); + /* * OS <-> Driver interface structures */ @@ -335,7 +330,6 @@ ioat_detach(device_t device) ioat_teardown_intr(ioat); callout_drain(&ioat->poll_timer); - callout_drain(&ioat->shrink_timer); pci_disable_busmaster(device); @@ -353,7 +347,12 @@ ioat_detach(device_t device) bus_dma_tag_destroy(ioat->comp_update_tag); } - bus_dma_tag_destroy(ioat->hw_desc_tag); + if (ioat->hw_desc_ring != NULL) { + bus_dmamap_unload(ioat->hw_desc_tag, ioat->hw_desc_map); + bus_dmamem_free(ioat->hw_desc_tag, ioat->hw_desc_ring, + ioat->hw_desc_map); + bus_dma_tag_destroy(ioat->hw_desc_tag); + } return (0); } @@ -387,8 +386,8 @@ ioat_start_channel(struct ioat_softc *ioat) /* Submit 'NULL' operation manually to avoid quiescing flag */ desc = ioat_get_ring_entry(ioat, ioat->head); + hw_desc = &ioat_get_descriptor(ioat, ioat->head)->dma; dmadesc = &desc->bus_dmadesc; - hw_desc = desc->u.dma; dmadesc->callback_fn = NULL; dmadesc->callback_arg = NULL; @@ -425,9 +424,10 @@ static int ioat3_attach(device_t device) { struct ioat_softc *ioat; - struct ioat_descriptor **ring; - struct ioat_descriptor *next; + struct ioat_descriptor *ring; struct ioat_dma_hw_descriptor *dma_hw_desc; + void *hw_desc; + size_t ringsz; int i, num_descriptors; int error; uint8_t xfercap; @@ -452,7 +452,6 @@ ioat3_attach(device_t device) mtx_init(&ioat->submit_lock, "ioat_submit", NULL, MTX_DEF); mtx_init(&ioat->cleanup_lock, "ioat_cleanup", NULL, MTX_DEF); callout_init(&ioat->poll_timer, 1); - callout_init(&ioat->shrink_timer, 1); TASK_INIT(&ioat->reset_task, 0, ioat_reset_hw_task, ioat); /* Establish lock order for Witness */ @@ -461,7 +460,7 @@ ioat3_attach(device_t device) mtx_unlock(&ioat->cleanup_lock); mtx_unlock(&ioat->submit_lock); - ioat->is_resize_pending = FALSE; + ioat->is_submitter_processing = FALSE; ioat->is_completion_pending = FALSE; ioat->is_reset_pending = FALSE; ioat->is_channel_running = FALSE; @@ -482,37 +481,43 @@ ioat3_attach(device_t device) if (error != 0) return (error); - ioat->ring_size_order = IOAT_MIN_ORDER; - + ioat->ring_size_order = g_ioat_ring_order; num_descriptors = 1 << ioat->ring_size_order; + ringsz = sizeof(struct ioat_dma_hw_descriptor) * num_descriptors; - bus_dma_tag_create(bus_get_dma_tag(ioat->device), 0x40, 0x0, - BUS_SPACE_MAXADDR_40BIT, BUS_SPACE_MAXADDR, NULL, NULL, - sizeof(struct ioat_dma_hw_descriptor), 1, - sizeof(struct ioat_dma_hw_descriptor), 0, NULL, NULL, + error = bus_dma_tag_create(bus_get_dma_tag(ioat->device), + 2 * 1024 * 1024, 0x0, (bus_addr_t)BUS_SPACE_MAXADDR_40BIT, + BUS_SPACE_MAXADDR, NULL, NULL, ringsz, 1, ringsz, 0, NULL, NULL, &ioat->hw_desc_tag); + if (error != 0) + return (error); + error = bus_dmamem_alloc(ioat->hw_desc_tag, &hw_desc, + BUS_DMA_ZERO | BUS_DMA_WAITOK, &ioat->hw_desc_map); + if (error != 0) + return (error); + + error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, + ringsz, ioat_dmamap_cb, &ioat->hw_desc_bus_addr, BUS_DMA_WAITOK); + if (error) + return (error); + + ioat->hw_desc_ring = hw_desc; + ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, M_ZERO | M_WAITOK); ring = ioat->ring; for (i = 0; i < num_descriptors; i++) { - ring[i] = ioat_alloc_ring_entry(ioat, M_WAITOK); - if (ring[i] == NULL) - return (ENOMEM); - - ring[i]->id = i; + memset(&ring[i].bus_dmadesc, 0, sizeof(ring[i].bus_dmadesc)); + ring[i].id = i; } - for (i = 0; i < num_descriptors - 1; i++) { - next = ring[i + 1]; - dma_hw_desc = ring[i]->u.dma; - - dma_hw_desc->next = next->hw_desc_bus_addr; + for (i = 0; i < num_descriptors; i++) { + dma_hw_desc = &ioat->hw_desc_ring[i].dma; + dma_hw_desc->next = RING_PHYS_ADDR(ioat, i + 1); } - ring[i]->u.dma->next = ring[0]->hw_desc_bus_addr; - ioat->head = ioat->hw_head = 0; ioat->tail = 0; ioat->last_seen = 0; @@ -662,8 +667,6 @@ ioat_process_events(struct ioat_softc *ioat) boolean_t pending; int error; - CTR0(KTR_IOAT, __func__); - mtx_lock(&ioat->cleanup_lock); /* @@ -680,31 +683,42 @@ ioat_process_events(struct ioat_softc *ioat) comp_update = *ioat->comp_update; status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; + if (status < ioat->hw_desc_bus_addr || + status >= ioat->hw_desc_bus_addr + (1 << ioat->ring_size_order) * + sizeof(struct ioat_generic_hw_descriptor)) + panic("Bogus completion address %jx (channel %u)", + (uintmax_t)status, ioat->chan_idx); + if (status == ioat->last_seen) { /* * If we landed in process_events and nothing has been * completed, check for a timeout due to channel halt. */ - comp_update = ioat_get_chansts(ioat); goto out; } + CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", + __func__, ioat->chan_idx, comp_update, ioat->last_seen); - while (1) { + while (RING_PHYS_ADDR(ioat, ioat->tail - 1) != status) { desc = ioat_get_ring_entry(ioat, ioat->tail); dmadesc = &desc->bus_dmadesc; - CTR1(KTR_IOAT, "completing desc %d", ioat->tail); + CTR5(KTR_IOAT, "channel=%u completing desc idx %u (%p) ok cb %p(%p)", + ioat->chan_idx, ioat->tail, dmadesc, dmadesc->callback_fn, + dmadesc->callback_arg); if (dmadesc->callback_fn != NULL) dmadesc->callback_fn(dmadesc->callback_arg, 0); completed++; ioat->tail++; - if (desc->hw_desc_bus_addr == status) - break; } + CTR5(KTR_IOAT, "%s channel=%u head=%u tail=%u active=%u", __func__, + ioat->chan_idx, ioat->head, ioat->tail, ioat_get_active(ioat)); - ioat->last_seen = desc->hw_desc_bus_addr; - ioat->stats.descriptors_processed += completed; + if (completed != 0) { + ioat->last_seen = RING_PHYS_ADDR(ioat, ioat->tail - 1); + ioat->stats.descriptors_processed += completed; + } out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); @@ -719,8 +733,6 @@ out: pending = (ioat_get_active(ioat) != 0); if (!pending && ioat->is_completion_pending) { ioat->is_completion_pending = FALSE; - callout_reset(&ioat->shrink_timer, IOAT_SHRINK_PERIOD, - ioat_shrink_timer_callback, ioat); callout_stop(&ioat->poll_timer); } mtx_unlock(&ioat->submit_lock); @@ -736,6 +748,12 @@ out: wakeup(&ioat->tail); } + /* + * The device doesn't seem to reliably push suspend/halt statuses to + * the channel completion memory address, so poll the device register + * here. + */ + comp_update = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; if (!is_ioat_halted(comp_update) && !is_ioat_suspended(comp_update)) return; @@ -745,19 +763,30 @@ out: * Fatal programming error on this DMA channel. Flush any outstanding * work with error status and restart the engine. */ - ioat_log_message(0, "Channel halted due to fatal programming error\n"); mtx_lock(&ioat->submit_lock); mtx_lock(&ioat->cleanup_lock); ioat->quiescing = TRUE; + /* + * This is safe to do here because we have both locks and the submit + * queue is quiesced. We know that we will drain all outstanding + * events, so ioat_reset_hw can't deadlock. It is necessary to + * protect other ioat_process_event threads from racing ioat_reset_hw, + * reading an indeterminate hw state, and attempting to continue + * issuing completions. + */ + ioat->resetting_cleanup = TRUE; chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); - ioat_halted_debug(ioat, chanerr); + if (1 <= g_ioat_debug_level) + ioat_halted_debug(ioat, chanerr); ioat->stats.last_halt_chanerr = chanerr; while (ioat_get_active(ioat) > 0) { desc = ioat_get_ring_entry(ioat, ioat->tail); dmadesc = &desc->bus_dmadesc; - CTR1(KTR_IOAT, "completing err desc %d", ioat->tail); + CTR5(KTR_IOAT, "channel=%u completing desc idx %u (%p) err cb %p(%p)", + ioat->chan_idx, ioat->tail, dmadesc, dmadesc->callback_fn, + dmadesc->callback_arg); if (dmadesc->callback_fn != NULL) dmadesc->callback_fn(dmadesc->callback_arg, @@ -768,7 +797,14 @@ out: ioat->stats.descriptors_processed++; ioat->stats.descriptors_error++; } + CTR5(KTR_IOAT, "%s channel=%u head=%u tail=%u active=%u", __func__, + ioat->chan_idx, ioat->head, ioat->tail, ioat_get_active(ioat)); + if (ioat->is_completion_pending) { + ioat->is_completion_pending = FALSE; + callout_stop(&ioat->poll_timer); + } + /* Clear error status */ ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); @@ -869,6 +905,15 @@ ioat_get_max_io_size(bus_dmaengine_t dmaengine) return (ioat->max_xfer_size); } +uint32_t +ioat_get_capabilities(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (ioat->capabilities); +} + int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { @@ -902,7 +947,8 @@ ioat_acquire(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); mtx_lock(&ioat->submit_lock); - CTR0(KTR_IOAT, __func__); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); + ioat->acq_head = ioat->head; } int @@ -926,8 +972,22 @@ ioat_release(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - CTR0(KTR_IOAT, __func__); - ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); + CTR4(KTR_IOAT, "%s channel=%u dispatch1 hw_head=%u head=%u", __func__, + ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + KFAIL_POINT_CODE(DEBUG_FP, ioat_release, /* do nothing */); + CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__, + ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + + if (ioat->acq_head != ioat->head) { + ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, + (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, + ioat_poll_timer_callback, ioat); + } + } mtx_unlock(&ioat->submit_lock); } @@ -960,7 +1020,7 @@ ioat_op_generic(struct ioat_softc *ioat, uint8_t op, return (NULL); desc = ioat_get_ring_entry(ioat, ioat->head); - hw_desc = desc->u.generic; + hw_desc = &ioat_get_descriptor(ioat, ioat->head)->generic; hw_desc->u.control_raw = 0; hw_desc->u.control_generic.op = op; @@ -988,15 +1048,15 @@ ioat_null(bus_dmaengine_t dmaengine, bus_dmaengine_cal struct ioat_descriptor *desc; struct ioat_softc *ioat; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); desc = ioat_op_generic(ioat, IOAT_OP_COPY, 8, 0, 0, callback_fn, callback_arg, flags); if (desc == NULL) return (NULL); - hw_desc = desc->u.dma; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->dma; hw_desc->u.control.null = 1; ioat_submit_single(ioat); return (&desc->bus_dmadesc); @@ -1011,7 +1071,6 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, struct ioat_descriptor *desc; struct ioat_softc *ioat; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); if (((src | dst) & (0xffffull << 48)) != 0) { @@ -1025,11 +1084,13 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, if (desc == NULL) return (NULL); - hw_desc = desc->u.dma; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->dma; if (g_ioat_debug_level >= 3) dump_descriptor(hw_desc); ioat_submit_single(ioat); + CTR6(KTR_IOAT, "%s channel=%u desc=%p dest=%lx src=%lx len=%lx", + __func__, ioat->chan_idx, &desc->bus_dmadesc, dst, src, len); return (&desc->bus_dmadesc); } @@ -1042,8 +1103,8 @@ ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_ad struct ioat_descriptor *desc; struct ioat_softc *ioat; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); if (((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) != 0) { ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", @@ -1061,7 +1122,7 @@ ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_ad if (desc == NULL) return (NULL); - hw_desc = desc->u.dma; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->dma; if (src2 != src1 + PAGE_SIZE) { hw_desc->u.control.src_page_break = 1; hw_desc->next_src_addr = src2; @@ -1089,8 +1150,8 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds uint32_t teststore; uint8_t op; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); if ((ioat->capabilities & IOAT_DMACAP_MOVECRC) == 0) { ioat_log_message(0, "%s: Device lacks MOVECRC capability\n", @@ -1138,7 +1199,7 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds if (desc == NULL) return (NULL); - hw_desc = desc->u.crc32; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->crc32; if ((flags & DMA_CRC_INLINE) == 0) hw_desc->crc_address = crcptr; @@ -1168,8 +1229,8 @@ ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, bu uint32_t teststore; uint8_t op; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); if ((ioat->capabilities & IOAT_DMACAP_CRC) == 0) { ioat_log_message(0, "%s: Device lacks CRC capability\n", @@ -1217,7 +1278,7 @@ ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, bu if (desc == NULL) return (NULL); - hw_desc = desc->u.crc32; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->crc32; if ((flags & DMA_CRC_INLINE) == 0) hw_desc->crc_address = crcptr; @@ -1245,8 +1306,8 @@ ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t d struct ioat_descriptor *desc; struct ioat_softc *ioat; - CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); if ((ioat->capabilities & IOAT_DMACAP_BFILL) == 0) { ioat_log_message(0, "%s: Device lacks BFILL capability\n", @@ -1265,7 +1326,7 @@ ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t d if (desc == NULL) return (NULL); - hw_desc = desc->u.fill; + hw_desc = &ioat_get_descriptor(ioat, desc->id)->fill; if (g_ioat_debug_level >= 3) dump_descriptor(hw_desc); @@ -1290,60 +1351,6 @@ ioat_get_ring_space(struct ioat_softc *ioat) return ((1 << ioat->ring_size_order) - ioat_get_active(ioat) - 1); } -static struct ioat_descriptor * -ioat_alloc_ring_entry(struct ioat_softc *ioat, int mflags) -{ - struct ioat_generic_hw_descriptor *hw_desc; - struct ioat_descriptor *desc; - int error, busdmaflag; - - error = ENOMEM; - hw_desc = NULL; - - if ((mflags & M_WAITOK) != 0) - busdmaflag = BUS_DMA_WAITOK; - else - busdmaflag = BUS_DMA_NOWAIT; - - desc = malloc(sizeof(*desc), M_IOAT, mflags); - if (desc == NULL) - goto out; - - bus_dmamem_alloc(ioat->hw_desc_tag, (void **)&hw_desc, - BUS_DMA_ZERO | busdmaflag, &ioat->hw_desc_map); - if (hw_desc == NULL) - goto out; - - memset(&desc->bus_dmadesc, 0, sizeof(desc->bus_dmadesc)); - desc->u.generic = hw_desc; - - error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, - sizeof(*hw_desc), ioat_dmamap_cb, &desc->hw_desc_bus_addr, - busdmaflag); - if (error) - goto out; - -out: - if (error) { - ioat_free_ring_entry(ioat, desc); - return (NULL); - } - return (desc); -} - -static void -ioat_free_ring_entry(struct ioat_softc *ioat, struct ioat_descriptor *desc) -{ - - if (desc == NULL) - return; - - if (desc->u.generic) - bus_dmamem_free(ioat->hw_desc_tag, desc->u.generic, - ioat->hw_desc_map); - free(desc, M_IOAT); -} - /* * Reserves space in this IOAT descriptor ring by ensuring enough slots remain * for 'num_descs'. @@ -1363,114 +1370,70 @@ ioat_free_ring_entry(struct ioat_softc *ioat, struct i static int ioat_reserve_space(struct ioat_softc *ioat, uint32_t num_descs, int mflags) { - struct ioat_descriptor **new_ring; - uint32_t order; + boolean_t dug; int error; mtx_assert(&ioat->submit_lock, MA_OWNED); error = 0; + dug = FALSE; - if (num_descs < 1 || num_descs > (1 << IOAT_MAX_ORDER)) { + if (num_descs < 1 || num_descs >= (1 << ioat->ring_size_order)) { error = EINVAL; goto out; } - if (ioat->quiescing) { - error = ENXIO; - goto out; - } for (;;) { + if (ioat->quiescing) { + error = ENXIO; + goto out; + } + if (ioat_get_ring_space(ioat) >= num_descs) goto out; - order = ioat->ring_size_order; - if (ioat->is_resize_pending || order == IOAT_MAX_ORDER) { - if ((mflags & M_WAITOK) != 0) { - msleep(&ioat->tail, &ioat->submit_lock, 0, - "ioat_rsz", 0); - continue; - } + CTR3(KTR_IOAT, "%s channel=%u starved (%u)", __func__, + ioat->chan_idx, num_descs); - error = EAGAIN; - break; - } - - ioat->is_resize_pending = TRUE; - for (;;) { + if (!dug && !ioat->is_submitter_processing) { + ioat->is_submitter_processing = TRUE; mtx_unlock(&ioat->submit_lock); - new_ring = ioat_prealloc_ring(ioat, 1 << (order + 1), - TRUE, mflags); + CTR2(KTR_IOAT, "%s channel=%u attempting to process events", + __func__, ioat->chan_idx); + ioat_process_events(ioat); mtx_lock(&ioat->submit_lock); - KASSERT(ioat->ring_size_order == order, - ("is_resize_pending should protect order")); - - if (new_ring == NULL) { - KASSERT((mflags & M_WAITOK) == 0, - ("allocation failed")); - error = EAGAIN; - break; - } - - error = ring_grow(ioat, order, new_ring); - if (error == 0) - break; + dug = TRUE; + KASSERT(ioat->is_submitter_processing == TRUE, + ("is_submitter_processing")); + ioat->is_submitter_processing = FALSE; + wakeup(&ioat->tail); + continue; } - ioat->is_resize_pending = FALSE; - wakeup(&ioat->tail); - if (error) + + if ((mflags & M_WAITOK) == 0) { + error = EAGAIN; break; + } + CTR2(KTR_IOAT, "%s channel=%u blocking on completions", + __func__, ioat->chan_idx); + msleep(&ioat->tail, &ioat->submit_lock, 0, + "ioat_full", 0); + continue; } out: mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT(!ioat->quiescing || error == ENXIO, + ("reserved during quiesce")); return (error); } -static struct ioat_descriptor ** -ioat_prealloc_ring(struct ioat_softc *ioat, uint32_t size, boolean_t need_dscr, - int mflags) -{ - struct ioat_descriptor **ring; - uint32_t i; - int error; - - KASSERT(size > 0 && powerof2(size), ("bogus size")); - - ring = malloc(size * sizeof(*ring), M_IOAT, M_ZERO | mflags); - if (ring == NULL) - return (NULL); - - if (need_dscr) { - error = ENOMEM; - for (i = size / 2; i < size; i++) { - ring[i] = ioat_alloc_ring_entry(ioat, mflags); - if (ring[i] == NULL) - goto out; - ring[i]->id = i; - } - } - error = 0; - -out: - if (error != 0 && ring != NULL) { - ioat_free_ring(ioat, size, ring); - ring = NULL; - } - return (ring); -} - static void ioat_free_ring(struct ioat_softc *ioat, uint32_t size, - struct ioat_descriptor **ring) + struct ioat_descriptor *ring) { - uint32_t i; - for (i = 0; i < size; i++) { - if (ring[i] != NULL) - ioat_free_ring_entry(ioat, ring[i]); - } free(ring, M_IOAT); } @@ -1478,164 +1441,20 @@ static struct ioat_descriptor * ioat_get_ring_entry(struct ioat_softc *ioat, uint32_t index) { - return (ioat->ring[index % (1 << ioat->ring_size_order)]); + return (&ioat->ring[index % (1 << ioat->ring_size_order)]); } -static int -ring_grow(struct ioat_softc *ioat, uint32_t oldorder, - struct ioat_descriptor **newring) +static union ioat_hw_descriptor * +ioat_get_descriptor(struct ioat_softc *ioat, uint32_t index) { - struct ioat_descriptor *tmp, *next; - struct ioat_dma_hw_descriptor *hw; - uint32_t oldsize, newsize, head, tail, i, end; - int error; - CTR0(KTR_IOAT, __func__); - - mtx_assert(&ioat->submit_lock, MA_OWNED); - - if (oldorder != ioat->ring_size_order || oldorder >= IOAT_MAX_ORDER) { - error = EINVAL; - goto out; - } - - oldsize = (1 << oldorder); - newsize = (1 << (oldorder + 1)); - - mtx_lock(&ioat->cleanup_lock); - - head = ioat->head & (oldsize - 1); - tail = ioat->tail & (oldsize - 1); - - /* Copy old descriptors to new ring */ - for (i = 0; i < oldsize; i++) - newring[i] = ioat->ring[i]; - - /* - * If head has wrapped but tail hasn't, we must swap some descriptors - * around so that tail can increment directly to head. - */ - if (head < tail) { - for (i = 0; i <= head; i++) { - tmp = newring[oldsize + i]; - - newring[oldsize + i] = newring[i]; - newring[oldsize + i]->id = oldsize + i; - - newring[i] = tmp; - newring[i]->id = i; - } - head += oldsize; - } - - KASSERT(head >= tail, ("invariants")); - - /* Head didn't wrap; we only need to link in oldsize..newsize */ - if (head < oldsize) { - i = oldsize - 1; - end = newsize; - } else { - /* Head did wrap; link newhead..newsize and 0..oldhead */ - i = head; - end = newsize + (head - oldsize) + 1; - } - - /* - * Fix up hardware ring, being careful not to trample the active - * section (tail -> head). - */ - for (; i < end; i++) { - KASSERT((i & (newsize - 1)) < tail || - (i & (newsize - 1)) >= head, ("trampling snake")); - - next = newring[(i + 1) & (newsize - 1)]; - hw = newring[i & (newsize - 1)]->u.dma; - hw->next = next->hw_desc_bus_addr; - } - - free(ioat->ring, M_IOAT); - ioat->ring = newring; - ioat->ring_size_order = oldorder + 1; - ioat->tail = tail; - ioat->head = head; - error = 0; - - mtx_unlock(&ioat->cleanup_lock); -out: - if (error) - ioat_free_ring(ioat, (1 << (oldorder + 1)), newring); - return (error); + return (&ioat->hw_desc_ring[index % (1 << ioat->ring_size_order)]); } -static int -ring_shrink(struct ioat_softc *ioat, uint32_t oldorder, - struct ioat_descriptor **newring) -{ - struct ioat_dma_hw_descriptor *hw; - struct ioat_descriptor *ent, *next; - uint32_t oldsize, newsize, current_idx, new_idx, i; - int error; - - CTR0(KTR_IOAT, __func__); - - mtx_assert(&ioat->submit_lock, MA_OWNED); - - if (oldorder != ioat->ring_size_order || oldorder <= IOAT_MIN_ORDER) { - error = EINVAL; - goto out_unlocked; - } - - oldsize = (1 << oldorder); - newsize = (1 << (oldorder - 1)); - - mtx_lock(&ioat->cleanup_lock); - - /* Can't shrink below current active set! */ - if (ioat_get_active(ioat) >= newsize) { - error = ENOMEM; - goto out; - } - - /* - * Copy current descriptors to the new ring, dropping the removed - * descriptors. - */ - for (i = 0; i < newsize; i++) { - current_idx = (ioat->tail + i) & (oldsize - 1); - new_idx = (ioat->tail + i) & (newsize - 1); - - newring[new_idx] = ioat->ring[current_idx]; - newring[new_idx]->id = new_idx; - } - - /* Free deleted descriptors */ - for (i = newsize; i < oldsize; i++) { - ent = ioat_get_ring_entry(ioat, ioat->tail + i); - ioat_free_ring_entry(ioat, ent); - } - - /* Fix up hardware ring. */ - hw = newring[(ioat->tail + newsize - 1) & (newsize - 1)]->u.dma; - next = newring[(ioat->tail + newsize) & (newsize - 1)]; - hw->next = next->hw_desc_bus_addr; - - free(ioat->ring, M_IOAT); - ioat->ring = newring; - ioat->ring_size_order = oldorder - 1; - error = 0; - -out: - mtx_unlock(&ioat->cleanup_lock); -out_unlocked: - if (error) - ioat_free_ring(ioat, (1 << (oldorder - 1)), newring); - return (error); -} - static void ioat_halted_debug(struct ioat_softc *ioat, uint32_t chanerr) { - struct ioat_descriptor *desc; + union ioat_hw_descriptor *desc; ioat_log_message(0, "Channel halted (%b)\n", (int)chanerr, IOAT_CHANERR_STR); @@ -1644,11 +1463,11 @@ ioat_halted_debug(struct ioat_softc *ioat, uint32_t ch mtx_assert(&ioat->cleanup_lock, MA_OWNED); - desc = ioat_get_ring_entry(ioat, ioat->tail + 0); - dump_descriptor(desc->u.raw); + desc = ioat_get_descriptor(ioat, ioat->tail + 0); + dump_descriptor(desc); - desc = ioat_get_ring_entry(ioat, ioat->tail + 1); - dump_descriptor(desc->u.raw); + desc = ioat_get_descriptor(ioat, ioat->tail + 1); + dump_descriptor(desc); } static void @@ -1662,52 +1481,6 @@ ioat_poll_timer_callback(void *arg) ioat_process_events(ioat); } -static void -ioat_shrink_timer_callback(void *arg) -{ - struct ioat_descriptor **newring; - struct ioat_softc *ioat; - uint32_t order; - - ioat = arg; - ioat_log_message(1, "%s\n", __func__); - - /* Slowly scale the ring down if idle. */ - mtx_lock(&ioat->submit_lock); - - /* Don't run while the hardware is being reset. */ - if (ioat->resetting) { - mtx_unlock(&ioat->submit_lock); - return; - } - - order = ioat->ring_size_order; - if (ioat->is_resize_pending || order == IOAT_MIN_ORDER) { - mtx_unlock(&ioat->submit_lock); - goto out; - } - ioat->is_resize_pending = TRUE; - mtx_unlock(&ioat->submit_lock); - - newring = ioat_prealloc_ring(ioat, 1 << (order - 1), FALSE, - M_NOWAIT); - - mtx_lock(&ioat->submit_lock); - KASSERT(ioat->ring_size_order == order, - ("resize_pending protects order")); - - if (newring != NULL) - ring_shrink(ioat, order, newring); - - ioat->is_resize_pending = FALSE; - mtx_unlock(&ioat->submit_lock); - -out: - if (ioat->ring_size_order > IOAT_MIN_ORDER) - callout_reset(&ioat->poll_timer, IOAT_SHRINK_PERIOD, - ioat_shrink_timer_callback, ioat); -} - /* * Support Functions */ @@ -1715,17 +1488,15 @@ static void ioat_submit_single(struct ioat_softc *ioat) { + mtx_assert(&ioat->submit_lock, MA_OWNED); + ioat_get(ioat, IOAT_ACTIVE_DESCR_REF); atomic_add_rel_int(&ioat->head, 1); atomic_add_rel_int(&ioat->hw_head, 1); + CTR5(KTR_IOAT, "%s channel=%u head=%u hw_head=%u tail=%u", __func__, + ioat->chan_idx, ioat->head, ioat->hw_head & UINT16_MAX, + ioat->tail); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - callout_stop(&ioat->shrink_timer); - } - ioat->stats.descriptors_submitted++; } @@ -1737,6 +1508,8 @@ ioat_reset_hw(struct ioat_softc *ioat) unsigned timeout; int error; + CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); + mtx_lock(IOAT_REFLK); while (ioat->resetting && !ioat->destroying) msleep(&ioat->resetting, IOAT_REFLK, 0, "IRH_drain", 0); @@ -1758,6 +1531,9 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat->resetting_cleanup = TRUE; mtx_unlock(&ioat->cleanup_lock); + CTR2(KTR_IOAT, "%s channel=%u quiesced and drained", __func__, + ioat->chan_idx); + status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) ioat_suspend(ioat); @@ -1778,6 +1554,9 @@ ioat_reset_hw(struct ioat_softc *ioat) chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); + CTR2(KTR_IOAT, "%s channel=%u hardware suspended", __func__, + ioat->chan_idx); + /* * IOAT v3 workaround - CHANERRMSK_INT with 3E07h to masks out errors * that can cause stability issues for IOAT v3. @@ -1797,6 +1576,8 @@ ioat_reset_hw(struct ioat_softc *ioat) } ioat_reset(ioat); + CTR2(KTR_IOAT, "%s channel=%u hardware reset", __func__, + ioat->chan_idx); /* Wait at most 20 ms */ for (timeout = 0; ioat_reset_pending(ioat) && timeout < 20; timeout++) @@ -1840,26 +1621,30 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat->tail = ioat->head = ioat->hw_head = 0; ioat->last_seen = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 21 01:30: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 D458414E631A; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@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 2A0DA8258B; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@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 0C979E22C; Thu, 21 Feb 2019 01:30:38 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L1UbSo044522; Thu, 21 Feb 2019 01:30:37 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L1Ub8c044520; Thu, 21 Feb 2019 01:30:37 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902210130.x1L1Ub8c044520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 21 Feb 2019 01:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344402 - in head: sys/kgssapi usr.sbin/gssd X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head: sys/kgssapi usr.sbin/gssd X-SVN-Commit-Revision: 344402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A0DA8258B 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.931,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 01:30:39 -0000 Author: sef Date: Thu Feb 21 01:30:37 2019 New Revision: 344402 URL: https://svnweb.freebsd.org/changeset/base/344402 Log: * Handle SIGPIPE in gssd We've got some cases where the other end of gssd's AF_LOCAL socket gets closed, resulting in an error (and SIGPIPE) when it tries to do I/O to it. Closing without cleaning up means the next time nfsd starts up, it hangs, unkillably; this allows gssd to handle that particular error. * Limit the retry cound in gssd_syscall to 5. The default is INT_MAX, which effectively means forever. And it's an uninterruptable RPC call, so it will never stop. The two changes mitigate the problem. Reviewed by: macklem MFC after: 2 weeks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D19153 Modified: head/sys/kgssapi/gss_impl.c head/usr.sbin/gssd/gssd.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Thu Feb 21 00:44:26 2019 (r344401) +++ head/sys/kgssapi/gss_impl.c Thu Feb 21 01:30:37 2019 (r344402) @@ -112,6 +112,15 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscal cl = clnt_reconnect_create(nconf, (struct sockaddr *) &sun, GSSD, GSSDVERS, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + /* + * The number of retries defaults to INT_MAX, which effectively + * means an infinite, uninterruptable loop. Limiting it to + * five retries keeps it from running forever. + */ + if (cl != NULL) { + int retry_count = 5; + CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + } } else cl = NULL; Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Thu Feb 21 00:44:26 2019 (r344401) +++ head/usr.sbin/gssd/gssd.c Thu Feb 21 01:30:37 2019 (r344402) @@ -202,6 +202,7 @@ main(int argc, char **argv) signal(SIGHUP, SIG_IGN); } signal(SIGTERM, gssd_terminate); + signal(SIGPIPE, gssd_terminate); memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL; From owner-svn-src-all@freebsd.org Thu Feb 21 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 C197014E4ECE; Thu, 21 Feb 2019 01:17:34 +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 419D081547; Thu, 21 Feb 2019 01:17:33 +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 7B5503D6168; Thu, 21 Feb 2019 12:17:23 +1100 (AEDT) Date: Thu, 21 Feb 2019 12:17:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Bright cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog In-Reply-To: <201902202205.x1KM5iZX036319@repo.freebsd.org> Message-ID: <20190221121712.Y989@besplex.bde.org> References: <201902202205.x1KM5iZX036319@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 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=tFM545eivrnJSQZQWzUA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 419D081547 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.949,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, 21 Feb 2019 01:17:34 -0000 On Wed, 20 Feb 2019, David Bright wrote: > Log: > Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog > > The result of a strdup() was stored in a global variable and not freed > before program exit. This is a follow-up to r343906. That change This was an especially large bug in Coverity. Understanding that exit(3) exits is about the first thing to understand for a checker. Now it is also a style bug in the source code. > attempted to plug these resource leaks but managed to miss a code path > on which the leak still occurs. Plug the leak on that path, too. > Modified: head/usr.sbin/newsyslog/newsyslog.c > ============================================================================== > --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 (r344388) > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 (r344389) > @@ -793,6 +793,9 @@ usage(void) > fprintf(stderr, > "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" > " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); > + /* Free global dynamically-allocated storage. */ > + free(timefnamefmt); > + free(requestor); > exit(1); > } There was no leak here. exit(3) frees storage much more finally than free(3). It is especially obvious that there is no leak here, since the exit() is 1-2 lines later than the frees. In theory, exit() might fail because it tries to allocate 100 MB more storage but wouldn't fail if 100 bytes are freed here (applications can easily do this foot shooting by allocating without freeing in atexit() destructors). In practice, even allocation failures "can't happen", except in programs that use setrlimit followed but foot shooting to test the limits. setrlimit is now broken for this purpose, since it doesn't limit allocations done using mmap() instead of break(), and malloc() now uses mmap(). If coverity understood this and wanted to spam you with warnings, then it would not warn about this, but would warn about more important things like failure to fflush() or fclose() or check for or handle errors for all open streams before calling exit(). Also, if all callers of usage() are not understood, for failures to switch stderr to unbuffered mode before using it in usage(). The error reporting is even harder to do if stderr is not available. Windowing systems and even curses need to do lots more cleanup _before_ exit() and it may be difficult to clean up enough to print error messages using the windowing system. Bruce From owner-svn-src-all@freebsd.org Thu Feb 21 02:41: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 9E3F014EAA71; Thu, 21 Feb 2019 02:41:58 +0000 (UTC) (envelope-from cem@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 4019785AC6; Thu, 21 Feb 2019 02:41:58 +0000 (UTC) (envelope-from cem@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 32C92F1A3; Thu, 21 Feb 2019 02:41:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L2fwir084130; Thu, 21 Feb 2019 02:41:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2fwrk084129; Thu, 21 Feb 2019 02:41:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902210241.x1L2fwrk084129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Feb 2019 02:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344407 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 344407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4019785AC6 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)[-0.999,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, 21 Feb 2019 02:41:58 -0000 Author: cem Date: Thu Feb 21 02:41:57 2019 New Revision: 344407 URL: https://svnweb.freebsd.org/changeset/base/344407 Log: fuse: Fix a regression introduced in r337165 On systems with non-default DFLTPHYS and/or MAXBSIZE, FUSE would attempt to use a buf cache block size in excess of permitted size. This did not affect most configurations, since DFLTPHYS and MAXBSIZE both default to 64kB. The issue was discovered and reported using a custom kernel with a DFLTPHYS of 512kB. PR: 230260 (comment #9) Reported by: ken@ MFC after: Ï€/ð‘’ weeks Modified: head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Thu Feb 21 02:37:01 2019 (r344406) +++ head/sys/fs/fuse/fuse_vfsops.c Thu Feb 21 02:41:57 2019 (r344407) @@ -338,7 +338,7 @@ fuse_vfsop_mount(struct mount *mp) mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ - mp->mnt_stat.f_iosize = DFLTPHYS; + mp->mnt_stat.f_iosize = MIN(DFLTPHYS, MAXBSIZE); if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); From owner-svn-src-all@freebsd.org Thu Feb 21 02:43: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 6132214EAD4D; Thu, 21 Feb 2019 02:43:51 +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 10D4585CC1; Thu, 21 Feb 2019 02:43:51 +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 01B47F1D7; Thu, 21 Feb 2019 02:43:51 +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 x1L2hoMD085836; Thu, 21 Feb 2019 02:43:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2hmNk085825; Thu, 21 Feb 2019 02:43:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210243.x1L2hmNk085825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:43:48 +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: r344408 - in stable/11/stand/libsa: . zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/libsa: . zfs X-SVN-Commit-Revision: 344408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10D4585CC1 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 02:43:51 -0000 Author: kevans Date: Thu Feb 21 02:43:48 2019 New Revision: 344408 URL: https://svnweb.freebsd.org/changeset/base/344408 Log: MFC various libsa fixes: r337037-r337039, r337065, r337412-r337413, r337874, r338535, r338540, r339651, r339992-r339993, r340026 r337037: libsa: pointer differs in signedness A small cleanup, fix the argument type and while there, replace (char *)0 with NULL. r337038: libsa: bootp is using pointers with different sign Just change bp_file to char and same for variable s. r337039: libsa: assignment to char * from u_char * Cast to char * instead of u_char * r337065: libsa: dereferencing type-punned pointer in cd9660 The warning is given by gcc build, but it is good to fix anyhow. use bcopy instead of direct assignment. r337412: libsa: dos_checksum() should take unsigned chars Fix pointers to integers with different sign issue. r337413: libsa: gzipfs.c converts pointers to integer types with different sign Signed versus unsigned char. r337874: libsa: zfs_probe() needs to set spa to NULL Silence the warning about possibly uninitialized use of spa. r338535: libsa: memory leak in tftp_open() tftpfile is allocated just above and needs to be freed. r338540: libsa: validate tftp_makereq() after we did reset the read The name check referred in the comment is not the only possible error source, we need to validate the result. r339651: libsa: re-send ACK for older data packets in tftp In current tftp code we drop out-of-order packets; however, we should play nice and re-send ACK for older data packets we are receiving. This will hopefully stop server repeating those packets we already have received. Note we do not answer duplicates from "previous" session (that is, session with different port number), those will eventually time out. r339992: libsa: tftp should not read past file end When we have the file size via tsize option, use it to make sure we will not attempt to read past file end. r339993: libsa: tftp should use calloc instead of malloc() memset(), use calloc(). r340026: libsa: cstyle cleanup tftp.c No functinal changes intended. Modified: stable/11/stand/libsa/bootp.c stable/11/stand/libsa/bootp.h stable/11/stand/libsa/cd9660.c stable/11/stand/libsa/cd9660read.c stable/11/stand/libsa/dosfs.c stable/11/stand/libsa/gzipfs.c stable/11/stand/libsa/net.c stable/11/stand/libsa/nfs.c stable/11/stand/libsa/tftp.c stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/bootp.c ============================================================================== --- stable/11/stand/libsa/bootp.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/bootp.c Thu Feb 21 02:43:48 2019 (r344408) @@ -735,7 +735,7 @@ setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts bcopy(cp, buf, size); /* cannot overflow */ buf[size] = '\0'; for (endv = buf; endv; endv = vp) { - u_char *s = NULL; /* semicolon ? */ + char *s = NULL; /* semicolon ? */ /* skip leading whitespace */ while (*endv && strchr(" \t\n\r", *endv)) Modified: stable/11/stand/libsa/bootp.h ============================================================================== --- stable/11/stand/libsa/bootp.h Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/bootp.h Thu Feb 21 02:43:48 2019 (r344408) @@ -39,7 +39,7 @@ struct bootp { struct in_addr bp_giaddr; /* gateway IP address */ unsigned char bp_chaddr[16]; /* client hardware address */ unsigned char bp_sname[64]; /* server host name */ - unsigned char bp_file[128]; /* boot file name */ + char bp_file[128]; /* boot file name */ #ifdef SUPPORT_DHCP #define BOOTP_VENDSIZE 312 #else Modified: stable/11/stand/libsa/cd9660.c ============================================================================== --- stable/11/stand/libsa/cd9660.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/cd9660.c Thu Feb 21 02:43:48 2019 (r344408) @@ -304,7 +304,7 @@ cd9660_open(const char *path, struct open_file *f) if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE) goto out; - rec = *(struct iso_directory_record *) vd->root_directory_record; + bcopy(vd->root_directory_record, &rec, sizeof(rec)); if (*path == '/') path++; /* eat leading '/' */ first = 1; Modified: stable/11/stand/libsa/cd9660read.c ============================================================================== --- stable/11/stand/libsa/cd9660read.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/cd9660read.c Thu Feb 21 02:43:48 2019 (r344408) @@ -241,7 +241,7 @@ cd9660_lookup(const char *path) break; } - rec = *(struct iso_directory_record *) vd->root_directory_record; + bcopy(vd->root_directory_record, &rec, sizeof(rec)); if (*path == '/') path++; /* eat leading '/' */ first = 1; Modified: stable/11/stand/libsa/dosfs.c ============================================================================== --- stable/11/stand/libsa/dosfs.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/dosfs.c Thu Feb 21 02:43:48 2019 (r344408) @@ -403,7 +403,7 @@ dos_stat(struct open_file *fd, struct stat *sb) } static int -dos_checksum(char *name, char *ext) +dos_checksum(unsigned char *name, unsigned char *ext) { int x, i; char buf[11]; Modified: stable/11/stand/libsa/gzipfs.c ============================================================================== --- stable/11/stand/libsa/gzipfs.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/gzipfs.c Thu Feb 21 02:43:48 2019 (r344408) @@ -40,7 +40,7 @@ struct z_file int zf_rawfd; off_t zf_dataoffset; z_stream zf_zstream; - char zf_buf[Z_BUFSIZE]; + unsigned char zf_buf[Z_BUFSIZE]; int zf_endseen; }; Modified: stable/11/stand/libsa/net.c ============================================================================== --- stable/11/stand/libsa/net.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/net.c Thu Feb 21 02:43:48 2019 (r344408) @@ -267,7 +267,7 @@ intoa(n_long addr) } static char * -number(char *s, int *n) +number(char *s, n_long *n) { for (*n = 0; isdigit(*s); s++) *n = (*n * 10) + *s - '0'; @@ -280,7 +280,7 @@ ip_convertaddr(char *p) #define IP_ANYADDR 0 n_long addr = 0, n; - if (p == (char *)0 || *p == '\0') + if (p == NULL || *p == '\0') return IP_ANYADDR; p = number(p, &n); addr |= (n << 24) & 0xff000000; Modified: stable/11/stand/libsa/nfs.c ============================================================================== --- stable/11/stand/libsa/nfs.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/nfs.c Thu Feb 21 02:43:48 2019 (r344408) @@ -837,7 +837,7 @@ nfs_readdir(struct open_file *f, struct dirent *d) fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos]) << 32) | ntohl(rent->nameplus[pos + 1]); pos += 2; - buf = (u_char *)&rent->nameplus[pos]; + buf = (char *)&rent->nameplus[pos]; return (0); err: Modified: stable/11/stand/libsa/tftp.c ============================================================================== --- stable/11/stand/libsa/tftp.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/tftp.c Thu Feb 21 02:43:48 2019 (r344408) @@ -63,30 +63,29 @@ __FBSDID("$FreeBSD$"); struct tftp_handle; struct tftprecv_extra; -static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload, - time_t tleft, void *recv_extra); -static int tftp_open(const char *path, struct open_file *f); -static int tftp_close(struct open_file *f); -static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); -static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static off_t tftp_seek(struct open_file *f, off_t offset, int where); -static int tftp_set_blksize(struct tftp_handle *h, const char *str); -static int tftp_stat(struct open_file *f, struct stat *sb); +static ssize_t recvtftp(struct iodesc *, void **, void **, time_t, void *); +static int tftp_open(const char *, struct open_file *); +static int tftp_close(struct open_file *); +static int tftp_parse_oack(struct tftp_handle *, char *, size_t); +static int tftp_read(struct open_file *, void *, size_t, size_t *); +static off_t tftp_seek(struct open_file *, off_t, int); +static int tftp_set_blksize(struct tftp_handle *, const char *); +static int tftp_stat(struct open_file *, struct stat *); struct fs_ops tftp_fsops = { - "tftp", - tftp_open, - tftp_close, - tftp_read, - null_write, - tftp_seek, - tftp_stat, - null_readdir + .fs_name = "tftp", + .fo_open = tftp_open, + .fo_close = tftp_close, + .fo_read = tftp_read, + .fo_write = null_write, + .fo_seek = tftp_seek, + .fo_stat = tftp_stat, + .fo_readdir = null_readdir }; extern struct in_addr servip; -static int tftpport = 2000; +static int tftpport = 2000; static int is_open = 0; /* @@ -94,21 +93,21 @@ static int is_open = 0; * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ -#define TFTP_REQUESTED_BLKSIZE 1428 +#define TFTP_REQUESTED_BLKSIZE 1428 /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. */ -#define TFTP_MAX_BLKSIZE 9008 +#define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { struct iodesc *iodesc; - int currblock; /* contents of lastdata */ - int islastblock; /* flag */ - int validsize; - int off; - char *path; /* saved for re-requests */ + int currblock; /* contents of lastdata */ + int islastblock; /* flag */ + int validsize; + int off; + char *path; /* saved for re-requests */ unsigned int tftp_blksize; unsigned long tftp_tsize; void *pkt; @@ -117,7 +116,7 @@ struct tftp_handle { struct tftprecv_extra { struct tftp_handle *tftp_handle; - unsigned short rtype; /* Received type */ + unsigned short rtype; /* Received type */ }; #define TFTP_MAX_ERRCODE EOPTNEG @@ -141,42 +140,42 @@ tftp_senderr(struct tftp_handle *h, u_short errcode, c { struct { u_char header[HEADER_SIZE]; - struct tftphdr t; + struct tftphdr t; u_char space[63]; /* +1 from t */ } __packed __aligned(4) wbuf; - char *wtail; - int len; + char *wtail; + int len; len = strlen(msg); if (len > sizeof(wbuf.space)) len = sizeof(wbuf.space); - wbuf.t.th_opcode = htons((u_short) ERROR); - wbuf.t.th_code = htons(errcode); + wbuf.t.th_opcode = htons((u_short)ERROR); + wbuf.t.th_code = htons(errcode); wtail = wbuf.t.th_msg; bcopy(msg, wtail, len); wtail[len] = '\0'; wtail += len + 1; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static void -tftp_sendack(struct tftp_handle *h) +tftp_sendack(struct tftp_handle *h, u_short block) { struct { u_char header[HEADER_SIZE]; struct tftphdr t; } __packed __aligned(4) wbuf; - char *wtail; + char *wtail; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; + wbuf.t.th_block = htons(block); wtail += 2; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static ssize_t @@ -190,7 +189,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, ssize_t len; errno = 0; - extra = (struct tftprecv_extra *)recv_extra; + extra = recv_extra; h = extra->tftp_handle; len = readudp(d, &ptr, (void **)&t, tleft); @@ -205,28 +204,36 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, case DATA: { int got; - if (htons(t->th_block) != (u_short) d->xid) { + if (htons(t->th_block) < (u_short)d->xid) { /* - * Expected block? + * Apparently our ACK was missed, re-send. */ + tftp_sendack(h, htons(t->th_block)); free(ptr); return (-1); } + if (htons(t->th_block) != (u_short)d->xid) { + /* + * Packet from the future, drop this. + */ + free(ptr); + return (-1); + } if (d->xid == 1) { /* * First data packet from new port. */ struct udphdr *uh; - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; - } /* else check uh_sport has not changed??? */ + } got = len - (t->th_data - (char *)t); *pkt = ptr; *payload = t; return (got); } case ERROR: - if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { + if ((unsigned)ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -241,8 +248,8 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct udphdr *uh; int tftp_oack_len; - /* - * Unexpected OACK. TFTP transfer already in progress. + /* + * Unexpected OACK. TFTP transfer already in progress. * Drop the pkt. */ if (d->xid != 1) { @@ -254,9 +261,9 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, * Remember which port this OACK came from, because we need * to send the ACK or errors back to it. */ - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; - + /* Parse options ACK-ed by the server. */ tftp_oack_len = len - sizeof(t->th_opcode); if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { @@ -288,9 +295,9 @@ tftp_makereq(struct tftp_handle *h) u_char space[FNAME_SIZE + 6]; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int l; - ssize_t res; + char *wtail; + int l; + ssize_t res; void *pkt; struct tftphdr *t; char *tftp_blksize = NULL; @@ -304,7 +311,7 @@ tftp_makereq(struct tftp_handle *h) tftp_set_blksize(h, tftp_blksize); } - wbuf.t.th_opcode = htons((u_short) RRQ); + wbuf.t.th_opcode = htons((u_short)RRQ); wtail = wbuf.t.th_stuff; l = strlen(h->path); #ifdef TFTP_PREPEND_PATH @@ -329,7 +336,6 @@ tftp_makereq(struct tftp_handle *h) bcopy("0", wtail, 2); wtail += 2; - /* h->iodesc->myport = htons(--tftpport); */ h->iodesc->myport = htons(tftpport + (getsecs() & 0x3ff)); h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ @@ -340,8 +346,8 @@ tftp_makereq(struct tftp_handle *h) pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { free(pkt); return (errno); @@ -364,7 +370,7 @@ tftp_makereq(struct tftp_handle *h) h->islastblock = 0; if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ - tftp_sendack(h); + tftp_sendack(h, h->currblock); } return (0); } @@ -376,7 +382,7 @@ tftp_makereq(struct tftp_handle *h) } /* ack block, expect next */ -static int +static int tftp_getnextblock(struct tftp_handle *h) { struct { @@ -384,21 +390,22 @@ tftp_getnextblock(struct tftp_handle *h) struct tftphdr t; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int res; + char *wtail; + int res; void *pkt; struct tftphdr *t; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; + wbuf.t.th_block = htons((u_short)h->currblock); wtail += 2; h->iodesc->xid = h->currblock + 1; /* expected block */ pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { /* 0 is OK! */ free(pkt); @@ -414,8 +421,8 @@ tftp_getnextblock(struct tftp_handle *h) h->islastblock = 1; /* EOF */ if (h->islastblock == 1) { - /* Send an ACK for the last block */ - wbuf.t.th_block = htons((u_short) h->currblock); + /* Send an ACK for the last block */ + wbuf.t.th_block = htons((u_short)h->currblock); sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } @@ -426,10 +433,10 @@ static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; - struct iodesc *io; - int res; - size_t pathsize; - const char *extraslash; + struct iodesc *io; + int res; + size_t pathsize; + const char *extraslash; if (netproto != NET_TFTP) return (EINVAL); @@ -440,15 +447,16 @@ tftp_open(const char *path, struct open_file *f) if (is_open) return (EBUSY); - tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile)); + tftpfile = calloc(1, sizeof(*tftpfile)); if (!tftpfile) return (ENOMEM); - memset(tftpfile, 0, sizeof(*tftpfile)); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; - tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); - if (io == NULL) + tftpfile->iodesc = io = socktodesc(*(int *)(f->f_devdata)); + if (io == NULL) { + free(tftpfile); return (EINVAL); + } io->destip = servip; tftpfile->off = 0; @@ -456,7 +464,7 @@ tftp_open(const char *path, struct open_file *f) tftpfile->path = malloc(pathsize); if (tftpfile->path == NULL) { free(tftpfile); - return(ENOMEM); + return (ENOMEM); } if (rootpath[strlen(rootpath) - 1] == '/' || path[0] == '/') extraslash = ""; @@ -467,7 +475,7 @@ tftp_open(const char *path, struct open_file *f) if (res < 0 || res > pathsize) { free(tftpfile->path); free(tftpfile); - return(ENOMEM); + return (ENOMEM); } res = tftp_makereq(tftpfile); @@ -478,7 +486,7 @@ tftp_open(const char *path, struct open_file *f) free(tftpfile); return (res); } - f->f_fsdata = (void *) tftpfile; + f->f_fsdata = tftpfile; is_open = 1; return (0); } @@ -488,8 +496,19 @@ tftp_read(struct open_file *f, void *addr, size_t size size_t *resid /* out */) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + size_t res; + int rc; + rc = 0; + res = size; + tftpfile = f->f_fsdata; + + /* Make sure we will not read past file end */ + if (tftpfile->tftp_tsize > 0 && + tftpfile->off + size > tftpfile->tftp_tsize) { + size = tftpfile->tftp_tsize - tftpfile->off; + } + while (size > 0) { int needblock, count; @@ -499,19 +518,19 @@ tftp_read(struct open_file *f, void *addr, size_t size if (tftpfile->currblock > needblock) { /* seek backwards */ tftp_senderr(tftpfile, 0, "No error: read aborted"); - tftp_makereq(tftpfile); /* no error check, it worked - * for open */ + rc = tftp_makereq(tftpfile); + if (rc != 0) + break; } while (tftpfile->currblock < needblock) { - int res; - res = tftp_getnextblock(tftpfile); - if (res) { /* no answer */ + rc = tftp_getnextblock(tftpfile); + if (rc) { /* no answer */ #ifdef TFTP_DEBUG printf("tftp: read error\n"); #endif - return (res); + return (rc); } if (tftpfile->islastblock) break; @@ -537,6 +556,7 @@ tftp_read(struct open_file *f, void *addr, size_t size addr = (char *)addr + count; tftpfile->off += count; size -= count; + res -= count; if ((tftpfile->islastblock) && (count == inbuffer)) break; /* EOF */ @@ -549,16 +569,16 @@ tftp_read(struct open_file *f, void *addr, size_t size } - if (resid) - *resid = size; - return (0); + if (resid != NULL) + *resid = res; + return (rc); } -static int +static int tftp_close(struct open_file *f) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; /* let it time out ... */ @@ -571,17 +591,17 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; sb->st_mode = 0444 | S_IFREG; sb->st_nlink = 1; sb->st_uid = 0; sb->st_gid = 0; - sb->st_size = (off_t) tftpfile->tftp_tsize; + sb->st_size = tftpfile->tftp_tsize; return (0); } @@ -589,7 +609,7 @@ static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; switch (where) { case SEEK_SET: @@ -608,7 +628,7 @@ tftp_seek(struct open_file *f, off_t offset, int where static int tftp_set_blksize(struct tftp_handle *h, const char *str) { - char *endptr; + char *endptr; int new_blksize; int ret = 0; @@ -623,8 +643,8 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * RFC2348 specifies that acceptable values are 8-65464. * Let's choose a limit less than MAXRSPACE. */ - if (*endptr == '\0' && new_blksize >= 8 - && new_blksize <= TFTP_MAX_BLKSIZE) { + if (*endptr == '\0' && new_blksize >= 8 && + new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; ret = 1; } @@ -655,10 +675,10 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * optN, valueN * The final option/value acknowledgment pair. */ -static int +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { - /* + /* * We parse the OACK strings into an array * of name-value pairs. */ @@ -668,7 +688,7 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size int option_idx = 0; int blksize_is_set = 0; int tsize = 0; - + unsigned int orig_blksize; while (option_idx < 128 && i < len) { @@ -685,26 +705,30 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size /* Save the block size we requested for sanity check later. */ orig_blksize = h->tftp_blksize; - /* + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. * * "tsize" is specified in RFC2349. - */ + */ for (i = 0; i < option_idx; i += 2) { - if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) - blksize_is_set = - tftp_set_blksize(h, tftp_options[i + 1]); - } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) - tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - if (tsize != 0) - h->tftp_tsize = tsize; - } else { - /* Do not allow any options we did not expect to be ACKed. */ - printf("unexpected tftp option '%s'\n", tftp_options[i]); - return (-1); - } + if (strcasecmp(tftp_options[i], "blksize") == 0) { + if (i + 1 < option_idx) + blksize_is_set = + tftp_set_blksize(h, tftp_options[i + 1]); + } else if (strcasecmp(tftp_options[i], "tsize") == 0) { + if (i + 1 < option_idx) + tsize = strtol(tftp_options[i + 1], NULL, 10); + if (tsize != 0) + h->tftp_tsize = tsize; + } else { + /* + * Do not allow any options we did not expect to be + * ACKed. + */ + printf("unexpected tftp option '%s'\n", + tftp_options[i]); + return (-1); + } } if (!blksize_is_set) { @@ -726,5 +750,5 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif - return 0; + return (0); } Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Thu Feb 21 02:41:57 2019 (r344407) +++ stable/11/stand/libsa/zfs/zfs.c Thu Feb 21 02:43:48 2019 (r344408) @@ -467,6 +467,7 @@ zfs_probe(int fd, uint64_t *pool_guid) spa_t *spa; int ret; + spa = NULL; ret = vdev_probe(vdev_read, (void *)(uintptr_t)fd, &spa); if (ret == 0 && pool_guid != NULL) *pool_guid = spa->spa_guid; From owner-svn-src-all@freebsd.org Thu Feb 21 02:46: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 53FC214EB074; Thu, 21 Feb 2019 02:46: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 EA3FA85FF6; Thu, 21 Feb 2019 02:46:32 +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 DBC14F1E0; Thu, 21 Feb 2019 02:46:32 +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 x1L2kWuo086033; Thu, 21 Feb 2019 02:46:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2kW7g086031; Thu, 21 Feb 2019 02:46:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210246.x1L2kW7g086031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:46:32 +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: r344409 - in stable/11/stand/efi: boot1 loader/arch/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: boot1 loader/arch/arm64 X-SVN-Commit-Revision: 344409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA3FA85FF6 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.944,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 02:46:33 -0000 Author: kevans Date: Thu Feb 21 02:46:32 2019 New Revision: 344409 URL: https://svnweb.freebsd.org/changeset/base/344409 Log: MFC r338337: Fix lualoader on arm64 Lua has a few places where it allocates a large buffer on the stack. This is normally fine, except there are a few places where there can be multiple frames with this buffer. This can cause a stack overflow on some arm64 SoCs. Fix this by allocating our own stack in loader.efi large enough for these objects. The required size has been found by tracing how the stack pointer changes in a virtual machine and found to be no larger than 50kB. A larger stack is allocated to reduce the likelihood of overflow from future changes. Modified: stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/loader/arch/arm64/start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/boot1/Makefile ============================================================================== --- stable/11/stand/efi/boot1/Makefile Thu Feb 21 02:43:48 2019 (r344408) +++ stable/11/stand/efi/boot1/Makefile Thu Feb 21 02:46:32 2019 (r344409) @@ -6,6 +6,7 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 +CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: stable/11/stand/efi/loader/arch/arm64/start.S ============================================================================== --- stable/11/stand/efi/loader/arch/arm64/start.S Thu Feb 21 02:43:48 2019 (r344408) +++ stable/11/stand/efi/loader/arch/arm64/start.S Thu Feb 21 02:46:32 2019 (r344409) @@ -160,6 +160,23 @@ _start: ldp x0, x1, [sp], #16 +#ifndef EFI_BOOT1 + /* + * Load the stack to use. The default stack may be too small for + * the lua loader. + */ + adr x2, initstack_end + mov sp, x2 +#endif + bl efi_main 1: b 1b + +#ifndef EFI_BOOT1 +.bss + .align 4 +initstack: + .space (64 * 1024) +initstack_end: +#endif From owner-svn-src-all@freebsd.org Thu Feb 21 02:50: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 BA17C14EB1FE; Thu, 21 Feb 2019 02:50:46 +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 5835D8625D; Thu, 21 Feb 2019 02:50:46 +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 4AA3BF317; Thu, 21 Feb 2019 02:50:46 +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 x1L2ok2q089315; Thu, 21 Feb 2019 02:50:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2okVU089314; Thu, 21 Feb 2019 02:50:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210250.x1L2okVU089314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:50:46 +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: r344411 - stable/11/stand/efi/libefi X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/efi/libefi X-SVN-Commit-Revision: 344411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5835D8625D 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.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 02:50:47 -0000 Author: kevans Date: Thu Feb 21 02:50:45 2019 New Revision: 344411 URL: https://svnweb.freebsd.org/changeset/base/344411 Log: MFC r336431: stand: Fix UEFI console scrolling Remove bogus attempt to simulate scrolling. It's not needed and messes up serial output. Setting the cursor position after every character is inefficient, and causes all lines to be over-printed in the serial console for the boot loader. Allow the terminal to do the emulation. This isn't completely perfect when the size of the terminal attached to the serial port isn't the same as 80x25 to match the viedoe console (or whatever the video console is). While imperfect still, these changes make it much better. This makes the serial port useful with UEFI. Modified: stable/11/stand/efi/libefi/efi_console.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/libefi/efi_console.c ============================================================================== --- stable/11/stand/efi/libefi/efi_console.c Thu Feb 21 02:48:38 2019 (r344410) +++ stable/11/stand/efi/libefi/efi_console.c Thu Feb 21 02:50:45 2019 (r344411) @@ -147,20 +147,20 @@ efi_cons_rawputchar(int c) switch (c) { case '\r': curx = 0; - curs_move(&curx, &cury, curx, cury); + efi_cons_efiputchar('\r'); return; case '\n': + efi_cons_efiputchar('\n'); + efi_cons_efiputchar('\r'); cury++; - if (cury >= y) { - efi_cons_efiputchar('\n'); + if (cury >= y) cury--; - } else - curs_move(&curx, &cury, curx, cury); + curx = 0; return; case '\b': if (curx > 0) { + efi_cons_efiputchar('\b'); curx--; - curs_move(&curx, &cury, curx, cury); } return; default: @@ -175,7 +175,6 @@ efi_cons_rawputchar(int c) cury--; } } - curs_move(&curx, &cury, curx, cury); #endif } } From owner-svn-src-all@freebsd.org Thu Feb 21 02:37: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 2064414EA85D; Thu, 21 Feb 2019 02:37:03 +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 B01E485760; Thu, 21 Feb 2019 02:37:02 +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 A25E5F008; Thu, 21 Feb 2019 02:37:02 +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 x1L2b2ii080671; Thu, 21 Feb 2019 02:37:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2b28G080669; Thu, 21 Feb 2019 02:37:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210237.x1L2b28G080669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:37:02 +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: r344406 - in stable/11/stand/efi: include libefi X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: include libefi X-SVN-Commit-Revision: 344406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B01E485760 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.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 02:37:03 -0000 Author: kevans Date: Thu Feb 21 02:37:01 2019 New Revision: 344406 URL: https://svnweb.freebsd.org/changeset/base/344406 Log: MFC r336651-r336655: stand: libefi: various boot protocol aux impl. r336651: Implement efi_devpath_to_media_path Takes a generic device path as its input. Scans through it to find the first media_path node in it and returns a pointer to it. If none is found, NULL is returned. r336652: Store the number of handles we get back in efipart_nhandles rather than the number of bytes. Don't divide by the element size every time we have to iterate. Eliminate now-unused variables. r336653: Implement efi_devpath_match_node Returns true if the first node pointed to by devpath1 is identical to the first node pointed to by devpath2, with care taken to not read past the end of the valid parts of either devpath1 or devpath2. Otherwise, returns false. r336654: Implement efi_devpath_length Return the total length, in bytes, of the device path (including the terminating node at the end). r336655: Implement efiblk_get_pdinfo_by_device_path Lookup a block device by it's device path. We use a 'loose' lookup whereby we scan forward to the first Media Path portion of the device path, then look at all our handles for one whose first Media Path matches. This will also work if the device path pointed to has a following file path (or paths) as that's ignored. It assumes that there's only one media path node that describes the entire device, which is true as of the latest UEFI spec (2.7 Errata A) as far as I've been able to determine. Modified: stable/11/stand/efi/include/efilib.h stable/11/stand/efi/libefi/devpath.c stable/11/stand/efi/libefi/efipart.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/include/efilib.h ============================================================================== --- stable/11/stand/efi/include/efilib.h Thu Feb 21 02:32:30 2019 (r344405) +++ stable/11/stand/efi/include/efilib.h Thu Feb 21 02:37:01 2019 (r344406) @@ -66,6 +66,7 @@ typedef struct pdinfo pdinfo_list_t *efiblk_get_pdinfo_list(struct devsw *dev); pdinfo_t *efiblk_get_pdinfo(struct devdesc *dev); pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h); +pdinfo_t *efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path); void *efi_get_table(EFI_GUID *tbl); @@ -85,9 +86,12 @@ EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); +bool efi_devpath_match_node(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); bool efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); +EFI_DEVICE_PATH *efi_devpath_to_media_path(EFI_DEVICE_PATH *); +UINTN efi_devpath_length(EFI_DEVICE_PATH *); int efi_status_to_errno(EFI_STATUS); EFI_STATUS errno_to_efi_status(int errno); Modified: stable/11/stand/efi/libefi/devpath.c ============================================================================== --- stable/11/stand/efi/libefi/devpath.c Thu Feb 21 02:32:30 2019 (r344405) +++ stable/11/stand/efi/libefi/devpath.c Thu Feb 21 02:37:01 2019 (r344406) @@ -140,25 +140,33 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath) } bool -efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) +efi_devpath_match_node(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) { size_t len; if (devpath1 == NULL || devpath2 == NULL) return (false); + if (DevicePathType(devpath1) != DevicePathType(devpath2) || + DevicePathSubType(devpath1) != DevicePathSubType(devpath2)) + return (false); + len = DevicePathNodeLength(devpath1); + if (len != DevicePathNodeLength(devpath2)) + return (false); + if (memcmp(devpath1, devpath2, len) != 0) + return (false); + return (true); +} - while (true) { - if (DevicePathType(devpath1) != DevicePathType(devpath2) || - DevicePathSubType(devpath1) != DevicePathSubType(devpath2)) - return (false); +bool +efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) +{ - len = DevicePathNodeLength(devpath1); - if (len != DevicePathNodeLength(devpath2)) - return (false); + if (devpath1 == NULL || devpath2 == NULL) + return (false); - if (memcmp(devpath1, devpath2, len) != 0) - return (false); - + while (true) { + if (!efi_devpath_match_node(devpath1, devpath2)) + return false; if (IsDevicePathEnd(devpath1)) break; devpath1 = NextDevicePathNode(devpath1); @@ -194,4 +202,30 @@ efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEV path = NextDevicePathNode(path); } return (true); +} + +/* + * Skip over the 'prefix' part of path and return the part of the path + * that starts with the first node that's a MEDIA_DEVICE_PATH. + */ +EFI_DEVICE_PATH * +efi_devpath_to_media_path(EFI_DEVICE_PATH *path) +{ + + while (!IsDevicePathEnd(path)) { + if (DevicePathType(path) == MEDIA_DEVICE_PATH) + return (path); + path = NextDevicePathNode(path); + } + return (NULL); +} + +UINTN +efi_devpath_length(EFI_DEVICE_PATH *path) +{ + EFI_DEVICE_PATH *start = path; + + while (!IsDevicePathEnd(path)) + path = NextDevicePathNode(path); + return ((UINTN)path - (UINTN)start) + DevicePathNodeLength(path); } Modified: stable/11/stand/efi/libefi/efipart.c ============================================================================== --- stable/11/stand/efi/libefi/efipart.c Thu Feb 21 02:32:30 2019 (r344405) +++ stable/11/stand/efi/libefi/efipart.c Thu Feb 21 02:37:01 2019 (r344406) @@ -137,6 +137,28 @@ efiblk_get_pdinfo(struct devdesc *dev) return (pd); } +pdinfo_t * +efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path) +{ + unsigned i; + EFI_DEVICE_PATH *media, *devpath; + EFI_HANDLE h; + + media = efi_devpath_to_media_path(path); + if (media == NULL) + return (NULL); + for (i = 0; i < efipart_nhandles; i++) { + h = efipart_handles[i]; + devpath = efi_lookup_devpath(h); + if (devpath == NULL) + continue; + if (!efi_devpath_match_node(media, efi_devpath_to_media_path(devpath))) + continue; + return (efiblk_get_pdinfo_by_handle(h)); + } + return (NULL); +} + static bool same_handle(pdinfo_t *pd, EFI_HANDLE h) { @@ -210,7 +232,7 @@ efipart_inithandles(void) return (efi_status_to_errno(status)); efipart_handles = hin; - efipart_nhandles = sz; + efipart_nhandles = sz / sizeof(*hin); #ifdef EFIPART_DEBUG printf("%s: Got %d BLOCK IO MEDIA handle(s)\n", __func__, efipart_nhandles); @@ -246,7 +268,7 @@ efipart_floppy(EFI_DEVICE_PATH *node) static bool efipart_hdd(EFI_DEVICE_PATH *dp) { - unsigned i, nin; + unsigned i; EFI_DEVICE_PATH *devpath, *node; EFI_BLOCK_IO *blkio; EFI_STATUS status; @@ -264,8 +286,7 @@ efipart_hdd(EFI_DEVICE_PATH *dp) * Test every EFI BLOCK IO handle to make sure dp is not device path * for CD/DVD. */ - nin = efipart_nhandles / sizeof (*efipart_handles); - for (i = 0; i < nin; i++) { + for (i = 0; i < efipart_nhandles; i++) { devpath = efi_lookup_devpath(efipart_handles[i]); if (devpath == NULL) return (false); @@ -340,10 +361,9 @@ efipart_updatefd(void) { EFI_DEVICE_PATH *devpath, *node; ACPI_HID_DEVICE_PATH *acpi; - int i, nin; + int i; - nin = efipart_nhandles / sizeof (*efipart_handles); - for (i = 0; i < nin; i++) { + for (i = 0; i < efipart_nhandles; i++) { devpath = efi_lookup_devpath(efipart_handles[i]); if (devpath == NULL) continue; @@ -410,14 +430,13 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias static void efipart_updatecd(void) { - int i, nin; + int i; EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; EFI_HANDLE handle; EFI_BLOCK_IO *blkio; EFI_STATUS status; - nin = efipart_nhandles / sizeof (*efipart_handles); - for (i = 0; i < nin; i++) { + for (i = 0; i < efipart_nhandles; i++) { devpath = efi_lookup_devpath(efipart_handles[i]); if (devpath == NULL) continue; @@ -666,14 +685,13 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) static void efipart_updatehd(void) { - int i, nin; + int i; EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; EFI_HANDLE handle; EFI_BLOCK_IO *blkio; EFI_STATUS status; - nin = efipart_nhandles / sizeof (*efipart_handles); - for (i = 0; i < nin; i++) { + for (i = 0; i < efipart_nhandles; i++) { devpath = efi_lookup_devpath(efipart_handles[i]); if (devpath == NULL) continue; From owner-svn-src-all@freebsd.org Thu Feb 21 02:52: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 6F40814EB3FB; Thu, 21 Feb 2019 02:52:28 +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 0DFC48659E; Thu, 21 Feb 2019 02:52:28 +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 EF3E2F396; Thu, 21 Feb 2019 02:52:27 +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 x1L2qRLe091306; Thu, 21 Feb 2019 02:52:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2qRtl091304; Thu, 21 Feb 2019 02:52:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210252.x1L2qRtl091304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:52: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: r344412 - stable/11/stand/efi/loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/efi/loader X-SVN-Commit-Revision: 344412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DFC48659E 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)[-0.999,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, 21 Feb 2019 02:52:28 -0000 Author: kevans Date: Thu Feb 21 02:52:27 2019 New Revision: 344412 URL: https://svnweb.freebsd.org/changeset/base/344412 Log: MFC r336837: Be more conservative about setting hw.uart.console Note when we've found a 8250 PNP node. Only try to set hw.uart.console if we see one (otherwise ignore serial hints). The 8250 is the only one known to have I/O ports, so limit the guessing to when we've positively seen one. And limit this to x86 since that's the only platform where we have I/O ports. Otherwise, we'd set the serial port to something crazy for the platform and fall off the cliff early in boot. Modified: stable/11/stand/efi/loader/bootinfo.c stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/loader/bootinfo.c ============================================================================== --- stable/11/stand/efi/loader/bootinfo.c Thu Feb 21 02:50:45 2019 (r344411) +++ stable/11/stand/efi/loader/bootinfo.c Thu Feb 21 02:52:27 2019 (r344412) @@ -82,10 +82,13 @@ bi_getboothowto(char *kargs) howto |= RB_SERIAL; if (strcmp(console, "nullconsole") == 0) howto |= RB_MUTE; - if (strcmp(console, "efi") == 0) { +#if defined(__i386__) || defined(__amd64__) + if (strcmp(console, "efi") == 0 && + getenv("efi_8250_uid") != NULL && + getenv("hw.uart.console") == NULL) { /* - * If we found a com port and com speed, we need to tell - * the kernel where the serial port is, and how + * If we found a 8250 com port and com speed, we need to + * tell the kernel where the serial port is, and how * fast. Ideally, we'd get the port from ACPI, but that * isn't running in the loader. Do the next best thing * by allowing it to be set by a loader.conf variable, @@ -93,24 +96,31 @@ bi_getboothowto(char *kargs) * comconsole_port if not. PCI support is needed, but * for that we'd ideally refactor the * libi386/comconsole.c code to have identical behavior. + * We only try to set the port for cases where we saw + * the Serial(x) node when parsing, otherwise + * specialized hardware that has Uart nodes will have a + * bogus address set. + * But if someone specifically setup hw.uart.console, + * don't override that. */ + speed = -1; + port = -1; tmp = getenv("efi_com_speed"); - if (tmp != NULL) { + if (tmp != NULL) speed = strtol(tmp, NULL, 0); - tmp = getenv("efi_com_port"); - if (tmp == NULL) - tmp = getenv("comconsole_port"); - /* XXX fallback to EFI variable set in rc.d? */ - if (tmp != NULL) - port = strtol(tmp, NULL, 0); - else - port = 0x3f8; + tmp = getenv("efi_com_port"); + if (tmp == NULL) + tmp = getenv("comconsole_port"); + if (tmp != NULL) + port = strtol(tmp, NULL, 0); + if (speed != -1 && port != -1) { snprintf(buf, sizeof(buf), "io:%d,br:%d", port, speed); env_setenv("hw.uart.console", EV_VOLATILE, buf, NULL, NULL); } } +#endif } return (howto); Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Thu Feb 21 02:50:45 2019 (r344411) +++ stable/11/stand/efi/loader/main.c Thu Feb 21 02:52:27 2019 (r344412) @@ -435,6 +435,15 @@ parse_args(int argc, CHAR16 *argv[]) return (howto); } +static void +setenv_int(const char *key, int val) +{ + char buf[20]; + + snprintf(buf, sizeof(buf), "%d", val); + setenv(key, buf, 1); +} + /* * Parse ConOut (the list of consoles active) and see if we can find a * serial port and/or a video port. It would be nice to also walk the @@ -466,15 +475,15 @@ parse_uefi_con_out(void) DevicePathSubType(node) == ACPI_DP) { /* Check for Serial node */ acpi = (void *)node; - if (EISA_ID_TO_NUM(acpi->HID) == 0x501) + if (EISA_ID_TO_NUM(acpi->HID) == 0x501) { + setenv_int("efi_8250_uid", acpi->UID); com_seen = ++seen; + } } else if (DevicePathType(node) == MESSAGING_DEVICE_PATH && DevicePathSubType(node) == MSG_UART_DP) { - char bd[16]; uart = (void *)node; - snprintf(bd, sizeof(bd), "%d", uart->BaudRate); - setenv("efi_com_speed", bd, 1); + setenv_int("efi_com_speed", uart->BaudRate); } else if (DevicePathType(node) == ACPI_DEVICE_PATH && DevicePathSubType(node) == ACPI_ADR_DP) { /* Check for AcpiAdr() Node for video */ From owner-svn-src-all@freebsd.org Thu Feb 21 02:28: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 CB79014EA022; Thu, 21 Feb 2019 02:28:05 +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 6853884ECF; Thu, 21 Feb 2019 02:28:05 +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 53294EE34; Thu, 21 Feb 2019 02:28:05 +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 x1L2S5dg075577; Thu, 21 Feb 2019 02:28:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2S4dn075574; Thu, 21 Feb 2019 02:28:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210228.x1L2S4dn075574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:28:04 +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: r344403 - in stable/11/stand/efi: include loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: include loader X-SVN-Commit-Revision: 344403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6853884ECF 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)[-0.999,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: Thu, 21 Feb 2019 02:28:06 -0000 Author: kevans Date: Thu Feb 21 02:28:04 2019 New Revision: 344403 URL: https://svnweb.freebsd.org/changeset/base/344403 Log: MFC r336264, r336270-r336272, r336464, r336627: UEFI Console Improvements r336264: Define ADR subtype of ACPI type for a device path. r336270: uefi stand: Guess the console better For server machines, ComOut is set to the set of devices that the efi console suppots. Parse it to see if we have serial, video or both. Make that take precidence over the command line args. boot1.efi parses them, but loader.efi doesn't. It's not clear where to read boot.conf from, so we don't do that. The command line args can still be set via efibootmgr, which is more inline with the UEFI boot manager to replace that. These args are typically used only to set serial vs video and the com speed line. We can infer that from ComOut, so do so. Remember the com speed and hw.uart.console to match. r336271: Add reporting of whether or not a keyboard is detected. In addition, note that r336270's commit message was slightly incorrect. It changed the default setting of the console to honor the ConOut variable. Overrides via the command line are still possible, and we use the devices in ConOut to set the proper console. If, for example, serial cosnole is specified, we'll set console to "efi" if ConOut has a serial port list and to either "efi comconsole" or "comconsole efi" if not depending on whether -D or -D -h was specified. r336272: Minor adjustments: o Fix the parsing of the device path. a last minute change terminated it too soon. o Kill setting LINES. We don't need to do it, and even if we did hard coding it to 24 is wrong. o Now that the console is working again for the loader, adjust the printfs to be more in line with other platforms. r336464: If the console is already set, don't override it. If console=X is specified on the command line, it's effectively overridden by the current code. It shouldn't do that. r336627: Fix the attempt to see if we're overriding the console in the command line args. I had thought console would be NULL, but it's efi. Set it to efi (as a clue) before we initialize the console, then test it to see if it changed on the command line to do the automatic override. This gets my serial console back. RelNotes: yes Modified: stable/11/stand/efi/include/efidevp.h stable/11/stand/efi/loader/bootinfo.c stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/include/efidevp.h ============================================================================== --- stable/11/stand/efi/include/efidevp.h Thu Feb 21 01:30:37 2019 (r344402) +++ stable/11/stand/efi/include/efidevp.h Thu Feb 21 02:28:04 2019 (r344403) @@ -141,6 +141,9 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE_PATH { UINT32 CID; } ACPI_EXTENDED_HID_DEVICE_PATH; +#define ACPI_ADR_DP 0x03 +/* ACPI_ADR_DEVICE_PATH not defined */ + // // EISA ID Macro // EISA ID Definition 32-bits Modified: stable/11/stand/efi/loader/bootinfo.c ============================================================================== --- stable/11/stand/efi/loader/bootinfo.c Thu Feb 21 01:30:37 2019 (r344402) +++ stable/11/stand/efi/loader/bootinfo.c Thu Feb 21 02:28:04 2019 (r344403) @@ -67,10 +67,11 @@ extern EFI_SYSTEM_TABLE *ST; static int bi_getboothowto(char *kargs) { - const char *sw; + const char *sw, *tmp; char *opts; char *console; - int howto; + int howto, speed, port; + char buf[50]; howto = boot_parse_cmdline(kargs); howto |= boot_env_to_howto(); @@ -81,6 +82,35 @@ bi_getboothowto(char *kargs) howto |= RB_SERIAL; if (strcmp(console, "nullconsole") == 0) howto |= RB_MUTE; + if (strcmp(console, "efi") == 0) { + /* + * If we found a com port and com speed, we need to tell + * the kernel where the serial port is, and how + * fast. Ideally, we'd get the port from ACPI, but that + * isn't running in the loader. Do the next best thing + * by allowing it to be set by a loader.conf variable, + * either a EFI specific one, or the compatible + * comconsole_port if not. PCI support is needed, but + * for that we'd ideally refactor the + * libi386/comconsole.c code to have identical behavior. + */ + tmp = getenv("efi_com_speed"); + if (tmp != NULL) { + speed = strtol(tmp, NULL, 0); + tmp = getenv("efi_com_port"); + if (tmp == NULL) + tmp = getenv("comconsole_port"); + /* XXX fallback to EFI variable set in rc.d? */ + if (tmp != NULL) + port = strtol(tmp, NULL, 0); + else + port = 0x3f8; + snprintf(buf, sizeof(buf), "io:%d,br:%d", port, + speed); + env_setenv("hw.uart.console", EV_VOLATILE, buf, + NULL, NULL); + } + } } return (howto); Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Thu Feb 21 01:30:37 2019 (r344402) +++ stable/11/stand/efi/loader/main.c Thu Feb 21 02:28:04 2019 (r344403) @@ -316,11 +316,6 @@ find_currdev(EFI_LOADED_IMAGE *img) if (dp->pd_parent != NULL) { dp = dp->pd_parent; STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { - text = efi_devpath_name(pp->pd_devpath); - if (text != NULL) { - printf("And now the part: %S\n", text); - efi_free_devpath_name(text); - } /* * Roll up the ZFS special case * for those partitions that have @@ -400,8 +395,8 @@ interactive_interrupt(const char *msg) return (false); } -int -parse_args(int argc, CHAR16 *argv[], bool has_kbd) +static int +parse_args(int argc, CHAR16 *argv[]) { int i, j, howto; bool vargood; @@ -429,12 +424,97 @@ parse_args(int argc, CHAR16 *argv[], bool has_kbd) return (howto); } +/* + * Parse ConOut (the list of consoles active) and see if we can find a + * serial port and/or a video port. It would be nice to also walk the + * ACPI name space to map the UID for the serial port to a port. The + * latter is especially hard. + */ +static int +parse_uefi_con_out(void) +{ + int how, rv; + int vid_seen = 0, com_seen = 0, seen = 0; + size_t sz; + char buf[4096], *ep; + EFI_DEVICE_PATH *node; + ACPI_HID_DEVICE_PATH *acpi; + UART_DEVICE_PATH *uart; + bool pci_pending; + how = 0; + sz = sizeof(buf); + rv = efi_global_getenv("ConOut", buf, &sz); + if (rv != EFI_SUCCESS) + goto out; + ep = buf + sz; + node = (EFI_DEVICE_PATH *)buf; + while ((char *)node < ep) { + pci_pending = false; + if (DevicePathType(node) == ACPI_DEVICE_PATH && + DevicePathSubType(node) == ACPI_DP) { + /* Check for Serial node */ + acpi = (void *)node; + if (EISA_ID_TO_NUM(acpi->HID) == 0x501) + com_seen = ++seen; + } else if (DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_UART_DP) { + char bd[16]; + + uart = (void *)node; + snprintf(bd, sizeof(bd), "%d", uart->BaudRate); + setenv("efi_com_speed", bd, 1); + } else if (DevicePathType(node) == ACPI_DEVICE_PATH && + DevicePathSubType(node) == ACPI_ADR_DP) { + /* Check for AcpiAdr() Node for video */ + vid_seen = ++seen; + } else if (DevicePathType(node) == HARDWARE_DEVICE_PATH && + DevicePathSubType(node) == HW_PCI_DP) { + /* + * Note, vmware fusion has a funky console device + * PciRoot(0x0)/Pci(0xf,0x0) + * which we can only detect at the end since we also + * have to cope with: + * PciRoot(0x0)/Pci(0x1f,0x0)/Serial(0x1) + * so only match it if it's last. + */ + pci_pending = true; + } + node = NextDevicePathNode(node); /* Skip the end node */ + } + if (pci_pending && vid_seen == 0) + vid_seen = ++seen; + + /* + * Truth table for RB_MULTIPLE | RB_SERIAL + * Value Result + * 0 Use only video console + * RB_SERIAL Use only serial console + * RB_MULTIPLE Use both video and serial console + * (but video is primary so gets rc messages) + * both Use both video and serial console + * (but serial is primary so gets rc messages) + * + * Try to honor this as best we can. If only one of serial / video + * found, then use that. Otherwise, use the first one we found. + * This also implies if we found nothing, default to video. + */ + how = 0; + if (vid_seen && com_seen) { + how |= RB_MULTIPLE; + if (com_seen < vid_seen) + how |= RB_SERIAL; + } else if (com_seen) + how |= RB_SERIAL; +out: + return (how); +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { EFI_GUID *guid; - int howto, i; + int howto, i, uhowto; UINTN k; bool has_kbd; char *s; @@ -474,6 +554,7 @@ main(int argc, CHAR16 *argv[]) * eg. the boot device, which we can't do yet. We can use * printf() etc. once this is done. */ + setenv("console", "efi", 1); cons_probe(); /* @@ -481,23 +562,61 @@ main(int argc, CHAR16 *argv[]) */ bcache_init(32768, 512); - howto = parse_args(argc, argv, has_kbd); + howto = parse_args(argc, argv); + if (!has_kbd && (howto & RB_PROBE)) + howto |= RB_SERIAL | RB_MULTIPLE; + howto &= ~RB_PROBE; + uhowto = parse_uefi_con_out(); - boot_howto_to_env(howto); - /* - * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables + * We now have two notions of console. howto should be viewed as + * overrides. If console is already set, don't set it again. */ - if (howto & RB_MULTIPLE) { - if (howto & RB_SERIAL) - setenv("console", "comconsole efi" , 1); - else - setenv("console", "efi comconsole" , 1); - } else if (howto & RB_SERIAL) { - setenv("console", "comconsole" , 1); - } else - setenv("console", "efi", 1); - +#define VIDEO_ONLY 0 +#define SERIAL_ONLY RB_SERIAL +#define VID_SER_BOTH RB_MULTIPLE +#define SER_VID_BOTH (RB_SERIAL | RB_MULTIPLE) +#define CON_MASK (RB_SERIAL | RB_MULTIPLE) + if (strcmp(getenv("console"), "efi") == 0) { + if ((howto & CON_MASK) == 0) { + /* No override, uhowto is controlling and efi cons is perfect */ + howto = howto | (uhowto & CON_MASK); + setenv("console", "efi", 1); + } else if ((howto & CON_MASK) == (uhowto & CON_MASK)) { + /* override matches what UEFI told us, efi console is perfect */ + setenv("console", "efi", 1); + } else if ((uhowto & (CON_MASK)) != 0) { + /* + * We detected a serial console on ConOut. All possible + * overrides include serial. We can't really override what efi + * gives us, so we use it knowing it's the best choice. + */ + setenv("console", "efi", 1); + } else { + /* + * We detected some kind of serial in the override, but ConOut + * has no serial, so we have to sort out which case it really is. + */ + switch (howto & CON_MASK) { + case SERIAL_ONLY: + setenv("console", "comconsole", 1); + break; + case VID_SER_BOTH: + setenv("console", "efi comconsole", 1); + break; + case SER_VID_BOTH: + setenv("console", "comconsole efi", 1); + break; + /* case VIDEO_ONLY can't happen -- it's the first if above */ + } + } + } + /* + * howto is set now how we want to export the flags to the kernel, so + * set the env based on it. + */ + boot_howto_to_env(howto); + if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); @@ -517,18 +636,17 @@ main(int argc, CHAR16 *argv[]) } else printf("efipart_inithandles failed %d, expect failures", i); - printf("Command line arguments:"); + printf("%s\n", bootprog_info); + printf(" Command line arguments:"); for (i = 0; i < argc; i++) printf(" %S", argv[i]); printf("\n"); - printf("Image base: 0x%lx\n", (u_long)img->ImageBase); - printf("EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, + printf(" EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff); - printf("EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, + printf(" EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); - printf("\n%s", bootprog_info); /* Determine the devpath of our image so we can prefer it. */ text = efi_devpath_name(img->FilePath); @@ -584,7 +702,6 @@ main(int argc, CHAR16 *argv[]) return (EFI_NOT_FOUND); efi_init_environment(); - setenv("LINES", "24", 1); /* optional */ #if !defined(__arm__) for (k = 0; k < ST->NumberOfTableEntries; k++) { From owner-svn-src-all@freebsd.org Thu Feb 21 03:22: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 35E3114ECEF4; Thu, 21 Feb 2019 03:22:21 +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 CF70687A88; Thu, 21 Feb 2019 03:22:20 +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 C123CF968; Thu, 21 Feb 2019 03:22:20 +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 x1L3MKCw007121; Thu, 21 Feb 2019 03:22:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L3MKeV007120; Thu, 21 Feb 2019 03:22:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210322.x1L3MKeV007120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 03:22:20 +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: r344414 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 344414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF70687A88 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)[-0.999,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, 21 Feb 2019 03:22:21 -0000 Author: kevans Date: Thu Feb 21 03:22:20 2019 New Revision: 344414 URL: https://svnweb.freebsd.org/changeset/base/344414 Log: MFC (RECORD ONLY) r338050: Loader default interpreter flip The default interpreter for stable/11 is 4th; this will never and can never change. Record MFC of r338050 to proactively prevent any accidents in future batching of MFCs. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Thu Feb 21 03:18: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 F1BB314ECA1C; Thu, 21 Feb 2019 03:18:17 +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 9E8868743F; Thu, 21 Feb 2019 03:18:17 +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 8E027F7C6; Thu, 21 Feb 2019 03:18:17 +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 x1L3IHjm002956; Thu, 21 Feb 2019 03:18:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L3IDMI002935; Thu, 21 Feb 2019 03:18:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210318.x1L3IDMI002935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 03:18:13 +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: r344413 - in stable/11: release/tools share/mk stand stand/common stand/efi stand/efi/loader stand/efi/loader_4th stand/efi/loader_lua stand/efi/loader_simp stand/i386 stand/i386/loader... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: release/tools share/mk stand stand/common stand/efi stand/efi/loader stand/efi/loader_4th stand/efi/loader_lua stand/efi/loader_simp stand/i386 stand/i386/loader stand/i386/loader_4th st... X-SVN-Commit-Revision: 344413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E8868743F 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)[-0.999,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: Thu, 21 Feb 2019 03:18:18 -0000 Author: kevans Date: Thu Feb 21 03:18:12 2019 New Revision: 344413 URL: https://svnweb.freebsd.org/changeset/base/344413 Log: MFC Loader Interpreter Coexistance: r337806, r337868, r337914, r337927, r337989, r338052, r338064, r338407, r338418, r338474 r337806: Create a loader for each interpreter for x86 BIOS and all EFI Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks. r337868: stand: Use -Oz/-Os for all loader/stand builds. While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader. Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080 r337914: Install links for loader.efi. r337927: Add ashldi3 and ashrdi3 to mips. Now that we're using -Os, mips needs these routines. r337989: Copy the boot loader from the new location for the co-existing loaders. r338052: libsa: Add lshrdi3.c for powerpc* and mips r338064: Turn back the clock just a little: make userboot.so always be 4th Turns out there was a hidden dependency we hasn't counted upon. The host load /boot/userboot.so to boot the VMs it runs. This means that the change to lua meant suddently that nobody could run their older VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or whatever. Even more than for the /boot/loader* binaries, we need a good coexistance strategy for this. While that's being designed and implemented, drop back to always 4th for userboot.so. This will fail safe in all but the most extreme environments (but lua-only hacks to .lua files won't be processes in VMs until we fix it). r338407: lualoader: Print error messages from command failures at the prompt Previously lualoader would remain silent, rather than printing command_errmsg or noting that a command had failed or was not found. r338418: userboot: handle guest interpreter mismatches more intelligently The switch to lualoader creates a problem with userboot: the host is inclined to build userboot with Lua, but the host userboot's interpreter must match what's available on the guest. For almost all FreeBSD guests in the wild, Lua is not yet available and a Lua-based userboot will fail. This revision updates userboot protocol to version 5, which adds a swap_interpreter callback to request a different interpreter, and tries to determine the proper interpreter to be used based on how the guest /boot/loader is compiled. This is still a bit of a guess, but it's likely the best possible guess we can make in order to get it right. The interpreter is now embedded in the resulting executable, so we can open /boot/loader on the guest and hunt that down to derive the interpreter it was built with. Using -l with bhyveload will not allow an intepreter swap, even if the loader specified happens to be a userboot with the wrong interpreter. We'll simply complain about the mismatch and bail out. For legacy guests without the interpreter marker, we assume they're 4th. For new guests with the interpreter marker, we'll read it and swap over to the proper interpreter if it doesn't match what the userboot we're using was compiled with. Both flavors of userboot are installed by default, userboot_4th.so and userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which was broken by userboot being forced to 4th. r338474: Be a little conservative about when to force size optimizations. Reports have come in that there's issue with powerpc and sparc64 since we've switched to using -Oz / -Os. We don't strictly need them for !x86, so be conservative about when we enable them. Added: stable/11/stand/efi/loader_4th/ - copied from r337806, head/stand/efi/loader_4th/ stable/11/stand/efi/loader_lua/ - copied from r337806, head/stand/efi/loader_lua/ stable/11/stand/efi/loader_simp/ - copied from r337806, head/stand/efi/loader_simp/ stable/11/stand/i386/loader_4th/ - copied from r337806, head/stand/i386/loader_4th/ stable/11/stand/i386/loader_lua/ - copied from r337806, head/stand/i386/loader_lua/ stable/11/stand/i386/loader_simp/ - copied from r337806, head/stand/i386/loader_simp/ stable/11/stand/userboot/userboot_4th/ - copied from r338418, head/stand/userboot/userboot_4th/ stable/11/stand/userboot/userboot_lua/ - copied from r338418, head/stand/userboot/userboot_lua/ Modified: stable/11/release/tools/arm.subr stable/11/share/mk/src.opts.mk stable/11/stand/common/bootstrap.h stable/11/stand/common/interp_forth.c stable/11/stand/common/interp_lua.c stable/11/stand/common/interp_simple.c stable/11/stand/defs.mk stable/11/stand/efi/Makefile stable/11/stand/efi/loader/Makefile stable/11/stand/i386/Makefile stable/11/stand/i386/loader/Makefile stable/11/stand/i386/pxeldr/Makefile stable/11/stand/libsa/Makefile stable/11/stand/loader.mk stable/11/stand/userboot/Makefile stable/11/stand/userboot/userboot.h stable/11/stand/userboot/userboot/Makefile stable/11/stand/userboot/userboot/main.c stable/11/stand/userboot/userboot/version stable/11/usr.sbin/bhyveload/bhyveload.c Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/arm.subr ============================================================================== --- stable/11/release/tools/arm.subr Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/release/tools/arm.subr Thu Feb 21 03:18:12 2019 (r344413) @@ -152,7 +152,7 @@ arm_install_boot() { BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT - chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ + chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader_lua/loader_lua.efi \ ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET}) chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/share/mk/src.opts.mk Thu Feb 21 03:18:12 2019 (r344413) @@ -126,6 +126,7 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LOADER_GELI \ + LOADER_LUA \ LOADER_OFW \ LOADER_UBOOT \ LOCALES \ @@ -196,7 +197,6 @@ __DEFAULT_NO_OPTIONS = \ LINT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ - LOADER_LUA \ NAND \ OFED_EXTRA \ OPENLDAP \ Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/common/bootstrap.h Thu Feb 21 03:18:12 2019 (r344413) @@ -164,6 +164,14 @@ extern int isapnp_readport; extern char bootprog_info[]; /* + * Interpreter information + */ +extern const char bootprog_interp[]; +#define INTERP_DEFINE(interpstr) \ +const char bootprog_interp[] = "$Interpreter:" interpstr + + +/* * Preloaded file metadata header. * * Metadata are allocated on our heap, and copied into kernel space Modified: stable/11/stand/common/interp_forth.c ============================================================================== --- stable/11/stand/common/interp_forth.c Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/common/interp_forth.c Thu Feb 21 03:18:12 2019 (r344413) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "ficl.h" extern unsigned bootprog_rev; +INTERP_DEFINE("4th"); /* #define BFORTH_DEBUG */ Modified: stable/11/stand/common/interp_lua.c ============================================================================== --- stable/11/stand/common/interp_lua.c Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/common/interp_lua.c Thu Feb 21 03:18:12 2019 (r344413) @@ -60,6 +60,7 @@ static struct interp_lua_softc lua_softc; #define LDBG(...) #endif +INTERP_DEFINE("lua"); static void * interp_lua_realloc(void *ud __unused, void *ptr, size_t osize __unused, size_t nsize) @@ -135,7 +136,7 @@ interp_run(const char *line) char **argv; lua_State *luap; struct interp_lua_softc *softc = &lua_softc; - int status; + int status, ret; luap = softc->luap; LDBG("executing line..."); @@ -147,14 +148,16 @@ interp_run(const char *line) * run it through cli_execute. If that fails, then we'll try it * as a builtin. */ + command_errmsg = NULL; if (parse(&argc, &argv, line) == 0) { lua_getglobal(luap, "cli_execute"); for (nargc = 0; nargc < argc; ++nargc) { lua_pushstring(luap, argv[nargc]); } status = lua_pcall(luap, argc, 1, 0); + ret = lua_tointeger(luap, 1); lua_pop(luap, 1); - if (status != 0) { + if (status != 0 || ret != 0) { /* * Lua cli_execute will pass the function back * through loader.command, which is a proxy to @@ -166,7 +169,10 @@ interp_run(const char *line) status = interp_builtin_cmd(argc, argv); } if (status != 0) { - printf("Command failed\n"); + if (command_errmsg != NULL) + printf("%s\n", command_errmsg); + else + printf("Command failed\n"); status = CMD_ERROR; } free(argv); Modified: stable/11/stand/common/interp_simple.c ============================================================================== --- stable/11/stand/common/interp_simple.c Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/common/interp_simple.c Thu Feb 21 03:18:12 2019 (r344413) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" +INTERP_DEFINE("simp"); + void interp_init(void) { Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/defs.mk Thu Feb 21 03:18:12 2019 (r344413) @@ -53,8 +53,15 @@ CFLAGS+= -I${SASRC} -D_STANDALONE CFLAGS+= -I${SYSDIR} # Spike the floating point interfaces CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +# Slim down the image. This saves about 15% in size with clang 6 on x86 +# Our most constrained /boot/loader env is BIOS booting on x86, where +# our text + data + BTX have to fit into 640k below the ISA hole. +# Experience has shown that problems arise between ~520k to ~530k. +CFLAGS.clang+= -Oz +CFLAGS.gcc+= -Os +.endif - # GELI Support, with backward compat hooks (mostly) .if defined(LOADER_NO_GELI_SUPPORT) MK_LOADER_GELI=no @@ -145,6 +152,18 @@ CFLAGS+= -G0 -fno-pic -mno-abicalls CFLAGS+= -mlittle-endian .endif .endif + +# +# Have a sensible default +# +.if ${MK_FORTH} == "yes" +LOADER_DEFAULT_INTERP?=4th +.elif ${MK_LOADER_LUA} == "yes" +LOADER_DEFAULT_INTERP?=lua +.else +LOADER_DEFAULT_INTERP?=simp +.endif +LOADER_INTERP?=${LOADER_DEFAULT_INTERP} # Make sure we use the machine link we're about to create CFLAGS+=-I. Modified: stable/11/stand/efi/Makefile ============================================================================== --- stable/11/stand/efi/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/efi/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -9,7 +9,10 @@ NO_OBJ=t .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 SUBDIR.${MK_FDT}+= fdt -SUBDIR.yes+= libefi loader boot1 +SUBDIR.yes+= libefi boot1 +SUBDIR.${MK_FORTH}+= loader_4th +SUBDIR.${MK_LOADER_LUA}+= loader_lua +SUBDIR.yes+= loader_simp .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/efi/loader/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -8,7 +8,8 @@ LOADER_EXT2FS_SUPPORT?= no .include -PROG= loader.sym +LOADER?= loader_${LOADER_INTERP} +PROG= ${LOADER}.sym INTERNALPROG= WARNS?= 3 @@ -24,6 +25,7 @@ SRCS= autoload.c \ smbios.c \ vers.c +CFLAGS+= -I${.CURDIR}/../loader .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT @@ -41,10 +43,11 @@ CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitializ # warnings for now. CWARNFLAGS.main.c+= -Wno-format -.PATH: ${.CURDIR}/arch/${MACHINE} -# For smbios.c +.PATH: ${.CURDIR}/../loader +.PATH: ${.CURDIR}/../loader/arch/${MACHINE} +# For smbios.c XXX need to abstract properly .PATH: ${BOOTSRC}/i386/libi386 -.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc" +.include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/arch/${MACHINE} @@ -78,20 +81,25 @@ HAVE_BCACHE= yes CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif +NEWVERSWHAT= "EFI loader" ${MACHINE} +VERSION_FILE= ${.CURDIR}/../loader/version + # Always add MI sources .include "${BOOTSRC}/loader.mk" -FILES+= loader.efi -FILESMODE_loader.efi= ${BINMODE} +FILES+= ${LOADER}.efi +FILESMODE_${LOADER}.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi +.endif + +LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared CLEANFILES+= loader.efi -NEWVERSWHAT= "EFI loader" ${MACHINE} - -loader.efi: ${PROG} +${LOADER}.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/i386/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -9,7 +9,9 @@ SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot g SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire -SUBDIR.yes+= loader +SUBDIR.${MK_FORTH}+= loader_4th +SUBDIR.${MK_LOADER_LUA}+= loader_lua +SUBDIR.yes+= loader_simp # special boot programs, 'self-extracting boot2+loader' SUBDIR.yes+= pxeldr Modified: stable/11/stand/i386/loader/Makefile ============================================================================== --- stable/11/stand/i386/loader/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/i386/loader/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -14,7 +14,7 @@ LOADER_BZIP2_SUPPORT?= yes .include -LOADER?= loader +LOADER?= loader_${LOADER_INTERP} PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 @@ -64,12 +64,13 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -# XXX TODO: Fix this when coexistence comes in -.if ${MK_LOADER_ZFS} == "yes" # && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +.if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/loader +.endif FILES+= ${LOADER} -# XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b # XXX crt0.o needs to be first for pxeboot(8) to work Modified: stable/11/stand/i386/pxeldr/Makefile ============================================================================== --- stable/11/stand/i386/pxeldr/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/i386/pxeldr/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -24,7 +24,8 @@ CFLAGS+=-DALWAYS_SERIAL CFLAGS+=-I${BOOTSRC}/i386/common -LOADERBIN= ${BOOTOBJ}/i386/loader/loader.bin +L=${LOADER_DEFAULT_INTERP} +LOADERBIN= ${BOOTOBJ}/i386/loader_${L}/loader_${L}.bin CLEANFILES+= ${BOOT}.tmp Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/libsa/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -73,8 +73,13 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S a .if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c +SRCS+= ashldi3.c ashrdi3.c lshrdi3.c SRCS+= syncicache.c +.endif + +.if ${MACHINE_CPUARCH} == "mips" +.PATH: ${LIBC_SRC}/quad +SRCS+= ashldi3.c ashrdi3.c lshrdi3.c .endif # uuid functions from libc Modified: stable/11/stand/loader.mk ============================================================================== --- stable/11/stand/loader.mk Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/loader.mk Thu Feb 21 03:18:12 2019 (r344413) @@ -59,19 +59,20 @@ SRCS+= isapnp.c SRCS+= pnp.c .endif -# Forth interpreter -.if ${MK_FORTH} != "no" -SRCS+= interp_forth.c -.include "${BOOTSRC}/ficl.mk" -LDR_INTERP= ${LIBFICL} -LDR_INTERP32= ${LIBFICL32} -.elif ${MK_LOADER_LUA} != "no" +.if ${LOADER_INTERP} == "lua" SRCS+= interp_lua.c .include "${BOOTSRC}/lua.mk" LDR_INTERP= ${LIBLUA} LDR_INTERP32= ${LIBLUA32} -.else +.elif ${LOADER_INTERP} == "4th" +SRCS+= interp_forth.c +.include "${BOOTSRC}/ficl.mk" +LDR_INTERP= ${LIBFICL} +LDR_INTERP32= ${LIBFICL32} +.elif ${LOADER_INTERP} == "simp" SRCS+= interp_simple.c +.else +.error Unknown interpreter ${LOADER_INTERP} .endif .if defined(BOOT_PROMPT_123) Modified: stable/11/stand/userboot/Makefile ============================================================================== --- stable/11/stand/userboot/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/userboot/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -1,8 +1,10 @@ # $FreeBSD$ -.include +.include -SUBDIR= test userboot +SUBDIR.yes= test +SUBDIR.${MK_FORTH}+= userboot_4th +SUBDIR.${MK_LOADER_LUA}+= userboot_lua .include Modified: stable/11/stand/userboot/userboot.h ============================================================================== --- stable/11/stand/userboot/userboot.h Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/userboot/userboot.h Thu Feb 21 03:18:12 2019 (r344413) @@ -42,6 +42,13 @@ #define USERBOOT_VERSION_4 4 /* + * Version 5 added a callback for indicating that the guest + * should be restarted with a different interpreter. The callback + * structure is still backward compatible. + */ +#define USERBOOT_VERSION_5 5 + +/* * Exit codes from the loader */ #define USERBOOT_EXIT_QUIT 1 @@ -210,4 +217,9 @@ struct loader_callbacks { int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, u_int limit, u_int access); + + /* + * Version 5 addition. + */ + void (*swap_interpreter)(void *arg, const char *interp); }; Modified: stable/11/stand/userboot/userboot/Makefile ============================================================================== --- stable/11/stand/userboot/userboot/Makefile Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/userboot/userboot/Makefile Thu Feb 21 03:18:12 2019 (r344413) @@ -8,10 +8,11 @@ PIC=yes .include -SHLIB_NAME= userboot.so +SHLIB_NAME= userboot_${LOADER_INTERP}.so STRIP= LIBDIR= /boot +.PATH: ${.CURDIR}/../userboot SRCS= autoload.c SRCS+= bcache.c SRCS+= biossmap.c @@ -37,7 +38,12 @@ CWARNFLAGS.main.c += -Wno-implicit-function-declaratio LDFLAGS+= -nostdlib -Wl,-Bsymbolic -NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} +NEWVERSWHAT= "User boot ${LOADER_INTERP}" ${MACHINE_CPUARCH} +VERSION_FILE= ${.CURDIR}/../userboot/version + +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${SHLIB_NAME} ${BINDIR}/userboot.so +.endif .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT Modified: stable/11/stand/userboot/userboot/main.c ============================================================================== --- stable/11/stand/userboot/userboot/main.c Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/userboot/userboot/main.c Thu Feb 21 03:18:12 2019 (r344413) @@ -47,6 +47,9 @@ static int userboot_zfs_found; /* Minimum version required */ #define USERBOOT_VERSION USERBOOT_VERSION_3 +#define LOADER_PATH "/boot/loader" +#define INTERP_MARKER "$Interpreter:" + #define MALLOCSZ (64*1024*1024) struct loader_callbacks *callbacks; @@ -57,6 +60,7 @@ static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */ static void extract_currdev(void); +static void check_interpreter(void); void delay(int usec) @@ -73,6 +77,62 @@ exit(int v) longjmp(jb, 1); } +static void +check_interpreter(void) +{ + struct stat st; + size_t marklen, rdsize; + const char *guest_interp, *my_interp; + char *buf; + int fd; + + /* + * If we can't stat(2) or open(2) LOADER_PATH, then we'll fail by + * simply letting us roll on with whatever interpreter we were compiled + * with. This is likely not going to be an issue in reality. + */ + buf = NULL; + if (stat(LOADER_PATH, &st) != 0) + return; + if ((fd = open(LOADER_PATH, O_RDONLY)) < 0) + return; + + rdsize = st.st_size; + buf = malloc(rdsize); + if (buf == NULL) + goto out; + if (read(fd, buf, rdsize) < rdsize) + goto out; + + marklen = strlen(INTERP_MARKER); + my_interp = bootprog_interp + marklen; + + /* + * Here we make the assumption that a loader binary without the + * interpreter marker is a 4th one. All loader binaries going forward + * should have this properly specified, so our assumption should always + * be a good one. + */ + if ((guest_interp = memmem(buf, rdsize, INTERP_MARKER, + marklen)) != NULL) + guest_interp += marklen; + else + guest_interp = "4th"; + + /* + * The guest interpreter may not have a version of loader that + * specifies the interpreter installed. If that's the case, we'll + * assume it's legacy (4th) and request a swap to that if we're + * a Lua-userboot. + */ + if (strcmp(my_interp, guest_interp) != 0) + CALLBACK(swap_interpreter, guest_interp); +out: + free(buf); + close(fd); + return; +} + void loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) { @@ -137,6 +197,14 @@ loader_main(struct loader_callbacks *cb, void *arg, in (devsw[i]->dv_init)(); extract_currdev(); + + /* + * Checking the interpreter isn't worth the overhead unless we + * actually have the swap_interpreter callback, so we actually version + * check here rather than later on. + */ + if (version >= USERBOOT_VERSION_5) + check_interpreter(); if (setjmp(jb)) return; Modified: stable/11/stand/userboot/userboot/version ============================================================================== --- stable/11/stand/userboot/userboot/version Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/stand/userboot/userboot/version Thu Feb 21 03:18:12 2019 (r344413) @@ -1,4 +1,5 @@ $FreeBSD$ +1.2: Userboot with lua or forth 1.1: Initial userland boot Modified: stable/11/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- stable/11/usr.sbin/bhyveload/bhyveload.c Thu Feb 21 02:52:27 2019 (r344412) +++ stable/11/usr.sbin/bhyveload/bhyveload.c Thu Feb 21 03:18:12 2019 (r344413) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -98,6 +99,13 @@ static int disk_fd[NDISKS]; static int ndisks; static int consin_fd, consout_fd; +static int need_reinit; + +static void *loader_hdl; +static char *loader; +static int explicit_loader; +static jmp_buf jb; + static char *vmname, *progname; static struct vmctx *ctx; @@ -560,6 +568,30 @@ cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); } +static void +cb_swap_interpreter(void *arg, const char *interp_req) +{ + + /* + * If the user specified a loader but we detected a mismatch, we should + * not try to pivot to a different loader on them. + */ + free(loader); + if (explicit_loader == 1) { + perror("requested loader interpreter does not match guest userboot"); + cb_exit(NULL, 1); + } + if (interp_req == NULL || *interp_req == '\0') { + perror("guest failed to request an interpreter"); + cb_exit(NULL, 1); + } + + if (asprintf(&loader, "/boot/userboot_%s.so", interp_req) == -1) + err(EX_OSERR, "malloc"); + need_reinit = 1; + longjmp(jb, 1); +} + static struct loader_callbacks cb = { .getc = cb_getc, .putc = cb_putc, @@ -593,6 +625,9 @@ static struct loader_callbacks cb = { /* Version 4 additions */ .vm_set_register = cb_vm_set_register, .vm_set_desc = cb_vm_set_desc, + + /* Version 5 additions */ + .swap_interpreter = cb_swap_interpreter, }; static int @@ -661,16 +696,12 @@ usage(void) int main(int argc, char** argv) { - char *loader; - void *h; void (*func)(struct loader_callbacks *, void *, int, int); uint64_t mem_size; - int opt, error, need_reinit, memflags; + int opt, error, memflags; progname = basename(argv[0]); - loader = NULL; - memflags = 0; mem_size = 256 * MB; @@ -705,6 +736,7 @@ main(int argc, char** argv) loader = strdup(optarg); if (loader == NULL) err(EX_OSERR, "malloc"); + explicit_loader = 1; break; case 'm': @@ -747,6 +779,13 @@ main(int argc, char** argv) exit(1); } + /* + * setjmp in the case the guest wants to swap out interpreter, + * cb_swap_interpreter will swap out loader as appropriate and set + * need_reinit so that we end up in a clean state once again. + */ + setjmp(jb); + if (need_reinit) { error = vm_reinit(ctx); if (error) { @@ -767,13 +806,15 @@ main(int argc, char** argv) if (loader == NULL) err(EX_OSERR, "malloc"); } - h = dlopen(loader, RTLD_LOCAL); - if (!h) { + if (loader_hdl != NULL) + dlclose(loader_hdl); + loader_hdl = dlopen(loader, RTLD_LOCAL); + if (!loader_hdl) { printf("%s\n", dlerror()); free(loader); return (1); } - func = dlsym(h, "loader_main"); + func = dlsym(loader_hdl, "loader_main"); if (!func) { printf("%s\n", dlerror()); free(loader); @@ -790,7 +831,7 @@ main(int argc, char** argv) addenv("smbios.bios.vendor=BHYVE"); addenv("boot_serial=1"); - func(&cb, NULL, USERBOOT_VERSION_4, ndisks); + func(&cb, NULL, USERBOOT_VERSION_5, ndisks); free(loader); return (0); From owner-svn-src-all@freebsd.org Thu Feb 21 04:13: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 B17DD14EFDEF; Thu, 21 Feb 2019 04:13:21 +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 51E088A2AF; Thu, 21 Feb 2019 04:13:21 +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 3DCD8182BD; Thu, 21 Feb 2019 04:13:21 +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 x1L4DLPo034170; Thu, 21 Feb 2019 04:13:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L4DLOK034169; Thu, 21 Feb 2019 04:13:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210413.x1L4DLOK034169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 04:13: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: r344419 - stable/11/etc/mtree X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc/mtree X-SVN-Commit-Revision: 344419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51E088A2AF 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)[-0.999,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: Thu, 21 Feb 2019 04:13:21 -0000 Author: kevans Date: Thu Feb 21 04:13:20 2019 New Revision: 344419 URL: https://svnweb.freebsd.org/changeset/base/344419 Log: MFC r329226: Add /boot/lua to mtree spec Modified: stable/11/etc/mtree/BSD.root.dist Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.root.dist ============================================================================== --- stable/11/etc/mtree/BSD.root.dist Thu Feb 21 03:48:39 2019 (r344418) +++ stable/11/etc/mtree/BSD.root.dist Thu Feb 21 04:13:20 2019 (r344419) @@ -16,6 +16,8 @@ .. firmware .. + lua + .. kernel .. modules From owner-svn-src-all@freebsd.org Thu Feb 21 04:58: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 1EFA414F2D6C; Thu, 21 Feb 2019 04:58:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 827E98C5D5; Thu, 21 Feb 2019 04:58:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52a.google.com with SMTP id q206so13166774pgq.4; Wed, 20 Feb 2019 20:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8SRbZvW2DQdpeX/1YUyPPSIJUJ+O8xxLNlilgTneM6M=; b=A+Q8MLAbKmOEX/KBDWj2vcYdgGvknukilHv1d5AYY4sjpCUxrGpz8QgGqR4bCCVl3K NyTP1taHg0Rm/nZVYgP+N3qHA+ndN7iKR8+LYkZ0kThR0vxKCZ8SpcywlvN9DvZHP3Ry 9G7S8gTmK+wRx5PU9Qkmdsouj4R9ThiOuVV34D97YFWovGp+kw2zxZ8aXx0NBzZ9Pr+p +O/Qy7ibph88Xip8unDxRWy2SLc49toN5IsU3p2Af/46E1hWwG1/PEs+1YR3Z4QyWQBY /qzNe/FmWjPbnRC8JYK5DFsg/pVSEp6OOHHwGBAp/96941TQ2SinRsqVpKNvvkT1tnlZ XsMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8SRbZvW2DQdpeX/1YUyPPSIJUJ+O8xxLNlilgTneM6M=; b=ANHFV0KMxVjWRxrYeVBhvBLbGLgKrIXN3meHGPI2pxaVkdv0Fpk1v0HvgrvKReYJx9 HV8vJQHn74gEN+Bbo2qB63NjVBf/fGt7D42ciXNXWEHeSlTWMBgFzRF6k/2acVsrd/Ui dpnU0H2GDr7WOBoJO2YaWNPWbaMjtY2ukb9+uDYABOIUyKqmsUOCBd7dUmalKa8niKRb meKpD3y9kTmwvOE4iiYM8m4iogjpwstwrfeoRmnwTbn60uXYhNt2RjX7MvJ2+PK+U3W6 SUyWdgCH+F6aLipirSY5cIIO+D5kPHLDuRNjDZeDgnOHKmKLevSTdqULnraxvT7RPTUo E3yQ== X-Gm-Message-State: AHQUAubHet/kVTXSENmsmL3wFkMX9Uv/uDZViVHM6ntQhSu3pLZgQMxd 4XyC956PBPS7aFmpeoXaDNI= X-Google-Smtp-Source: AHgI3IakhE8QbXYyFr1OoLTLSG0bovKjFFopJ3ow2xpxl0mxpe182BLQXaqCyuFi7wLosQFfNNGTgw== X-Received: by 2002:a65:510c:: with SMTP id f12mr19411672pgq.40.1550725124355; Wed, 20 Feb 2019 20:58:44 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z18sm34255713pfl.164.2019.02.20.20.58.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 20:58:43 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog From: Enji Cooper In-Reply-To: <20190221121712.Y989@besplex.bde.org> Date: Wed, 20 Feb 2019 20:58:42 -0800 Cc: David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 827E98C5D5 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_SHORT(-0.97)[-0.975,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, 21 Feb 2019 04:58:46 -0000 > On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: >=20 > On Wed, 20 Feb 2019, David Bright wrote: >=20 >> Log: >> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog >>=20 >> The result of a strdup() was stored in a global variable and not = freed >> before program exit. This is a follow-up to r343906. That change >=20 > This was an especially large bug in Coverity. Understanding that = exit(3) > exits is about the first thing to understand for a checker. >=20 > Now it is also a style bug in the source code. >=20 >> attempted to plug these resource leaks but managed to miss a code = path >> on which the leak still occurs. Plug the leak on that path, too. >=20 >> Modified: head/usr.sbin/newsyslog/newsyslog.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/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 = (r344388) >> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 = (r344389) >> @@ -793,6 +793,9 @@ usage(void) >> fprintf(stderr, >> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] = [-f config_file]\n" >> " [-S pidfile] [-t timefmt] [[-R tagname] = file ...]\n"); >> + /* Free global dynamically-allocated storage. */ >> + free(timefnamefmt); >> + free(requestor); >> exit(1); >> } >=20 > There was no leak here. exit(3) frees storage much more finally than > free(3). >=20 > It is especially obvious that there is no leak here, since the exit() = is > 1-2 lines later than the frees. >=20 > In theory, exit() might fail because it tries to allocate 100 MB more > storage but wouldn't fail if 100 bytes are freed here (applications = can > easily do this foot shooting by allocating without freeing in atexit() > destructors). In practice, even allocation failures "can't happen", > except in programs that use setrlimit followed but foot shooting to = test > the limits. setrlimit is now broken for this purpose, since it = doesn't > limit allocations done using mmap() instead of break(), and malloc() = now > uses mmap(). >=20 > If coverity understood this and wanted to spam you with warnings, then = it > would not warn about this, but would warn about more important things = like > failure to fflush() or fclose() or check for or handle errors for all > open streams before calling exit(). Also, if all callers of usage() = are > not understood, for failures to switch stderr to unbuffered mode = before > using it in usage(). >=20 > The error reporting is even harder to do if stderr is not available. > Windowing systems and even curses need to do lots more cleanup = _before_ > exit() and it may be difficult to clean up enough to print error = messages > using the windowing system. I agree with Bruce. Items like these should be ignored in the Coverity = UI as false positives with reasoning, like =E2=80=9Cglobal variables; = freed on exit=E2=80=9D. As others have noted in past mailing threads, freeing variables on exit = can cause applications to hang for a period of time, while the memory is = being reclaimed. I think it=E2=80=99s best to ignore these kinds of = allocations on exit to avoid introducing unnecessary complexity in the = program, as they=E2=80=99re benign issues. Thank you, -Enji= From owner-svn-src-all@freebsd.org Thu Feb 21 05:20: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 0BC3D14F4059 for ; Thu, 21 Feb 2019 05:20:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99B948D3A6 for ; Thu, 21 Feb 2019 05:20:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x736.google.com with SMTP id x9so3600862qkf.0 for ; Wed, 20 Feb 2019 21:20:22 -0800 (PST) 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=WZO4cSS3pdlTJDHNjH1CexprcxmppJ/U+PIxvcgRCnY=; b=G4HHFMKfhYS1qVStHnqSSKjGqconbMf2q9CMUrduixwDJaTyxd6VCXAj6sI1I/9Kvi UInaVw65wQwvgAibQxdyw5amrwzPShZGnqcopDc2evMFc0Q2BRwFztwhKIWgZDug23qv +r8ruRAw7gwc3XbB4u7UQ9Moe9rQJOtSggsKfglbgkA2bkp70DJO+U9OwHSpmT6U/Esm iciLtxIIM8wCsFSeHrOJ472e7sEXHtBFyPlXehiRgVJN2t7SKxz3s4rX0YA7ZawAexCQ Rhwntn/k8F+30gY7PVUne8Iu5bsAYfdwyiDMK7th04KbBciACwlhZQnP5gHhRu5ka08B g1xg== 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=WZO4cSS3pdlTJDHNjH1CexprcxmppJ/U+PIxvcgRCnY=; b=e8wg9JjJIAROLXPsm4nePIuEJh9/xpRBF6El8SiIXj8KuNCPeo3gc4Y34cHDMP73Vn HO5U+/zsQKwj9eib6707XNoBt41HCiAiO1MLfRgK2/yGLmm6ttHjs+kRTkM7995/7nPd qKTbGoazikq/dCi/1Yd9z6Oh1GdVwaiUpVcPNupSVmpgQl3Ezk5dM1nioUUvT5f6D3KP YvmzGxKOWtadTAT9WO1FnRkkKQGgSe9n2YN0dA76fwsEyniWHPLQ6ecMvsOgAGtGbBNR MhhW24zroplVYmLXg9jsgY2n/otRIo4JyJfe5/J3P0VfK35n3wxs5iER8bNPQV0M+f/t rNuA== X-Gm-Message-State: AHQUAubtN++cXoj5aOiPQEg3Bta3bwcy6LE8iTho2+h9D0/SNE3jAPak +eqMbHKSrxRsibm969m3FaKw6XL1wns5PbK3dTnxcQ== X-Google-Smtp-Source: AHgI3IYpxHvwnFKmVaJCOrKPgVjP3eCe1v3belgI3QgVIzsFvKDkNwai8V97MqSfw/ZbHVimtTmI4NRJvoq8D4ZOb1Y= X-Received: by 2002:a37:6fc2:: with SMTP id k185mr17330360qkc.175.1550726421724; Wed, 20 Feb 2019 21:20:21 -0800 (PST) MIME-Version: 1.0 References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> In-Reply-To: <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> From: Warner Losh Date: Wed, 20 Feb 2019 22:20:09 -0700 Message-ID: Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog To: Garrett Cooper Cc: Bruce Evans , David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 99B948D3A6 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Thu, 21 Feb 2019 05:20:23 -0000 On Wed, Feb 20, 2019, 9:59 PM Enji Cooper > > On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: > > > > On Wed, 20 Feb 2019, David Bright wrote: > > > >> Log: > >> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog > >> > >> The result of a strdup() was stored in a global variable and not freed > >> before program exit. This is a follow-up to r343906. That change > > > > This was an especially large bug in Coverity. Understanding that exit(= 3) > > exits is about the first thing to understand for a checker. > > > > Now it is also a style bug in the source code. > > > >> attempted to plug these resource leaks but managed to miss a code path > >> on which the leak still occurs. Plug the leak on that path, too. > > > >> Modified: head/usr.sbin/newsyslog/newsyslog.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/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 > (r344388) > >> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 > (r344389) > >> @@ -793,6 +793,9 @@ usage(void) > >> fprintf(stderr, > >> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] > [-f config_file]\n" > >> " [-S pidfile] [-t timefmt] [[-R tagname] fil= e > ...]\n"); > >> + /* Free global dynamically-allocated storage. */ > >> + free(timefnamefmt); > >> + free(requestor); > >> exit(1); > >> } > > > > There was no leak here. exit(3) frees storage much more finally than > > free(3). > > > > It is especially obvious that there is no leak here, since the exit() i= s > > 1-2 lines later than the frees. > > > > In theory, exit() might fail because it tries to allocate 100 MB more > > storage but wouldn't fail if 100 bytes are freed here (applications can > > easily do this foot shooting by allocating without freeing in atexit() > > destructors). In practice, even allocation failures "can't happen", > > except in programs that use setrlimit followed but foot shooting to tes= t > > the limits. setrlimit is now broken for this purpose, since it doesn't > > limit allocations done using mmap() instead of break(), and malloc() no= w > > uses mmap(). > > > > If coverity understood this and wanted to spam you with warnings, then = it > > would not warn about this, but would warn about more important things > like > > failure to fflush() or fclose() or check for or handle errors for all > > open streams before calling exit(). Also, if all callers of usage() ar= e > > not understood, for failures to switch stderr to unbuffered mode before > > using it in usage(). > > > > The error reporting is even harder to do if stderr is not available. > > Windowing systems and even curses need to do lots more cleanup _before_ > > exit() and it may be difficult to clean up enough to print error messag= es > > using the windowing system. > > I agree with Bruce. Items like these should be ignored in the Coverity UI > as false positives with reasoning, like =E2=80=9Cglobal variables; freed = on exit=E2=80=9D. > > As others have noted in past mailing threads, freeing variables on exit > can cause applications to hang for a period of time, while the memory is > being reclaimed. I think it=E2=80=99s best to ignore these kinds of alloc= ations on > exit to avoid introducing unnecessary complexity in the program, as they= =E2=80=99re > benign issues. > It's been a long running debate since 92 or so when purify came out and this problem started to be found. In the last 25 years the question hasn't been settled. I tend to think it's a waste of time, though I get that issues like this create a lot of false positives. Warner Thank you, > -Enji > From owner-svn-src-all@freebsd.org Thu Feb 21 03:48: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 D160F14EE6E5; Thu, 21 Feb 2019 03:48: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 73346890E4; Thu, 21 Feb 2019 03:48: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 5F25FFD44; Thu, 21 Feb 2019 03:48: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 x1L3meeR018888; Thu, 21 Feb 2019 03:48:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L3meFu018887; Thu, 21 Feb 2019 03:48:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210348.x1L3meFu018887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 03:48:40 +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: r344418 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 344418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73346890E4 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)[-0.999,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: Thu, 21 Feb 2019 03:48:41 -0000 Author: kevans Date: Thu Feb 21 03:48:39 2019 New Revision: 344418 URL: https://svnweb.freebsd.org/changeset/base/344418 Log: Direct commit for post-mortem UPDATING update regarding lualoader Indicate that it's been merged (after some delay since lua came back to this branch) and how one can test lua, both by swapping build knobs and creating links in /boot. Modified: stable/11/UPDATING Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Thu Feb 21 03:39:51 2019 (r344417) +++ stable/11/UPDATING Thu Feb 21 03:48:39 2019 (r344418) @@ -17,6 +17,20 @@ the tip of head, and then rebuild without this option. from older version of current across the gcc/clang cutover is a bit fragile. 20190220: + Co-existance for Forth and Lua interpreters in bootloaders has now been + merged to ease testing of lualoader. LOADER_DEFAULT_INTERP, documented + in build(7), may be used to control which interpreter flavor is used in + the default loader to be installed. For systems where Lua and Forth + coexist, this switch can also be made on a running system by creating a + link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather + than requiring a rebuild. + + The default flavor in this branch will remain Forth. As indicated in + the 20190216 UPDATING entry, booting is a complex environment; it would + be prudent to assume that lualoader may not work for your setup and make + provisions for backup boot methods. + +20190220: zfsloader's functionality has now been folded into loader. zfsloader is no longer necesasary once you've updated your boot blocks. For a transition period, we will install a From owner-svn-src-all@freebsd.org Thu Feb 21 06:02: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 B090E14F6817; Thu, 21 Feb 2019 06:02:52 +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 4CACC8F347; Thu, 21 Feb 2019 06:02:52 +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 3ED2319674; Thu, 21 Feb 2019 06:02:52 +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 x1L62qng091862; Thu, 21 Feb 2019 06:02:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L62p8O091859; Thu, 21 Feb 2019 06:02:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210602.x1L62p8O091859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 06:02:51 +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: r344421 - in stable/11: share/mk stand/pc98/kgzldr stand/pc98/libpc98 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: share/mk stand/pc98/kgzldr stand/pc98/libpc98 X-SVN-Commit-Revision: 344421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CACC8F347 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)[-0.999,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: Thu, 21 Feb 2019 06:02:52 -0000 Author: kevans Date: Thu Feb 21 06:02:51 2019 New Revision: 344421 URL: https://svnweb.freebsd.org/changeset/base/344421 Log: Direct commit to catch pc98 up to recent changes I have no means of actually testing the new features on pc98, so simply mark them as BROKEN_OPTIONS on pc98 and interested parties can test/report back as to the functionality. This is done out of an abundance of caution. pc98 also needed catching up on the inflate.c -> subr_inflate.c rename. Modified: stable/11/share/mk/src.opts.mk stable/11/stand/pc98/kgzldr/Makefile stable/11/stand/pc98/libpc98/biosdisk.c Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Thu Feb 21 04:47:44 2019 (r344420) +++ stable/11/share/mk/src.opts.mk Thu Feb 21 06:02:51 2019 (r344421) @@ -306,7 +306,11 @@ BROKEN_OPTIONS+=LOADER_UBOOT .if ${__T} == "sparc64" || ${__T:Mpowerpc*} BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif - +# Both features are untested on pc98, so we'll mark them as disabled just to +# be safe and make sure we keep pc98 stable. +.if ${__TT:Mpc98*} +BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA +.endif .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE Modified: stable/11/stand/pc98/kgzldr/Makefile ============================================================================== --- stable/11/stand/pc98/kgzldr/Makefile Thu Feb 21 04:47:44 2019 (r344420) +++ stable/11/stand/pc98/kgzldr/Makefile Thu Feb 21 06:02:51 2019 (r344421) @@ -7,7 +7,7 @@ STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -SRCS= start.s boot.c inflate.c lib.c crt.s sio.s +SRCS= start.s boot.c subr_inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= Modified: stable/11/stand/pc98/libpc98/biosdisk.c ============================================================================== --- stable/11/stand/pc98/libpc98/biosdisk.c Thu Feb 21 04:47:44 2019 (r344420) +++ stable/11/stand/pc98/libpc98/biosdisk.c Thu Feb 21 06:02:51 2019 (r344421) @@ -51,10 +51,6 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libi386.h" -#ifdef LOADER_GELI_SUPPORT -#error "Nope! No GELI on pc98 so sorry." -#endif - #define BIOS_NUMDRIVES 0x475 #define BIOSDISK_SECSIZE 512 #define BUFSIZE (1 * BIOSDISK_SECSIZE) @@ -364,7 +360,6 @@ bd_open(struct open_file *f, ...) err = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize); - /* i386 has GELI here */ return(err); } @@ -665,7 +660,6 @@ static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest) { - /* i386 has GELI here */ return (bd_io(dev, dblk, blks, dest, 0)); } From owner-svn-src-all@freebsd.org Thu Feb 21 02:31: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 7C9D114EA167; Thu, 21 Feb 2019 02:31:15 +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 1CBB585058; Thu, 21 Feb 2019 02:31:15 +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 0F028EE78; Thu, 21 Feb 2019 02:31:15 +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 x1L2VEDG078841; Thu, 21 Feb 2019 02:31:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2VEAd078840; Thu, 21 Feb 2019 02:31:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210231.x1L2VEAd078840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:31:14 +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: r344404 - stable/11/stand/efi/loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/efi/loader X-SVN-Commit-Revision: 344404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CBB585058 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.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 02:31:15 -0000 Author: kevans Date: Thu Feb 21 02:31:14 2019 New Revision: 344404 URL: https://svnweb.freebsd.org/changeset/base/344404 Log: MFC r336463: If rootdev is set, use it as currdev. Setting rootdev in the enviornment should specify things completely. If it is set, then have it override everything else. Modified: stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Thu Feb 21 02:28:04 2019 (r344403) +++ stable/11/stand/efi/loader/main.c Thu Feb 21 02:31:14 2019 (r344404) @@ -166,16 +166,21 @@ out: } static void +set_currdev(const char *devname) +{ + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); +} + +static void set_currdev_devdesc(struct devdesc *currdev) { const char *devname; devname = efi_fmtdev(currdev); - printf("Setting currdev to %s\n", devname); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); + set_currdev(devname); } static void @@ -279,7 +284,15 @@ find_currdev(EFI_LOADED_IMAGE *img) struct devsw *dev; int unit; uint64_t extra; + char *rootdev; + rootdev = getenv("rootdev"); + if (rootdev != NULL) { + printf("Setting currdev to configured rootdev %s\n", rootdev); + set_currdev(rootdev); + return (0); + } + #ifdef EFI_ZFS_BOOT /* * Did efi_zfs_probe() detect the boot pool? If so, use the zpool @@ -616,7 +629,7 @@ main(int argc, CHAR16 *argv[]) * set the env based on it. */ boot_howto_to_env(howto); - + if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); From owner-svn-src-all@freebsd.org Thu Feb 21 06:20: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 C638A14F763E; Thu, 21 Feb 2019 06:20:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 25C4890130; Thu, 21 Feb 2019 06:20:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1L6KG3x018739; Wed, 20 Feb 2019 22:20:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1L6KGnv018738; Wed, 20 Feb 2019 22:20:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902210620.x1L6KGnv018738@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344418 - stable/11 In-Reply-To: <201902210348.x1L3meFu018887@repo.freebsd.org> To: Kyle Evans Date: Wed, 20 Feb 2019 22:20:16 -0800 (PST) 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: 25C4890130 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.950,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, 21 Feb 2019 06:20:18 -0000 > Author: kevans > Date: Thu Feb 21 03:48:39 2019 > New Revision: 344418 > URL: https://svnweb.freebsd.org/changeset/base/344418 > > Log: > Direct commit for post-mortem UPDATING update regarding lualoader > > Indicate that it's been merged (after some delay since lua came back to this > branch) and how one can test lua, both by swapping build knobs and creating > links in /boot. > > Modified: > stable/11/UPDATING > > Modified: stable/11/UPDATING > ============================================================================== > --- stable/11/UPDATING Thu Feb 21 03:39:51 2019 (r344417) > +++ stable/11/UPDATING Thu Feb 21 03:48:39 2019 (r344418) > @@ -17,6 +17,20 @@ the tip of head, and then rebuild without this option. > from older version of current across the gcc/clang cutover is a bit fragile. > > 20190220: > + Co-existance for Forth and Lua interpreters in bootloaders has now been > + merged to ease testing of lualoader. LOADER_DEFAULT_INTERP, documented > + in build(7), may be used to control which interpreter flavor is used in > + the default loader to be installed. For systems where Lua and Forth > + coexist, this switch can also be made on a running system by creating a > + link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather ^. missing And is not the direction of that link reversed? /boot/loader_${,.efi} -> /boot/loader_${flavor}{,.efi} is what I would expect the link to be for this. > + than requiring a rebuild. > + > + The default flavor in this branch will remain Forth. As indicated in > + the 20190216 UPDATING entry, booting is a complex environment; it would > + be prudent to assume that lualoader may not work for your setup and make > + provisions for backup boot methods. > + > +20190220: > zfsloader's functionality has now been folded into loader. > zfsloader is no longer necesasary once you've updated your > boot blocks. For a transition period, we will install a > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 02:32: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 C84A514EA37F; Thu, 21 Feb 2019 02:32:31 +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 6C83985345; Thu, 21 Feb 2019 02:32:31 +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 5D896EFF6; Thu, 21 Feb 2019 02:32:31 +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 x1L2WVD1080392; Thu, 21 Feb 2019 02:32:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2WUde080390; Thu, 21 Feb 2019 02:32:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210232.x1L2WUde080390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:32:30 +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: r344405 - in stable/11/stand/efi: . boot1 loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: . boot1 loader X-SVN-Commit-Revision: 344405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C83985345 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)[-0.999,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, 21 Feb 2019 02:32:32 -0000 Author: kevans Date: Thu Feb 21 02:32:30 2019 New Revision: 344405 URL: https://svnweb.freebsd.org/changeset/base/344405 Log: MFC r336535: Hoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc Modified: stable/11/stand/efi/Makefile.inc stable/11/stand/efi/boot1/Makefile stable/11/stand/efi/loader/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/Makefile.inc ============================================================================== --- stable/11/stand/efi/Makefile.inc Thu Feb 21 02:31:14 2019 (r344404) +++ stable/11/stand/efi/Makefile.inc Thu Feb 21 02:32:30 2019 (r344405) @@ -19,4 +19,16 @@ CFLAGS+= -fPIC CFLAGS+= -fPIC .endif +.if ${MACHINE_CPUARCH} == "amd64" +EFI_TARGET= efi-app-x86_64 +.elif ${MACHINE_CPUARCH} == "i386" +EFI_TARGET= efi-app-ia32 +.else +EFI_TARGET= binary +.endif + +# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 +# for build reproducibility. +SOURCE_DATE_EPOCH?=1451606400 + .include "../Makefile.inc" Modified: stable/11/stand/efi/boot1/Makefile ============================================================================== --- stable/11/stand/efi/boot1/Makefile Thu Feb 21 02:31:14 2019 (r344404) +++ stable/11/stand/efi/boot1/Makefile Thu Feb 21 02:32:30 2019 (r344405) @@ -76,17 +76,6 @@ LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} -.if ${MACHINE_CPUARCH} == "amd64" -EFI_TARGET= efi-app-x86_64 -.elif ${MACHINE_CPUARCH} == "i386" -EFI_TARGET= efi-app-ia32 -.else -EFI_TARGET= binary -.endif - -# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 -# for build reproducibility. -SOURCE_DATE_EPOCH?=1451606400 boot1.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Thu Feb 21 02:31:14 2019 (r344404) +++ stable/11/stand/efi/loader/Makefile Thu Feb 21 02:32:30 2019 (r344405) @@ -91,17 +91,6 @@ CLEANFILES+= loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} -.if ${MACHINE_CPUARCH} == "amd64" -EFI_TARGET= efi-app-x86_64 -.elif ${MACHINE_CPUARCH} == "i386" -EFI_TARGET= efi-app-ia32 -.else -EFI_TARGET= binary -.endif - -# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 -# for build reproducibility. -SOURCE_DATE_EPOCH?=1451606400 loader.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ From owner-svn-src-all@freebsd.org Thu Feb 21 06:16: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 5B12014F72A3; Thu, 21 Feb 2019 06:16:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 D67268FE20; Thu, 21 Feb 2019 06:16:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1L6G7Pj018722; Wed, 20 Feb 2019 22:16:07 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1L6G7SV018721; Wed, 20 Feb 2019 22:16:07 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902210616.x1L6G7SV018721@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344414 - stable/11 In-Reply-To: <201902210322.x1L3MKeV007120@repo.freebsd.org> To: Kyle Evans Date: Wed, 20 Feb 2019 22:16:07 -0800 (PST) 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: D67268FE20 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.946,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, 21 Feb 2019 06:16:13 -0000 > Author: kevans > Date: Thu Feb 21 03:22:20 2019 > New Revision: 344414 > URL: https://svnweb.freebsd.org/changeset/base/344414 > > Log: > MFC (RECORD ONLY) r338050: Loader default interpreter flip > > The default interpreter for stable/11 is 4th; this will never and can never > change. Record MFC of r338050 to proactively prevent any accidents in future > batching of MFCs. > > Modified: > Directory Properties: > stable/11/ (props changed) Does it make sense to do a direct commit to stable/11 marking the line that does this flip with a "Do not change this in the stable/11 branch" so that someone does not try to manually merge the change if they happen to notice the code is different? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 02:48: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 7708D14EB124; Thu, 21 Feb 2019 02:48:39 +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 1AE1A860FD; Thu, 21 Feb 2019 02:48:39 +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 0C57BF1E5; Thu, 21 Feb 2019 02:48:39 +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 x1L2mcl8086180; Thu, 21 Feb 2019 02:48:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L2mcJ0086179; Thu, 21 Feb 2019 02:48:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210248.x1L2mcJ0086179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 02:48:38 +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: r344410 - stable/11/stand/efi/loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/efi/loader X-SVN-Commit-Revision: 344410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AE1A860FD 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,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, 21 Feb 2019 02:48:39 -0000 Author: kevans Date: Thu Feb 21 02:48:38 2019 New Revision: 344410 URL: https://svnweb.freebsd.org/changeset/base/344410 Log: MFC r337131, r337231: stand: efipart fixes r337131: loader.efi: efipart_inithandles() failure should not prevent devsw initialization The efipart_inithandles() can return error code when there are no block devices, however, we still should walk and initialize devsw. r337231: loader.efi: clean up misleading noise from missing block devices If there are no block devices, there is no need to printout error (ENOENT). In case of netboot, our image path has no block device, no need to make noise about it. Modified: stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Thu Feb 21 02:46:32 2019 (r344409) +++ stable/11/stand/efi/loader/main.c Thu Feb 21 02:48:38 2019 (r344410) @@ -338,8 +338,6 @@ find_currdev(EFI_LOADED_IMAGE *img) return (0); } } - } else { - printf("Can't find device by handle\n"); } /* @@ -642,12 +640,15 @@ main(int argc, CHAR16 *argv[]) * Scan the BLOCK IO MEDIA handles then * march through the device switch probing for things. */ - if ((i = efipart_inithandles()) == 0) { - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - } else - printf("efipart_inithandles failed %d, expect failures", i); + i = efipart_inithandles(); + if (i != 0 && i != ENOENT) { + printf("efipart_inithandles failed with ERRNO %d, expect " + "failures\n", i); + } + + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); printf("%s\n", bootprog_info); printf(" Command line arguments:"); From owner-svn-src-all@freebsd.org Thu Feb 21 03:39: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 4A06A14EDB32; Thu, 21 Feb 2019 03:39:52 +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 DEBE4886EB; Thu, 21 Feb 2019 03:39:51 +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 D0C0CFB67; Thu, 21 Feb 2019 03:39:51 +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 x1L3dphI013700; Thu, 21 Feb 2019 03:39:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L3dpvj013699; Thu, 21 Feb 2019 03:39:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902210339.x1L3dpvj013699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Feb 2019 03:39:51 +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: r344417 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 344417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEBE4886EB 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 03:39:52 -0000 Author: kevans Date: Thu Feb 21 03:39:51 2019 New Revision: 344417 URL: https://svnweb.freebsd.org/changeset/base/344417 Log: MFc r338043: Document LOADER_DEFAULT_INTERP. This controls what interpreter the default boot loader in /boot/loader{,.efi} is, and which one we compile into userboot by default. Modified: stable/11/share/man/man7/build.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/build.7 ============================================================================== --- stable/11/share/man/man7/build.7 Thu Feb 21 03:37:31 2019 (r344416) +++ stable/11/share/man/man7/build.7 Thu Feb 21 03:39:51 2019 (r344417) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd February 20, 2019 .Dt BUILD 7 .Os .Sh NAME @@ -572,6 +572,18 @@ using the option of .Xr make 1 : .Bl -tag -width ".Va -DNO_KERNELCONFIG" +.It Va LOADER_DEFAULT_INTERP +Defines what interpreter the default loader program will have. +Valid values include +.Dq 4th , +.Dq lua , +and +.Dq simp . +This creates the default link for +.Pa /boot/loader +to the loader with that interpreter. +It also determines what interpreter is compiled into +.Pa userboot . .It Va NO_CLEANDIR If set, the build targets that clean parts of the object tree use the equivalent of From owner-svn-src-all@freebsd.org Thu Feb 21 06:40: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 7019614F8B96; Thu, 21 Feb 2019 06:40:16 +0000 (UTC) (envelope-from jah@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 1410F9134F; Thu, 21 Feb 2019 06:40:16 +0000 (UTC) (envelope-from jah@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 DCAE519BBD; Thu, 21 Feb 2019 06:40:15 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L6eFHj008434; Thu, 21 Feb 2019 06:40:15 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L6eFVQ008433; Thu, 21 Feb 2019 06:40:15 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201902210640.x1L6eFVQ008433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Thu, 21 Feb 2019 06:40:15 +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: r344422 - stable/12/lib/libcasper/services/cap_syslog X-SVN-Group: stable-12 X-SVN-Commit-Author: jah X-SVN-Commit-Paths: stable/12/lib/libcasper/services/cap_syslog X-SVN-Commit-Revision: 344422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1410F9134F 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.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 06:40:16 -0000 Author: jah Date: Thu Feb 21 06:40:15 2019 New Revision: 344422 URL: https://svnweb.freebsd.org/changeset/base/344422 Log: MFC r343827: r342089 changed cap_syslog(3) to preserve the stdio descriptors inherited from its parent so that LOG_PERROR would work. However, this caused dhclient(8)'s stdio streams to remain open across daemonization, breaking the ability to capture its foreground output as done in netconfig_ipv4. Fix this by reverting r341692 and instead passing the parent's stderr descriptor as an argument to cap_openlog() only when LOG_PERROR is specified in logopt. PR: 234514 Modified: stable/12/lib/libcasper/services/cap_syslog/cap_syslog.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/services/cap_syslog/cap_syslog.c ============================================================================== --- stable/12/lib/libcasper/services/cap_syslog/cap_syslog.c Thu Feb 21 06:02:51 2019 (r344421) +++ stable/12/lib/libcasper/services/cap_syslog/cap_syslog.c Thu Feb 21 06:40:15 2019 (r344422) @@ -88,6 +88,9 @@ cap_openlog(cap_channel_t *chan, const char *ident, in } nvlist_add_number(nvl, "logopt", logopt); nvlist_add_number(nvl, "facility", facility); + if (logopt & LOG_PERROR) { + nvlist_add_descriptor(nvl, "stderr", STDERR_FILENO); + } nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) { return; @@ -131,6 +134,7 @@ cap_setlogmask(cap_channel_t *chan, int maskpri) */ static char *LogTag; +static int prev_stderr = -1; static void slog_vsyslog(const nvlist_t *limits __unused, const nvlist_t *nvlin, @@ -146,6 +150,8 @@ slog_openlog(const nvlist_t *limits __unused, const nv nvlist_t *nvlout __unused) { const char *ident; + uint64_t logopt; + int stderr_fd; ident = dnvlist_get_string(nvlin, "ident", NULL); if (ident != NULL) { @@ -153,8 +159,19 @@ slog_openlog(const nvlist_t *limits __unused, const nv LogTag = strdup(ident); } - openlog(LogTag, nvlist_get_number(nvlin, "logopt"), - nvlist_get_number(nvlin, "facility")); + logopt = nvlist_get_number(nvlin, "logopt"); + if (logopt & LOG_PERROR) { + stderr_fd = dnvlist_get_descriptor(nvlin, "stderr", -1); + if (prev_stderr == -1) + prev_stderr = dup(STDERR_FILENO); + if (prev_stderr != -1) + (void)dup2(stderr_fd, STDERR_FILENO); + } else if (prev_stderr != -1) { + (void)dup2(prev_stderr, STDERR_FILENO); + close(prev_stderr); + prev_stderr = -1; + } + openlog(LogTag, logopt, nvlist_get_number(nvlin, "facility")); } static void @@ -166,6 +183,12 @@ slog_closelog(const nvlist_t *limits __unused, const n free(LogTag); LogTag = NULL; + + if (prev_stderr != -1) { + (void)dup2(prev_stderr, STDERR_FILENO); + close(prev_stderr); + prev_stderr = -1; + } } static void @@ -198,4 +221,4 @@ syslog_command(const char *cmd, const nvlist_t *limits return (0); } -CREATE_SERVICE("system.syslog", NULL, syslog_command, CASPER_SERVICE_STDIO); +CREATE_SERVICE("system.syslog", NULL, syslog_command, 0); From owner-svn-src-all@freebsd.org Thu Feb 21 07:20: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 8D56814FA7EC; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@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 279049327C; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@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 0E5CC1A265; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L7KHpF029227; Thu, 21 Feb 2019 07:20:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L7KHlS029225; Thu, 21 Feb 2019 07:20:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902210720.x1L7KHlS029225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 07:20:17 +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: r344425 - in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Commit-Revision: 344425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 279049327C 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_SHORT(-0.93)[-0.929,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)[-0.999,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, 21 Feb 2019 07:20:18 -0000 Author: dim Date: Thu Feb 21 07:20:17 2019 New Revision: 344425 URL: https://svnweb.freebsd.org/changeset/base/344425 Log: MFC r344261: Pull in r345199 from upstream libc++ trunk (by Petr Hosek): Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are floating-point types." This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 This prevents "_Float16 is not supported on this target" errors in libc++'s type_traits header, in some cases. Reported by: Charlie Li Modified: stable/12/contrib/libc++/include/type_traits Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/libc++/include/type_traits Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/libc++/include/type_traits ============================================================================== --- stable/12/contrib/libc++/include/type_traits Thu Feb 21 06:51:35 2019 (r344424) +++ stable/12/contrib/libc++/include/type_traits Thu Feb 21 07:20:17 2019 (r344425) @@ -733,12 +733,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_ // is_floating_point template struct __libcpp_is_floating_point : public false_type {}; -#ifdef __clang__ -template <> struct __libcpp_is_floating_point<__fp16> : public true_type {}; -#endif -#ifdef __FLT16_MANT_DIG__ -template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; -#endif template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; From owner-svn-src-all@freebsd.org Thu Feb 21 07:20: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 D96ED14FA7F1; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@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 79B029327D; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@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 689291A266; Thu, 21 Feb 2019 07:20:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L7KISq029233; Thu, 21 Feb 2019 07:20:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L7KIUT029232; Thu, 21 Feb 2019 07:20:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902210720.x1L7KIUT029232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 07:20:18 +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: r344425 - in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Commit-Revision: 344425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79B029327D 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_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2019 07:20:19 -0000 Author: dim Date: Thu Feb 21 07:20:17 2019 New Revision: 344425 URL: https://svnweb.freebsd.org/changeset/base/344425 Log: MFC r344261: Pull in r345199 from upstream libc++ trunk (by Petr Hosek): Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are floating-point types." This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 This prevents "_Float16 is not supported on this target" errors in libc++'s type_traits header, in some cases. Reported by: Charlie Li Modified: stable/11/contrib/libc++/include/type_traits Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/libc++/include/type_traits Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/libc++/include/type_traits ============================================================================== --- stable/11/contrib/libc++/include/type_traits Thu Feb 21 06:51:35 2019 (r344424) +++ stable/11/contrib/libc++/include/type_traits Thu Feb 21 07:20:17 2019 (r344425) @@ -733,12 +733,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_ // is_floating_point template struct __libcpp_is_floating_point : public false_type {}; -#ifdef __clang__ -template <> struct __libcpp_is_floating_point<__fp16> : public true_type {}; -#endif -#ifdef __FLT16_MANT_DIG__ -template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; -#endif template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; From owner-svn-src-all@freebsd.org Thu Feb 21 07:22: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 C0A3E14FA9EF; Thu, 21 Feb 2019 07:22:06 +0000 (UTC) (envelope-from dim@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 5FD5993783; Thu, 21 Feb 2019 07:22:06 +0000 (UTC) (envelope-from dim@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 527E41A3DC; Thu, 21 Feb 2019 07:22:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L7M6cA033155; Thu, 21 Feb 2019 07:22:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L7M6Q4033154; Thu, 21 Feb 2019 07:22:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902210722.x1L7M6Q4033154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 07:22: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: r344426 - in stable: 11/lib/clang/libllvmminimal 12/lib/clang/libllvmminimal X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/clang/libllvmminimal 12/lib/clang/libllvmminimal X-SVN-Commit-Revision: 344426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FD5993783 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)[-0.999,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, 21 Feb 2019 07:22:06 -0000 Author: dim Date: Thu Feb 21 07:22:05 2019 New Revision: 344426 URL: https://svnweb.freebsd.org/changeset/base/344426 Log: MFC r344264: Add one additional file to libllvmminimal, since in some cases (e.g. upgrading from stable/10 to stable/11) symbols from it are needed to link llvm-tblgen and clang-tblgen. Reported by: kib Modified: stable/12/lib/clang/libllvmminimal/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/clang/libllvmminimal/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/clang/libllvmminimal/Makefile ============================================================================== --- stable/12/lib/clang/libllvmminimal/Makefile Thu Feb 21 07:20:17 2019 (r344425) +++ stable/12/lib/clang/libllvmminimal/Makefile Thu Feb 21 07:22:05 2019 (r344426) @@ -18,6 +18,7 @@ SRCS+= Support/Errno.cpp SRCS+= Support/Error.cpp SRCS+= Support/ErrorHandling.cpp SRCS+= Support/FoldingSet.cpp +SRCS+= Support/FormatVariadic.cpp SRCS+= Support/FormattedStream.cpp SRCS+= Support/Hashing.cpp SRCS+= Support/Host.cpp From owner-svn-src-all@freebsd.org Thu Feb 21 07:22: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 2124514FA9F3; Thu, 21 Feb 2019 07:22:07 +0000 (UTC) (envelope-from dim@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 B812F93785; Thu, 21 Feb 2019 07:22:06 +0000 (UTC) (envelope-from dim@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 A6FCE1A3DD; Thu, 21 Feb 2019 07:22:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L7M6ad033161; Thu, 21 Feb 2019 07:22:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L7M6df033160; Thu, 21 Feb 2019 07:22:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902210722.x1L7M6df033160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 07:22:06 +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: r344426 - in stable: 11/lib/clang/libllvmminimal 12/lib/clang/libllvmminimal X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/clang/libllvmminimal 12/lib/clang/libllvmminimal X-SVN-Commit-Revision: 344426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B812F93785 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)[-0.999,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, 21 Feb 2019 07:22:07 -0000 Author: dim Date: Thu Feb 21 07:22:05 2019 New Revision: 344426 URL: https://svnweb.freebsd.org/changeset/base/344426 Log: MFC r344264: Add one additional file to libllvmminimal, since in some cases (e.g. upgrading from stable/10 to stable/11) symbols from it are needed to link llvm-tblgen and clang-tblgen. Reported by: kib Modified: stable/11/lib/clang/libllvmminimal/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/clang/libllvmminimal/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/clang/libllvmminimal/Makefile ============================================================================== --- stable/11/lib/clang/libllvmminimal/Makefile Thu Feb 21 07:20:17 2019 (r344425) +++ stable/11/lib/clang/libllvmminimal/Makefile Thu Feb 21 07:22:05 2019 (r344426) @@ -18,6 +18,7 @@ SRCS+= Support/Errno.cpp SRCS+= Support/Error.cpp SRCS+= Support/ErrorHandling.cpp SRCS+= Support/FoldingSet.cpp +SRCS+= Support/FormatVariadic.cpp SRCS+= Support/FormattedStream.cpp SRCS+= Support/Hashing.cpp SRCS+= Support/Host.cpp From owner-svn-src-all@freebsd.org Thu Feb 21 08:32: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 06DA414FCF2B; Thu, 21 Feb 2019 08:32:47 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5679623C; Thu, 21 Feb 2019 08:32:46 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pg1-x536.google.com with SMTP id h11so11072159pgl.0; Thu, 21 Feb 2019 00:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ei4Jjnt754yWA/xrjc4VZZOuSWC143LiIyKb16aMlXo=; b=G0tc0Ri3ksfkdd4agd5M2DDbZad2wXpwQABogx+pCj0UkfW5Ccvy9vr8GjZiH7Ca4s 29ezoxeVBHdFV6NECP9dqjbrVEtrrHFKHaynOrxQUtx9dsVNhUMQZ2ubEPuKp2kz5yaG K81mUZCEXU62a/omvQSLOJFrJu9uNDvpIJampYo7VJC8rCEOwcDqLi9K+PpwpHzhRilI +6S2Yv2PD5dZOGTsiFUyAhd6E6HlmWCVOKNsymjTLfdwF5o2oqj2xu3GAb39UqY9/VEM 2SdhjM3UaRhXksBvhFVGbO87QQ0IqETRRh/ZF50GhFsaKvvdNLWai7JU2SXzOOsWOEJj geJQ== 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:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ei4Jjnt754yWA/xrjc4VZZOuSWC143LiIyKb16aMlXo=; b=q7bmShJN6BuzDxmwHaZqEfBSH0MjLvxa/w/OYUOiCrgTHEgRVmhSwVRTmBk/Rdl19S nVwTCD4YcYKQSL636zgc59Qf3P4xnuZ7aR3vrR19Jux3nAcfs8KloT+q0OzYrkgB2WJ8 QPGDypRq/ucgSGVQDqgoDZwWmjRjBApNrijAebA67JoxryRN7se/odjeBbtlOV1/KXYn iieCbZLCahqKuUe5vmZBQK8KsCrnOlaVHjw8+d8fwXZPueqJa7BG0wLUO0fE9U6rtqIw NK5/UdnFZtYocAxLCCyoOR30NTDZUABJaRaGgC56R2a5GrUy+gJbN71RKuiEodN7PgNo pQ/g== X-Gm-Message-State: AHQUAuZAdH8ObIkzXpfTYGx6HbWs2TMurHqi0AzxK5lwW6ANHXdvXCeL Rjt7vpU0zGzg5bV3Wnn9ySes9VxT X-Google-Smtp-Source: AHgI3IZwCoaPjF9YEVwBBAwPc6JAgjtSXBVL3glqzkKmVeIIq+Ylz5K0hSShJZ+Zt6XyO4eGhCKvjw== X-Received: by 2002:aa7:8d57:: with SMTP id s23mr38911849pfe.237.1550737965022; Thu, 21 Feb 2019 00:32:45 -0800 (PST) Received: from [192.168.1.105] (119-18-15-55.77120f.syd.nbn.aussiebb.net. [119.18.15.55]) by smtp.gmail.com with ESMTPSA id p2sm26562806pfi.95.2019.02.21.00.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 00:32:44 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r344368 - head/sys/netinet To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902201803.x1KI3haW078567@repo.freebsd.org> From: Kubilay Kocak Message-ID: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 19:32:41 +1100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Thunderbird/66.0 MIME-Version: 1.0 In-Reply-To: <201902201803.x1KI3haW078567@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6B5679623C 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.927,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: Thu, 21 Feb 2019 08:32:47 -0000 On 21/02/2019 5:03 am, Michael Tuexen wrote: > Author: tuexen > Date: Wed Feb 20 18:03:43 2019 > New Revision: 344368 > URL: https://svnweb.freebsd.org/changeset/base/344368 > > Log: > Reduce the TCP initial retransmission timeout from 3 seconds to > 1 second as allowed by RFC 6298. > > Reviewed by: kbowling@, Richard Scheffenegger > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D18941 > > Modified: > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_timer.h > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================== > --- head/sys/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 (r344367) > +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 (r344368) > @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str > * tcp_backoff[1] + > * tcp_backoff[2] + > * tcp_backoff[3]) + 3 * tcp_rexmit_slop, > - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, > + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, > * the odds are that the user has given up attempting to connect by then. > */ > #define SYNCACHE_MAXREXMTS 3 > > Modified: head/sys/netinet/tcp_timer.h > ============================================================================== > --- head/sys/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 (r344367) > +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 (r344368) > @@ -77,7 +77,7 @@ > #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ > #define TCPTV_SRTTBASE 0 /* base roundtrip time; > if 0, no idea yet */ > -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ > +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ > > #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ > #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ > _______________________________________________ Any way this can be a run-time tunable? From owner-svn-src-all@freebsd.org Thu Feb 21 08:37: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 127B414FD166; Thu, 21 Feb 2019 08:37:41 +0000 (UTC) (envelope-from bde@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 B10C2964BE; Thu, 21 Feb 2019 08:37:40 +0000 (UTC) (envelope-from bde@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 8A2671B03A; Thu, 21 Feb 2019 08:37:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L8bekf070586; Thu, 21 Feb 2019 08:37:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L8beve070582; Thu, 21 Feb 2019 08:37:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902210837.x1L8beve070582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 08:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344427 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 344427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B10C2964BE 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.944,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, 21 Feb 2019 08:37:41 -0000 Author: bde Date: Thu Feb 21 08:37:39 2019 New Revision: 344427 URL: https://svnweb.freebsd.org/changeset/base/344427 Log: Restore syscons' terminal emulators. The trivial fixes to make them compile will be committed later. The "sc" emulator has the advantages of full support for cons25 and running about 8 times faster than teken (for writing to the frame buffer). The "dumb" emulator has the advantage of being simple. Runtime choice of the emulator is good, but compile time choice is bad. Added: - copied unchanged from r186680, head/sys/dev/syscons/scterm-dumb.c - copied unchanged from r186680, head/sys/dev/syscons/scterm-sc.c - copied unchanged from r186680, head/sys/dev/syscons/sctermvar.h Directory Properties: head/sys/dev/syscons/scterm-dumb.c (props changed) head/sys/dev/syscons/scterm-sc.c (props changed) head/sys/dev/syscons/sctermvar.h (props changed) Copied: head/sys/dev/syscons/scterm-dumb.c (from r186680, head/sys/dev/syscons/scterm-dumb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/scterm-dumb.c) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS 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 "opt_syscons.h" + +#include +#include +#include + +#if defined(__sparc64__) || defined(__powerpc__) +#include +#else +#include +#endif + +#include +#include + +#ifdef SC_DUMB_TERMINAL + +/* dumb terminal emulator */ + +static sc_term_init_t dumb_init; +static sc_term_term_t dumb_term; +static sc_term_puts_t dumb_puts; +static sc_term_ioctl_t dumb_ioctl; +static sc_term_clear_t dumb_clear; +static sc_term_input_t dumb_input; +static void dumb_nop(void); + +static sc_term_sw_t sc_term_dumb = { + { NULL, NULL }, + "dumb", /* emulator name */ + "dumb terminal", /* description */ + "*", /* matching renderer */ + 0, /* softc size */ + 0, + dumb_init, + dumb_term, + dumb_puts, + dumb_ioctl, + (sc_term_reset_t *)dumb_nop, + (sc_term_default_attr_t *)dumb_nop, + dumb_clear, + (sc_term_notify_t *)dumb_nop, + dumb_input, +}; + +SCTERM_MODULE(dumb, sc_term_dumb); + +static int +dumb_init(scr_stat *scp, void **softc, int code) +{ + switch (code) { + case SC_TE_COLD_INIT: + ++sc_term_dumb.te_refcount; + break; + case SC_TE_WARM_INIT: + break; + } + return 0; +} + +static int +dumb_term(scr_stat *scp, void **softc) +{ + --sc_term_dumb.te_refcount; + return 0; +} + +static void +dumb_puts(scr_stat *scp, u_char *buf, int len) +{ + while (len > 0) { + ++scp->sc->write_in_progress; + sc_term_gen_print(scp, &buf, &len, SC_NORM_ATTR << 8); + sc_term_gen_scroll(scp, scp->sc->scr_map[0x20], + SC_NORM_ATTR << 8); + --scp->sc->write_in_progress; + } +} + +static int +dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, + int flag, struct proc *p) +{ + vid_info_t *vi; + + switch (cmd) { + case GIO_ATTR: /* get current attributes */ + *(int*)data = SC_NORM_ATTR; + return 0; + case CONS_GETINFO: /* get current (virtual) console info */ + vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return EINVAL; + vi->mv_norm.fore = SC_NORM_ATTR & 0x0f; + vi->mv_norm.back = (SC_NORM_ATTR >> 4) & 0x0f; + vi->mv_rev.fore = SC_NORM_ATTR & 0x0f; + vi->mv_rev.back = (SC_NORM_ATTR >> 4) & 0x0f; + /* + * The other fields are filled by the upper routine. XXX + */ + return ENOIOCTL; + } + return ENOIOCTL; +} + +static void +dumb_clear(scr_stat *scp) +{ + sc_move_cursor(scp, 0, 0); + sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], SC_NORM_ATTR << 8); + mark_all(scp); +} + +static int +dumb_input(scr_stat *scp, int c, struct tty *tp) +{ + return FALSE; +} + +static void +dumb_nop(void) +{ + /* nothing */ +} + +#endif /* SC_DUMB_TERMINAL */ Copied: head/sys/dev/syscons/scterm-sc.c (from r186680, head/sys/dev/syscons/scterm-sc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/scterm-sc.c Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/scterm-sc.c) @@ -0,0 +1,811 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * Copyright (c) 1992-1998 Søren Schmidt + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS 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 "opt_syscons.h" + +#include +#include +#include +#include +#include + +#if defined(__sparc64__) || defined(__powerpc__) +#include +#else +#include +#endif + +#include +#include + +#ifndef SC_DUMB_TERMINAL + +#define MAX_ESC_PAR 5 + +/* attribute flags */ +typedef struct { + u_short fg; /* foreground color */ + u_short bg; /* background color */ +} color_t; + +typedef struct { + int flags; +#define SCTERM_BUSY (1 << 0) + int esc; + int num_param; + int last_param; + int param[MAX_ESC_PAR]; + int saved_xpos; + int saved_ypos; + int attr_mask; /* current logical attr mask */ +#define NORMAL_ATTR 0x00 +#define BLINK_ATTR 0x01 +#define BOLD_ATTR 0x02 +#define UNDERLINE_ATTR 0x04 +#define REVERSE_ATTR 0x08 +#define FG_CHANGED 0x10 +#define BG_CHANGED 0x20 + int cur_attr; /* current hardware attr word */ + color_t cur_color; /* current hardware color */ + color_t std_color; /* normal hardware color */ + color_t rev_color; /* reverse hardware color */ + color_t dflt_std_color; /* default normal color */ + color_t dflt_rev_color; /* default reverse color */ +} term_stat; + +static sc_term_init_t scterm_init; +static sc_term_term_t scterm_term; +static sc_term_puts_t scterm_puts; +static sc_term_ioctl_t scterm_ioctl; +static sc_term_reset_t scterm_reset; +static sc_term_default_attr_t scterm_default_attr; +static sc_term_clear_t scterm_clear; +static sc_term_notify_t scterm_notify; +static sc_term_input_t scterm_input; + +static sc_term_sw_t sc_term_sc = { + { NULL, NULL }, + "sc", /* emulator name */ + "syscons terminal", /* description */ + "*", /* matching renderer, any :-) */ + sizeof(term_stat), /* softc size */ + 0, + scterm_init, + scterm_term, + scterm_puts, + scterm_ioctl, + scterm_reset, + scterm_default_attr, + scterm_clear, + scterm_notify, + scterm_input, +}; + +SCTERM_MODULE(sc, sc_term_sc); + +static term_stat reserved_term_stat; +static void scterm_scan_esc(scr_stat *scp, term_stat *tcp, + u_char c); +static int mask2attr(term_stat *tcp); + +static int +scterm_init(scr_stat *scp, void **softc, int code) +{ + term_stat *tcp; + + if (*softc == NULL) { + if (reserved_term_stat.flags & SCTERM_BUSY) + return EINVAL; + *softc = &reserved_term_stat; + } + tcp = *softc; + + switch (code) { + case SC_TE_COLD_INIT: + bzero(tcp, sizeof(*tcp)); + tcp->flags = SCTERM_BUSY; + tcp->esc = 0; + tcp->saved_xpos = -1; + tcp->saved_ypos = -1; + tcp->attr_mask = NORMAL_ATTR; + /* XXX */ + tcp->dflt_std_color.fg = SC_NORM_ATTR & 0x0f; + tcp->dflt_std_color.bg = (SC_NORM_ATTR >> 4) & 0x0f; + tcp->dflt_rev_color.fg = SC_NORM_REV_ATTR & 0x0f; + tcp->dflt_rev_color.bg = (SC_NORM_REV_ATTR >> 4) & 0x0f; + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + ++sc_term_sc.te_refcount; + break; + + case SC_TE_WARM_INIT: + tcp->esc = 0; + tcp->saved_xpos = -1; + tcp->saved_ypos = -1; +#if 0 + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; +#endif + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + } + + return 0; +} + +static int +scterm_term(scr_stat *scp, void **softc) +{ + if (*softc == &reserved_term_stat) { + *softc = NULL; + bzero(&reserved_term_stat, sizeof(reserved_term_stat)); + } + --sc_term_sc.te_refcount; + return 0; +} + +static void +scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c) +{ + static u_char ansi_col[16] = { + FG_BLACK, FG_RED, FG_GREEN, FG_BROWN, + FG_BLUE, FG_MAGENTA, FG_CYAN, FG_LIGHTGREY, + FG_DARKGREY, FG_LIGHTRED, FG_LIGHTGREEN, FG_YELLOW, + FG_LIGHTBLUE, FG_LIGHTMAGENTA, FG_LIGHTCYAN, FG_WHITE + }; + static int cattrs[] = { + 0, /* block */ + CONS_BLINK_CURSOR, /* blinking block */ + CONS_CHAR_CURSOR, /* underline */ + CONS_CHAR_CURSOR | CONS_BLINK_CURSOR, /* blinking underline */ + CONS_RESET_CURSOR, /* reset to default */ + CONS_HIDDEN_CURSOR, /* hide cursor */ + }; + static int tcattrs[] = { + CONS_RESET_CURSOR | CONS_LOCAL_CURSOR, /* normal */ + CONS_HIDDEN_CURSOR | CONS_LOCAL_CURSOR, /* invisible */ + CONS_BLINK_CURSOR | CONS_LOCAL_CURSOR, /* very visible */ + }; + sc_softc_t *sc; + int v0, v1, v2; + int i, n; + + i = n = 0; + sc = scp->sc; + if (tcp->esc == 1) { /* seen ESC */ + switch (c) { + + case '7': /* Save cursor position */ + tcp->saved_xpos = scp->xpos; + tcp->saved_ypos = scp->ypos; + break; + + case '8': /* Restore saved cursor position */ + if (tcp->saved_xpos >= 0 && tcp->saved_ypos >= 0) + sc_move_cursor(scp, tcp->saved_xpos, + tcp->saved_ypos); + break; + + case '[': /* Start ESC [ sequence */ + tcp->esc = 2; + tcp->last_param = -1; + for (i = tcp->num_param; i < MAX_ESC_PAR; i++) + tcp->param[i] = 1; + tcp->num_param = 0; + return; + + case 'M': /* Move cursor up 1 line, scroll if at top */ + sc_term_up_scroll(scp, 1, sc->scr_map[0x20], + tcp->cur_attr, 0, 0); + break; +#ifdef notyet + case 'Q': + tcp->esc = 4; + return; +#endif + case 'c': /* reset */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color + = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_attr = mask2attr(tcp); + sc_change_cursor_shape(scp, + CONS_RESET_CURSOR | CONS_LOCAL_CURSOR, -1, -1); + sc_clear_screen(scp); + break; + + case '(': /* iso-2022: designate 94 character set to G0 */ + tcp->esc = 5; + return; + } + } else if (tcp->esc == 2) { /* seen ESC [ */ + if (c >= '0' && c <= '9') { + if (tcp->num_param < MAX_ESC_PAR) { + if (tcp->last_param != tcp->num_param) { + tcp->last_param = tcp->num_param; + tcp->param[tcp->num_param] = 0; + } else { + tcp->param[tcp->num_param] *= 10; + } + tcp->param[tcp->num_param] += c - '0'; + return; + } + } + tcp->num_param = tcp->last_param + 1; + switch (c) { + + case ';': + if (tcp->num_param < MAX_ESC_PAR) + return; + break; + + case '=': + tcp->esc = 3; + tcp->last_param = -1; + for (i = tcp->num_param; i < MAX_ESC_PAR; i++) + tcp->param[i] = 1; + tcp->num_param = 0; + return; + + case 'A': /* up n rows */ + sc_term_up(scp, tcp->param[0], 0); + break; + + case 'B': /* down n rows */ + sc_term_down(scp, tcp->param[0], 0); + break; + + case 'C': /* right n columns */ + sc_term_right(scp, tcp->param[0]); + break; + + case 'D': /* left n columns */ + sc_term_left(scp, tcp->param[0]); + break; + + case 'E': /* cursor to start of line n lines down */ + n = tcp->param[0]; + if (n < 1) + n = 1; + sc_move_cursor(scp, 0, scp->ypos + n); + break; + + case 'F': /* cursor to start of line n lines up */ + n = tcp->param[0]; + if (n < 1) + n = 1; + sc_move_cursor(scp, 0, scp->ypos - n); + break; + + case 'f': /* Cursor move */ + case 'H': + if (tcp->num_param == 0) + sc_move_cursor(scp, 0, 0); + else if (tcp->num_param == 2) + sc_move_cursor(scp, tcp->param[1] - 1, + tcp->param[0] - 1); + break; + + case 'J': /* Clear all or part of display */ + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + sc_term_clr_eos(scp, n, sc->scr_map[0x20], + tcp->cur_attr); + break; + + case 'K': /* Clear all or part of line */ + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + sc_term_clr_eol(scp, n, sc->scr_map[0x20], + tcp->cur_attr); + break; + + case 'L': /* Insert n lines */ + sc_term_ins_line(scp, scp->ypos, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'M': /* Delete n lines */ + sc_term_del_line(scp, scp->ypos, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'P': /* Delete n chars */ + sc_term_del_char(scp, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr); + break; + + case '@': /* Insert n chars */ + sc_term_ins_char(scp, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr); + break; + + case 'S': /* scroll up n lines */ + sc_term_del_line(scp, 0, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'T': /* scroll down n lines */ + sc_term_ins_line(scp, 0, tcp->param[0], + sc->scr_map[0x20], tcp->cur_attr, 0); + break; + + case 'X': /* erase n characters in line */ + n = tcp->param[0]; + if (n < 1) + n = 1; + if (n > scp->xsize - scp->xpos) + n = scp->xsize - scp->xpos; + sc_vtb_erase(&scp->vtb, scp->cursor_pos, n, + sc->scr_map[0x20], tcp->cur_attr); + mark_for_update(scp, scp->cursor_pos); + mark_for_update(scp, scp->cursor_pos + n - 1); + break; + + case 'Z': /* move n tabs backwards */ + sc_term_backtab(scp, tcp->param[0]); + break; + + case '`': /* move cursor to column n */ + sc_term_col(scp, tcp->param[0]); + break; + + case 'a': /* move cursor n columns to the right */ + sc_term_right(scp, tcp->param[0]); + break; + + case 'd': /* move cursor to row n */ + sc_term_row(scp, tcp->param[0]); + break; + + case 'e': /* move cursor n rows down */ + sc_term_down(scp, tcp->param[0], 0); + break; + + case 'm': /* change attribute */ + if (tcp->num_param == 0) { + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + } + for (i = 0; i < tcp->num_param; i++) { + switch (n = tcp->param[i]) { + case 0: /* back to normal */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); + break; + case 1: /* bold */ + tcp->attr_mask |= BOLD_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 4: /* underline */ + tcp->attr_mask |= UNDERLINE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 5: /* blink */ + tcp->attr_mask |= BLINK_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 7: /* reverse */ + tcp->attr_mask |= REVERSE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 22: /* remove bold (or dim) */ + tcp->attr_mask &= ~BOLD_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 24: /* remove underline */ + tcp->attr_mask &= ~UNDERLINE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 25: /* remove blink */ + tcp->attr_mask &= ~BLINK_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 27: /* remove reverse */ + tcp->attr_mask &= ~REVERSE_ATTR; + tcp->cur_attr = mask2attr(tcp); + break; + case 30: case 31: /* set ansi fg color */ + case 32: case 33: case 34: + case 35: case 36: case 37: + tcp->attr_mask |= FG_CHANGED; + tcp->cur_color.fg = ansi_col[n - 30]; + tcp->cur_attr = mask2attr(tcp); + break; + case 39: /* restore fg color back to normal */ + tcp->attr_mask &= ~(FG_CHANGED|BOLD_ATTR); + tcp->cur_color.fg = tcp->std_color.fg; + tcp->cur_attr = mask2attr(tcp); + break; + case 40: case 41: /* set ansi bg color */ + case 42: case 43: case 44: + case 45: case 46: case 47: + tcp->attr_mask |= BG_CHANGED; + tcp->cur_color.bg = ansi_col[n - 40]; + tcp->cur_attr = mask2attr(tcp); + break; + case 49: /* restore bg color back to normal */ + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg; + tcp->cur_attr = mask2attr(tcp); + break; + } + } + break; + + case 's': /* Save cursor position */ + tcp->saved_xpos = scp->xpos; + tcp->saved_ypos = scp->ypos; + break; + + case 'u': /* Restore saved cursor position */ + if (tcp->saved_xpos >= 0 && tcp->saved_ypos >= 0) + sc_move_cursor(scp, tcp->saved_xpos, + tcp->saved_ypos); + break; + + case 'x': + if (tcp->num_param == 0) + n = 0; + else + n = tcp->param[0]; + switch (n) { + case 0: /* reset colors and attributes back to normal */ + tcp->attr_mask = NORMAL_ATTR; + tcp->cur_color = tcp->std_color + = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_attr = mask2attr(tcp); + break; + case 1: /* set ansi background */ + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg + = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 2: /* set ansi foreground */ + tcp->attr_mask &= ~FG_CHANGED; + tcp->cur_color.fg = tcp->std_color.fg + = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 3: /* set adapter attribute directly */ + tcp->attr_mask &= ~(FG_CHANGED | BG_CHANGED); + tcp->cur_color.fg = tcp->std_color.fg + = tcp->param[1] & 0x0f; + tcp->cur_color.bg = tcp->std_color.bg + = (tcp->param[1] >> 4) & 0x0f; + tcp->cur_attr = mask2attr(tcp); + break; + case 5: /* set ansi reverse background */ + tcp->rev_color.bg = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 6: /* set ansi reverse foreground */ + tcp->rev_color.fg = ansi_col[tcp->param[1] & 0x0f]; + tcp->cur_attr = mask2attr(tcp); + break; + case 7: /* set adapter reverse attribute directly */ + tcp->rev_color.fg = tcp->param[1] & 0x0f; + tcp->rev_color.bg = (tcp->param[1] >> 4) & 0x0f; + tcp->cur_attr = mask2attr(tcp); + break; + } + break; + + case 'z': /* switch to (virtual) console n */ + if (tcp->num_param == 1) + sc_switch_scr(sc, tcp->param[0]); + break; + } + } else if (tcp->esc == 3) { /* seen ESC [0-9]+ = */ + if (c >= '0' && c <= '9') { + if (tcp->num_param < MAX_ESC_PAR) { + if (tcp->last_param != tcp->num_param) { + tcp->last_param = tcp->num_param; + tcp->param[tcp->num_param] = 0; + } else { + tcp->param[tcp->num_param] *= 10; + } + tcp->param[tcp->num_param] += c - '0'; + return; + } + } + tcp->num_param = tcp->last_param + 1; + switch (c) { + + case ';': + if (tcp->num_param < MAX_ESC_PAR) + return; + break; + + case 'A': /* set display border color */ + if (tcp->num_param == 1) { + scp->border=tcp->param[0] & 0xff; + if (scp == sc->cur_scp) + sc_set_border(scp, scp->border); + } + break; + + case 'B': /* set bell pitch and duration */ + if (tcp->num_param == 2) { + scp->bell_pitch = tcp->param[0]; + scp->bell_duration = + (tcp->param[1] * hz + 99) / 100; + } + break; + + case 'C': /* set global/parmanent cursor type & shape */ + i = spltty(); + n = tcp->num_param; + v0 = tcp->param[0]; + v1 = tcp->param[1]; + v2 = tcp->param[2]; + switch (n) { + case 1: /* flags only */ + if (v0 < sizeof(cattrs)/sizeof(cattrs[0])) + v0 = cattrs[v0]; + else /* backward compatibility */ + v0 = cattrs[v0 & 0x3]; + sc_change_cursor_shape(scp, v0, -1, -1); + break; + case 2: + v2 = 0; + v0 &= 0x1f; /* backward compatibility */ + v1 &= 0x1f; + /* FALL THROUGH */ + case 3: /* base and height */ + if (v2 == 0) /* count from top */ + sc_change_cursor_shape(scp, -1, + scp->font_size - v1 - 1, + v1 - v0 + 1); + else if (v2 == 1) /* count from bottom */ + sc_change_cursor_shape(scp, -1, + v0, v1 - v0 + 1); + break; + } + splx(i); + break; + + case 'F': /* set adapter foreground */ + if (tcp->num_param == 1) { + tcp->attr_mask &= ~FG_CHANGED; + tcp->cur_color.fg = tcp->std_color.fg + = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'G': /* set adapter background */ + if (tcp->num_param == 1) { + tcp->attr_mask &= ~BG_CHANGED; + tcp->cur_color.bg = tcp->std_color.bg + = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'H': /* set adapter reverse foreground */ + if (tcp->num_param == 1) { + tcp->rev_color.fg = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'I': /* set adapter reverse background */ + if (tcp->num_param == 1) { + tcp->rev_color.bg = tcp->param[0] & 0x0f; + tcp->cur_attr = mask2attr(tcp); + } + break; + + case 'S': /* set local/temporary cursor type & shape */ + i = spltty(); + n = tcp->num_param; + v0 = tcp->param[0]; + switch (n) { + case 0: + v0 = 0; + /* FALL THROUGH */ + case 1: + if (v0 < sizeof(tcattrs)/sizeof(tcattrs[0])) + sc_change_cursor_shape(scp, + tcattrs[v0], -1, -1); + break; + } + splx(i); + break; + } +#ifdef notyet + } else if (tcp->esc == 4) { /* seen ESC Q */ + /* to be filled */ +#endif + } else if (tcp->esc == 5) { /* seen ESC ( */ + switch (c) { + case 'B': /* iso-2022: desginate ASCII into G0 */ + break; + /* other items to be filled */ + default: + break; + } + } + tcp->esc = 0; +} + +static void +scterm_puts(scr_stat *scp, u_char *buf, int len) +{ + term_stat *tcp; + + tcp = scp->ts; +outloop: + scp->sc->write_in_progress++; + + if (tcp->esc) { + scterm_scan_esc(scp, tcp, *buf); + buf++; + len--; + } else { + switch (*buf) { + case 0x1b: + tcp->esc = 1; + tcp->num_param = 0; + buf++; + len--; + break; + default: + sc_term_gen_print(scp, &buf, &len, tcp->cur_attr); + break; + } + } + + sc_term_gen_scroll(scp, scp->sc->scr_map[0x20], tcp->cur_attr); + + scp->sc->write_in_progress--; + if (len) + goto outloop; +} + +static int +scterm_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, + struct thread *td) +{ + term_stat *tcp = scp->ts; + vid_info_t *vi; + + switch (cmd) { + case GIO_ATTR: /* get current attributes */ + /* FIXME: */ + *(int*)data = (tcp->cur_attr >> 8) & 0xff; + return 0; + case CONS_GETINFO: /* get current (virtual) console info */ + vi = (vid_info_t *)data; + if (vi->size != sizeof(struct vid_info)) + return EINVAL; + vi->mv_norm.fore = tcp->std_color.fg; + vi->mv_norm.back = tcp->std_color.bg; + vi->mv_rev.fore = tcp->rev_color.fg; + vi->mv_rev.back = tcp->rev_color.bg; + /* + * The other fields are filled by the upper routine. XXX + */ + return ENOIOCTL; + } + return ENOIOCTL; +} + +static int +scterm_reset(scr_stat *scp, int code) +{ + /* FIXME */ + return 0; +} + +static void +scterm_default_attr(scr_stat *scp, int color, int rev_color) +{ + term_stat *tcp = scp->ts; + + tcp->dflt_std_color.fg = color & 0x0f; + tcp->dflt_std_color.bg = (color >> 4) & 0x0f; + tcp->dflt_rev_color.fg = rev_color & 0x0f; + tcp->dflt_rev_color.bg = (rev_color >> 4) & 0x0f; + tcp->std_color = tcp->dflt_std_color; + tcp->rev_color = tcp->dflt_rev_color; + tcp->cur_color = tcp->std_color; + tcp->cur_attr = mask2attr(tcp); +} + +static void +scterm_clear(scr_stat *scp) +{ + term_stat *tcp = scp->ts; + + sc_move_cursor(scp, 0, 0); + sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], tcp->cur_attr); + mark_all(scp); +} + +static void +scterm_notify(scr_stat *scp, int event) +{ + switch (event) { + case SC_TE_NOTIFY_VTSWITCH_IN: + break; + case SC_TE_NOTIFY_VTSWITCH_OUT: + break; + } +} + +static int +scterm_input(scr_stat *scp, int c, struct tty *tp) +{ + return FALSE; +} + +/* + * Calculate hardware attributes word using logical attributes mask and + * hardware colors + */ + +/* FIXME */ +static int +mask2attr(term_stat *tcp) +{ + int attr, mask = tcp->attr_mask; + + if (mask & REVERSE_ATTR) { + attr = ((mask & FG_CHANGED) ? + tcp->cur_color.bg : tcp->rev_color.fg) | + (((mask & BG_CHANGED) ? + tcp->cur_color.fg : tcp->rev_color.bg) << 4); + } else + attr = tcp->cur_color.fg | (tcp->cur_color.bg << 4); + + /* XXX: underline mapping for Hercules adapter can be better */ + if (mask & (BOLD_ATTR | UNDERLINE_ATTR)) + attr ^= 0x08; + if (mask & BLINK_ATTR) + attr ^= 0x80; + + return (attr << 8); +} + +#endif /* SC_DUMB_TERMINAL */ Copied: head/sys/dev/syscons/sctermvar.h (from r186680, head/sys/dev/syscons/sctermvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscons/sctermvar.h Thu Feb 21 08:37:39 2019 (r344427, copy of r186680, head/sys/dev/syscons/sctermvar.h) @@ -0,0 +1,432 @@ +/*- + * Copyright (c) 1999 Kazutaka YOKOTA + * 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 as + * the first lines of this file unmodified. + * 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 AUTHORS ``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 AUTHORS 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. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 21 09:22: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 E2D9514FF62E; Thu, 21 Feb 2019 09:22:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D8D69C89; Thu, 21 Feb 2019 09:22:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.9] (p57BB46EC.dip0.t-ipconnect.de [87.187.70.236]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id CA965721E281A; Thu, 21 Feb 2019 10:21:57 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344368 - head/sys/netinet From: Michael Tuexen In-Reply-To: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 10:21:56 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-transport@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1141FFDF-F764-4CBB-B245-8E92815FCE8F@freebsd.org> References: <201902201803.x1KI3haW078567@repo.freebsd.org> <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> To: "koobs@freebsd.org" X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2019 09:22:05 -0000 > On 21. Feb 2019, at 09:32, Kubilay Kocak wrote: >=20 > On 21/02/2019 5:03 am, Michael Tuexen wrote: >> Author: tuexen >> Date: Wed Feb 20 18:03:43 2019 >> New Revision: 344368 >> URL: https://svnweb.freebsd.org/changeset/base/344368 >> Log: >> Reduce the TCP initial retransmission timeout from 3 seconds to >> 1 second as allowed by RFC 6298. >> Reviewed by: kbowling@, Richard Scheffenegger >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D18941 >> Modified: >> head/sys/netinet/tcp_syncache.c >> head/sys/netinet/tcp_timer.h >> Modified: head/sys/netinet/tcp_syncache.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/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -159,7 +159,7 @@ static int syncookie_cmp(struct = in_conninfo *inc, str >> * tcp_backoff[1] + >> * tcp_backoff[2] + >> * tcp_backoff[3]) + 3 * tcp_rexmit_slop, >> - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 45600 ms, >> + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 15600 ms, >> * the odds are that the user has given up attempting to connect by = then. >> */ >> #define SYNCACHE_MAXREXMTS 3 >> Modified: head/sys/netinet/tcp_timer.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/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -77,7 +77,7 @@ >> #define TCPTV_MSL ( 30*hz) /* max seg = lifetime (hah!) */ >> #define TCPTV_SRTTBASE 0 /* base = roundtrip time; >> if 0, no idea yet */ >> -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO = if no info */ >> +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO = if no info */ >> #define TCPTV_PERSMIN ( 5*hz) /* minimum = persist interval */ >> #define TCPTV_PERSMAX ( 60*hz) /* maximum = persist interval */ >> _______________________________________________ >=20 > Any way this can be a run-time tunable? That is definitely possible. However, changing the default should be = separate from making it sysctl-able. I'll bring this up in the bi-weekly transport call and see what others = think. Best regards Michael >=20 From owner-svn-src-all@freebsd.org Thu Feb 21 09:34: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 428E614D9094; Thu, 21 Feb 2019 09:34:48 +0000 (UTC) (envelope-from tuexen@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 DA3B46A928; Thu, 21 Feb 2019 09:34:47 +0000 (UTC) (envelope-from tuexen@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 AD7141BAF3; Thu, 21 Feb 2019 09:34:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9YlK9001870; Thu, 21 Feb 2019 09:34:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9Ylos001869; Thu, 21 Feb 2019 09:34:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902210934.x1L9Ylos001869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Feb 2019 09:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344428 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA3B46A928 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_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2019 09:34:48 -0000 Author: tuexen Date: Thu Feb 21 09:34:47 2019 New Revision: 344428 URL: https://svnweb.freebsd.org/changeset/base/344428 Log: This patch addresses an issue brought up by bz@ in D18968: When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen, if user data was received during the TCP handshake and BB logging is used. A KASSERT is also added to detect tcp_reass() calls with illegal parameter combinations. Reported by: bz@ Reviewed by: rrs@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19254 Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Feb 21 08:37:39 2019 (r344427) +++ head/sys/netinet/tcp_reass.c Thu Feb 21 09:34:47 2019 (r344428) @@ -542,6 +542,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq * and should be rewritten (see NetBSD for optimizations). */ + KASSERT(th == NULL || (seq_start != NULL && tlenp != NULL), + ("tcp_reass called with illegal parameter combination " + "(tp=%p, th=%p, seq_start=%p, tlenp=%p, m=%p)", + tp, th, seq_start, tlenp, m)); /* * Call with th==NULL after become established to * force pre-ESTABLISHED data up to user socket. @@ -1062,12 +1066,20 @@ present: } else { #ifdef TCP_REASS_LOGGING tcp_reass_log_new_in(tp, q->tqe_start, q->tqe_len, q->tqe_m, TCP_R_LOG_READ, q); - tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 1); + if (th != NULL) { + tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 1); + } else { + tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 1); + } #endif sbappendstream_locked(&so->so_rcv, q->tqe_m, 0); } #ifdef TCP_REASS_LOGGING - tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 2); + if (th != NULL) { + tcp_log_reassm(tp, q, NULL, th->th_seq, *tlenp, TCP_R_LOG_READ, 2); + } else { + tcp_log_reassm(tp, q, NULL, 0, 0, TCP_R_LOG_READ, 2); + } #endif KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt, ("tp:%p seg queue goes negative", tp)); @@ -1083,7 +1095,11 @@ present: tp, &tp->t_segq, tp->t_segqmbuflen); #else #ifdef TCP_REASS_LOGGING - tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, TCP_R_LOG_ZERO, 0); + if (th != NULL) { + tcp_log_reassm(tp, NULL, NULL, th->th_seq, *tlenp, TCP_R_LOG_ZERO, 0); + } else { + tcp_log_reassm(tp, NULL, NULL, 0, 0, TCP_R_LOG_ZERO, 0); + } #endif tp->t_segqmbuflen = 0; #endif From owner-svn-src-all@freebsd.org Thu Feb 21 09:43: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 F007014D99A8; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@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 B706B6B1FD; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@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 A80141BCB2; Thu, 21 Feb 2019 09:43:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9hEJ6006975; Thu, 21 Feb 2019 09:43:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9hElJ006974; Thu, 21 Feb 2019 09:43:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902210943.x1L9hElJ006974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 21 Feb 2019 09:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344429 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 344429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B706B6B1FD 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.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 09:43:15 -0000 Author: andrew Date: Thu Feb 21 09:43:14 2019 New Revision: 344429 URL: https://svnweb.freebsd.org/changeset/base/344429 Log: Use KCOV_ENTRY_SIZE for the entry size. Previously it was sizeof(uint64_t). While this is currently true, it may not be on all future architectures. Sponsored by: DARPA, AFRL Modified: head/tests/sys/kern/kcov.c Modified: head/tests/sys/kern/kcov.c ============================================================================== --- head/tests/sys/kern/kcov.c Thu Feb 21 09:34:47 2019 (r344428) +++ head/tests/sys/kern/kcov.c Thu Feb 21 09:43:14 2019 (r344429) @@ -89,7 +89,7 @@ ATF_TC_BODY(kcov_mmap, tc) fd, 0) == MAP_FAILED); ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, - 2 * PAGE_SIZE / sizeof(uint64_t)) == 0); + 2 * PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) == MAP_FAILED); @@ -113,7 +113,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap, tc) fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); @@ -128,7 +128,7 @@ ATF_TC_BODY(kcov_mmap_no_munmap_no_close, tc) fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); @@ -144,7 +144,7 @@ kcov_mmap_enable_thread(void *data) fd = open_kcov(); *(int *)data = fd; - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) != MAP_FAILED); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); @@ -180,7 +180,7 @@ ATF_TC_BODY(kcov_enable, tc) ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == -1); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); /* We need to enable before disable */ ATF_CHECK(ioctl(fd, KIODISABLE, 0) == -1); @@ -208,7 +208,7 @@ ATF_TC_BODY(kcov_enable_no_disable, tc) int fd; fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); close(fd); } @@ -219,7 +219,7 @@ ATF_TC_BODY(kcov_enable_no_disable_no_close, tc) int fd; fd = open_kcov(); - ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / sizeof(uint64_t)) ==0); + ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, PAGE_SIZE / KCOV_ENTRY_SIZE) == 0); ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0); } @@ -232,7 +232,7 @@ common_head(int *fdp) fd = open_kcov(); ATF_REQUIRE_MSG(ioctl(fd, KIOSETBUFSIZE, - PAGE_SIZE / sizeof(uint64_t)) == 0, + PAGE_SIZE / KCOV_ENTRY_SIZE) == 0, "Unable to set the kcov buffer size"); data = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); From owner-svn-src-all@freebsd.org Thu Feb 21 09: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 3C28E14DA08D; Thu, 21 Feb 2019 09:54:12 +0000 (UTC) (envelope-from avos@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 D272F6B956; Thu, 21 Feb 2019 09:54:11 +0000 (UTC) (envelope-from avos@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 C22801BE6E; Thu, 21 Feb 2019 09:54:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9sBJX012322; Thu, 21 Feb 2019 09:54:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9sB5p012320; Thu, 21 Feb 2019 09:54:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902210954.x1L9sB5p012320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Feb 2019 09:54:11 +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: r344430 - in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata X-SVN-Commit-Revision: 344430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D272F6B956 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2019 09:54:12 -0000 Author: avos Date: Thu Feb 21 09:54:10 2019 New Revision: 344430 URL: https://svnweb.freebsd.org/changeset/base/344430 Log: MFC r344198: GC ATA_REQUEST_TIMEOUT option remnants It was removed from code in r249083 and from sys/conf/options in r249213. PR: 193935, 222170 Modified: stable/11/sys/conf/NOTES stable/11/sys/dev/ata/ata-all.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/conf/NOTES stable/12/sys/dev/ata/ata-all.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Thu Feb 21 09:43:14 2019 (r344429) +++ stable/11/sys/conf/NOTES Thu Feb 21 09:54:10 2019 (r344430) @@ -1785,14 +1785,6 @@ hint.ata.1.port="0x170" hint.ata.1.irq="15" # -# The following options are valid on the ATA driver: -# -# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request -# before timing out. - -#options ATA_REQUEST_TIMEOUT=10 - -# # Standard floppy disk controllers and floppy tapes, supports # the Y-E DATA External FDD (PC Card) # Modified: stable/11/sys/dev/ata/ata-all.h ============================================================================== --- stable/11/sys/dev/ata/ata-all.h Thu Feb 21 09:43:14 2019 (r344429) +++ stable/11/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019 (r344430) @@ -207,10 +207,6 @@ #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL -#ifndef ATA_REQUEST_TIMEOUT -#define ATA_REQUEST_TIMEOUT 10 -#endif - /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { From owner-svn-src-all@freebsd.org Thu Feb 21 09: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 A11DE14DA091; Thu, 21 Feb 2019 09:54:12 +0000 (UTC) (envelope-from avos@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 4421F6B957; Thu, 21 Feb 2019 09:54:12 +0000 (UTC) (envelope-from avos@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 368BD1BE6F; Thu, 21 Feb 2019 09:54:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9sCUB012329; Thu, 21 Feb 2019 09:54:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9sBvR012328; Thu, 21 Feb 2019 09:54:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902210954.x1L9sBvR012328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Feb 2019 09:54:11 +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: r344430 - in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/sys/conf 11/sys/dev/ata 12/sys/conf 12/sys/dev/ata X-SVN-Commit-Revision: 344430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4421F6B957 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 09:54:13 -0000 Author: avos Date: Thu Feb 21 09:54:10 2019 New Revision: 344430 URL: https://svnweb.freebsd.org/changeset/base/344430 Log: MFC r344198: GC ATA_REQUEST_TIMEOUT option remnants It was removed from code in r249083 and from sys/conf/options in r249213. PR: 193935, 222170 Modified: stable/12/sys/conf/NOTES stable/12/sys/dev/ata/ata-all.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/conf/NOTES stable/11/sys/dev/ata/ata-all.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Thu Feb 21 09:43:14 2019 (r344429) +++ stable/12/sys/conf/NOTES Thu Feb 21 09:54:10 2019 (r344430) @@ -1813,14 +1813,6 @@ hint.ata.1.port="0x170" hint.ata.1.irq="15" # -# The following options are valid on the ATA driver: -# -# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request -# before timing out. - -#options ATA_REQUEST_TIMEOUT=10 - -# # Standard floppy disk controllers and floppy tapes, supports # the Y-E DATA External FDD (PC Card) # Modified: stable/12/sys/dev/ata/ata-all.h ============================================================================== --- stable/12/sys/dev/ata/ata-all.h Thu Feb 21 09:43:14 2019 (r344429) +++ stable/12/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019 (r344430) @@ -203,10 +203,6 @@ #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL -#ifndef ATA_REQUEST_TIMEOUT -#define ATA_REQUEST_TIMEOUT 10 -#endif - /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { From owner-svn-src-all@freebsd.org Thu Feb 21 09:54: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 3792B14DA14B; Thu, 21 Feb 2019 09:54:58 +0000 (UTC) (envelope-from avos@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 CEC966BBB9; Thu, 21 Feb 2019 09:54:57 +0000 (UTC) (envelope-from avos@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 C0AE91BE72; Thu, 21 Feb 2019 09:54:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1L9sv8M012423; Thu, 21 Feb 2019 09:54:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1L9svod012421; Thu, 21 Feb 2019 09:54:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902210954.x1L9svod012421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Feb 2019 09:54:57 +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: r344431 - in stable/10/sys: conf dev/ata X-SVN-Group: stable-10 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/10/sys: conf dev/ata X-SVN-Commit-Revision: 344431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEC966BBB9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 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)[-0.999,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, 21 Feb 2019 09:54:58 -0000 Author: avos Date: Thu Feb 21 09:54:57 2019 New Revision: 344431 URL: https://svnweb.freebsd.org/changeset/base/344431 Log: MFC r344198: GC ATA_REQUEST_TIMEOUT option remnants It was removed from code in r249083 and from sys/conf/options in r249213. PR: 193935, 222170 Modified: stable/10/sys/conf/NOTES stable/10/sys/dev/ata/ata-all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Thu Feb 21 09:54:10 2019 (r344430) +++ stable/10/sys/conf/NOTES Thu Feb 21 09:54:57 2019 (r344431) @@ -1765,11 +1765,8 @@ hint.ata.1.irq="15" # # ATA_STATIC_ID: controller numbering is static ie depends on location # else the device numbers are dynamically allocated. -# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request -# before timing out. options ATA_STATIC_ID -#options ATA_REQUEST_TIMEOUT=10 # # Standard floppy disk controllers and floppy tapes, supports Modified: stable/10/sys/dev/ata/ata-all.h ============================================================================== --- stable/10/sys/dev/ata/ata-all.h Thu Feb 21 09:54:10 2019 (r344430) +++ stable/10/sys/dev/ata/ata-all.h Thu Feb 21 09:54:57 2019 (r344431) @@ -207,10 +207,6 @@ #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL -#ifndef ATA_REQUEST_TIMEOUT -#define ATA_REQUEST_TIMEOUT 10 -#endif - /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { From owner-svn-src-all@freebsd.org Thu Feb 21 10:11: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 00AA014DA57E; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@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 8CE096C36A; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@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 65B2E1C058; Thu, 21 Feb 2019 10:11:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LABGdf021112; Thu, 21 Feb 2019 10:11:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LABGQr021111; Thu, 21 Feb 2019 10:11:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902211011.x1LABGQr021111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 21 Feb 2019 10:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344432 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 344432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CE096C36A 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.932,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 10:11:17 -0000 Author: andrew Date: Thu Feb 21 10:11:15 2019 New Revision: 344432 URL: https://svnweb.freebsd.org/changeset/base/344432 Log: Allow the kcov buffer to be mmaped multiple times. After r344391 this restriction is no longer needed. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_kcov.c head/tests/sys/kern/kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Thu Feb 21 09:54:57 2019 (r344431) +++ head/sys/kern/kern_kcov.c Thu Feb 21 10:11:15 2019 (r344432) @@ -127,7 +127,6 @@ struct kcov_info { size_t bufsize; /* (o) */ kcov_state_t state; /* (s) */ int mode; /* (l) */ - bool mmap; }; /* Prototypes */ @@ -303,7 +302,6 @@ kcov_open(struct cdev *dev, int oflags, int devtype, s info->state = KCOV_STATE_OPEN; info->thread = NULL; info->mode = -1; - info->mmap = false; if ((error = devfs_set_cdevpriv(info, kcov_mmap_cleanup)) != 0) kcov_mmap_cleanup(info); @@ -344,12 +342,10 @@ kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offse if ((error = devfs_get_cdevpriv((void **)&info)) != 0) return (error); - if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries || - info->mmap != false) + if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries) return (EINVAL); vm_object_reference(info->bufobj); - info->mmap = true; *offset = 0; *object = info->bufobj; return (0); Modified: head/tests/sys/kern/kcov.c ============================================================================== --- head/tests/sys/kern/kcov.c Thu Feb 21 09:54:57 2019 (r344431) +++ head/tests/sys/kern/kcov.c Thu Feb 21 10:11:15 2019 (r344432) @@ -80,7 +80,7 @@ ATF_TC_BODY(kcov_bufsize, tc) ATF_TC_WITHOUT_HEAD(kcov_mmap); ATF_TC_BODY(kcov_mmap, tc) { - void *data; + void *data1, *data2; int fd; fd = open_kcov(); @@ -95,12 +95,18 @@ ATF_TC_BODY(kcov_mmap, tc) fd, 0) == MAP_FAILED); ATF_CHECK(mmap(NULL, 3 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) == MAP_FAILED); - ATF_REQUIRE((data = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, + ATF_REQUIRE((data1 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) != MAP_FAILED); - ATF_CHECK(mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, - fd, 0) == MAP_FAILED); + ATF_REQUIRE((data2 = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE, + MAP_SHARED, fd, 0)) != MAP_FAILED); - munmap(data, 2 * PAGE_SIZE); + *(uint64_t *)data1 = 0x123456789abcdeful; + ATF_REQUIRE(*(uint64_t *)data2 == 0x123456789abcdefull); + *(uint64_t *)data2 = 0xfedcba9876543210ul; + ATF_REQUIRE(*(uint64_t *)data1 == 0xfedcba9876543210ull); + + munmap(data1, 2 * PAGE_SIZE); + munmap(data2, 2 * PAGE_SIZE); close(fd); } From owner-svn-src-all@freebsd.org Thu Feb 21 10:35: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 C6FC514DB464; Thu, 21 Feb 2019 10:35:33 +0000 (UTC) (envelope-from tuexen@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 6C6496D216; Thu, 21 Feb 2019 10:35:33 +0000 (UTC) (envelope-from tuexen@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 5D1F41C558; Thu, 21 Feb 2019 10:35:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LAZXuC033119; Thu, 21 Feb 2019 10:35:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LAZXM2033118; Thu, 21 Feb 2019 10:35:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902211035.x1LAZXM2033118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Feb 2019 10:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344433 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C6496D216 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)[-0.999,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: Thu, 21 Feb 2019 10:35:34 -0000 Author: tuexen Date: Thu Feb 21 10:35:32 2019 New Revision: 344433 URL: https://svnweb.freebsd.org/changeset/base/344433 Log: The receive buffer autoscaling for TCP is based on a linear growth, which is acceptable in the congestion avoidance phase, but not during slow start. The MTU is is also not taken into account. Use a method instead, which is based on exponential growth working also in slow start and being independent from the MTU. This is joint work with rrs@. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18375 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Feb 21 10:11:15 2019 (r344432) +++ head/sys/netinet/tcp_input.c Thu Feb 21 10:35:32 2019 (r344433) @@ -212,11 +212,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLF &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); -VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(tcp_autorcvbuf_inc), 0, - "Incrementor step size of automatic receive buffer"); - VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, @@ -1449,13 +1444,16 @@ drop: * The criteria to step up the receive buffer one notch are: * 1. Application has not set receive buffer size with * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. - * 2. the number of bytes received during the time it takes - * one timestamp to be reflected back to us (the RTT); - * 3. received bytes per RTT is within seven eighth of the - * current socket buffer size; - * 4. receive buffer size has not hit maximal automatic size; + * 2. the number of bytes received during 1/2 of an sRTT + * is at least 3/8 of the current socket buffer size. + * 3. receive buffer size has not hit maximal automatic size; * - * This algorithm does one step per RTT at most and only if + * If all of the criteria are met we increaset the socket buffer + * by a 1/2 (bounded by the max). This allows us to keep ahead + * of slow-start but also makes it so our peer never gets limited + * by our rwnd which we then open up causing a burst. + * + * This algorithm does two steps per RTT at most and only if * we receive a bulk stream w/o packet losses or reorderings. * Shrinking the buffer during idle times is not necessary as * it doesn't consume any memory when idle. @@ -1472,11 +1470,10 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, stru if (V_tcp_do_autorcvbuf && (so->so_rcv.sb_flags & SB_AUTOSIZE) && tp->t_srtt != 0 && tp->rfbuf_ts != 0 && TCP_TS_TO_TICKS(tcp_ts_getticks() - tp->rfbuf_ts) > - (tp->t_srtt >> TCP_RTT_SHIFT)) { - if (tp->rfbuf_cnt > (so->so_rcv.sb_hiwat / 8 * 7) && + ((tp->t_srtt >> TCP_RTT_SHIFT)/2)) { + if (tp->rfbuf_cnt > ((so->so_rcv.sb_hiwat / 2)/ 4 * 3) && so->so_rcv.sb_hiwat < V_tcp_autorcvbuf_max) { - newsize = min(so->so_rcv.sb_hiwat + - V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); + newsize = min((so->so_rcv.sb_hiwat + (so->so_rcv.sb_hiwat/2)), V_tcp_autorcvbuf_max); } TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); From owner-svn-src-all@freebsd.org Thu Feb 21 12:09: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 AFD3C14DE708; Thu, 21 Feb 2019 12:09:05 +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 5132C70054; Thu, 21 Feb 2019 12:09:05 +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 40C9A1D47C; Thu, 21 Feb 2019 12:09:05 +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 x1LC95i0079607; Thu, 21 Feb 2019 12:09:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LC95pW079606; Thu, 21 Feb 2019 12:09:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902211209.x1LC95pW079606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Feb 2019 12:09:05 +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: r344434 - stable/12/sys/i386/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/include X-SVN-Commit-Revision: 344434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5132C70054 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.942,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 12:09:05 -0000 Author: kib Date: Thu Feb 21 12:09:04 2019 New Revision: 344434 URL: https://svnweb.freebsd.org/changeset/base/344434 Log: MFC r344118: Provide userspace versions of do_cpuid() and cpuid_count() on i386. Modified: stable/12/sys/i386/include/cpufunc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/include/cpufunc.h ============================================================================== --- stable/12/sys/i386/include/cpufunc.h Thu Feb 21 10:35:32 2019 (r344433) +++ stable/12/sys/i386/include/cpufunc.h Thu Feb 21 12:09:04 2019 (r344434) @@ -108,21 +108,47 @@ disable_intr(void) __asm __volatile("cli" : : : "memory"); } +#ifdef _KERNEL static __inline void do_cpuid(u_int ax, u_int *p) { __asm __volatile("cpuid" - : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax)); } static __inline void cpuid_count(u_int ax, u_int cx, u_int *p) { __asm __volatile("cpuid" - : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax), "c" (cx)); + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax), "c" (cx)); } +#else +static __inline void +do_cpuid(u_int ax, u_int *p) +{ + __asm __volatile( + "pushl\t%%ebx\n\t" + "cpuid\n\t" + "movl\t%%ebx,%1\n\t" + "popl\t%%ebx" + : "=a" (p[0]), "=DS" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax)); +} + +static __inline void +cpuid_count(u_int ax, u_int cx, u_int *p) +{ + __asm __volatile( + "pushl\t%%ebx\n\t" + "cpuid\n\t" + "movl\t%%ebx,%1\n\t" + "popl\t%%ebx" + : "=a" (p[0]), "=DS" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax), "c" (cx)); +} +#endif static __inline void enable_intr(void) From owner-svn-src-all@freebsd.org Thu Feb 21 12:10: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 75E2814DE7D8; Thu, 21 Feb 2019 12:10:57 +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 1A86070207; Thu, 21 Feb 2019 12:10:57 +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 0CCD11D4A7; Thu, 21 Feb 2019 12:10:57 +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 x1LCAu4t080479; Thu, 21 Feb 2019 12:10:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LCAuV5080478; Thu, 21 Feb 2019 12:10:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902211210.x1LCAuV5080478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Feb 2019 12:10: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: r344435 - stable/12/lib/libc/x86/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/x86/sys X-SVN-Commit-Revision: 344435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A86070207 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.942,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 12:10:57 -0000 Author: kib Date: Thu Feb 21 12:10:56 2019 New Revision: 344435 URL: https://svnweb.freebsd.org/changeset/base/344435 Log: MFC r344119: x86 __vdso_gettc(): use machine/cpufunc.h function for CPUID. Modified: stable/12/lib/libc/x86/sys/__vdso_gettc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- stable/12/lib/libc/x86/sys/__vdso_gettc.c Thu Feb 21 12:09:04 2019 (r344434) +++ stable/12/lib/libc/x86/sys/__vdso_gettc.c Thu Feb 21 12:10:56 2019 (r344435) @@ -54,31 +54,6 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" static void -cpuidp(u_int leaf, u_int p[4]) -{ - - __asm __volatile( -#if defined(__i386__) - " pushl %%ebx\n" -#endif - " cpuid\n" -#if defined(__i386__) - " movl %%ebx,%1\n" - " popl %%ebx" -#endif - : "=a" (p[0]), -#if defined(__i386__) - "=r" (p[1]), -#elif defined(__amd64__) - "=b" (p[1]), -#else -#error "Arch" -#endif - "=c" (p[2]), "=d" (p[3]) - : "0" (leaf)); -} - -static void rdtsc_mb_lfence(void) { @@ -100,12 +75,12 @@ rdtsc_mb_none(void) DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static) { u_int p[4]; - /* Not a typo, string matches our cpuidp() registers use. */ + /* Not a typo, string matches our do_cpuid() registers use. */ static const char intel_id[] = "GenuntelineI"; if ((cpu_feature & CPUID_SSE2) == 0) return (rdtsc_mb_none); - cpuidp(0, p); + do_cpuid(0, p); return (memcmp(p + 1, intel_id, sizeof(intel_id) - 1) == 0 ? rdtsc_mb_lfence : rdtsc_mb_mfence); } From owner-svn-src-all@freebsd.org Thu Feb 21 12:13: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 3F1CA14DEAA6; Thu, 21 Feb 2019 12:13:29 +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 D36B0705BC; Thu, 21 Feb 2019 12:13:28 +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 828621D61E; Thu, 21 Feb 2019 12:13:28 +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 x1LCDSo1084649; Thu, 21 Feb 2019 12:13:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LCDRBW084646; Thu, 21 Feb 2019 12:13:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902211213.x1LCDRBW084646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Feb 2019 12:13: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: r344436 - in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Commit-Revision: 344436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D36B0705BC 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,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, 21 Feb 2019 12:13:29 -0000 Author: kib Date: Thu Feb 21 12:13:27 2019 New Revision: 344436 URL: https://svnweb.freebsd.org/changeset/base/344436 Log: MFC r344120: Unify i386 and amd64 getcontextx.c, and use ifuncs while there. Added: stable/12/lib/libc/x86/gen/ - copied from r344120, head/lib/libc/x86/gen/ Deleted: stable/12/lib/libc/amd64/gen/getcontextx.c stable/12/lib/libc/i386/gen/getcontextx.c Modified: stable/12/lib/libc/Makefile stable/12/lib/libc/amd64/gen/Makefile.inc stable/12/lib/libc/i386/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/Makefile ============================================================================== --- stable/12/lib/libc/Makefile Thu Feb 21 12:10:56 2019 (r344435) +++ stable/12/lib/libc/Makefile Thu Feb 21 12:13:27 2019 (r344436) @@ -120,6 +120,7 @@ NOASM= .endif .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" .include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.include "${LIBC_SRCTOP}/x86/gen/Makefile.inc" .endif .if ${MK_NIS} != "no" CFLAGS+= -DYP Modified: stable/12/lib/libc/amd64/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/gen/Makefile.inc Thu Feb 21 12:10:56 2019 (r344435) +++ stable/12/lib/libc/amd64/gen/Makefile.inc Thu Feb 21 12:13:27 2019 (r344436) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ - fabs.S getcontextx.c \ + fabs.S \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ fpgetround.c fpsetround.c fpgetsticky.c Modified: stable/12/lib/libc/i386/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/i386/gen/Makefile.inc Thu Feb 21 12:10:56 2019 (r344435) +++ stable/12/lib/libc/i386/gen/Makefile.inc Thu Feb 21 12:13:27 2019 (r344436) @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \ - flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \ + flt_rounds.c infinity.c ldexp.c makecontext.c \ rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S From owner-svn-src-all@freebsd.org Thu Feb 21 12:35: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 4092114DF119; Thu, 21 Feb 2019 12:35:53 +0000 (UTC) (envelope-from kevans@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 C61CF70EBB; Thu, 21 Feb 2019 12:35:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 7511BA5D4; Thu, 21 Feb 2019 12:35:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f51.google.com with SMTP id j1so20220901lfb.10; Thu, 21 Feb 2019 04:35:52 -0800 (PST) X-Gm-Message-State: AHQUAuboRkIvWICByJeKIDTdjJL4ImlSxVqBR20VKbxMN6n7Y9ycITZK LbmWv3z9iXMOro5wPrES+/PYOXaTixH+O+fpjII= X-Google-Smtp-Source: AHgI3IYT174TBhXDOVj4KHWhBlr9ujKJ1xeX/b24dUOBS1jWDyuUOtaaeN3ztSjrYbwhBPPQmOs8rjFFKQX+EIxX2kI= X-Received: by 2002:a19:c50c:: with SMTP id w12mr23621039lfe.53.1550752550923; Thu, 21 Feb 2019 04:35:50 -0800 (PST) MIME-Version: 1.0 References: <201902210348.x1L3meFu018887@repo.freebsd.org> <201902210620.x1L6KGnv018738@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902210620.x1L6KGnv018738@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 21 Feb 2019 06:35:39 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344418 - stable/11 To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C61CF70EBB 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,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, 21 Feb 2019 12:35:53 -0000 On Thu, Feb 21, 2019 at 12:20 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Thu Feb 21 03:48:39 2019 > > New Revision: 344418 > > URL: https://svnweb.freebsd.org/changeset/base/344418 > > > > Log: > > Direct commit for post-mortem UPDATING update regarding lualoader > > > > Indicate that it's been merged (after some delay since lua came back to this > > branch) and how one can test lua, both by swapping build knobs and creating > > links in /boot. > > > > Modified: > > stable/11/UPDATING > > > > Modified: stable/11/UPDATING > > ============================================================================== > > --- stable/11/UPDATING Thu Feb 21 03:39:51 2019 (r344417) > > +++ stable/11/UPDATING Thu Feb 21 03:48:39 2019 (r344418) > > @@ -17,6 +17,20 @@ the tip of head, and then rebuild without this option. > > from older version of current across the gcc/clang cutover is a bit fragile. > > > > 20190220: > > + Co-existance for Forth and Lua interpreters in bootloaders has now been > > + merged to ease testing of lualoader. LOADER_DEFAULT_INTERP, documented > > + in build(7), may be used to control which interpreter flavor is used in > > + the default loader to be installed. For systems where Lua and Forth > > + coexist, this switch can also be made on a running system by creating a > > + link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather > ^. missing > And is not the direction of that link reversed? > /boot/loader_${,.efi} -> /boot/loader_${flavor}{,.efi} > is what I would expect the link to be for this. > Whoops. Will fix shortly, thanks! Kyle Evans From owner-svn-src-all@freebsd.org Thu Feb 21 12:44: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 2A5BA14DFAFB; Thu, 21 Feb 2019 12:44:00 +0000 (UTC) (envelope-from kevans@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 C1D8A716A4; Thu, 21 Feb 2019 12:43:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 66CE1A6FB; Thu, 21 Feb 2019 12:43:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f181.google.com with SMTP id j19so23073735ljg.5; Thu, 21 Feb 2019 04:43:59 -0800 (PST) X-Gm-Message-State: AHQUAubvFVFTIuO+Xv8YgCLnistAtCPQUuG9m42iAUu3YpNkD5kdiq/G Qt1N9SrMEyqUbUXtKY7XTljDwHd7v0GbgdNIzeQ= X-Google-Smtp-Source: AHgI3Ia+ROueJ0zSSIUfHm0qHeZUiKroACHMGNUpMRxvLg3C3hZVJQOLNgqWigdO1UZbDq9hwyHQLK5Mq7xtb2bZIvw= X-Received: by 2002:a2e:9f49:: with SMTP id v9mr23409622ljk.77.1550753037840; Thu, 21 Feb 2019 04:43:57 -0800 (PST) MIME-Version: 1.0 References: <201902210322.x1L3MKeV007120@repo.freebsd.org> <201902210616.x1L6G7SV018721@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902210616.x1L6G7SV018721@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 21 Feb 2019 06:43:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344414 - stable/11 To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C1D8A716A4 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.950,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, 21 Feb 2019 12:44:00 -0000 On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Thu Feb 21 03:22:20 2019 > > New Revision: 344414 > > URL: https://svnweb.freebsd.org/changeset/base/344414 > > > > Log: > > MFC (RECORD ONLY) r338050: Loader default interpreter flip > > > > The default interpreter for stable/11 is 4th; this will never and can never > > change. Record MFC of r338050 to proactively prevent any accidents in future > > batching of MFCs. > > > > Modified: > > Directory Properties: > > stable/11/ (props changed) > > Does it make sense to do a direct commit to stable/11 > marking the line that does this flip with a > "Do not change this in the stable/11 branch" > so that someone does not try to manually merge > the change if they happen to notice the code > is different? > I'll chew on it for a little bit. It's fairly clear what the ramifications of swapping those lines around are, even from diff review, and I'd like to assume no one would willfully do it if they put a couple seconds thought into what they were about to commit. From owner-svn-src-all@freebsd.org Thu Feb 21 14:10: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 7F55214E1EDC; Thu, 21 Feb 2019 14:10:15 +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 21CAF743FF; Thu, 21 Feb 2019 14:10:15 +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 126411E8DB; Thu, 21 Feb 2019 14:10:15 +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 x1LEAElX042272; Thu, 21 Feb 2019 14:10:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LEAEa2042271; Thu, 21 Feb 2019 14:10:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902211410.x1LEAEa2042271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 14:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344437 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 344437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21CAF743FF 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-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: Thu, 21 Feb 2019 14:10:15 -0000 Author: mav Date: Thu Feb 21 14:10:14 2019 New Revision: 344437 URL: https://svnweb.freebsd.org/changeset/base/344437 Log: Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. Its a hack, we can't know/list all DMA engines, but this covers all I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 (r344436) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 (r344437) @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) if (sc->alut) PNTX_WRITE(sc, 0xc94, 0); - /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ - PNTX_WRITE(sc, 0xdb4, 0x00090001); + /* Enable all Link Interface LUT entries for peer. */ + for (i = 0; i < 32; i += 2) { + PNTX_WRITE(sc, 0xdb4 + i * 2, + 0x00010001 | ((i + 1) << 19) | (i << 3)); + } } /* - * Enable Virtual Interface LUT entry 0 for 0:0.0 and - * entry 1 for our Requester ID reported by chip. + * Enable Virtual Interface LUT entry 0 for 0:0.*. + * entry 1 for our Requester ID reported by the chip, + * entries 2-5 for 0/64/128/192:4.* of I/OAT DMA engines. + * XXX: Its a hack, we can't know all DMA engines, but this covers all + * I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. */ val = (NTX_READ(sc, 0xc90) << 16) | 0x00010001; NTX_WRITE(sc, sc->link ? 0xdb4 : 0xd94, val); + NTX_WRITE(sc, sc->link ? 0xdb8 : 0xd98, 0x40210021); + NTX_WRITE(sc, sc->link ? 0xdbc : 0xd9c, 0xc0218021); /* Set Link to Virtual address translation. */ for (i = 0; i < sc->mw_count; i++) { From owner-svn-src-all@freebsd.org Thu Feb 21 15:08: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 C5A6B14E43B1; Thu, 21 Feb 2019 15:08:28 +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 786F376C68; Thu, 21 Feb 2019 15:08:28 +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 691AF1F360; Thu, 21 Feb 2019 15:08:28 +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 x1LF8SiL074408; Thu, 21 Feb 2019 15:08:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LF8QeC074396; Thu, 21 Feb 2019 15:08:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902211508.x1LF8QeC074396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Feb 2019 15:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344438 - in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Commit-Revision: 344438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 786F376C68 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,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, 21 Feb 2019 15:08:29 -0000 Author: emaste Date: Thu Feb 21 15:08:25 2019 New Revision: 344438 URL: https://svnweb.freebsd.org/changeset/base/344438 Log: svn: support building with WITH_PIE Subversion builds and links against its own .a archives using local rules, so did not benefit from with the WITH_PIE library support added in r344179. Apply the same _pie suffix locally. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D19246 Modified: head/usr.bin/svn/Makefile.inc head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svnbench/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnfsfs/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile Modified: head/usr.bin/svn/Makefile.inc ============================================================================== --- head/usr.bin/svn/Makefile.inc Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/Makefile.inc Thu Feb 21 15:08:25 2019 (r344438) @@ -2,13 +2,14 @@ .include -MK_PIE:= no # Explicit libXXX.a references - .if ${MK_SVN} == "yes" SVNLITE?= .else SVNLITE?= lite .endif +.if ${MK_PIE} != "no" +PIE_SUFFIX= _pie +.endif PACKAGE= svn @@ -40,23 +41,23 @@ LIBSVN_REPOSDIR= ${.OBJDIR:H}/lib/libsvn_repos LIBSVN_SUBRDIR= ${.OBJDIR:H}/lib/libsvn_subr LIBSVN_WCDIR= ${.OBJDIR:H}/lib/libsvn_wc -LIBAPR= ${LIBAPRDIR}/libapr.a -LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a -LIBSERF= ${LIBSERFDIR}/libserf.a +LIBAPR= ${LIBAPRDIR}/libapr${PIE_SUFFIX}.a +LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util${PIE_SUFFIX}.a +LIBSERF= ${LIBSERFDIR}/libserf${PIE_SUFFIX}.a -LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client.a -LIBSVN_DELTA= ${LIBSVN_DELTADIR}/libsvn_delta.a -LIBSVN_DIFF= ${LIBSVN_DIFFDIR}/libsvn_diff.a -LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs.a -LIBSVN_FS_FS= ${LIBSVN_FS_FSDIR}/libsvn_fs_fs.a -LIBSVN_FS_UTIL= ${LIBSVN_FS_UTILDIR}/libsvn_fs_util.a -LIBSVN_FS_X= ${LIBSVN_FS_XDIR}/libsvn_fs_x.a -LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra.a -LIBSVN_RA_LOCAL= ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local.a -LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn.a -LIBSVN_RA_SERF= ${LIBSVN_RA_SERFDIR}/libsvn_ra_serf.a -LIBSVN_REPOS= ${LIBSVN_REPOSDIR}/libsvn_repos.a -LIBSVN_SUBR= ${LIBSVN_SUBRDIR}/libsvn_subr.a -LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc.a +LIBSVN_CLIENT= ${LIBSVN_CLIENTDIR}/libsvn_client${PIE_SUFFIX}.a +LIBSVN_DELTA= ${LIBSVN_DELTADIR}/libsvn_delta${PIE_SUFFIX}.a +LIBSVN_DIFF= ${LIBSVN_DIFFDIR}/libsvn_diff${PIE_SUFFIX}.a +LIBSVN_FS= ${LIBSVN_FSDIR}/libsvn_fs${PIE_SUFFIX}.a +LIBSVN_FS_FS= ${LIBSVN_FS_FSDIR}/libsvn_fs_fs${PIE_SUFFIX}.a +LIBSVN_FS_UTIL= ${LIBSVN_FS_UTILDIR}/libsvn_fs_util${PIE_SUFFIX}.a +LIBSVN_FS_X= ${LIBSVN_FS_XDIR}/libsvn_fs_x${PIE_SUFFIX}.a +LIBSVN_RA= ${LIBSVN_RADIR}/libsvn_ra${PIE_SUFFIX}.a +LIBSVN_RA_LOCAL= ${LIBSVN_RA_LOCALDIR}/libsvn_ra_local${PIE_SUFFIX}.a +LIBSVN_RA_SVN= ${LIBSVN_RA_SVNDIR}/libsvn_ra_svn${PIE_SUFFIX}.a +LIBSVN_RA_SERF= ${LIBSVN_RA_SERFDIR}/libsvn_ra_serf${PIE_SUFFIX}.a +LIBSVN_REPOS= ${LIBSVN_REPOSDIR}/libsvn_repos${PIE_SUFFIX}.a +LIBSVN_SUBR= ${LIBSVN_SUBRDIR}/libsvn_subr${PIE_SUFFIX}.a +LIBSVN_WC= ${LIBSVN_WCDIR}/libsvn_wc${PIE_SUFFIX}.a .endif Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svn/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -26,23 +26,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z magic crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ Modified: head/usr.bin/svn/svnadmin/Makefile ============================================================================== --- head/usr.bin/svn/svnadmin/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnadmin/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnbench/Makefile ============================================================================== --- head/usr.bin/svn/svnbench/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnbench/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -19,23 +19,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z magic crypto ssl pthread Modified: head/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- head/usr.bin/svn/svndumpfilter/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svndumpfilter/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypt pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnfsfs/Makefile ============================================================================== --- head/usr.bin/svn/svnfsfs/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnfsfs/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,15 +18,15 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnlook/Makefile ============================================================================== --- head/usr.bin/svn/svnlook/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnlook/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,16 +18,16 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_REPOS} ${LIBSVN_FS} ${LIBSVN_FS_FS} ${LIBSVN_FS_UTIL} \ Modified: head/usr.bin/svn/svnmucc/Makefile ============================================================================== --- head/usr.bin/svn/svnmucc/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnmucc/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,23 +18,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} \ Modified: head/usr.bin/svn/svnrdump/Makefile ============================================================================== --- head/usr.bin/svn/svnrdump/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnrdump/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,23 +18,23 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client \ - -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_CLIENTDIR} -lsvn_client${PIE_SUFFIX} \ + -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \ Modified: head/usr.bin/svn/svnserve/Makefile ============================================================================== --- head/usr.bin/svn/svnserve/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnserve/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,20 +18,20 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ Modified: head/usr.bin/svn/svnsync/Makefile ============================================================================== --- head/usr.bin/svn/svnsync/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnsync/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,20 +18,20 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_RADIR} -lsvn_ra \ - -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local \ - -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn \ - -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf \ - -L${LIBSVN_REPOSDIR} -lsvn_repos \ - -L${LIBSVN_FSDIR} -lsvn_fs \ - -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs \ - -L${LIBSVN_FS_XDIR} -lsvn_fs_x \ - -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBSERFDIR} -lserf \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_RADIR} -lsvn_ra${PIE_SUFFIX} \ + -L${LIBSVN_RA_LOCALDIR} -lsvn_ra_local${PIE_SUFFIX} \ + -L${LIBSVN_RA_SVNDIR} -lsvn_ra_svn${PIE_SUFFIX} \ + -L${LIBSVN_RA_SERFDIR} -lsvn_ra_serf${PIE_SUFFIX} \ + -L${LIBSVN_REPOSDIR} -lsvn_repos${PIE_SUFFIX} \ + -L${LIBSVN_FSDIR} -lsvn_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_FSDIR} -lsvn_fs_fs${PIE_SUFFIX} \ + -L${LIBSVN_FS_XDIR} -lsvn_fs_x${PIE_SUFFIX} \ + -L${LIBSVN_FS_UTILDIR} -lsvn_fs_util${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBSERFDIR} -lserf${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD= bsdxml sqlite3 z crypto ssl pthread DPADD= ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} ${LIBSVN_RA_SVN} ${LIBSVN_RA_SERF} \ Modified: head/usr.bin/svn/svnversion/Makefile ============================================================================== --- head/usr.bin/svn/svnversion/Makefile Thu Feb 21 14:10:14 2019 (r344437) +++ head/usr.bin/svn/svnversion/Makefile Thu Feb 21 15:08:25 2019 (r344438) @@ -18,12 +18,12 @@ CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} -I${APRU}/include/private \ -I${APRU}/include -LDADD= -L${LIBSVN_WCDIR} -lsvn_wc \ - -L${LIBSVN_DELTADIR} -lsvn_delta \ - -L${LIBSVN_DIFFDIR} -lsvn_diff \ - -L${LIBSVN_SUBRDIR} -lsvn_subr \ - -L${LIBAPR_UTILDIR} -lapr-util \ - -L${LIBAPRDIR} -lapr +LDADD= -L${LIBSVN_WCDIR} -lsvn_wc${PIE_SUFFIX} \ + -L${LIBSVN_DELTADIR} -lsvn_delta${PIE_SUFFIX} \ + -L${LIBSVN_DIFFDIR} -lsvn_diff${PIE_SUFFIX} \ + -L${LIBSVN_SUBRDIR} -lsvn_subr${PIE_SUFFIX} \ + -L${LIBAPR_UTILDIR} -lapr-util${PIE_SUFFIX} \ + -L${LIBAPRDIR} -lapr${PIE_SUFFIX} LIBADD+= bsdxml sqlite3 z pthread DPADD= ${LIBSVN_WC} ${LIBSVN_DELTA} ${LIBSVN_DIFF} ${LIBSVN_SUBR} \ From owner-svn-src-all@freebsd.org Thu Feb 21 15:29: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 CA94714E4C8C for ; Thu, 21 Feb 2019 15:29:50 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 933347769F for ; Thu, 21 Feb 2019 15:29:49 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-qk1-x742.google.com with SMTP id f196so4466291qke.10 for ; Thu, 21 Feb 2019 07:29:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7O8B8NiQCRhhilisquiHkWkqKzojKEJDUHqSyvgYLLM=; b=ilACJBXcz7mdZMRXEgu9i6IMvzkPf3KoZCHDe8t5MQTLp3XvHKOPXjbezbo8aJSSWT fKO5ROGvhNJrqKln9aRD2Nt7qCCngnksnSgpKv9/roqXcik8LWkCz78KK008RuDUPuIw w7N/cg3bN/mLz4Jm7+J/nWXcKmepeY6v8TZAhbljOngwXfG1kwNtJErpoHYL52PpGqVi AWkhsTHgZhTUPj0EdFeZj1SJeWwTUvN9rcKxNE4E2OQkvdk+s0dxv51KWyMIQIwFeavx DgcGJ5VfCJXVWckeTiQ2D4jGzYrQq9gCwrzqHdu4EiJJVIpTi37eeq1Prl+zzetn/M7k 3X+w== X-Gm-Message-State: AHQUAuYjc8tk49TBxyZHmTl7vwjaugNDmV+GyVXMlFK84RKzIYTEHvrW Rxa/HQYtytCBoHJkwYAaeoYjVw== X-Google-Smtp-Source: AHgI3Iaj6KvBeXPBcqwY01apj5i6ECMvcqH3rYd2DbDu+7+XPP007ZxHo0I9e9R/hJIHG9qwN9WQIA== X-Received: by 2002:a37:a783:: with SMTP id q125mr22998180qke.264.1550762988648; Thu, 21 Feb 2019 07:29:48 -0800 (PST) Received: from ?IPv6:2607:fb10:7061:7fd::8d34? ([2607:fb10:7061:7fd::8d34]) by smtp.gmail.com with ESMTPSA id k27sm2165688qki.19.2019.02.21.07.29.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 07:29:47 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r344099 - head/sys/net From: Randall Stewart In-Reply-To: <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> Date: Thu, 21 Feb 2019 10:29:46 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 933347769F X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.40 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; NEURAL_HAM_SHORT(-0.90)[-0.898,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.01)[ip: (4.72), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-1.99), country: US(-0.07)]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2019 15:29:51 -0000 > On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >=20 > On 2/13/19 10:03 AM, Randall Stewart wrote: >> oh and one other thing.. >>=20 >> It was *not* a random IFP.. it was the IFP to the lagg. >>=20 >> I.e. an alloc() was done to the lagg.. and the free was >> done back to the same IFP (that provided the allocate). >=20 > Yes, that's wrong. Suppose the route changes so that my traffic is = now over > em0 instead of lagg0 (where em0 isn't a member of the lagg), how do = you > expect if_lagg_free to invoke em0's free routine? In your case it = does, > but only by accident. It doesn't work in the other case I described = which > is if you have non-lagg interfaces and a route moves from cc0 to em0. = In > that case your existing code that is using the wrong ifp will just = panic. >=20 > These aren't real alloc routines as the lagg and vlan ones don't = allocate > anything, they pass along the request to the child and the child = allocates > the tag. Only ifnet's that actually allocate tags should need to free = them, > and you should be using tag->ifp to as the ifp whose if_snd_tag_free = works. But thats what the lagg=E2=80=99s routine does, use the tag sent in to find the real ifp (where the tag was allocated) and call the if_snd_tag_free() on that. Its not an accident it works, it calls the free of the actual interface where the allocation came from. I don=E2=80=99t see how it would panic. R >=20 >> R >>=20 >>> On Feb 13, 2019, at 1:02 PM, Randall Stewart = wrote: >>>=20 >>> I disagree. If you define an alloc it is only >>> reciprocal that you should define a free. >>>=20 >>> The code in question that hit this was changed (its in a version >>> of rack that has the rate-limit and TLS code).. but I think these >>> things *should* be balanced.. if you provide an Allocate, you >>> should also provide a Free=E2=80=A6=20 >>>=20 >>> R >>>=20 >>>=20 >>>> On Feb 13, 2019, at 12:09 PM, John Baldwin wrote: >>>>=20 >>>> On 2/13/19 6:57 AM, Randall Stewart wrote: >>>>> Author: rrs >>>>> Date: Wed Feb 13 14:57:59 2019 >>>>> New Revision: 344099 >>>>> URL: https://svnweb.freebsd.org/changeset/base/344099 >>>>>=20 >>>>> Log: >>>>> This commit adds the missing release mechanism for the >>>>> ratelimiting code. The two modules (lagg and vlan) did have >>>>> allocation routines, and even though they are indirect (and >>>>> vector down to the underlying interfaces) they both need to >>>>> have a free routine (that also vectors down to the actual = interface). >>>>>=20 >>>>> Sponsored by: Netflix Inc. >>>>> Differential Revision: https://reviews.freebsd.org/D19032 >>>>=20 >>>> Hmm, I don't understand why you'd ever invoke if_snd_tag_free from = anything >>>> but 'tag->ifp' rather than some other ifp. What if the route for a = connection >>>> moves so that a tag allocated on cc0 is now on a route that goes = over em0? >>>> You can't expect em0 to have an if_snd_tag_free routine that will = know to >>>> go invoke cxgbe's snd_tag_free. I think you should always be using >>>> 'tag->ifp->if_snd_tag_free' to free tags and never using any other = ifp. >>>>=20 >>>> That is, I think this should be reverted and that instead you need = to fix >>>> the code invoking if_snd_tag_free to invoke it on the tag's ifp = instead of >>>> some random other ifp. >>>>=20 >>>> --=20 >>>> John Baldwin >>>>=20 >>>>=20 >>>=20 >>> ------ >>> Randall Stewart >>> rrs@netflix.com >>>=20 >>>=20 >>>=20 >>=20 >> ------ >> Randall Stewart >> rrs@netflix.com >>=20 >>=20 >>=20 >=20 >=20 > --=20 > John Baldwin ------ Randall Stewart rrs@netflix.com From owner-svn-src-all@freebsd.org Thu Feb 21 15:31: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 DB3EC14E4D49; Thu, 21 Feb 2019 15:31:02 +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 38A8A779D6; Thu, 21 Feb 2019 15:31:02 +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 C30F41F6FE; Thu, 21 Feb 2019 15:31:01 +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 x1LFV188085732; Thu, 21 Feb 2019 15:31:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LFV1vg085731; Thu, 21 Feb 2019 15:31:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902211531.x1LFV1vg085731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 15:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r344439 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: markj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 344439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38A8A779D6 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)[-0.999,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, 21 Feb 2019 15:31:03 -0000 Author: markj Date: Thu Feb 21 15:31:01 2019 New Revision: 344439 URL: https://svnweb.freebsd.org/changeset/base/344439 Log: Release lwhsu from mentorship. Discussed with: emaste Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Feb 21 15:08:25 2019 (r344438) +++ svnadmin/conf/mentors Thu Feb 21 15:31:01 2019 (r344439) @@ -23,7 +23,6 @@ jkh rwatson jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko leitao jhibbits Co-mentor: nwhitehorn -lwhsu markj Co-mentor: emaste mahrens mckusick miwi araujo mjoras rstone From owner-svn-src-all@freebsd.org Thu Feb 21 15:44: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 B202214E53C5; Thu, 21 Feb 2019 15:44:33 +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 4D3D080078; Thu, 21 Feb 2019 15:44:33 +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 3AABD1FA1D; Thu, 21 Feb 2019 15:44:33 +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 x1LFiX5a094849; Thu, 21 Feb 2019 15:44:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LFiXOf094848; Thu, 21 Feb 2019 15:44:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902211544.x1LFiXOf094848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 15:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344440 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D3D080078 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)[-0.999,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, 21 Feb 2019 15:44:33 -0000 Author: markj Date: Thu Feb 21 15:44:32 2019 New Revision: 344440 URL: https://svnweb.freebsd.org/changeset/base/344440 Log: Clear pointers to indicate that the respective locks are released. This fixes a problem in r344231: vm_pageout_launder() may scan two queues when swap is disabled. Reported by: pho MFC with: r344231 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Feb 21 15:31:01 2019 (r344439) +++ head/sys/vm/vm_pageout.c Thu Feb 21 15:44:32 2019 (r344440) @@ -893,10 +893,14 @@ free_page: object = NULL; } } - if (mtx != NULL) + if (mtx != NULL) { mtx_unlock(mtx); - if (object != NULL) + mtx = NULL; + } + if (object != NULL) { VM_OBJECT_WUNLOCK(object); + object = NULL; + } vm_pagequeue_lock(pq); vm_pageout_end_scan(&ss); vm_pagequeue_unlock(pq); From owner-svn-src-all@freebsd.org Thu Feb 21 16: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 412C414E6D73; Thu, 21 Feb 2019 16:28:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 978508206D; Thu, 21 Feb 2019 16:28:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x529.google.com with SMTP id i130so13939527pgd.1; Thu, 21 Feb 2019 08:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hZP6DDnvc540eJHBg8RcvyZ9Ogw09cukITCRskFEQU8=; b=eMh0i1qrXI4b+O5ap/M+PfhvH/1KWD95zF0ld/5Dx/WL4P0/kxD6o4e5dcevpVKs9C l+Du2/imm50VCC7S66xVSBZrhAryH2Ab6adare8JBGPTnecjmMmevhV7SW2e5hRaFAqs IvsNY4qIiPsUTV/5RTACSLNOYH/VPRw8mX9CMDysZRGi4a5Z9tZZABH34BWeFoYvvFjg Kx7Q1vRPvgz4BhTvldQtUEdi9Kmfv5VczWYLNzK2z+pJwJeRnGW/wl+IIcFkFAUFQ37m YBJVVUhFBL7Rl0JHUHBt5CaWeQSHsKsYvQaA1W2TM82q45sTZQ5LX64OVN3cYSrBnF7Y lKdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hZP6DDnvc540eJHBg8RcvyZ9Ogw09cukITCRskFEQU8=; b=gQY5XoYc6WbN9GzqjRWuTlbQgaTypCZbaMc4jZb1dmA/P7sVhqwRs80VzAZAmfBC3S Vef6zoTN0GZXSmROjWMeIJO/cwtQaXcjPoHG5yhSt0g/z0GnoDMqewoEPyN634fD1wcg g+qutCXBqraSVQ2Bp3uwxwQVXE/Omvw00caKbwFSfd4ECyzu/+hey7MUibddETpTuR8v kRoACyIXJ4vswTFj9ka0DHLxH/SMZ1n15/2nEwZdhgcV37NjUnQhWOXzYv5K9BvsOHsk HFh5NsFCcSgx4dTSOn536qlWkTLLkvoCBRs18JPeZKKNlUETi371Xzguhp2kS7qOIt4b TMIQ== X-Gm-Message-State: AHQUAuZreanVXmXlCh3tOaR1wKT7jogV25V5H0L5gF06MUFXMNF+ks49 EA1DiDmcMUPiDZGHKuBSHi8sAsTL X-Google-Smtp-Source: AHgI3IbzIq1L6SaNeE7VRF68yGGqYYgf4oWHLlj0FV1feGjowXD8dqXK+03dBr15qim6TtigAyeucg== X-Received: by 2002:a62:11ca:: with SMTP id 71mr36864039pfr.18.1550766512078; Thu, 21 Feb 2019 08:28:32 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k64sm45160840pfj.69.2019.02.21.08.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 08:28:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344414 - stable/11 From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: Date: Thu, 21 Feb 2019 08:28:30 -0800 Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6A8C488C-05F4-4607-8F40-F301AF91E7EA@gmail.com> References: <201902210322.x1L3MKeV007120@repo.freebsd.org> <201902210616.x1L6G7SV018721@pdx.rh.CN85.dnsmgr.net> To: Kyle Evans X-Rspamd-Queue-Id: 978508206D 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.942,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, 21 Feb 2019 16:28:34 -0000 > On Feb 21, 2019, at 04:43, Kyle Evans wrote: >=20 > On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes > wrote: >>=20 >>> Author: kevans >>> Date: Thu Feb 21 03:22:20 2019 >>> New Revision: 344414 >>> URL: https://svnweb.freebsd.org/changeset/base/344414 >>>=20 >>> Log: >>> MFC (RECORD ONLY) r338050: Loader default interpreter flip >>>=20 >>> The default interpreter for stable/11 is 4th; this will never and can n= ever >>> change. Record MFC of r338050 to proactively prevent any accidents in f= uture >>> batching of MFCs. >>>=20 >>> Modified: >>> Directory Properties: >>> stable/11/ (props changed) >>=20 >> Does it make sense to do a direct commit to stable/11 >> marking the line that does this flip with a >> "Do not change this in the stable/11 branch" >> so that someone does not try to manually merge >> the change if they happen to notice the code >> is different? >=20 > I'll chew on it for a little bit. It's fairly clear what the > ramifications of swapping those lines around are, even from diff > review, and I'd like to assume no one would willfully do it if they > put a couple seconds thought into what they were about to commit. Kyle, I think what you did makes sense. I=E2=80=99ve done this and I=E2=80=99v= e seen others do similar in the past.=20 As someone who=E2=80=99s merged code in from others, I appreciate measur= es like this, which would prevent me from breaking a stable branch by accide= nt. Thanks! -Enji= From owner-svn-src-all@freebsd.org Thu Feb 21 16:41: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 172DE14E774F; Thu, 21 Feb 2019 16:41:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 7044E82A7A; Thu, 21 Feb 2019 16:41:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LGetR2021291; Thu, 21 Feb 2019 08:40:55 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LGetma021290; Thu, 21 Feb 2019 08:40:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902211640.x1LGetma021290@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344414 - stable/11 In-Reply-To: <6A8C488C-05F4-4607-8F40-F301AF91E7EA@gmail.com> To: Enji Cooper Date: Thu, 21 Feb 2019 08:40:55 -0800 (PST) CC: Kyle Evans , "Rodney W. Grimes" , src-committers , 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: 7044E82A7A 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.979,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, 21 Feb 2019 16:41:05 -0000 > > On Feb 21, 2019, at 04:43, Kyle Evans wrote: > > > > On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes > > wrote: > >> > >>> Author: kevans > >>> Date: Thu Feb 21 03:22:20 2019 > >>> New Revision: 344414 > >>> URL: https://svnweb.freebsd.org/changeset/base/344414 > >>> > >>> Log: > >>> MFC (RECORD ONLY) r338050: Loader default interpreter flip > >>> > >>> The default interpreter for stable/11 is 4th; this will never and can never > >>> change. Record MFC of r338050 to proactively prevent any accidents in future > >>> batching of MFCs. > >>> > >>> Modified: > >>> Directory Properties: > >>> stable/11/ (props changed) > >> > >> Does it make sense to do a direct commit to stable/11 > >> marking the line that does this flip with a > >> "Do not change this in the stable/11 branch" > >> so that someone does not try to manually merge > >> the change if they happen to notice the code > >> is different? > > > > I'll chew on it for a little bit. It's fairly clear what the > > ramifications of swapping those lines around are, even from diff > > review, and I'd like to assume no one would willfully do it if they > > put a couple seconds thought into what they were about to commit. > > Kyle, > I think what you did makes sense. I?ve done this and I?ve > seen others do similar in the past. I concur, what he did do makes perfect since. > As someone who?s merged code in from others, I appreciate > measures like this, which would prevent me from breaking a > stable branch by accident. I am just wondering about a second safety belt, as the current one just makes a svn merge -c338050 a silent nop, but in no way stops someone from manually applying the diff. We have people that are very good with svn and would know how to investigate the nop, and we have people who can barely manage to do a merge with proper mergeinfo. > Thanks! > -Enji -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 16:47: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 A321714E7A6E; Thu, 21 Feb 2019 16:47:37 +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 4CF2E82FC5; Thu, 21 Feb 2019 16:47:37 +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 36362204D2; Thu, 21 Feb 2019 16:47:37 +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 x1LGlbxf027485; Thu, 21 Feb 2019 16:47:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LGlas2027483; Thu, 21 Feb 2019 16:47:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902211647.x1LGlas2027483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 21 Feb 2019 16:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344441 - head/sys/dev/ioat X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ioat X-SVN-Commit-Revision: 344441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CF2E82FC5 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,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, 21 Feb 2019 16:47:37 -0000 Author: mav Date: Thu Feb 21 16:47:36 2019 New Revision: 344441 URL: https://svnweb.freebsd.org/changeset/base/344441 Log: Fix few issues in ioat(4) driver. - Do not explicitly count active descriptors. It allows hardware reset to happen while device is still referenced, plus simplifies locking. - Do not stop/start callout each time the queue becomes empty. Let it run to completion and rearm if needed, that is much cheaper then to touch it every time, plus also simplifies locking. - Decouple submit and cleanup locks, making driver reentrant. - Avoid memory mapped status register read on every interrupt. - Improve locking during device attach/detach. - Remove some no longer used variables. Reviewed by: cem MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D19231 Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Feb 21 15:44:32 2019 (r344440) +++ head/sys/dev/ioat/ioat.c Thu Feb 21 16:47:36 2019 (r344441) @@ -1,6 +1,7 @@ /*- * Copyright (C) 2012 Intel Corporation * All rights reserved. + * Copyright (C) 2018 Alexander Motin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$"); #ifndef BUS_SPACE_MAXADDR_40BIT #define BUS_SPACE_MAXADDR_40BIT 0xFFFFFFFFFFULL #endif -#define IOAT_REFLK (&ioat->submit_lock) static int ioat_probe(device_t device); static int ioat_attach(device_t device); @@ -77,7 +77,7 @@ static void ioat_dmamap_cb(void *arg, bus_dma_segment_ static void ioat_interrupt_handler(void *arg); static boolean_t ioat_model_resets_msix(struct ioat_softc *ioat); static int chanerr_to_errno(uint32_t); -static void ioat_process_events(struct ioat_softc *ioat); +static void ioat_process_events(struct ioat_softc *ioat, boolean_t intr); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); static void ioat_free_ring(struct ioat_softc *, uint32_t size, @@ -97,15 +97,8 @@ static int ioat_reset_hw(struct ioat_softc *ioat); static void ioat_reset_hw_task(void *, int); static void ioat_setup_sysctl(device_t device); static int sysctl_handle_reset(SYSCTL_HANDLER_ARGS); -static inline struct ioat_softc *ioat_get(struct ioat_softc *, - enum ioat_ref_kind); -static inline void ioat_put(struct ioat_softc *, enum ioat_ref_kind); -static inline void _ioat_putn(struct ioat_softc *, uint32_t, - enum ioat_ref_kind, boolean_t); -static inline void ioat_putn(struct ioat_softc *, uint32_t, - enum ioat_ref_kind); -static inline void ioat_putn_locked(struct ioat_softc *, uint32_t, - enum ioat_ref_kind); +static void ioat_get(struct ioat_softc *); +static void ioat_put(struct ioat_softc *); static void ioat_drain_locked(struct ioat_softc *); #define ioat_log_message(v, ...) do { \ @@ -157,6 +150,8 @@ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNE static unsigned ioat_channel_index = 0; SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, "Number of IOAT channels attached"); +static struct mtx ioat_list_mtx; +MTX_SYSINIT(ioat_list_mtx, &ioat_list_mtx, "ioat list mtx", MTX_DEF); static struct _pcsid { @@ -266,7 +261,7 @@ static int ioat_attach(device_t device) { struct ioat_softc *ioat; - int error; + int error, i; ioat = DEVICE2SOFTC(device); ioat->device = device; @@ -297,11 +292,26 @@ ioat_attach(device_t device) if (error != 0) goto err; - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); ioat_setup_sysctl(device); - ioat->chan_idx = ioat_channel_index; - ioat_channel[ioat_channel_index++] = ioat; + mtx_lock(&ioat_list_mtx); + for (i = 0; i < IOAT_MAX_CHANNELS; i++) { + if (ioat_channel[i] == NULL) + break; + } + if (i >= IOAT_MAX_CHANNELS) { + mtx_unlock(&ioat_list_mtx); + device_printf(device, "Too many I/OAT devices in system\n"); + error = ENXIO; + goto err; + } + ioat->chan_idx = i; + ioat_channel[i] = ioat; + if (i >= ioat_channel_index) + ioat_channel_index = i + 1; + mtx_unlock(&ioat_list_mtx); + ioat_test_attach(); err: @@ -317,19 +327,28 @@ ioat_detach(device_t device) ioat = DEVICE2SOFTC(device); + mtx_lock(&ioat_list_mtx); + ioat_channel[ioat->chan_idx] = NULL; + while (ioat_channel_index > 0 && + ioat_channel[ioat_channel_index - 1] == NULL) + ioat_channel_index--; + mtx_unlock(&ioat_list_mtx); + ioat_test_detach(); taskqueue_drain(taskqueue_thread, &ioat->reset_task); - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); ioat->quiescing = TRUE; ioat->destroying = TRUE; wakeup(&ioat->quiescing); wakeup(&ioat->resetting); - ioat_channel[ioat->chan_idx] = NULL; - ioat_drain_locked(ioat); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + while (ioat_get_active(ioat) > 0) + msleep(&ioat->tail, &ioat->cleanup_lock, 0, "ioat_drain", 1); + mtx_unlock(&ioat->cleanup_lock); ioat_teardown_intr(ioat); callout_drain(&ioat->poll_timer); @@ -458,15 +477,12 @@ ioat3_attach(device_t device) TASK_INIT(&ioat->reset_task, 0, ioat_reset_hw_task, ioat); /* Establish lock order for Witness */ - mtx_lock(&ioat->submit_lock); mtx_lock(&ioat->cleanup_lock); - mtx_unlock(&ioat->cleanup_lock); + mtx_lock(&ioat->submit_lock); mtx_unlock(&ioat->submit_lock); + mtx_unlock(&ioat->cleanup_lock); ioat->is_submitter_processing = FALSE; - ioat->is_completion_pending = FALSE; - ioat->is_reset_pending = FALSE; - ioat->is_channel_running = FALSE; bus_dma_tag_create(bus_get_dma_tag(ioat->device), sizeof(uint64_t), 0x0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, @@ -521,7 +537,7 @@ ioat3_attach(device_t device) dma_hw_desc->next = RING_PHYS_ADDR(ioat, i + 1); } - ioat->head = ioat->hw_head = 0; + ioat->head = 0; ioat->tail = 0; ioat->last_seen = 0; *ioat->comp_update = 0; @@ -641,7 +657,7 @@ ioat_interrupt_handler(void *arg) struct ioat_softc *ioat = arg; ioat->stats.interrupts++; - ioat_process_events(ioat); + ioat_process_events(ioat, TRUE); } static int @@ -661,13 +677,12 @@ chanerr_to_errno(uint32_t chanerr) } static void -ioat_process_events(struct ioat_softc *ioat) +ioat_process_events(struct ioat_softc *ioat, boolean_t intr) { struct ioat_descriptor *desc; struct bus_dmadesc *dmadesc; uint64_t comp_update, status; uint32_t completed, chanerr; - boolean_t pending; int error; mtx_lock(&ioat->cleanup_lock); @@ -721,42 +736,21 @@ ioat_process_events(struct ioat_softc *ioat) if (completed != 0) { ioat->last_seen = RING_PHYS_ADDR(ioat, ioat->tail - 1); ioat->stats.descriptors_processed += completed; + wakeup(&ioat->tail); } out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); - - /* Perform a racy check first; only take the locks if it passes. */ - pending = (ioat_get_active(ioat) != 0); - if (!pending && ioat->is_completion_pending) { - mtx_unlock(&ioat->cleanup_lock); - mtx_lock(&ioat->submit_lock); - mtx_lock(&ioat->cleanup_lock); - - pending = (ioat_get_active(ioat) != 0); - if (!pending && ioat->is_completion_pending) { - ioat->is_completion_pending = FALSE; - callout_stop(&ioat->poll_timer); - } - mtx_unlock(&ioat->submit_lock); - } mtx_unlock(&ioat->cleanup_lock); - if (pending) - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - - if (completed != 0) { - ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); - wakeup(&ioat->tail); - } - /* * The device doesn't seem to reliably push suspend/halt statuses to * the channel completion memory address, so poll the device register - * here. + * here. For performance reasons skip it on interrupts, do it only + * on much more rare polling events. */ - comp_update = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; + if (!intr) + comp_update = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; if (!is_ioat_halted(comp_update) && !is_ioat_suspended(comp_update)) return; @@ -767,16 +761,17 @@ out: * work with error status and restart the engine. */ mtx_lock(&ioat->submit_lock); - mtx_lock(&ioat->cleanup_lock); ioat->quiescing = TRUE; + mtx_unlock(&ioat->submit_lock); + /* - * This is safe to do here because we have both locks and the submit - * queue is quiesced. We know that we will drain all outstanding - * events, so ioat_reset_hw can't deadlock. It is necessary to - * protect other ioat_process_event threads from racing ioat_reset_hw, - * reading an indeterminate hw state, and attempting to continue - * issuing completions. + * This is safe to do here because the submit queue is quiesced. We + * know that we will drain all outstanding events, so ioat_reset_hw + * can't deadlock. It is necessary to protect other ioat_process_event + * threads from racing ioat_reset_hw, reading an indeterminate hw + * state, and attempting to continue issuing completions. */ + mtx_lock(&ioat->cleanup_lock); ioat->resetting_cleanup = TRUE; chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); @@ -795,7 +790,6 @@ out: dmadesc->callback_fn(dmadesc->callback_arg, chanerr_to_errno(chanerr)); - ioat_putn_locked(ioat, 1, IOAT_ACTIVE_DESCR_REF); ioat->tail++; ioat->stats.descriptors_processed++; ioat->stats.descriptors_error++; @@ -803,16 +797,10 @@ out: CTR5(KTR_IOAT, "%s channel=%u head=%u tail=%u active=%u", __func__, ioat->chan_idx, ioat->head, ioat->tail, ioat_get_active(ioat)); - if (ioat->is_completion_pending) { - ioat->is_completion_pending = FALSE; - callout_stop(&ioat->poll_timer); - } - /* Clear error status */ ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); mtx_unlock(&ioat->cleanup_lock); - mtx_unlock(&ioat->submit_lock); ioat_log_message(0, "Resetting channel to recover from error\n"); error = taskqueue_enqueue(taskqueue_thread, &ioat->reset_task); @@ -854,31 +842,39 @@ ioat_get_dmaengine(uint32_t index, int flags) KASSERT((flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK), ("invalid wait | nowait")); - if (index >= ioat_channel_index) + mtx_lock(&ioat_list_mtx); + if (index >= ioat_channel_index || + (ioat = ioat_channel[index]) == NULL) { + mtx_unlock(&ioat_list_mtx); return (NULL); + } + mtx_lock(&ioat->submit_lock); + mtx_unlock(&ioat_list_mtx); - ioat = ioat_channel[index]; - if (ioat == NULL || ioat->destroying) + if (ioat->destroying) { + mtx_unlock(&ioat->submit_lock); return (NULL); + } + ioat_get(ioat); if (ioat->quiescing) { - if ((flags & M_NOWAIT) != 0) + if ((flags & M_NOWAIT) != 0) { + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); return (NULL); + } - mtx_lock(IOAT_REFLK); while (ioat->quiescing && !ioat->destroying) - msleep(&ioat->quiescing, IOAT_REFLK, 0, "getdma", 0); - mtx_unlock(IOAT_REFLK); + msleep(&ioat->quiescing, &ioat->submit_lock, 0, "getdma", 0); - if (ioat->destroying) + if (ioat->destroying) { + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); return (NULL); + } } - - /* - * There's a race here between the quiescing check and HW reset or - * module destroy. - */ - return (&ioat_get(ioat, IOAT_DMAENGINE_REF)->dmaengine); + mtx_unlock(&ioat->submit_lock); + return (&ioat->dmaengine); } void @@ -887,7 +883,9 @@ ioat_put_dmaengine(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - ioat_put(ioat, IOAT_DMAENGINE_REF); + mtx_lock(&ioat->submit_lock); + ioat_put(ioat); + mtx_unlock(&ioat->submit_lock); } int @@ -975,18 +973,17 @@ ioat_release(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - CTR4(KTR_IOAT, "%s channel=%u dispatch1 hw_head=%u head=%u", __func__, - ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + CTR3(KTR_IOAT, "%s channel=%u dispatch1 head=%u", __func__, + ioat->chan_idx, ioat->head); KFAIL_POINT_CODE(DEBUG_FP, ioat_release, /* do nothing */); - CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__, - ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); + CTR3(KTR_IOAT, "%s channel=%u dispatch2 head=%u", __func__, + ioat->chan_idx, ioat->head); if (ioat->acq_head != ioat->head) { ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, - (uint16_t)ioat->hw_head); + (uint16_t)ioat->head); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; + if (!callout_pending(&ioat->poll_timer)) { callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, ioat); } @@ -1403,7 +1400,7 @@ ioat_reserve_space(struct ioat_softc *ioat, uint32_t n CTR2(KTR_IOAT, "%s channel=%u attempting to process events", __func__, ioat->chan_idx); - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); mtx_lock(&ioat->submit_lock); dug = TRUE; @@ -1481,7 +1478,12 @@ ioat_poll_timer_callback(void *arg) ioat = arg; ioat_log_message(3, "%s\n", __func__); - ioat_process_events(ioat); + ioat_process_events(ioat, FALSE); + + mtx_lock(&ioat->submit_lock); + if (ioat_get_active(ioat) > 0) + callout_schedule(&ioat->poll_timer, 1); + mtx_unlock(&ioat->submit_lock); } /* @@ -1493,12 +1495,9 @@ ioat_submit_single(struct ioat_softc *ioat) mtx_assert(&ioat->submit_lock, MA_OWNED); - ioat_get(ioat, IOAT_ACTIVE_DESCR_REF); - atomic_add_rel_int(&ioat->head, 1); - atomic_add_rel_int(&ioat->hw_head, 1); - CTR5(KTR_IOAT, "%s channel=%u head=%u hw_head=%u tail=%u", __func__, - ioat->chan_idx, ioat->head, ioat->hw_head & UINT16_MAX, - ioat->tail); + ioat->head++; + CTR4(KTR_IOAT, "%s channel=%u head=%u tail=%u", __func__, + ioat->chan_idx, ioat->head, ioat->tail); ioat->stats.descriptors_submitted++; } @@ -1513,24 +1512,24 @@ ioat_reset_hw(struct ioat_softc *ioat) CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); while (ioat->resetting && !ioat->destroying) - msleep(&ioat->resetting, IOAT_REFLK, 0, "IRH_drain", 0); + msleep(&ioat->resetting, &ioat->submit_lock, 0, "IRH_drain", 0); if (ioat->destroying) { - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); return (ENXIO); } ioat->resetting = TRUE; - ioat->quiescing = TRUE; - ioat_drain_locked(ioat); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + while (ioat_get_active(ioat) > 0) + msleep(&ioat->tail, &ioat->cleanup_lock, 0, "ioat_drain", 1); /* * Suspend ioat_process_events while the hardware and softc are in an * indeterminate state. */ - mtx_lock(&ioat->cleanup_lock); ioat->resetting_cleanup = TRUE; mtx_unlock(&ioat->cleanup_lock); @@ -1621,10 +1620,9 @@ ioat_reset_hw(struct ioat_softc *ioat) * The internal ring counter resets to zero, so we have to start over * at zero as well. */ - ioat->tail = ioat->head = ioat->hw_head = 0; + ioat->tail = ioat->head = 0; ioat->last_seen = 0; *ioat->comp_update = 0; - KASSERT(!ioat->is_completion_pending, ("bogus completion_pending")); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); @@ -1649,18 +1647,15 @@ out: mtx_unlock(&ioat->cleanup_lock); /* Unblock submission of new work */ - mtx_lock(IOAT_REFLK); + mtx_lock(&ioat->submit_lock); ioat->quiescing = FALSE; wakeup(&ioat->quiescing); ioat->resetting = FALSE; wakeup(&ioat->resetting); - if (ioat->is_completion_pending) - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); CTR2(KTR_IOAT, "%s channel=%u reset done", __func__, ioat->chan_idx); - mtx_unlock(IOAT_REFLK); + mtx_unlock(&ioat->submit_lock); return (error); } @@ -1804,8 +1799,6 @@ ioat_setup_sysctl(device_t device) 0, "SW descriptor head pointer index"); SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, 0, "SW descriptor tail pointer index"); - SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "hw_head", CTLFLAG_RD, - &ioat->hw_head, 0, "HW DMACOUNT"); SYSCTL_ADD_UQUAD(ctx, state, OID_AUTO, "last_completion", CTLFLAG_RD, ioat->comp_update, "HW addr of last completion"); @@ -1813,12 +1806,6 @@ ioat_setup_sysctl(device_t device) SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_submitter_processing", CTLFLAG_RD, &ioat->is_submitter_processing, 0, "submitter processing"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_completion_pending", - CTLFLAG_RD, &ioat->is_completion_pending, 0, "completion pending"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_reset_pending", CTLFLAG_RD, - &ioat->is_reset_pending, 0, "reset pending"); - SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_channel_running", CTLFLAG_RD, - &ioat->is_channel_running, 0, "channel running"); SYSCTL_ADD_PROC(ctx, state, OID_AUTO, "chansts", CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", @@ -1864,91 +1851,35 @@ ioat_setup_sysctl(device_t device) "Descriptors per interrupt"); } -static inline struct ioat_softc * -ioat_get(struct ioat_softc *ioat, enum ioat_ref_kind kind) +static void +ioat_get(struct ioat_softc *ioat) { - uint32_t old; - KASSERT(kind < IOAT_NUM_REF_KINDS, ("bogus")); + mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT(ioat->refcnt < UINT32_MAX, ("refcnt overflow")); - old = atomic_fetchadd_32(&ioat->refcnt, 1); - KASSERT(old < UINT32_MAX, ("refcnt overflow")); - -#ifdef INVARIANTS - old = atomic_fetchadd_32(&ioat->refkinds[kind], 1); - KASSERT(old < UINT32_MAX, ("refcnt kind overflow")); -#endif - - return (ioat); + ioat->refcnt++; } -static inline void -ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) +static void +ioat_put(struct ioat_softc *ioat) { - _ioat_putn(ioat, n, kind, FALSE); -} + mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT(ioat->refcnt >= 1, ("refcnt error")); -static inline void -ioat_putn_locked(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) -{ - - _ioat_putn(ioat, n, kind, TRUE); + if (--ioat->refcnt == 0) + wakeup(&ioat->refcnt); } -static inline void -_ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind, - boolean_t locked) -{ - uint32_t old; - - KASSERT(kind < IOAT_NUM_REF_KINDS, ("bogus")); - - if (n == 0) - return; - -#ifdef INVARIANTS - old = atomic_fetchadd_32(&ioat->refkinds[kind], -n); - KASSERT(old >= n, ("refcnt kind underflow")); -#endif - - /* Skip acquiring the lock if resulting refcnt > 0. */ - for (;;) { - old = ioat->refcnt; - if (old <= n) - break; - if (atomic_cmpset_32(&ioat->refcnt, old, old - n)) - return; - } - - if (locked) - mtx_assert(IOAT_REFLK, MA_OWNED); - else - mtx_lock(IOAT_REFLK); - - old = atomic_fetchadd_32(&ioat->refcnt, -n); - KASSERT(old >= n, ("refcnt error")); - - if (old == n) - wakeup(IOAT_REFLK); - if (!locked) - mtx_unlock(IOAT_REFLK); -} - -static inline void -ioat_put(struct ioat_softc *ioat, enum ioat_ref_kind kind) -{ - - ioat_putn(ioat, 1, kind); -} - static void ioat_drain_locked(struct ioat_softc *ioat) { - mtx_assert(IOAT_REFLK, MA_OWNED); + mtx_assert(&ioat->submit_lock, MA_OWNED); + while (ioat->refcnt > 0) - msleep(IOAT_REFLK, IOAT_REFLK, 0, "ioat_drain", 0); + msleep(&ioat->refcnt, &ioat->submit_lock, 0, "ioat_drain", 0); } #ifdef DDB @@ -1991,15 +1922,11 @@ DB_SHOW_COMMAND(ioat, db_show_ioat) db_printf(" destroying: %d\n", (int)sc->destroying); db_printf(" is_submitter_processing: %d\n", (int)sc->is_submitter_processing); - db_printf(" is_completion_pending: %d\n", (int)sc->is_completion_pending); - db_printf(" is_reset_pending: %d\n", (int)sc->is_reset_pending); - db_printf(" is_channel_running: %d\n", (int)sc->is_channel_running); db_printf(" intrdelay_supported: %d\n", (int)sc->intrdelay_supported); db_printf(" resetting: %d\n", (int)sc->resetting); db_printf(" head: %u\n", sc->head); db_printf(" tail: %u\n", sc->tail); - db_printf(" hw_head: %u\n", sc->hw_head); db_printf(" ring_size_order: %u\n", sc->ring_size_order); db_printf(" last_seen: 0x%lx\n", sc->last_seen); db_printf(" ring: %p\n", sc->ring); @@ -2040,11 +1967,6 @@ DB_SHOW_COMMAND(ioat, db_show_ioat) db_show_lock(&sc->cleanup_lock); db_printf(" refcnt: %u\n", sc->refcnt); -#ifdef INVARIANTS - CTASSERT(IOAT_NUM_REF_KINDS == 2); - db_printf(" refkinds: [ENG=%u, DESCR=%u]\n", sc->refkinds[0], - sc->refkinds[1]); -#endif db_printf(" stats:\n"); db_printf(" interrupts: %lu\n", sc->stats.interrupts); db_printf(" descriptors_processed: %lu\n", sc->stats.descriptors_processed); Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Thu Feb 21 15:44:32 2019 (r344440) +++ head/sys/dev/ioat/ioat_internal.h Thu Feb 21 16:47:36 2019 (r344441) @@ -426,12 +426,6 @@ struct ioat_descriptor { #define IOAT_OP_OLD_XOR 0x85 #define IOAT_OP_OLD_XOR_VAL 0x86 -enum ioat_ref_kind { - IOAT_DMAENGINE_REF = 0, - IOAT_ACTIVE_DESCR_REF, - IOAT_NUM_REF_KINDS -}; - /* One of these per allocated PCI device. */ struct ioat_softc { bus_dmaengine_t dmaengine; @@ -442,22 +436,22 @@ struct ioat_softc { offsetof(struct ioat_softc, dmaengine)); \ }) + device_t device; int version; unsigned chan_idx; - struct mtx submit_lock; - device_t device; bus_space_tag_t pci_bus_tag; bus_space_handle_t pci_bus_handle; - int pci_resource_id; struct resource *pci_resource; + int pci_resource_id; uint32_t max_xfer_size; uint32_t capabilities; + uint32_t ring_size_order; uint16_t intrdelay_max; uint16_t cached_intrdelay; - struct resource *res; int rid; + struct resource *res; void *tag; bus_dma_tag_t hw_desc_tag; @@ -468,27 +462,13 @@ struct ioat_softc { uint64_t *comp_update; bus_addr_t comp_update_bus_addr; - struct callout poll_timer; - struct callout shrink_timer; - struct task reset_task; - boolean_t quiescing; boolean_t destroying; boolean_t is_submitter_processing; - boolean_t is_completion_pending; /* submit_lock */ - boolean_t is_reset_pending; - boolean_t is_channel_running; boolean_t intrdelay_supported; boolean_t resetting; /* submit_lock */ boolean_t resetting_cleanup; /* cleanup_lock */ - uint32_t head; - uint32_t acq_head; - uint32_t tail; - uint32_t hw_head; - uint32_t ring_size_order; - bus_addr_t last_seen; - struct ioat_descriptor *ring; union ioat_hw_descriptor { @@ -506,11 +486,16 @@ struct ioat_softc { #define RING_PHYS_ADDR(sc, i) (sc)->hw_desc_bus_addr + \ (((i) % (1 << (sc)->ring_size_order)) * sizeof(struct ioat_dma_hw_descriptor)) - struct mtx cleanup_lock; - volatile uint32_t refcnt; -#ifdef INVARIANTS - volatile uint32_t refkinds[IOAT_NUM_REF_KINDS]; -#endif + struct mtx_padalign submit_lock; + struct callout poll_timer; + struct task reset_task; + struct mtx_padalign cleanup_lock; + + uint32_t refcnt; + uint32_t head; + uint32_t acq_head; + uint32_t tail; + bus_addr_t last_seen; struct { uint64_t interrupts; From owner-svn-src-all@freebsd.org Thu Feb 21 17:27: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 A037714E9007; Thu, 21 Feb 2019 17:27:40 +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 3FF7B84580; Thu, 21 Feb 2019 17:27:40 +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 3136B20BAA; Thu, 21 Feb 2019 17:27:40 +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 x1LHRe04048127; Thu, 21 Feb 2019 17:27:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LHRc1F048118; Thu, 21 Feb 2019 17:27:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201902211727.x1LHRc1F048118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Feb 2019 17:27:38 +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: r344442 - stable/11/release/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/arm X-SVN-Commit-Revision: 344442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FF7B84580 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)[-0.999,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, 21 Feb 2019 17:27:40 -0000 Author: gjb Date: Thu Feb 21 17:27:37 2019 New Revision: 344442 URL: https://svnweb.freebsd.org/changeset/base/344442 Log: Update the stable/11 arm SoC IMAGE_SIZE to 3072M as build failures were encountered due to the target filesystem running out of space during the installkernel target. The 3072M size is used as it is consistent with head and stable/12 image sizes, and build failures due to a full filesystem have been common enough to justify making the default size the same across all supported branches in order to avoid such surprises. This is a direct commit to stable/11, as there are several changes between several size bumps that are unrelated or unnecessary in this branch. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/arm/BANANAPI.conf stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/CUBIEBOARD.conf stable/11/release/arm/CUBIEBOARD2.conf stable/11/release/arm/CUBOX-HUMMINGBOARD.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf stable/11/release/arm/RPI2.conf stable/11/release/arm/WANDBOARD.conf Modified: stable/11/release/arm/BANANAPI.conf ============================================================================== --- stable/11/release/arm/BANANAPI.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/BANANAPI.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-bananapi" FAT_SIZE="50m -b 1m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="ALLWINNER" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/BEAGLEBONE.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" FAT_SIZE="50m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="BEAGLEBONE" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/CUBIEBOARD.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/CUBIEBOARD.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard" FAT_SIZE="50m -b 1m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="ALLWINNER_UP" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/CUBIEBOARD2.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD2.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/CUBIEBOARD2.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" FAT_SIZE="50m -b 1m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="ALLWINNER" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" FAT_SIZE="50m -b 16384" FAT_TYPE="16" -IMAGE_SIZE="1536M" +IMAGE_SIZE="3072M" KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/GUMSTIX.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" FAT_SIZE="50m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="GUMSTIX" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/PANDABOARD.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" FAT_SIZE="50m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="PANDABOARD" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/RPI-B.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" FAT_SIZE="50m" FAT_TYPE="16" -IMAGE_SIZE="1G" +IMAGE_SIZE="3072M" KERNEL="RPI-B" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/RPI2.conf ============================================================================== --- stable/11/release/arm/RPI2.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/RPI2.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi2 sysutils/rpi-firmware" FAT_SIZE="50m" FAT_TYPE="16" -IMAGE_SIZE="1536M" +IMAGE_SIZE="3072M" KERNEL="RPI2" MD_ARGS="-x 63 -y 255" NODOC=1 Modified: stable/11/release/arm/WANDBOARD.conf ============================================================================== --- stable/11/release/arm/WANDBOARD.conf Thu Feb 21 16:47:36 2019 (r344441) +++ stable/11/release/arm/WANDBOARD.conf Thu Feb 21 17:27:37 2019 (r344442) @@ -9,7 +9,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-wandboard" FAT_SIZE="50m -b 16384" FAT_TYPE="16" -IMAGE_SIZE="1536M" +IMAGE_SIZE="3072M" KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 From owner-svn-src-all@freebsd.org Thu Feb 21 17:31: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 AA3EE14E93CF; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@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 4C193849C4; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@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 3815B20D11; Thu, 21 Feb 2019 17:31:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LHVZ5M052052; Thu, 21 Feb 2019 17:31:35 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LHVXtf052045; Thu, 21 Feb 2019 17:31:33 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902211731.x1LHVXtf052045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 17:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344443 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C193849C4 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.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 17:31:35 -0000 Author: bde Date: Thu Feb 21 17:31:33 2019 New Revision: 344443 URL: https://svnweb.freebsd.org/changeset/base/344443 Log: Move scterm_teken.c from 6 MD files lists to the MI files list so that it is easier to configure. It is MI, unlike some of the other syscons files already in the MI list. Move scvtb.c similarly. It is needed whenever sc is configured, and is more MI than most of the files already in the MI list. This only changes the combined list for arm64 and mips. These arches already cannot build sc or even NOTES. Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.sparc64 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files Thu Feb 21 17:31:33 2019 (r344443) @@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc +dev/syscons/scterm-teken.c optional sc dev/syscons/scvidctl.c optional sc +dev/syscons/scvtb.c optional sc dev/syscons/snake/snake_saver.c optional snake_saver dev/syscons/star/star_saver.c optional star_saver dev/syscons/syscons.c optional sc Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.amd64 Thu Feb 21 17:31:33 2019 (r344443) @@ -486,10 +486,8 @@ dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm -dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga -dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm dev/tpm/tpm_crb.c optional tpm acpi Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.arm Thu Feb 21 17:31:33 2019 (r344443) @@ -132,8 +132,6 @@ dev/pci/pci_host_generic_fdt.c optional pci_host_gener dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt font.h optional sc \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.i386 Thu Feb 21 17:31:33 2019 (r344443) @@ -309,10 +309,8 @@ dev/sio/sio_pci.c optional sio pci dev/sio/sio_puc.c optional sio puc dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm -dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga -dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.mips Thu Feb 21 17:31:33 2019 (r344443) @@ -75,8 +75,6 @@ dev/cfe/cfe_env.c optional cfe_env # syscons support dev/fb/fb.c optional sc dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc mips/mips/sc_machdep.c optional sc # FDT support Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.powerpc Thu Feb 21 17:31:33 2019 (r344443) @@ -74,8 +74,6 @@ dev/sound/macio/onyx.c optional snd_ai2s iicbus power dev/sound/macio/snapper.c optional snd_ai2s iicbus powermac dev/sound/macio/tumbler.c optional snd_ai2s iicbus powermac dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec dev/uart/uart_cpu_powerpc.c optional uart Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Thu Feb 21 17:27:37 2019 (r344442) +++ head/sys/conf/files.sparc64 Thu Feb 21 17:31:33 2019 (r344443) @@ -56,8 +56,6 @@ dev/pcf/pcf_ebus.c optional pcf ebus dev/sound/sbus/cs4231.c optional snd_audiocs ebus | \ snd_audiocs sbus dev/syscons/scgfbrndr.c optional sc -dev/syscons/scterm-teken.c optional sc -dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_sparc64.c optional uart dev/uart/uart_kbd_sun.c optional uart sc | vt dev/vt/hw/ofwfb/ofwfb.c optional vt From owner-svn-src-all@freebsd.org Thu Feb 21 18: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 3788A14EABFE; Thu, 21 Feb 2019 18:13:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 893B286508; Thu, 21 Feb 2019 18:13:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id g6so14103363pfh.13; Thu, 21 Feb 2019 10:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VCyPQWdc0bDdIjLLiYXLKr2D2cLQXRNK3BxIJfgDY5A=; b=DDgD922eDAS9LjEcu1l4Fh9TDxICxn9+AGhQ3SU9/kxR5wWG0sIwrJOMn7/k22k9PM 3S52Zs0w+wBA8MiTKLbMKe86/8TNKhvJkVARlTJPFV/JQLPPEF8+UY8F1hITu6pWrz8U vVx2i/O0RmcRp/6dsnYT9IqVgh9up489vRJSWt0RGRZaQTii+88t3LhhVIEpkWrdzgv9 3GOK5R2d0db33rDk6lU5ceOfCOX9fg/iOB7E0QWAOBq6UqOkbe9gUGk13LhNSgj2qPS2 bTW368TOveNw+tmgZaEmCl8XkCdzfXQXVXxJQUTZqkVixUZIloaHifSzDHxkwmHYIbBm t9wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VCyPQWdc0bDdIjLLiYXLKr2D2cLQXRNK3BxIJfgDY5A=; b=KCrPGAdCUL356RZTBBnPz8dxv58L+8dioYl2XOobWv/lwsianXVm88E/LJoNS8xAC2 5VD98ywVsQok6vZXSKe5HBf8mJ2kS3lHF/k1Pfq+QooKcGqr/qAHUzH2+BjWsyVJUx9H NNk/ZC3hkloLhWDEexTdP7lDIWelHKxmVSNPuvOqKvyEycBdnfgufYaDExPdP1LsAz1l vwVCn/k3yu+Du/jOh4scf+W67bRZWa8/vVgJ99nywPXL5pkv/DvLe9a+Si94Vki9icTZ bBHr7gyiF2nqZwjsZ17nE9p+yMB8MYObgl7ZaHqaSYkkvIcA2CoVc7Xr1T82w8TQuzQk 05Og== X-Gm-Message-State: AHQUAubOTD2zCbOhZ8VaT1IAAFmausM6r05YtTmhKAOQ/GIQDuhd+MuI lpkfL0/9M9WFU5EIw/DZaUvQBG8j X-Google-Smtp-Source: AHgI3IZ1mc9rB+HwylrK4b4bGrVTKQ5/qnQZcOBHj3zsi4rK4cmbzkbj/OURja1L0fIXhik5L+N7Lw== X-Received: by 2002:a62:1d0c:: with SMTP id d12mr41672355pfd.126.1550772792956; Thu, 21 Feb 2019 10:13:12 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v1sm19207167pff.9.2019.02.21.10.13.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:13:12 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw From: Enji Cooper In-Reply-To: <201902211410.x1LEAEa2042271@repo.freebsd.org> Date: Thu, 21 Feb 2019 10:13:11 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> References: <201902211410.x1LEAEa2042271@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 893B286508 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,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, 21 Feb 2019 18:13:15 -0000 > On Feb 21, 2019, at 6:10 AM, Alexander Motin wrote: >=20 > Author: mav > Date: Thu Feb 21 14:10:14 2019 > New Revision: 344437 > URL: https://svnweb.freebsd.org/changeset/base/344437 >=20 > Log: > Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >=20 > Its a hack, we can't know/list all DMA engines, but this covers all > I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >=20 > MFC after: 1 week > Sponsored by: iXsystems, Inc. >=20 > Modified: > head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >=20 > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.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/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 = (r344436) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 = (r344437) > @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) > if (sc->alut) > PNTX_WRITE(sc, 0xc94, 0); >=20 > - /* Enable Link Interface LUT entries 0/1 for peer 0/1. = */ > - PNTX_WRITE(sc, 0xdb4, 0x00090001); > + /* Enable all Link Interface LUT entries for peer. */ > + for (i =3D 0; i < 32; i +=3D 2) { Is `32` written down in the NTB spec somewhere? Should it be a = #define, or should it be programmatically adjusted based on the CPU? Thank you! -Enji= From owner-svn-src-all@freebsd.org Thu Feb 21 18:19: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 C400014EAE60; Thu, 21 Feb 2019 18:19:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC7C86824; Thu, 21 Feb 2019 18:19:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc44.google.com with SMTP id v201so11187167ywa.9; Thu, 21 Feb 2019 10:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=47HT63DqvmMUTgwX3oytIzlZ3JsNYzxfMzmmyv4hxz0=; b=FyIUyIe2sb9YCoEH64HEA2Badt7G2n9+kkGEzuR9u9wVeR9NJEpB30OEsGLj/iiWnG i/PYDq9lDeFHY5o5c9DQc7Le0JLZ4nhS2xfFFNjQkEb0hnzgA1U3X7jUnQdpwzShd+jy ee3fZX3ZoC+hFP6j8zmpTzrsDsDxbXgO/PUIMRP8foxxLuoY9rfbiQ3ipz0u6eZ7k8da /A//ar0Q4oCNLVzA7sU25q28cbjAf9QDP6aX/X+UZ/6YXHliR/tkiaGVdPGz1XaPcOPS OVBnbjZSyQqW02Z4E1at4Q2LpLFPCOF4XrA9Mf2LMslT2BOptD2hvV5Edpa9dLSyFGfL WYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=47HT63DqvmMUTgwX3oytIzlZ3JsNYzxfMzmmyv4hxz0=; b=ltD4HJV3sBH7GfQojRgZ/Bj/4JfqANRwCCfz2J+cVLWcjfLaxcjKeHhqwTyKJOyO7t EC+HV4rCcRz4XJMKn9Y4KhNgja/+IGEAKA2uBway+FIW7ZnqdYhGpW5rQ6s6V2iecvAs G7SRXGQZ8JGQUkYyuygP6eTA6Q7015ybU19c5yWy9V62X3Kkxr3MGzjTqi6/BHFSoqvr gdq9NRWgtBpFkasIwygR1E1YNO2aWAaRub/DaRHpG9yMP77rUmZfJtzIWp1/fERHzMQL Z4gzTa9rXebB7JjTN/u9CxOqTDurZP8BY1Xbq33hAA+D/gWHcASLH24Iw9s+sDnNakzn FnCg== X-Gm-Message-State: AHQUAuaReDJr2uezQEJ4N5oYphj1rQOpgub+xTNZUmL4SMhO89xqXgBK GemZhEHEw54QTfd5/6zvON0z4gpD X-Google-Smtp-Source: AHgI3Ib1hzK96KC+5An9WEzbDnO5+B9UHTMc0/jWRQMsm+mtrBHi2gvJpPfJMvGKgz6dhHuV3nPFxA== X-Received: by 2002:a81:3c47:: with SMTP id j68mr34279275ywa.69.1550773163082; Thu, 21 Feb 2019 10:19:23 -0800 (PST) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id a190sm8627620ywg.76.2019.02.21.10.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:19:22 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902211410.x1LEAEa2042271@repo.freebsd.org> <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> Date: Thu, 21 Feb 2019 13:19:21 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3AC7C86824 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, 21 Feb 2019 18:19:25 -0000 On 21.02.2019 13:13, Enji Cooper wrote: > >> On Feb 21, 2019, at 6:10 AM, Alexander Motin wrote: >> >> Author: mav >> Date: Thu Feb 21 14:10:14 2019 >> New Revision: 344437 >> URL: https://svnweb.freebsd.org/changeset/base/344437 >> >> Log: >> Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >> >> Its a hack, we can't know/list all DMA engines, but this covers all >> I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >> >> MFC after: 1 week >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >> >> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >> ============================================================================== >> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 (r344436) >> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 (r344437) >> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) >> if (sc->alut) >> PNTX_WRITE(sc, 0xc94, 0); >> >> - /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ >> - PNTX_WRITE(sc, 0xdb4, 0x00090001); >> + /* Enable all Link Interface LUT entries for peer. */ >> + for (i = 0; i < 32; i += 2) { > > Is `32` written down in the NTB spec somewhere? Should it be a #define, or should it be programmatically adjusted based on the CPU? It is a property of the hardware, it has 32 LUT entries. #define would be good indeed, but the code is already full of other numeric constants. -- Alexander Motin From owner-svn-src-all@freebsd.org Thu Feb 21 18:22: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 2621C14EB11C; Thu, 21 Feb 2019 18:22:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94CC286C7C; Thu, 21 Feb 2019 18:22:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42c.google.com with SMTP id n22so14136595pfa.3; Thu, 21 Feb 2019 10:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4r3MGQ7GR4Wd32iVQrhVjmz1AJkuyXG7QtNps6pEeGI=; b=DlOnbxDpok4GB1L32FdtWM9QcEMsM5t7mCsGLgtdD4WmWnFgWYegRJOfeytre/nEPk R96oTejKFugDqNmbTZKHX4NJD9rKaxp9GcHz5H4DB3oX1ymcWI/AK/OZHyGjMN0wzAdz +Lh+dLoAiWMXPcYChnQ4XHbBRpimOg3YcAAFENVhuNkuIhBmYU/Hnzi3FbiKVak5ITfK Zj6HoJvlpnGijf0apgqdrbG1y/t+zo3FPJ/WURRFPEwu6l/1gbomM2nXe6XlwXmnQQqq /Hw3nCB2W6bW99c42G7K+pfYGy7HF9VEplwsiMJefMRgf8STJN9KQl+VBQyaGwLJAYts Q/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4r3MGQ7GR4Wd32iVQrhVjmz1AJkuyXG7QtNps6pEeGI=; b=uhV4986fNVdSVZ9KAaNE+aRBVmBMlawQEvnIeDPo3zT6wEsqKy+NvIT0YL/P/VCKL/ md7HYHAUIz//d3wFSJ3fp2kHnZMVNpInmi6EactVs4oM0XomxH+PQkPTKQnZjl+sSTT6 OC9Zo8z+66NdAaDwrgzt/OnJwIGDZUKwAe6XET9PWww8L6+NXfFQuEI/uWBdUtMBlRz6 X3pPNxLYDaaLP2T19SVfVxXCCij7Aw0IBS23kS4EQgFn2Vdbrvqehf4hxlDpv5XSoJFN TJvtSmZLDeExWhT93U7beymAlbiJRY5seiQbodr4XvKPaL9wGBWQRA7OWlBuT+iOHXXs bxLg== X-Gm-Message-State: AHQUAub3fLIPARUQVxRMAhJYUbgiN6dry437xggXRvPwg/iIaBxsM3fR zCj9+dGWF7EfhHdRWlYcrPVKsTvt X-Google-Smtp-Source: AHgI3IbtQppaArLLRKsx1Gd4WjxDqLAdxB0bHxOUfE6WM9dQLmm0T7mGR5x1Om64MghyiZjvohWsfg== X-Received: by 2002:a62:e082:: with SMTP id d2mr42819151pfm.240.1550773362183; Thu, 21 Feb 2019 10:22:42 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y133sm31388011pfb.107.2019.02.21.10.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:22:41 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344437 - head/sys/dev/ntb/ntb_hw Date: Thu, 21 Feb 2019 10:22:40 -0800 In-Reply-To: <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Alexander Motin References: <201902211410.x1LEAEa2042271@repo.freebsd.org> <8FC17E30-1360-44CE-9284-286B6282C244@gmail.com> <54cb17e7-9b4a-e779-22b6-0bf317bd86ca@FreeBSD.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 94CC286C7C 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.939,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Thu, 21 Feb 2019 18:22:44 -0000 > On Feb 21, 2019, at 10:19 AM, Alexander Motin wrote: >=20 > On 21.02.2019 13:13, Enji Cooper wrote: >>=20 >>> On Feb 21, 2019, at 6:10 AM, Alexander Motin = wrote: >>>=20 >>> Author: mav >>> Date: Thu Feb 21 14:10:14 2019 >>> New Revision: 344437 >>> URL: https://svnweb.freebsd.org/changeset/base/344437 >>>=20 >>> Log: >>> Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB. >>>=20 >>> Its a hack, we can't know/list all DMA engines, but this covers all >>> I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw. >>>=20 >>> MFC after: 1 week >>> Sponsored by: iXsystems, Inc. >>>=20 >>> Modified: >>> head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c >>>=20 >>> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.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/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 12:13:27 2019 = (r344436) >>> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Feb 21 14:10:14 2019 = (r344437) >>> @@ -202,16 +202,24 @@ ntb_plx_init(device_t dev) >>> if (sc->alut) >>> PNTX_WRITE(sc, 0xc94, 0); >>>=20 >>> - /* Enable Link Interface LUT entries 0/1 for peer 0/1. = */ >>> - PNTX_WRITE(sc, 0xdb4, 0x00090001); >>> + /* Enable all Link Interface LUT entries for peer. */ >>> + for (i =3D 0; i < 32; i +=3D 2) { >>=20 >> Is `32` written down in the NTB spec somewhere? Should it be a = #define, or should it be programmatically adjusted based on the CPU? >=20 > It is a property of the hardware, it has 32 LUT entries. Cool! I was thinking that this is probably a number that can change in = the future, as processor designs evolve. > #define would be good indeed, but the code is already full of other = numeric constants. Yes, but it would make the code more readable/easier to reason through. = That=E2=80=99s where my concern is coming from. Also, thank you very much for working on this :). Cheers! -Enji= From owner-svn-src-all@freebsd.org Thu Feb 21 18: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 DC2D514EB1A2; Thu, 21 Feb 2019 18:23:24 +0000 (UTC) (envelope-from jhb@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 7900186DD5; Thu, 21 Feb 2019 18:23:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.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 84F8FCBCD; Thu, 21 Feb 2019 18:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog To: Warner Losh , Garrett Cooper Cc: Bruce Evans , David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> 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: Thu, 21 Feb 2019 10:22:55 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7900186DD5 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.883,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, 21 Feb 2019 18:23:25 -0000 On 2/20/19 9:20 PM, Warner Losh wrote: > On Wed, Feb 20, 2019, 9:59 PM Enji Cooper >> >>> On Feb 20, 2019, at 5:17 PM, Bruce Evans wrote: >>> >>> On Wed, 20 Feb 2019, David Bright wrote: >>> >>>> Log: >>>> Complete fix for CID 1007454, CID 1007453: Resource leak in newsyslog >>>> >>>> The result of a strdup() was stored in a global variable and not freed >>>> before program exit. This is a follow-up to r343906. That change >>> >>> This was an especially large bug in Coverity. Understanding that exit(3) >>> exits is about the first thing to understand for a checker. >>> >>> Now it is also a style bug in the source code. >>> >>>> attempted to plug these resource leaks but managed to miss a code path >>>> on which the leak still occurs. Plug the leak on that path, too. >>> >>>> Modified: head/usr.sbin/newsyslog/newsyslog.c >>>> >> ============================================================================== >>>> --- head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 21:24:56 2019 >> (r344388) >>>> +++ head/usr.sbin/newsyslog/newsyslog.c Wed Feb 20 22:05:44 2019 >> (r344389) >>>> @@ -793,6 +793,9 @@ usage(void) >>>> fprintf(stderr, >>>> "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] >> [-f config_file]\n" >>>> " [-S pidfile] [-t timefmt] [[-R tagname] file >> ...]\n"); >>>> + /* Free global dynamically-allocated storage. */ >>>> + free(timefnamefmt); >>>> + free(requestor); >>>> exit(1); >>>> } >>> >>> There was no leak here. exit(3) frees storage much more finally than >>> free(3). >>> >>> It is especially obvious that there is no leak here, since the exit() is >>> 1-2 lines later than the frees. >>> >>> In theory, exit() might fail because it tries to allocate 100 MB more >>> storage but wouldn't fail if 100 bytes are freed here (applications can >>> easily do this foot shooting by allocating without freeing in atexit() >>> destructors). In practice, even allocation failures "can't happen", >>> except in programs that use setrlimit followed but foot shooting to test >>> the limits. setrlimit is now broken for this purpose, since it doesn't >>> limit allocations done using mmap() instead of break(), and malloc() now >>> uses mmap(). >>> >>> If coverity understood this and wanted to spam you with warnings, then it >>> would not warn about this, but would warn about more important things >> like >>> failure to fflush() or fclose() or check for or handle errors for all >>> open streams before calling exit(). Also, if all callers of usage() are >>> not understood, for failures to switch stderr to unbuffered mode before >>> using it in usage(). >>> >>> The error reporting is even harder to do if stderr is not available. >>> Windowing systems and even curses need to do lots more cleanup _before_ >>> exit() and it may be difficult to clean up enough to print error messages >>> using the windowing system. >> >> I agree with Bruce. Items like these should be ignored in the Coverity UI >> as false positives with reasoning, like “global variables; freed on exitâ€. >> >> As others have noted in past mailing threads, freeing variables on exit >> can cause applications to hang for a period of time, while the memory is >> being reclaimed. I think it’s best to ignore these kinds of allocations on >> exit to avoid introducing unnecessary complexity in the program, as they’re >> benign issues. >> > > > It's been a long running debate since 92 or so when purify came out and > this problem started to be found. In the last 25 years the question hasn't > been settled. I tend to think it's a waste of time, though I get that > issues like this create a lot of false positives. I'm +1 on Bruce's point on this. I find it similar to the recent spate of adding pointless '__dead2' annotations to usage functions that unconditionally call exit() (and thus are already inferred as __dead2 by any compiler written in this millenium) -- John Baldwin                                                                              From owner-svn-src-all@freebsd.org Thu Feb 21 18:28: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 A4CB414EB49C; Thu, 21 Feb 2019 18:28:31 +0000 (UTC) (envelope-from jhb@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 4A163871AE; Thu, 21 Feb 2019 18:28:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.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 A5445CBCE; Thu, 21 Feb 2019 18:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344099 - head/sys/net To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@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: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Date: Thu, 21 Feb 2019 10:28:02 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A163871AE 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]; 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, 21 Feb 2019 18:28:32 -0000 On 2/21/19 7:29 AM, Randall Stewart wrote: > > >> On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >> >> On 2/13/19 10:03 AM, Randall Stewart wrote: >>> oh and one other thing.. >>> >>> It was *not* a random IFP.. it was the IFP to the lagg. >>> >>> I.e. an alloc() was done to the lagg.. and the free was >>> done back to the same IFP (that provided the allocate). >> >> Yes, that's wrong. Suppose the route changes so that my traffic is now over >> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you >> expect if_lagg_free to invoke em0's free routine? In your case it does, >> but only by accident. It doesn't work in the other case I described which >> is if you have non-lagg interfaces and a route moves from cc0 to em0. In >> that case your existing code that is using the wrong ifp will just panic. >> >> These aren't real alloc routines as the lagg and vlan ones don't allocate >> anything, they pass along the request to the child and the child allocates >> the tag. Only ifnet's that actually allocate tags should need to free them, >> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works. > > But thats what the lagg’s routine does, use the tag sent in > to find the real ifp (where the tag was allocated) and call > the if_snd_tag_free() on that. > > Its not an accident it works, it calls the free of the actual > interface where the allocation came from. > > I don’t see how it would panic. My point is that your calling code should do this. Suppose I have a socket over cc0. It allocates a send tag. Later, the connection is rerouted over em0 and em(4) doesn't support send tags at all. If you use the ifp from the route to free the tag, you will try to use em's if_snd_tag_free routine and that will be NULL and panic. The fix is that you shouldn't be using the route ifp to free the tag, only to note that the tag is stale, so something like: ifp = route.rt_ifp; if (ifp != m->m_snd_tag->ifp) { /* Need to free tag. */ tag = m->m_snd_tag; /* Free mbuf or clear tag or whatever */ tag->ifp->if_snd_tag_free(tag); } if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp that owns that tag and knows how to free it. Your patch happens to work for the case of the route going over a lagg and the connection switching between lagg ports only because you've made the lagg routine do what the calling code should be doing in the first place. -- John Baldwin                                                                              From owner-svn-src-all@freebsd.org Thu Feb 21 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 6394A14EC041; Thu, 21 Feb 2019 18:41:43 +0000 (UTC) (envelope-from dim@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 065DB87E64; Thu, 21 Feb 2019 18:41:43 +0000 (UTC) (envelope-from dim@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 EA31221889; Thu, 21 Feb 2019 18:41:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LIfgha085607; Thu, 21 Feb 2019 18:41:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LIfgw8085603; Thu, 21 Feb 2019 18:41:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902211841.x1LIfgw8085603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Feb 2019 18:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344444 - in head/contrib/llvm/tools/lld/ELF: . Arch X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm/tools/lld/ELF: . Arch X-SVN-Commit-Revision: 344444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 065DB87E64 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 18:41:43 -0000 Author: dim Date: Thu Feb 21 18:41:41 2019 New Revision: 344444 URL: https://svnweb.freebsd.org/changeset/base/344444 Log: Pull in r353299 from upstream lld trunk (by George Rimar): Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target." With the following changes: 1) Compilation fix: std::atomic HasStaticTlsModel = false; -> std::atomic HasStaticTlsModel{false}; 2) Adjusted the comment in code. Initial commit message: DF_STATIC_TLS flag indicates that the shared object or executable contains code using a static thread-local storage scheme. Patch checks if IE/LE relocations were used to check if the code uses a static model. If so it sets the DF_STATIC_TLS flag. Differential revision: https://reviews.llvm.org/D57749 Pull in r353378 from upstream lld trunk (by George Rimar): [LLD][ELF] - Set DF_STATIC_TLS flag for X64 target This is the same as D57749, but for x64 target. "ELF Handling For Thread-Local Storage" p41 says (https://www.akkadia.org/drepper/tls.pdf): R_X86_64_GOTTPOFF relocation is used for IE TLS models. Hence if linker sees this relocation we should add DF_STATIC_TLS flag. Differential revision: https://reviews.llvm.org/D57821 This adds support to lld for the DF_STATIC_TLS flag in shared objects, which signals to the dynamic linker that the shared object requires static thread local storage. See also: https://reviews.freebsd.org/D19072 MFC after: 1 week Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp head/contrib/llvm/tools/lld/ELF/Config.h head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Arch/X86.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -70,6 +70,14 @@ static bool hasBaseReg(uint8_t ModRM) { return (ModRM RelExpr X86::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { + // There are 4 different TLS variable models with varying degrees of + // flexibility and performance. LocalExec and InitialExec models are fast but + // less-flexible models. If they are in use, we set DF_STATIC_TLS flag in the + // dynamic section to let runtime know about that. + if (Type == R_386_TLS_LE || Type == R_386_TLS_LE_32 || Type == R_386_TLS_IE || + Type == R_386_TLS_GOTIE) + Config->HasStaticTlsModel = true; + switch (Type) { case R_386_8: case R_386_16: Modified: head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -76,6 +76,9 @@ template X86_64::X86_64() { template RelExpr X86_64::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { + if (Type == R_X86_64_GOTTPOFF) + Config->HasStaticTlsModel = true; + switch (Type) { case R_X86_64_8: case R_X86_64_16: Modified: head/contrib/llvm/tools/lld/ELF/Config.h ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Config.h Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/Config.h Thu Feb 21 18:41:41 2019 (r344444) @@ -18,6 +18,7 @@ #include "llvm/Support/CachePruning.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Endian.h" +#include #include namespace lld { @@ -81,6 +82,7 @@ struct VersionDefinition { // and such fields have the same name as the corresponding options. // Most fields are initialized by the driver. struct Configuration { + std::atomic HasStaticTlsModel{false}; uint8_t OSABI = 0; llvm::CachePruningPolicy ThinLTOCachePolicy; llvm::StringMap SectionStartMap; Modified: head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Feb 21 17:31:33 2019 (r344443) +++ head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp Thu Feb 21 18:41:41 2019 (r344444) @@ -1282,6 +1282,8 @@ template void DynamicSection::final } if (!Config->ZText) DtFlags |= DF_TEXTREL; + if (Config->HasStaticTlsModel) + DtFlags |= DF_STATIC_TLS; if (DtFlags) addInt(DT_FLAGS, DtFlags); From owner-svn-src-all@freebsd.org Thu Feb 21 18:49: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 D5DE214EC36E; Thu, 21 Feb 2019 18:49:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 68A9E88347; Thu, 21 Feb 2019 18:49:13 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D0694260296; Thu, 21 Feb 2019 19:49:10 +0100 (CET) Subject: Re: svn commit: r344099 - head/sys/net To: John Baldwin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> From: Hans Petter Selasky Message-ID: <47882eda-b33c-9577-14b3-5cd2402af5e7@selasky.org> Date: Thu, 21 Feb 2019 19:46:44 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68A9E88347 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.945,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, 21 Feb 2019 18:49:14 -0000 Hi, On 2/21/19 7:28 PM, John Baldwin wrote: > On 2/21/19 7:29 AM, Randall Stewart wrote: >> >>> On Feb 13, 2019, at 1:10 PM, John Baldwin wrote: >>> >>> On 2/13/19 10:03 AM, Randall Stewart wrote: >>>> oh and one other thing.. >>>> >>>> It was*not* a random IFP.. it was the IFP to the lagg. >>>> >>>> I.e. an alloc() was done to the lagg.. and the free was >>>> done back to the same IFP (that provided the allocate). >>> Yes, that's wrong. Suppose the route changes so that my traffic is now over >>> em0 instead of lagg0 (where em0 isn't a member of the lagg), how do you >>> expect if_lagg_free to invoke em0's free routine? In your case it does, >>> but only by accident. It doesn't work in the other case I described which >>> is if you have non-lagg interfaces and a route moves from cc0 to em0. In >>> that case your existing code that is using the wrong ifp will just panic. >>> >>> These aren't real alloc routines as the lagg and vlan ones don't allocate >>> anything, they pass along the request to the child and the child allocates >>> the tag. Only ifnet's that actually allocate tags should need to free them, >>> and you should be using tag->ifp to as the ifp whose if_snd_tag_free works. >> But thats what the lagg’s routine does, use the tag sent in >> to find the real ifp (where the tag was allocated) and call >> the if_snd_tag_free() on that. >> >> Its not an accident it works, it calls the free of the actual >> interface where the allocation came from. >> >> I don’t see how it would panic. > My point is that your calling code should do this. > > Suppose I have a socket over cc0. It allocates a send tag. Later, the > connection is rerouted over em0 and em(4) doesn't support send tags at all. > If you use the ifp from the route to free the tag, you will try to use > em's if_snd_tag_free routine and that will be NULL and panic. The fix is > that you shouldn't be using the route ifp to free the tag, only to note that > the tag is stale, so something like: > > ifp = route.rt_ifp; > if (ifp != m->m_snd_tag->ifp) { > /* Need to free tag. */ > tag = m->m_snd_tag; > > /* Free mbuf or clear tag or whatever */ > > tag->ifp->if_snd_tag_free(tag); > } > > if_snd_tag_free should always be called from 'tag->ifp' as that's the ifp > that owns that tag and knows how to free it. > > Your patch happens to work for the case of the route going over a lagg and > the connection switching between lagg ports only because you've made the > lagg routine do what the calling code should be doing in the first place. I haven't seen Randall's code, but unless he is using the same ifp to free the send that that was used to allocate it, then John is right. The send tag already contains an interface pointer, that should be used when freeing it. --HPS From owner-svn-src-all@freebsd.org Thu Feb 21 19:19: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 C27DC14ECF78; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@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 5EA4389403; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@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 4FA4721F2C; Thu, 21 Feb 2019 19:19:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LJJVJm005498; Thu, 21 Feb 2019 19:19:31 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LJJUiA005495; Thu, 21 Feb 2019 19:19:30 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902211919.x1LJJUiA005495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Feb 2019 19:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344445 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 344445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EA4389403 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)[-0.999,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: Thu, 21 Feb 2019 19:19:32 -0000 Author: bde Date: Thu Feb 21 19:19:30 2019 New Revision: 344445 URL: https://svnweb.freebsd.org/changeset/base/344445 Log: Fix the dumb and sc terminal emulators to compile and work. First remove ifdefs of the unsupported option SC_DUMB_TERMINAL which prevented building using both in the same kernel and broke regression tests. This option will be replaced by per-emulator supported options. The dumb emulator rotted with KSE in r83366, but usually compiled since it is ifdefed to nothing unless SC_DUMB_TERMINAL is defined. The type of an unused function parameter changed. Both emulators rotted when 2 new methods were added while the emulators were removed. Only null methods are needed, but null function pointers give panics instead. The wildcard in the default for the unsupported option SC_DFLT_TERM never really worked. It tends to prefer the dumb emulator when multiple emulators are configured. Change it to prefer scteken for compatibility. Modified: head/sys/dev/syscons/scterm-dumb.c head/sys/dev/syscons/scterm-sc.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scterm-dumb.c ============================================================================== --- head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/scterm-dumb.c Thu Feb 21 19:19:30 2019 (r344445) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #if defined(__sparc64__) || defined(__powerpc__) @@ -42,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SC_DUMB_TERMINAL - /* dumb terminal emulator */ static sc_term_init_t dumb_init; @@ -53,6 +53,8 @@ static sc_term_ioctl_t dumb_ioctl; static sc_term_clear_t dumb_clear; static sc_term_input_t dumb_input; static void dumb_nop(void); +static sc_term_fkeystr_t dumb_fkeystr; +static sc_term_sync_t dumb_sync; static sc_term_sw_t sc_term_dumb = { { NULL, NULL }, @@ -70,6 +72,8 @@ static sc_term_sw_t sc_term_dumb = { dumb_clear, (sc_term_notify_t *)dumb_nop, dumb_input, + dumb_fkeystr, + dumb_sync, }; SCTERM_MODULE(dumb, sc_term_dumb); @@ -108,7 +112,7 @@ dumb_puts(scr_stat *scp, u_char *buf, int len) static int dumb_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, - int flag, struct proc *p) + struct thread *td) { vid_info_t *vi; @@ -146,10 +150,19 @@ dumb_input(scr_stat *scp, int c, struct tty *tp) return FALSE; } +static const char * +dumb_fkeystr(scr_stat *scp, int c) +{ + return (NULL); +} + static void +dumb_sync(scr_stat *scp) +{ +} + +static void dumb_nop(void) { /* nothing */ } - -#endif /* SC_DUMB_TERMINAL */ Modified: head/sys/dev/syscons/scterm-sc.c ============================================================================== --- head/sys/dev/syscons/scterm-sc.c Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/scterm-sc.c Thu Feb 21 19:19:30 2019 (r344445) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef SC_DUMB_TERMINAL - #define MAX_ESC_PAR 5 /* attribute flags */ @@ -89,6 +87,8 @@ static sc_term_default_attr_t scterm_default_attr; static sc_term_clear_t scterm_clear; static sc_term_notify_t scterm_notify; static sc_term_input_t scterm_input; +static sc_term_fkeystr_t scterm_fkeystr; +static sc_term_sync_t scterm_sync; static sc_term_sw_t sc_term_sc = { { NULL, NULL }, @@ -106,6 +106,8 @@ static sc_term_sw_t sc_term_sc = { scterm_clear, scterm_notify, scterm_input, + scterm_fkeystr, + scterm_sync, }; SCTERM_MODULE(sc, sc_term_sc); @@ -780,6 +782,17 @@ scterm_input(scr_stat *scp, int c, struct tty *tp) return FALSE; } +static const char * +scterm_fkeystr(scr_stat *scp, int c) +{ + return (NULL); +} + +static void +scterm_sync(scr_stat *scp) +{ +} + /* * Calculate hardware attributes word using logical attributes mask and * hardware colors @@ -807,5 +820,3 @@ mask2attr(term_stat *tcp) return (attr << 8); } - -#endif /* SC_DUMB_TERMINAL */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Thu Feb 21 18:41:41 2019 (r344444) +++ head/sys/dev/syscons/syscons.h Thu Feb 21 19:19:30 2019 (r344445) @@ -378,7 +378,7 @@ typedef struct sc_ttysoftc { /* terminal emulator */ #ifndef SC_DFLT_TERM -#define SC_DFLT_TERM "*" /* any */ +#define SC_DFLT_TERM "scteken" #endif typedef int sc_term_init_t(scr_stat *scp, void **tcp, int code); From owner-svn-src-all@freebsd.org Thu Feb 21 21:15: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 3E0C814F1369; Thu, 21 Feb 2019 21:15:50 +0000 (UTC) (envelope-from jkim@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 D4BEC8DE0A; Thu, 21 Feb 2019 21:15:49 +0000 (UTC) (envelope-from jkim@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 C093B2343B; Thu, 21 Feb 2019 21:15:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LLFnxm068322; Thu, 21 Feb 2019 21:15:49 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LLFnc0068321; Thu, 21 Feb 2019 21:15:49 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902212115.x1LLFnc0068321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Feb 2019 21:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344446 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 344446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4BEC8DE0A 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)[-0.999,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, 21 Feb 2019 21:15:50 -0000 Author: jkim Date: Thu Feb 21 21:15:49 2019 New Revision: 344446 URL: https://svnweb.freebsd.org/changeset/base/344446 Log: Catch up with ACPICA 20190215. PR: 235922 Modified: head/usr.sbin/bhyve/acpi.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); EFPRINTF(fp, "\n"); } From owner-svn-src-all@freebsd.org Thu Feb 21 21:30: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 0F32514F1D47; Thu, 21 Feb 2019 21:30:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 70E0E8E8A3; Thu, 21 Feb 2019 21:30:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLUt6V022213; Thu, 21 Feb 2019 13:30:55 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLUtMq022212; Thu, 21 Feb 2019 13:30:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212130.x1LLUtMq022212@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212115.x1LLFnc0068321@repo.freebsd.org> To: Jung-uk Kim Date: Thu, 21 Feb 2019 13:30:54 -0800 (PST) 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: 70E0E8E8A3 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.936,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, 21 Feb 2019 21:30:59 -0000 > Author: jkim > Date: Thu Feb 21 21:15:49 2019 > New Revision: 344446 > URL: https://svnweb.freebsd.org/changeset/base/344446 > > Log: > Catch up with ACPICA 20190215. > > PR: 235922 > > Modified: > head/usr.sbin/bhyve/acpi.c > > Modified: head/usr.sbin/bhyve/acpi.c > ============================================================================== > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > EFPRINTF(fp, "\n"); Hang on, acpi tables have version numbers, why is this needed, we did not change versions of acpi in bhyve. Isnt this a new item added by a new version? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 21:31: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 C293F14F1E13; Thu, 21 Feb 2019 21:31:48 +0000 (UTC) (envelope-from jkim@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 66E7A8EAC7; Thu, 21 Feb 2019 21:31:48 +0000 (UTC) (envelope-from jkim@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 5472723659; Thu, 21 Feb 2019 21:31:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LLVmqq077054; Thu, 21 Feb 2019 21:31:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LLVmcc077053; Thu, 21 Feb 2019 21:31:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902212131.x1LLVmcc077053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Feb 2019 21:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r344447 - vendor-sys/acpica/dist/source/components/utilities X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/dist/source/components/utilities X-SVN-Commit-Revision: 344447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66E7A8EAC7 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)[-0.999,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, 21 Feb 2019 21:31:48 -0000 Author: jkim Date: Thu Feb 21 21:31:47 2019 New Revision: 344447 URL: https://svnweb.freebsd.org/changeset/base/344447 Log: Fix missing comma in array declaration. https://github.com/acpica/acpica/commit/113286 Modified: vendor-sys/acpica/dist/source/components/utilities/utdecode.c Modified: vendor-sys/acpica/dist/source/components/utilities/utdecode.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utdecode.c Thu Feb 21 21:15:49 2019 (r344446) +++ vendor-sys/acpica/dist/source/components/utilities/utdecode.c Thu Feb 21 21:31:47 2019 (r344447) @@ -632,7 +632,7 @@ static const char *AcpiGbl_GenericNotify[ACP /* 0B */ "System Locality Update", /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update", - /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ + /* 0E */ "Heterogeneous Memory Attributes Update", /* ACPI 6.2 */ /* 0F */ "Error Disconnect Recover" /* ACPI 6.3 */ }; From owner-svn-src-all@freebsd.org Thu Feb 21 21:33: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 E412114F1F4F; Thu, 21 Feb 2019 21:33:28 +0000 (UTC) (envelope-from jkim@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 837F88EE02; Thu, 21 Feb 2019 21:33:28 +0000 (UTC) (envelope-from jkim@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 15F2E237AC; Thu, 21 Feb 2019 21:33:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LLXRGY078749; Thu, 21 Feb 2019 21:33:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LLXR62078748; Thu, 21 Feb 2019 21:33:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902212133.x1LLXR62078748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Feb 2019 21:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344448 - head/sys/contrib/dev/acpica/components/utilities X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/contrib/dev/acpica/components/utilities X-SVN-Commit-Revision: 344448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 837F88EE02 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)[-0.999,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: Thu, 21 Feb 2019 21:33:29 -0000 Author: jkim Date: Thu Feb 21 21:33:27 2019 New Revision: 344448 URL: https://svnweb.freebsd.org/changeset/base/344448 Log: MFV: r344447 Fix missing comma in array declaration. Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 21:31:47 2019 (r344447) +++ head/sys/contrib/dev/acpica/components/utilities/utdecode.c Thu Feb 21 21:33:27 2019 (r344448) @@ -632,7 +632,7 @@ static const char *AcpiGbl_GenericNotify[ACP /* 0B */ "System Locality Update", /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update", - /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ + /* 0E */ "Heterogeneous Memory Attributes Update", /* ACPI 6.2 */ /* 0F */ "Error Disconnect Recover" /* ACPI 6.3 */ }; From owner-svn-src-all@freebsd.org Thu Feb 21 21:37: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 ECA4914F21D7; Thu, 21 Feb 2019 21:37:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 52AFD8F161; Thu, 21 Feb 2019 21:37:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLawWb022262; Thu, 21 Feb 2019 13:36:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLaw2K022261; Thu, 21 Feb 2019 13:36:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212136.x1LLaw2K022261@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212115.x1LLFnc0068321@repo.freebsd.org> To: Jung-uk Kim Date: Thu, 21 Feb 2019 13:36:58 -0800 (PST) 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: 52AFD8F161 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.936,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, 21 Feb 2019 21:37:01 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: jkim > Date: Thu Feb 21 21:15:49 2019 > New Revision: 344446 > URL: https://svnweb.freebsd.org/changeset/base/344446 > > Log: > Catch up with ACPICA 20190215. > > PR: 235922 > > Modified: > head/usr.sbin/bhyve/acpi.c > > Modified: head/usr.sbin/bhyve/acpi.c > ============================================================================== > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > EFPRINTF(fp, "\n"); > } This is wrong, this is a version 1.0 MADT table, that version does NOT have this value. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 21: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 0AF8114F2509; Thu, 21 Feb 2019 21:42:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 667CF8F5D2; Thu, 21 Feb 2019 21:42:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1LLgq52022278; Thu, 21 Feb 2019 13:42:52 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1LLgqND022277; Thu, 21 Feb 2019 13:42:52 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902212142.x1LLgqND022277@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344446 - head/usr.sbin/bhyve In-Reply-To: <201902212136.x1LLaw2K022261@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Thu, 21 Feb 2019 13:42:52 -0800 (PST) CC: Jung-uk Kim , 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: 667CF8F5D2 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.934,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, 21 Feb 2019 21:42:55 -0000 > > Author: jkim > > Date: Thu Feb 21 21:15:49 2019 > > New Revision: 344446 > > URL: https://svnweb.freebsd.org/changeset/base/344446 > > > > Log: > > Catch up with ACPICA 20190215. > > > > PR: 235922 > > > > Modified: > > head/usr.sbin/bhyve/acpi.c > > > > Modified: head/usr.sbin/bhyve/acpi.c > > ============================================================================== > > --- head/usr.sbin/bhyve/acpi.c Thu Feb 21 19:19:30 2019 (r344445) > > +++ head/usr.sbin/bhyve/acpi.c Thu Feb 21 21:15:49 2019 (r344446) > > @@ -256,6 +256,7 @@ basl_fwrite_madt(FILE *fp) > > EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i); > > EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 00000001\n"); > > EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n"); > > + EFPRINTF(fp, "\t\t\tRuntime Online Capable : 0\n"); > > EFPRINTF(fp, "\n"); > > } > > This is wrong, this is a version 1.0 MADT table, > that version does NOT have this value. Let me guess.. this does not change the table generated, it only makes the iasl compiler happy about what we are feeding it? If so, just ignore my statement above, and sorry for the noise. If not how do we actually fix this so that the table is not changed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 21 22:03: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 0835D14F3029; Thu, 21 Feb 2019 22:03:54 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 996D1684A0; Thu, 21 Feb 2019 22:03:53 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.9] (p57BB46EC.dip0.t-ipconnect.de [87.187.70.236]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 835C8721E280C; Thu, 21 Feb 2019 23:03:50 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344368 - head/sys/netinet From: Michael Tuexen In-Reply-To: <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> Date: Thu, 21 Feb 2019 23:03:49 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <05B47F51-7016-4842-B8C3-36E533120DBE@freebsd.org> References: <201902201803.x1KI3haW078567@repo.freebsd.org> <7b4f29d5-e909-6397-7c24-b5979a3963c1@FreeBSD.org> To: "koobs@freebsd.org" X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 996D1684A0 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_SHORT(-0.97)[-0.973,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, 21 Feb 2019 22:03:54 -0000 > On 21. Feb 2019, at 09:32, Kubilay Kocak wrote: >=20 > On 21/02/2019 5:03 am, Michael Tuexen wrote: >> Author: tuexen >> Date: Wed Feb 20 18:03:43 2019 >> New Revision: 344368 >> URL: https://svnweb.freebsd.org/changeset/base/344368 >> Log: >> Reduce the TCP initial retransmission timeout from 3 seconds to >> 1 second as allowed by RFC 6298. >> Reviewed by: kbowling@, Richard Scheffenegger >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D18941 >> Modified: >> head/sys/netinet/tcp_syncache.c >> head/sys/netinet/tcp_timer.h >> Modified: head/sys/netinet/tcp_syncache.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/netinet/tcp_syncache.c Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_syncache.c Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -159,7 +159,7 @@ static int syncookie_cmp(struct = in_conninfo *inc, str >> * tcp_backoff[1] + >> * tcp_backoff[2] + >> * tcp_backoff[3]) + 3 * tcp_rexmit_slop, >> - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 45600 ms, >> + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms =3D 15600 ms, >> * the odds are that the user has given up attempting to connect by = then. >> */ >> #define SYNCACHE_MAXREXMTS 3 >> Modified: head/sys/netinet/tcp_timer.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/netinet/tcp_timer.h Wed Feb 20 17:56:38 2019 = (r344367) >> +++ head/sys/netinet/tcp_timer.h Wed Feb 20 18:03:43 2019 = (r344368) >> @@ -77,7 +77,7 @@ >> #define TCPTV_MSL ( 30*hz) /* max seg = lifetime (hah!) */ >> #define TCPTV_SRTTBASE 0 /* base = roundtrip time; >> if 0, no idea yet */ >> -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO = if no info */ >> +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO = if no info */ >> #define TCPTV_PERSMIN ( 5*hz) /* minimum = persist interval */ >> #define TCPTV_PERSMAX ( 60*hz) /* maximum = persist interval */ >> _______________________________________________ >=20 > Any way this can be a run-time tunable? Will implement this and add you to the review. Best regards Michael >=20 From owner-svn-src-all@freebsd.org Thu Feb 21 22:45: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 D6E3514F45FB; Thu, 21 Feb 2019 22:45:55 +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 733C06B36E; Thu, 21 Feb 2019 22:45:55 +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 6434924398; Thu, 21 Feb 2019 22:45:55 +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 x1LMjtHN015631; Thu, 21 Feb 2019 22:45:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMjtwI015629; Thu, 21 Feb 2019 22:45:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902212245.x1LMjtwI015629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Feb 2019 22:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344449 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 344449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 733C06B36E 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 21 Feb 2019 22:45:56 -0000 Author: emaste Date: Thu Feb 21 22:45:54 2019 New Revision: 344449 URL: https://svnweb.freebsd.org/changeset/base/344449 Log: scp: validate filenames provided by server against wildcard in client OpenSSH-portable commits: check in scp client that filenames sent during remote->local directory copies satisfy the wildcard specified by the user. This checking provides some protection against a malicious server sending unexpected filenames, but it comes at a risk of rejecting wanted files due to differences between client and server wildcard expansion rules. For this reason, this also adds a new -T flag to disable the check. reported by Harry Sintonen fix approach suggested by markus@; has been in snaps for ~1wk courtesy deraadt@ OpenBSD-Commit-ID: 00f44b50d2be8e321973f3c6d014260f8f7a8eda Minor patch conflict (getopt) resolved. Obtained from: OpenSSH-portable 391ffc4b9d31fa1f4ad566499fef9176ff8a07dc scp: add -T to usage(); OpenBSD-Commit-ID: a7ae14d9436c64e1bd05022329187ea3a0ce1899 Obtained from: OpenSSH-portable 2c21b75a7be6ebdcbceaebb43157c48dbb36f3d8 PR: 234965 Approved by: des MFC after: 3 days Obtained from: OpenSSH-portable 391ffc4b9d, 2c21b75a7b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19076 Modified: head/crypto/openssh/scp.1 head/crypto/openssh/scp.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/scp.1 ============================================================================== --- head/crypto/openssh/scp.1 Thu Feb 21 21:33:27 2019 (r344448) +++ head/crypto/openssh/scp.1 Thu Feb 21 22:45:54 2019 (r344449) @@ -18,7 +18,7 @@ .Nd secure copy (remote file copy program) .Sh SYNOPSIS .Nm scp -.Op Fl 346BCpqrv +.Op Fl 346BCpqrTv .Op Fl c Ar cipher .Op Fl F Ar ssh_config .Op Fl i Ar identity_file @@ -207,6 +207,16 @@ to use for the encrypted connection. The program must understand .Xr ssh 1 options. +.It Fl T +Disable strict filename checking. +By default when copying files from a remote host to a local directory +.Nm +checks that the received filenames match those requested on the command-line +to prevent the remote end from sending unexpected or unwanted files. +Because of differences in how various operating systems and shells interpret +filename wildcards, these checks may cause wanted files to be rejected. +This option disables these checks at the expense of fully trusting that +the server will not send unexpected filenames. .It Fl v Verbose mode. Causes Modified: head/crypto/openssh/scp.c ============================================================================== --- head/crypto/openssh/scp.c Thu Feb 21 21:33:27 2019 (r344448) +++ head/crypto/openssh/scp.c Thu Feb 21 22:45:54 2019 (r344449) @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */ +/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -94,6 +94,7 @@ #include #include #include +#include #include #include #include @@ -375,14 +376,14 @@ void verifydir(char *); struct passwd *pwd; uid_t userid; int errs, remin, remout; -int pflag, iamremote, iamrecursive, targetshouldbedirectory; +int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory; #define CMDNEEDS 64 char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ int response(void); void rsource(char *, struct stat *); -void sink(int, char *[]); +void sink(int, char *[], const char *); void source(int, char *[]); void tolocal(int, char *[]); void toremote(int, char *[]); @@ -421,8 +422,9 @@ main(int argc, char **argv) addargs(&args, "-oRemoteCommand=none"); addargs(&args, "-oRequestTTY=no"); - fflag = tflag = 0; - while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12346S:o:F:")) != -1) + fflag = Tflag = tflag = 0; + while ((ch = getopt(argc, argv, + "dfl:prtTvBCc:i:P:q12346S:o:F:")) != -1) { switch (ch) { /* User-visible flags. */ case '1': @@ -501,9 +503,13 @@ main(int argc, char **argv) setmode(0, O_BINARY); #endif break; + case 'T': + Tflag = 1; + break; default: usage(); } + } argc -= optind; argv += optind; @@ -534,7 +540,7 @@ main(int argc, char **argv) } if (tflag) { /* Receive data. */ - sink(argc, argv); + sink(argc, argv, NULL); exit(errs != 0); } if (argc < 2) @@ -791,7 +797,7 @@ tolocal(int argc, char **argv) continue; } free(bp); - sink(1, argv + argc - 1); + sink(1, argv + argc - 1, src); (void) close(remin); remin = remout = -1; } @@ -967,7 +973,7 @@ rsource(char *name, struct stat *statp) (sizeof(type) != 4 && sizeof(type) != 8)) void -sink(int argc, char **argv) +sink(int argc, char **argv, const char *src) { static BUF buffer; struct stat stb; @@ -983,6 +989,7 @@ sink(int argc, char **argv) unsigned long long ull; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; + char *src_copy = NULL, *restrict_pattern = NULL; struct timeval tv[2]; #define atime tv[0] @@ -1007,6 +1014,17 @@ sink(int argc, char **argv) (void) atomicio(vwrite, remout, "", 1); if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) targisdir = 1; + if (src != NULL && !iamrecursive && !Tflag) { + /* + * Prepare to try to restrict incoming filenames to match + * the requested destination file glob. + */ + if ((src_copy = strdup(src)) == NULL) + fatal("strdup failed"); + if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) { + *restrict_pattern++ = '\0'; + } + } for (first = 1;; first = 0) { cp = buf; if (atomicio(read, remin, cp, 1) != 1) @@ -1111,6 +1129,9 @@ sink(int argc, char **argv) run_err("error: unexpected filename: %s", cp); exit(1); } + if (restrict_pattern != NULL && + fnmatch(restrict_pattern, cp, 0) != 0) + SCREWUP("filename does not match request"); if (targisdir) { static char *namebuf; static size_t cursize; @@ -1148,7 +1169,7 @@ sink(int argc, char **argv) goto bad; } vect[0] = xstrdup(np); - sink(1, vect); + sink(1, vect, src); if (setimes) { setimes = 0; if (utimes(vect[0], tv) < 0) @@ -1316,7 +1337,7 @@ void usage(void) { (void) fprintf(stderr, - "usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]\n" + "usage: scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]\n" " [-l limit] [-o ssh_option] [-P port] [-S program] source ... target\n"); exit(1); } From owner-svn-src-all@freebsd.org Thu Feb 21 22:49: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 E5CE314F484A; Thu, 21 Feb 2019 22:49:21 +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 89F976B6BC; Thu, 21 Feb 2019 22:49:21 +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 7A974243B0; Thu, 21 Feb 2019 22:49:21 +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 x1LMnLiP015855; Thu, 21 Feb 2019 22:49:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMnLip015854; Thu, 21 Feb 2019 22:49:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212249.x1LMnLip015854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344450 - head/sys/modules/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/modules/dtrace X-SVN-Commit-Revision: 344450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89F976B6BC 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)[-0.999,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, 21 Feb 2019 22:49:22 -0000 Author: markj Date: Thu Feb 21 22:49:21 2019 New Revision: 344450 URL: https://svnweb.freebsd.org/changeset/base/344450 Log: Disconnect fasttrap from the 32-bit powerpc build. An upcoming bug fix requires 64-bit atomics, which aren't implemented on powerpc. The powerpc port of fasttrap is incomplete anyway and doesn't get loaded by dtraceall.ko on powerpc because of a missing dependency; it's presumed that it's effectively unused. Discussed with: jhibbits MFC after: 2 weeks Modified: head/sys/modules/dtrace/Makefile Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Thu Feb 21 22:45:54 2019 (r344449) +++ head/sys/modules/dtrace/Makefile Thu Feb 21 22:49:21 2019 (r344450) @@ -19,9 +19,6 @@ SUBDIR+= fasttrap fbt systrace_linux .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= systrace_linux32 .endif -.if ${MACHINE_CPUARCH} == "powerpc" -SUBDIR+= fbt fasttrap -.endif .if ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "mips64" || \ @@ -31,7 +28,9 @@ SUBDIR+= systrace_freebsd32 .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "mips" || \ + ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "riscv" SUBDIR+= fbt .endif + .include From owner-svn-src-all@freebsd.org Thu Feb 21 22:49: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 4124A14F488B; Thu, 21 Feb 2019 22:49:40 +0000 (UTC) (envelope-from sef@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 D34D46B7DA; Thu, 21 Feb 2019 22:49:39 +0000 (UTC) (envelope-from sef@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 C26A9243B1; Thu, 21 Feb 2019 22:49:39 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LMndke015917; Thu, 21 Feb 2019 22:49:39 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMndlW015916; Thu, 21 Feb 2019 22:49:39 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902212249.x1LMndlW015916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Thu, 21 Feb 2019 22:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344451 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 344451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D34D46B7DA 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)[-0.999,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, 21 Feb 2019 22:49:40 -0000 Author: sef Date: Thu Feb 21 22:49:39 2019 New Revision: 344451 URL: https://svnweb.freebsd.org/changeset/base/344451 Log: Fix the usage error I introduced in r344192. Specifically, I put the new option line in the wrong place, and then fixed up the rest without realizing it. This puts the usage statement back to what it was, with an additional line for the new -V option. Reported by: mav Sponsored by: iXsystems Inc. Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:21 2019 (r344450) +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:39 2019 (r344451) @@ -189,9 +189,9 @@ main(int argc, char **argv) "usage:\n" " nfsd [-ardtue] [-h bindip]\n" " [-n numservers] [--minthreads #] [--maxthreads #]\n" - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" - " [-V virtual_hostname]\n" - " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," + "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n" + " [-V virtual_hostname]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { From owner-svn-src-all@freebsd.org Thu Feb 21 22:54: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 68F4714F4C01; Thu, 21 Feb 2019 22:54:18 +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 0B7B26BD0E; Thu, 21 Feb 2019 22:54:18 +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 ED1D02456C; Thu, 21 Feb 2019 22:54:17 +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 x1LMsH4x020673; Thu, 21 Feb 2019 22:54:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMsHo1020671; Thu, 21 Feb 2019 22:54:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212254.x1LMsHo1020671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Commit-Revision: 344452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7B26BD0E 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 21 Feb 2019 22:54:18 -0000 Author: markj Date: Thu Feb 21 22:54:17 2019 New Revision: 344452 URL: https://svnweb.freebsd.org/changeset/base/344452 Log: Fix a tracepoint lookup race in fasttrap_pid_probe(). fasttrap hooks the userspace breakpoint handler; the hook looks up the breakpoint address in a hash table of tracepoints. It is possible for the tracepoint to be removed by a different thread in between the breakpoint trap and the hash table lookup, in which case SIGTRAP gets delivered to the target process. Fix the problem by adding a per-process generation counter that gets incremented when a tracepoint belonging to that process is removed. Then, when a lookup fails, the trapping instruction is restarted if the thread's counter doesn't match that of the process. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19273 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/dev/dtrace/dtrace_cddl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Feb 21 22:54:17 2019 (r344452) @@ -1089,6 +1089,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_ ASSERT(p->p_proc_flag & P_PR_LOCK); #endif p->p_dtrace_count--; + + atomic_add_rel_64(&p->p_fasttrap_tp_gen, 1); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:54:17 2019 (r344452) @@ -967,6 +967,7 @@ fasttrap_pid_probe(struct trapframe *tf) struct reg reg, *rp; proc_t *p = curproc, *pp; struct rm_priotracker tracker; + uint64_t gen; uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1026,8 +1027,22 @@ fasttrap_pid_probe(struct trapframe *tf) while (pp->p_vmspace == pp->p_pptr->p_vmspace) pp = pp->p_pptr; pid = pp->p_pid; + if (pp != p) { + PROC_LOCK(pp); + if ((pp->p_flag & P_WEXIT) != 0) { + /* + * This can happen if the child was created with + * rfork(2). Userspace tracing cannot work reliably in + * such a scenario, but we can at least try. + */ + PROC_UNLOCK(pp); + sx_sunlock(&proctree_lock); + return (-1); + } + _PHOLD_LITE(pp); + PROC_UNLOCK(pp); + } sx_sunlock(&proctree_lock); - pp = NULL; rm_rlock(&fasttrap_tp_lock, &tracker); #endif @@ -1051,11 +1066,28 @@ fasttrap_pid_probe(struct trapframe *tf) if (tp == NULL) { #ifdef illumos mutex_exit(pid_mtx); + return (-1); #else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif + gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); + if (pp != p) + PRELE(pp); + if (curthread->t_fasttrap_tp_gen != gen) { + /* + * At least one tracepoint associated with this PID has + * been removed from the table since #BP was raised. + * Speculate that we hit a tracepoint that has since + * been removed, and retry the instruction. + */ + curthread->t_fasttrap_tp_gen = gen; + tf->tf_rip = pc; + return (0); + } return (-1); +#endif } + if (pp != p) + PRELE(pp); /* * Set the program counter to the address of the traced instruction Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Feb 21 22:49:39 2019 (r344451) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Feb 21 22:54:17 2019 (r344452) @@ -37,7 +37,7 @@ typedef struct kdtrace_proc { u_int64_t p_dtrace_count; /* Number of DTrace tracepoints */ void *p_dtrace_helpers; /* DTrace helpers, if any */ int p_dtrace_model; - + uint64_t p_fasttrap_tp_gen; /* Tracepoint hash table gen */ } kdtrace_proc_t; /* @@ -86,6 +86,7 @@ typedef struct kdtrace_thread { u_int64_t td_hrtime; /* Last time on cpu. */ void *td_dtrace_sscr; /* Saved scratch space location. */ void *td_systrace_args; /* syscall probe arguments. */ + uint64_t td_fasttrap_tp_gen; /* Tracepoint hash table gen. */ } kdtrace_thread_t; /* @@ -113,10 +114,12 @@ typedef struct kdtrace_thread { #define t_dtrace_regv td_dtrace->td_dtrace_regv #define t_dtrace_sscr td_dtrace->td_dtrace_sscr #define t_dtrace_systrace_args td_dtrace->td_systrace_args +#define t_fasttrap_tp_gen td_dtrace->td_fasttrap_tp_gen #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes #define p_model p_dtrace->p_dtrace_model +#define p_fasttrap_tp_gen p_dtrace->p_fasttrap_tp_gen #define DATAMODEL_NATIVE 0 #ifdef __amd64__ From owner-svn-src-all@freebsd.org Thu Feb 21 22:56: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 6FE3B14F4D5F; Thu, 21 Feb 2019 22:56:55 +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 115296BF95; Thu, 21 Feb 2019 22:56:55 +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 F0BCB24585; Thu, 21 Feb 2019 22:56:54 +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 x1LMusI9020860; Thu, 21 Feb 2019 22:56:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LMusof020859; Thu, 21 Feb 2019 22:56:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902212256.x1LMusof020859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Feb 2019 22:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344453 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 344453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 115296BF95 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)[-0.999,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, 21 Feb 2019 22:56:55 -0000 Author: markj Date: Thu Feb 21 22:56:54 2019 New Revision: 344453 URL: https://svnweb.freebsd.org/changeset/base/344453 Log: Commit a missing piece of r344452. MFC with: r344452 Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:54:17 2019 (r344452) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 21 22:56:54 2019 (r344453) @@ -1080,7 +1080,11 @@ fasttrap_pid_probe(struct trapframe *tf) * been removed, and retry the instruction. */ curthread->t_fasttrap_tp_gen = gen; +#ifdef __amd64 tf->tf_rip = pc; +#else + tf->tf_eip = pc; +#endif return (0); } return (-1); From owner-svn-src-all@freebsd.org Thu Feb 21 23:53: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 5D8D614F6D57; Thu, 21 Feb 2019 23:53:53 +0000 (UTC) (envelope-from avos@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 02EAC6E0A8; Thu, 21 Feb 2019 23:53:53 +0000 (UTC) (envelope-from avos@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 E8CC324FC9; Thu, 21 Feb 2019 23:53:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LNrqx5051965; Thu, 21 Feb 2019 23:53:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LNrqZZ051964; Thu, 21 Feb 2019 23:53:52 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902212353.x1LNrqZZ051964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Feb 2019 23:53:52 +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: r344454 - in stable: 11/tools/build/mk 12/tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/tools/build/mk 12/tools/build/mk X-SVN-Commit-Revision: 344454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02EAC6E0A8 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 21 Feb 2019 23:53:53 -0000 Author: avos Date: Thu Feb 21 23:53:52 2019 New Revision: 344454 URL: https://svnweb.freebsd.org/changeset/base/344454 Log: MFC r344201: Remove vi(1)-related files via 'make delete-old' when WITHOUT_VI=1 is set. Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 21 22:56:54 2019 (r344453) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 21 23:53:52 2019 (r344454) @@ -9339,6 +9339,32 @@ OLD_FILES+=usr/share/man/man8/lastlogin.8.gz OLD_FILES+=usr/share/man/man8/utx.8.gz .endif +.if ${MK_VI} == no +OLD_FILES+=etc/rc.d/virecover +OLD_FILES+=rescue/ex +OLD_FILES+=rescue/vi +OLD_FILES+=usr/bin/ex +OLD_FILES+=usr/bin/nex +OLD_FILES+=usr/bin/nvi +OLD_FILES+=usr/bin/nview +OLD_FILES+=usr/bin/vi +OLD_FILES+=usr/bin/view +OLD_FILES+=usr/share/man/man1/ex.1.gz +OLD_FILES+=usr/share/man/man1/nex.1.gz +OLD_FILES+=usr/share/man/man1/nvi.1.gz +OLD_FILES+=usr/share/man/man1/nview.1.gz +OLD_FILES+=usr/share/man/man1/vi.1.gz +OLD_FILES+=usr/share/man/man1/view.1.gz +. if exists(${DESTDIR}/usr/share/vi) +VI_DIRS!=find ${DESTDIR}/usr/share/vi -type d \ + | sed -e 's,^${DESTDIR}/,,'; echo +VI_FILES!=find ${DESTDIR}/usr/share/vi \! -type d \ + | sed -e 's,^${DESTDIR}/,,'; echo +OLD_DIRS+=${VI_DIRS} +OLD_FILES+=${VI_FILES} +. endif +.endif + .if ${MK_WIRELESS} == no OLD_FILES+=etc/regdomain.xml OLD_FILES+=etc/rc.d/hostapd From owner-svn-src-all@freebsd.org Thu Feb 21 23:53: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 BC17714F6D5B; Thu, 21 Feb 2019 23:53:53 +0000 (UTC) (envelope-from avos@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 588E36E0A9; Thu, 21 Feb 2019 23:53:53 +0000 (UTC) (envelope-from avos@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 4A2C124FCA; Thu, 21 Feb 2019 23:53:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LNrr18051971; Thu, 21 Feb 2019 23:53:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1LNrrAP051970; Thu, 21 Feb 2019 23:53:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902212353.x1LNrrAP051970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 21 Feb 2019 23:53: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: r344454 - in stable: 11/tools/build/mk 12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/tools/build/mk 12/tools/build/mk X-SVN-Commit-Revision: 344454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 588E36E0A9 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)[-0.999,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, 21 Feb 2019 23:53:53 -0000 Author: avos Date: Thu Feb 21 23:53:52 2019 New Revision: 344454 URL: https://svnweb.freebsd.org/changeset/base/344454 Log: MFC r344201: Remove vi(1)-related files via 'make delete-old' when WITHOUT_VI=1 is set. Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 21 22:56:54 2019 (r344453) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 21 23:53:52 2019 (r344454) @@ -9720,6 +9720,32 @@ OLD_FILES+=usr/share/man/man8/lastlogin.8.gz OLD_FILES+=usr/share/man/man8/utx.8.gz .endif +.if ${MK_VI} == no +OLD_FILES+=etc/rc.d/virecover +OLD_FILES+=rescue/ex +OLD_FILES+=rescue/vi +OLD_FILES+=usr/bin/ex +OLD_FILES+=usr/bin/nex +OLD_FILES+=usr/bin/nvi +OLD_FILES+=usr/bin/nview +OLD_FILES+=usr/bin/vi +OLD_FILES+=usr/bin/view +OLD_FILES+=usr/share/man/man1/ex.1.gz +OLD_FILES+=usr/share/man/man1/nex.1.gz +OLD_FILES+=usr/share/man/man1/nvi.1.gz +OLD_FILES+=usr/share/man/man1/nview.1.gz +OLD_FILES+=usr/share/man/man1/vi.1.gz +OLD_FILES+=usr/share/man/man1/view.1.gz +. if exists(${DESTDIR}/usr/share/vi) +VI_DIRS!=find ${DESTDIR}/usr/share/vi -type d \ + | sed -e 's,^${DESTDIR}/,,'; echo +VI_FILES!=find ${DESTDIR}/usr/share/vi \! -type d \ + | sed -e 's,^${DESTDIR}/,,'; echo +OLD_DIRS+=${VI_DIRS} +OLD_FILES+=${VI_FILES} +. endif +.endif + .if ${MK_WIRELESS} == no OLD_FILES+=etc/regdomain.xml OLD_FILES+=etc/rc.d/hostapd From owner-svn-src-all@freebsd.org Fri Feb 22 02:16: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 9A96714FB10C; Fri, 22 Feb 2019 02:16:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DDF672B27; Fri, 22 Feb 2019 02:16:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id x131so985518itc.3; Thu, 21 Feb 2019 18:16:05 -0800 (PST) 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=utyy3LzZU1lyNCSnh/YtmuoMo97BPGom0mu1TI8aZWY=; b=dlDDXLA1TBuj6Fsd0tq6Ops18/xHLMtrhUzjSxjON+tdy0pW41b6avd4ASDAceLp0P m6B/k1g9q7Gjjl5Ig6lCyh4aFYT7tyXq0Tg8f4ou4WXyjgoU3NvlIT8ig63lY+wqf6BW WRICQbM8RSDtV++Z/lXKgvTMaEZgKouekPkQFTIJ1HZXcM9e2Xy1JwOvzKdqGnHaro5J IACqg5TEThqOtaDcghzp0iqDruJ7g+oIZqNdP1zGwBUdxb7XIJp3ZS/OvOtmxUNjrQgr DmfuN3YEm2OfrP7sd48LqNdvrql7OjAr2fRjgbBbzs4VwddplEK0dRl802k6RwCJUfQ8 R8zA== X-Gm-Message-State: AHQUAubqu6q89us0VsOiW/75ijCW0FdZI8a8PyvlYvzD0PP5b8Ez3u22 qCIdFs8YOyFPVvZOIUrxkr5Xu0Lo X-Google-Smtp-Source: AHgI3IZ9Tm8THaNBwQfPzhdng62Tte9Nb2Fkl8P2KGJnuiKkwFYw/y3s/ugOW8hx7PMYAU/qEJedbA== X-Received: by 2002:a05:660c:6cc:: with SMTP id z12mr1111049itk.65.1550801757862; Thu, 21 Feb 2019 18:15:57 -0800 (PST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id y190sm54827itb.26.2019.02.21.18.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 18:15:57 -0800 (PST) Received: by mail-io1-f48.google.com with SMTP id p17so578996iol.7; Thu, 21 Feb 2019 18:15:57 -0800 (PST) X-Received: by 2002:a6b:6007:: with SMTP id r7mr1031368iog.124.1550801757345; Thu, 21 Feb 2019 18:15:57 -0800 (PST) MIME-Version: 1.0 References: <201902212254.x1LMsHo1020671@repo.freebsd.org> In-Reply-To: <201902212254.x1LMsHo1020671@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 21 Feb 2019 18:15:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344452 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/intel/dtrace dev/dtrace To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2DDF672B27 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.942,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, 22 Feb 2019 02:16:05 -0000 Thanks Mark! Prior to this change, if you used userspace dtrace enough, eventually you would get a spurious SIGTRAP on a process, which has the default behavior of dumping core. Perhaps understandably, people balk at random core files lying around. Or at dtrace killing their programs. This patch should address that long-standing problem. An easy repro scenario was described in the differential: > It's possible to reproduce this by, for example, calling strlen() > in a loop, probing every instruction in strlen(), and killing dtrace(1). On Thu, Feb 21, 2019 at 2:54 PM Mark Johnston wrote: > > Author: markj > Date: Thu Feb 21 22:54:17 2019 > New Revision: 344452 > URL: https://svnweb.freebsd.org/changeset/base/344452 > > Log: > Fix a tracepoint lookup race in fasttrap_pid_probe(). > > fasttrap hooks the userspace breakpoint handler; the hook looks up the > breakpoint address in a hash table of tracepoints. It is possible for > the tracepoint to be removed by a different thread in between the > breakpoint trap and the hash table lookup, in which case SIGTRAP gets > delivered to the target process. Fix the problem by adding a > per-process generation counter that gets incremented when a tracepoint > belonging to that process is removed. Then, when a lookup fails, the > trapping instruction is restarted if the thread's counter doesn't match > that of the process. From owner-svn-src-all@freebsd.org Fri Feb 22 03:10: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 CDF7114FCBFE; Fri, 22 Feb 2019 03:10:25 +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 6CB8A76219; Fri, 22 Feb 2019 03:10:25 +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 2A0DD271B2; Fri, 22 Feb 2019 03:10:25 +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 x1M3APgK053327; Fri, 22 Feb 2019 03:10:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M3AOpJ053326; Fri, 22 Feb 2019 03:10:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902220310.x1M3AOpJ053326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 22 Feb 2019 03:10:24 +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: r344455 - in stable/11: . stand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: . stand X-SVN-Commit-Revision: 344455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CB8A76219 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.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 03:10:26 -0000 Author: kevans Date: Fri Feb 22 03:10:24 2019 New Revision: 344455 URL: https://svnweb.freebsd.org/changeset/base/344455 Log: Direct commit for some clarification/correction The notice in UPDATING stated the wrong direction for the link. Additionally, it's decidedly not a bad idea to throw in a comment mandating that the ordering of LOADER_DEFAULT_INTERP bits remains the same in this branch. This makes it even more obvious from diff review (against head) that this difference is intentional and creates merge conflicts if someone tries to apply the original commit manually. I suspect this won't be a problem given the set of people that maintain loader bits in stable/11, but it does offer a peace of mind. Reported by: rgrimes Modified: stable/11/UPDATING stable/11/stand/defs.mk Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Thu Feb 21 23:53:52 2019 (r344454) +++ stable/11/UPDATING Fri Feb 22 03:10:24 2019 (r344455) @@ -22,7 +22,7 @@ from older version of current across the gcc/clang cut in build(7), may be used to control which interpreter flavor is used in the default loader to be installed. For systems where Lua and Forth coexist, this switch can also be made on a running system by creating a - link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather + link from /boot/loader{,.efi} to /boot/loader_${flavor}{,efi} rather than requiring a rebuild. The default flavor in this branch will remain Forth. As indicated in Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Thu Feb 21 23:53:52 2019 (r344454) +++ stable/11/stand/defs.mk Fri Feb 22 03:10:24 2019 (r344455) @@ -156,6 +156,8 @@ CFLAGS+= -mlittle-endian # # Have a sensible default # +# XXX Do not change the ordering of this chain in this branch. 4th must remain +# the default for the lifetime of stable/11. .if ${MK_FORTH} == "yes" LOADER_DEFAULT_INTERP?=4th .elif ${MK_LOADER_LUA} == "yes" From owner-svn-src-all@freebsd.org Fri Feb 22 03:11: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 0AE8314FCCB2; Fri, 22 Feb 2019 03:11:29 +0000 (UTC) (envelope-from ganbold@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 3E7367653C; Fri, 22 Feb 2019 03:11:28 +0000 (UTC) (envelope-from ganbold@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 2F8F227304; Fri, 22 Feb 2019 03:11:28 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M3BSA8058165; Fri, 22 Feb 2019 03:11:28 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M3BSxG058164; Fri, 22 Feb 2019 03:11:28 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201902220311.x1M3BSxG058164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Fri, 22 Feb 2019 03:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344456 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 344456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E7367653C 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.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 03:11:29 -0000 Author: ganbold Date: Fri Feb 22 03:11:27 2019 New Revision: 344456 URL: https://svnweb.freebsd.org/changeset/base/344456 Log: Add base to the warning threshold. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:10:24 2019 (r344455) +++ head/sys/arm/allwinner/axp81x.c Fri Feb 22 03:11:27 2019 (r344456) @@ -195,8 +195,9 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_BAT_COULOMB_LO 0xe3 #define AXP_BAT_CAP_WARN 0xe6 -#define AXP_BAT_CAP_WARN_LV1 0xf0 /* Bits 4, 5, 6, 7 */ -#define AXP_BAT_CAP_WARN_LV2 0xf /* Bits 0, 1, 2, 3 */ +#define AXP_BAT_CAP_WARN_LV1 0xf0 /* Bits 4, 5, 6, 7 */ +#define AXP_BAP_CAP_WARN_LV1BASE 5 /* 5-20%, 1% per step */ +#define AXP_BAT_CAP_WARN_LV2 0xf /* Bits 0, 1, 2, 3 */ /* Sensor conversion macros */ #define AXP_SENSOR_BAT_H(hi) ((hi) << 4) @@ -1527,6 +1528,7 @@ axp8xx_attach(device_t dev) /* Get thresholds */ if (axp8xx_read(dev, AXP_BAT_CAP_WARN, &val, 1) == 0) { sc->warn_thres = (val & AXP_BAT_CAP_WARN_LV1) >> 4; + sc->warn_thres += AXP_BAP_CAP_WARN_LV1BASE; sc->shut_thres = (val & AXP_BAT_CAP_WARN_LV2); if (bootverbose) { device_printf(dev, From owner-svn-src-all@freebsd.org Fri Feb 22 03:12: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 70E6314FCEF4; Fri, 22 Feb 2019 03:12:57 +0000 (UTC) (envelope-from kevans@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 13FAD7678F; Fri, 22 Feb 2019 03:12:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B165110573; Fri, 22 Feb 2019 03:12:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f177.google.com with SMTP id v16so476978ljg.13; Thu, 21 Feb 2019 19:12:56 -0800 (PST) X-Gm-Message-State: AHQUAubytw5M5Ow6x1UjstU4sg+Jys+UGTQNN6YHj2DtoSte7jxy5l/j cBFnYZMbVzkTsRGoWGttQdCyZAinXxhcetwfysw= X-Google-Smtp-Source: AHgI3IZwtrnZzQbgSQYfXchTs72p0GmGUIa5LVFSfQ9tdSSAet4vksG8Q//cUy0Gq/FpZfL9Fe5GaYfZ63bL/vmXNgw= X-Received: by 2002:a2e:8006:: with SMTP id j6-v6mr929890ljg.186.1550805175226; Thu, 21 Feb 2019 19:12:55 -0800 (PST) MIME-Version: 1.0 References: <6A8C488C-05F4-4607-8F40-F301AF91E7EA@gmail.com> <201902211640.x1LGetma021290@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902211640.x1LGetma021290@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 21 Feb 2019 21:12:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344414 - stable/11 To: "Rodney W. Grimes" Cc: Enji Cooper , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 13FAD7678F 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.938,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: Fri, 22 Feb 2019 03:12:57 -0000 On Thu, Feb 21, 2019 at 10:41 AM Rodney W. Grimes wrote: > > > > On Feb 21, 2019, at 04:43, Kyle Evans wrote: > > > > > > On Thu, Feb 21, 2019 at 12:16 AM Rodney W. Grimes > > > wrote: > > >> > > >>> Author: kevans > > >>> Date: Thu Feb 21 03:22:20 2019 > > >>> New Revision: 344414 > > >>> URL: https://svnweb.freebsd.org/changeset/base/344414 > > >>> > > >>> Log: > > >>> MFC (RECORD ONLY) r338050: Loader default interpreter flip > > >>> > > >>> The default interpreter for stable/11 is 4th; this will never and can never > > >>> change. Record MFC of r338050 to proactively prevent any accidents in future > > >>> batching of MFCs. > > >>> > > >>> Modified: > > >>> Directory Properties: > > >>> stable/11/ (props changed) > > >> > > >> Does it make sense to do a direct commit to stable/11 > > >> marking the line that does this flip with a > > >> "Do not change this in the stable/11 branch" > > >> so that someone does not try to manually merge > > >> the change if they happen to notice the code > > >> is different? > > > > > > I'll chew on it for a little bit. It's fairly clear what the > > > ramifications of swapping those lines around are, even from diff > > > review, and I'd like to assume no one would willfully do it if they > > > put a couple seconds thought into what they were about to commit. > > > > Kyle, > > I think what you did makes sense. I?ve done this and I?ve > > seen others do similar in the past. > I concur, what he did do makes perfect since. > > > As someone who?s merged code in from others, I appreciate > > measures like this, which would prevent me from breaking a > > stable branch by accident. > > I am just wondering about a second safety belt, > as the current one just makes a svn merge -c338050 a silent nop, > but in no way stops someone from manually applying the diff. > > We have people that are very good with svn and would know how > to investigate the nop, and we have people who can barely > manage to do a merge with proper mergeinfo. > After mulling it over, I went ahead and committed the result in r344455. I still don't necessarily think it'll be a problem, but I certainly don't object to more safety belts and peace of mind -- especially since it's a subtle change to flip the ordering that might not be easy to catch at a glance without the ugly warning nearby. From owner-svn-src-all@freebsd.org Fri Feb 22 04:26: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 14BF214FEE90; Fri, 22 Feb 2019 04:26:22 +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 57F2D8088E; Fri, 22 Feb 2019 04:26:20 +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 D15183D79DF; Fri, 22 Feb 2019 15:26:10 +1100 (AEDT) Date: Fri, 22 Feb 2019 15:26:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Eric Fagan cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344451 - head/usr.sbin/nfsd In-Reply-To: <201902212249.x1LMndlW015916@repo.freebsd.org> Message-ID: <20190222131548.O1013@besplex.bde.org> References: <201902212249.x1LMndlW015916@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=UJetJGXy c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=SvWHm_VhSpC4oVs-_eoA:9 a=YVRJsE9b-wrcqvZu:21 a=VOkeM6AD56tJ1krA:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 57F2D8088E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,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: Fri, 22 Feb 2019 04:26:22 -0000 On Thu, 21 Feb 2019, Sean Eric Fagan wrote: > Log: > Fix the usage error I introduced in r344192. > > Specifically, I put the new option line in the wrong place, and then fixed > up the rest without realizing it. This puts the usage statement back to > what it was, with an additional line for the new -V option. This restores the misformatting of the output. Usage messages should have the same formatting as the man page. Not to mention they should have the same options. > Modified: head/usr.sbin/nfsd/nfsd.c > ============================================================================== > --- head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:21 2019 (r344450) > +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 21 22:49:39 2019 (r344451) > @@ -189,9 +189,9 @@ main(int argc, char **argv) > "usage:\n" > " nfsd [-ardtue] [-h bindip]\n" Misformatting starts here. man(1) output has a 5-column left margin without "usage: ". Normal usage messages use a 7-column left margin as needed to fit "usage: " before the command name on the same line. > " [-n numservers] [--minthreads #] [--maxthreads #]\n" > - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" > - " [-V virtual_hostname]\n" > - " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; > + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," > + "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n" This is the worst misformatting. > + " [-V virtual_hostname]\n"; > while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, > &longindex)) != -1) > switch (ch) { The man(1) output is: XX nfsd [-ardute] [-n num_servers] [-h bindip] [-p pnfs_setup] XX [-m mirror_level] [-V virtual_hostname] [--maxthreads max_threads] XX [--minthreads min_threads] This is missing the --pnfs and -V options. The usage messge is: XX usage: XX nfsd [-ardtue] [-h bindip] XX [-n numservers] [--minthreads #] [--maxthreads #] XX [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel] XX [-V virtual_hostname] Other bugs in the usage message: - the -n option is unsorted - the name of the arg for the -n option is different - the --minthreads and --maxthreads options are sorted backwards - the name of the arg for --minthreads and --maxthreads is different and unusual. Man pages cannot use the abbreviation '#' for a number since this is not unique. - the arg for the -p/--pnfs option is a description, not a name. This is also unsuitable for the synopsis in man pages - the description of the arg for the -p/--pnfs option is too long. man(1) would make a different mess of formatting a single long token. - the description for -p/-pnfs is not normally formatted. cp(1) gave an example of normal formatting for lists, but this was and is broken too. It was "src1 ... srcN directory" and is now "source_file ... target directory". The old version is apparently carefully abbreviated to fit on 1 line, but " srcN" is redundant if N > 1 and a syntax error if N == 1. nfsd has the same syntax error and this helps mess up the formatting. cp leaves a space between the arg names and the ellipsis. The commas in the nfsd arg are needed to give a single token, but are especially hard to format and to describe in a more formal syntax. nfsd's man page doesn't attempt to give a more formal syntax. The current version of cp(1) fixes the redundant/wrong srcN, but expands the arg names and misformats the resulting long line only in the usage message. The separate tokens allow man(1) to split the line at a bad place, but it somehow splits early so as to not split in the middle of related tokens. I found misformatting in man output in additions to vidcontrol(1) yesterday. It needs to start a new line for the -f arg after adding args before -f, but splits in between the option and the arg. This seems to be because the -f option has a complicated fairly formal syntax involving lots of square brackets and the man page source uses lots of markup to express this, and this confuses man(1). - there isn't even a newline after the long description for -p/--pnfs gives a too-long line - the -m option is unsorted - the name of the arg for the -m option is different. I seem to have lost my synopsis/usage checker. Here is a quick re-implementation: XX #!/bin/sh XX XX name=$1 XX XX IFS= synopsis=$(man $name | col -bx | awk '{ XX if (match($1, "SYNOPSIS")) { XX state = 1 XX next XX } else if (state == 0) XX next XX else if (length($0) == 0) XX exit XX if (state == 1) { XX print "usage: " substr($0, 6) XX state = 2 XX } else XX print " " $0 XX }') XX IFS= usage=$($name -? --help 2>&1 <>/dev/null | grep -v "illegal option") XX XX if test "$synopsis" = "$usage"; then XX echo "$name passed synopsis vs usage check" XX else XX echo "$name failed synopsis vs usage check" XX # XXX: should do a diff here. XX echo "synopsis:" XX echo "$synopsis" XX echo "usage:" XX echo "$usage" XX fi A reasonable number of files pass the strict lexical identity check (after minor edits to man(1) output). Pass/fail counts: FreeBSD-~5.2 FreeBSD-12.0-ALPHA10 /bin 11/32 15/28 # some improvements /sbin 20/78 20/116 # no improvements /usr/bin # failed (bugware doesn't check options and hangs) /usr/sbin # failed (bugware doesn't check options and hangs) /usr/libexec # failed (bugware as above, or man(1) spins on bad man page) Just found the old version. It uses sed instead of awk and edits the usage method instead of the man page, and removes 1 more line in the usage: XX sed -e '/Unrecognized switch/d' \ but is otherwise worse. Bruce From owner-svn-src-all@freebsd.org Fri Feb 22 04:40: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 B4A7414FF2F4; Fri, 22 Feb 2019 04:40:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 07FAD80E41; Fri, 22 Feb 2019 04:40:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1M4eAnN023764; Thu, 21 Feb 2019 20:40:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1M4eAND023763; Thu, 21 Feb 2019 20:40:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902220440.x1M4eAND023763@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344455 - in stable/11: . stand In-Reply-To: <201902220310.x1M3AOpJ053326@repo.freebsd.org> To: Kyle Evans Date: Thu, 21 Feb 2019 20:40:10 -0800 (PST) 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: 07FAD80E41 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.946,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, 22 Feb 2019 04:40:13 -0000 > Author: kevans > Date: Fri Feb 22 03:10:24 2019 > New Revision: 344455 > URL: https://svnweb.freebsd.org/changeset/base/344455 > > Log: > Direct commit for some clarification/correction > > The notice in UPDATING stated the wrong direction for the link. > > Additionally, it's decidedly not a bad idea to throw in a comment mandating > that the ordering of LOADER_DEFAULT_INTERP bits remains the same in this > branch. This makes it even more obvious from diff review (against head) that > this difference is intentional and creates merge conflicts if someone tries > to apply the original commit manually. I suspect this won't be a problem > given the set of people that maintain loader bits in stable/11, but it does > offer a peace of mind. > > Reported by: rgrimes Thank you, but you still missed the missing . > > Modified: > stable/11/UPDATING > stable/11/stand/defs.mk > > Modified: stable/11/UPDATING > ============================================================================== > --- stable/11/UPDATING Thu Feb 21 23:53:52 2019 (r344454) > +++ stable/11/UPDATING Fri Feb 22 03:10:24 2019 (r344455) > @@ -22,7 +22,7 @@ from older version of current across the gcc/clang cut > in build(7), may be used to control which interpreter flavor is used in > the default loader to be installed. For systems where Lua and Forth > coexist, this switch can also be made on a running system by creating a > - link from /boot/loader_${flavor}{,efi} to /boot/loader{,.efi} rather > + link from /boot/loader{,.efi} to /boot/loader_${flavor}{,efi} rather ^.efi? > than requiring a rebuild. > > The default flavor in this branch will remain Forth. As indicated in > > Modified: stable/11/stand/defs.mk > ============================================================================== > --- stable/11/stand/defs.mk Thu Feb 21 23:53:52 2019 (r344454) > +++ stable/11/stand/defs.mk Fri Feb 22 03:10:24 2019 (r344455) > @@ -156,6 +156,8 @@ CFLAGS+= -mlittle-endian > # > # Have a sensible default > # > +# XXX Do not change the ordering of this chain in this branch. 4th must remain > +# the default for the lifetime of stable/11. > .if ${MK_FORTH} == "yes" > LOADER_DEFAULT_INTERP?=4th > .elif ${MK_LOADER_LUA} == "yes" > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Feb 22 06:41: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 061CB14DBAFF; Fri, 22 Feb 2019 06:41:50 +0000 (UTC) (envelope-from bde@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 9E5CB85126; Fri, 22 Feb 2019 06:41:49 +0000 (UTC) (envelope-from bde@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 942BF17C5; Fri, 22 Feb 2019 06:41:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M6fnKl068607; Fri, 22 Feb 2019 06:41:49 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M6fmJI068601; Fri, 22 Feb 2019 06:41:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220641.x1M6fmJI068601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 06:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344458 - in head: share/man/man4 sys/conf usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head: share/man/man4 sys/conf usr.sbin/vidcontrol X-SVN-Commit-Revision: 344458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E5CB85126 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)[-0.999,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, 22 Feb 2019 06:41:50 -0000 Author: bde Date: Fri Feb 22 06:41:47 2019 New Revision: 344458 URL: https://svnweb.freebsd.org/changeset/base/344458 Log: Connect the restored dumb and sc terminal emulators to the kernel build. Add or fix options to control static and dynamic configuration. Keep the default of scteken, but default to statically configuring all available emulators (now 3 instead of 1). The dumb emulator is almost usable. libedit and libreadline handle dumb terminals perfectly for at least shell history. less(1) works as well as possible except on exit. But curses programs make messes. The dumb emulator has strange color support, with 2 dumb colors for normal output but fancy colorization for the cursor, mouse pointer and (with a non-dumb initial emulator) for low-level console output. Using the sc emulator instead of the default of scteken fixes at least the following bugs: - NUL is a printing character in cons25 but not in teken - teken doesn't support fixed colors for "reverse" video. - The best versions of sc are about 10 times faster than scteken (for printing to the frame buffer). This version is only about 5 times faster. Fix configuration features: - make SC_DFLT_TERM (for setting the initial emulator) a normal option. Add configuration features: - negative options SC_NO_TERM_* for omitting emulators in the static config. Modules for emulators might work, but I don't know of any - vidcontrol -e shows the available emulators - vidcontrol -E sets the active emulator. Modified: head/share/man/man4/syscons.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/usr.sbin/vidcontrol/vidcontrol.1 head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Fri Feb 22 04:52:12 2019 (r344457) +++ head/share/man/man4/syscons.4 Fri Feb 22 06:41:47 2019 (r344458) @@ -38,6 +38,7 @@ .Cd "options SC_ALT_MOUSE_IMAGE" .Cd "options SC_CUT_SEPCHARS=_characters_" .Cd "options SC_CUT_SPACES2TABS" +.Cd "options SC_DFLT_TERM" .Cd "options SC_DISABLE_KDBKEY" .Cd "options SC_DISABLE_REBOOT" .Cd "options SC_HISTORY_SIZE=N" @@ -48,6 +49,9 @@ .Cd "options SC_NO_PALETTE_LOADING" .Cd "options SC_NO_SUSPEND_VTYSWITCH" .Cd "options SC_NO_SYSMOUSE" +.Cd "options SC_NO_TERM_DUMB" +.Cd "options SC_NO_TERM_SC" +.Cd "options SC_NO_TERM_SCTEKEN" .Cd "options SC_PIXEL_MODE" .Cd "options SC_TWOBUTTON_MOUSE" .Cd "options SC_NORM_ATTR=_attribute_" @@ -285,6 +289,8 @@ This options instructs the driver to convert leading s when copying data into cut buffer. This might be useful to preserve indentation when copying tab-indented text. +.It Dv SC_DFLT_TERM=_name_ +This option specifies the name of the preferred terminal emulator. .It Dv SC_DISABLE_KDBKEY This option disables the ``debug'' key combination (by default, it is .Dv Alt-Esc , @@ -409,6 +415,15 @@ will fail if this option is defined. This option implies the .Dv SC_NO_CUTPASTE option too. +.It Dv SC_NO_TERM_DUMB +.It Dv SC_NO_TERM_SC +.It Dv SC_NO_TERM_SCTEKEN +These options remove the +.Qq dumb , +.Qq sc , +and +.Qq scteken +terminal emulators, respectively. .El .Ss Driver Flags The following driver flags can be used to control the Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/NOTES Fri Feb 22 06:41:47 2019 (r344458) @@ -1488,6 +1488,7 @@ options MAXCONS=16 # number of virtual consoles options SC_ALT_MOUSE_IMAGE # simplified mouse cursor in text mode options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp850 +options SC_DFLT_TERM=\"sc\" # default terminal emulator options SC_DISABLE_KDBKEY # disable `debug' key options SC_DISABLE_REBOOT # disable reboot key sequence options SC_HISTORY_SIZE=200 # number of history buffer lines @@ -1518,6 +1519,9 @@ options SC_NO_HISTORY options SC_NO_MODE_CHANGE options SC_NO_SYSMOUSE options SC_NO_SUSPEND_VTYSWITCH +#!options SC_NO_TERM_DUMB +#!options SC_NO_TERM_SC +#!options SC_NO_TERM_SCTEKEN # `flags' for sc # 0x80 Put the video card in the VESA 800x600 dots, 16 color mode Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/files Fri Feb 22 06:41:47 2019 (r344458) @@ -3133,7 +3133,9 @@ dev/syscons/rain/rain_saver.c optional rain_saver dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc -dev/syscons/scterm-teken.c optional sc +dev/syscons/scterm-dumb.c optional sc !SC_NO_TERM_DUMB +dev/syscons/scterm-sc.c optional sc !SC_NO_TERM_SC +dev/syscons/scterm-teken.c optional sc !SC_NO_TERM_TEKEN dev/syscons/scvidctl.c optional sc dev/syscons/scvtb.c optional sc dev/syscons/snake/snake_saver.c optional snake_saver @@ -4883,7 +4885,7 @@ security/mac_veriexec/mac_veriexec_sha1.c optional mac security/mac_veriexec/mac_veriexec_sha256.c optional mac_veriexec_sha256 security/mac_veriexec/mac_veriexec_sha384.c optional mac_veriexec_sha384 security/mac_veriexec/mac_veriexec_sha512.c optional mac_veriexec_sha512 -teken/teken.c optional sc | vt +teken/teken.c optional sc !SC_NO_TERM_TEKEN | vt ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs ufs/ffs/ffs_inode.c optional ffs Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Feb 22 04:52:12 2019 (r344457) +++ head/sys/conf/options Fri Feb 22 06:41:47 2019 (r344458) @@ -767,6 +767,7 @@ SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h +SC_DFLT_TERM opt_syscons.h SC_DISABLE_KDBKEY opt_syscons.h SC_DISABLE_REBOOT opt_syscons.h SC_HISTORY_SIZE opt_syscons.h @@ -780,6 +781,9 @@ SC_NO_HISTORY opt_syscons.h SC_NO_MODE_CHANGE opt_syscons.h SC_NO_SUSPEND_VTYSWITCH opt_syscons.h SC_NO_SYSMOUSE opt_syscons.h +SC_NO_TERM_DUMB opt_syscons.h +SC_NO_TERM_SC opt_syscons.h +SC_NO_TERM_TEKEN opt_syscons.h SC_NORM_ATTR opt_syscons.h SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h Modified: head/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.1 Fri Feb 22 04:52:12 2019 (r344457) +++ head/usr.sbin/vidcontrol/vidcontrol.1 Fri Feb 22 06:41:47 2019 (r344458) @@ -21,9 +21,10 @@ .Nd system console control and configuration utility .Sh SYNOPSIS .Nm -.Op Fl CdLHPpx +.Op Fl CdHLPpx .Op Fl b Ar color .Op Fl c Ar appearance +.Op Fl E Ar emulator .Oo .Fl f .Oo @@ -282,6 +283,11 @@ Show the current changes. .El .It Fl d Print out current output screen map. +.It Fl E Ar emulator +Set the terminal emulator to +.Ar emulator . +.It Fl e +Show the active and available terminal emulators. .It Xo .Fl f .Oo Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 04:52:12 2019 (r344457) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:41:47 2019 (r344458) @@ -204,11 +204,11 @@ usage(void) " [foreground [background]] [show]"); else fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", -" [-g geometry] [-h size] [-i active | adapter | mode]", -" [-l screen_map] [-M char] [-m on | off]", -" [-r foreground background] [-S on | off] [-s number]", -" [-T xterm | cons25] [-t N | off] [mode]", +"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-E emulator]", +" [-f [[size] file]] [-g geometry] [-h size]", +" [-i active | adapter | mode] [-l screen_map] [-M char]", +" [-m on | off] [-r foreground background] [-S on | off]", +" [-s number] [-T xterm | cons25] [-t N | off] [mode]", " [foreground [background]] [show]"); exit(1); } @@ -1384,7 +1384,46 @@ clear_history(void) } } +static int +get_terminal_emulator(int i, struct term_info *tip) +{ + tip->ti_index = i; + if (ioctl(0, CONS_GETTERM, tip) == 0) + return (1); + strlcpy(tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy(tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + return (0); +} + static void +get_terminal_emulators(void) +{ + struct term_info ti; + int i; + + for (i = 0; i < 10; i++) { + if (get_terminal_emulator(i, &ti) == 0) + break; + printf("%d: %s (%s)%s\n", i, ti.ti_name, ti.ti_desc, + i == 0 ? " (active)" : ""); + } +} + +static void +set_terminal_emulator(const char *name) +{ + struct term_info old_ti, ti; + + get_terminal_emulator(0, &old_ti); + strlcpy(ti.ti_name, name, sizeof(ti.ti_name)); + if (ioctl(0, CONS_SETTERM, &ti) != 0) + warn("SETTERM '%s'", name); + get_terminal_emulator(0, &ti); + printf("%s (%s) -> %s (%s)\n", old_ti.ti_name, old_ti.ti_desc, + ti.ti_name, ti.ti_desc); +} + +static void set_terminal_mode(char *arg) { @@ -1412,7 +1451,7 @@ main(int argc, char **argv) if (vt4_mode) opts = "b:Cc:fg:h:Hi:M:m:pPr:S:s:T:t:x"; else - opts = "b:Cc:dfg:h:Hi:l:LM:m:pPr:S:s:T:t:x"; + opts = "b:Cc:deE:fg:h:Hi:l:LM:m:pPr:S:s:T:t:x"; while ((opt = getopt(argc, argv, opts)) != -1) switch(opt) { @@ -1429,6 +1468,16 @@ main(int argc, char **argv) if (vt4_mode) break; print_scrnmap(); + break; + case 'E': + if (vt4_mode) + break; + set_terminal_emulator(optarg); + break; + case 'e': + if (vt4_mode) + break; + get_terminal_emulators(); break; case 'f': optarg = nextarg(argc, argv, &optind, 'f', 0); From owner-svn-src-all@freebsd.org Fri Feb 22 06:57: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 67E4014DC5B4; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@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 0BE3885ADD; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@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 0133519E9; Fri, 22 Feb 2019 06:57:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M6vkBA074629; Fri, 22 Feb 2019 06:57:46 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M6vkcY074628; Fri, 22 Feb 2019 06:57:46 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220657.x1M6vkcY074628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 06:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344459 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 344459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BE3885ADD 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 06:57:47 -0000 Author: bde Date: Fri Feb 22 06:57:46 2019 New Revision: 344459 URL: https://svnweb.freebsd.org/changeset/base/344459 Log: Fix warnings from -Wpointer-sign. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:41:47 2019 (r344458) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:57:46 2019 (r344459) @@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip) tip->ti_index = i; if (ioctl(0, CONS_GETTERM, tip) == 0) return (1); - strlcpy(tip->ti_name, "unknown", sizeof(tip->ti_name)); - strlcpy(tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); return (0); } @@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name) struct term_info old_ti, ti; get_terminal_emulator(0, &old_ti); - strlcpy(ti.ti_name, name, sizeof(ti.ti_name)); + strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name)); if (ioctl(0, CONS_SETTERM, &ti) != 0) warn("SETTERM '%s'", name); get_terminal_emulator(0, &ti); From owner-svn-src-all@freebsd.org Fri Feb 22 07:00: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 86B9114DC800; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@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 25F1785DDF; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@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 1AFA619F5; Fri, 22 Feb 2019 07:00:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M70NrV074971; Fri, 22 Feb 2019 07:00:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M70Nsb074970; Fri, 22 Feb 2019 07:00:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902220700.x1M70Nsb074970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 07:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344460 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 344460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25F1785DDF 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)[-0.999,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, 22 Feb 2019 07:00:24 -0000 Author: bde Date: Fri Feb 22 07:00:23 2019 New Revision: 344460 URL: https://svnweb.freebsd.org/changeset/base/344460 Log: Oops, actually fix warnings from -Wpointer-sign. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 06:57:46 2019 (r344459) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Feb 22 07:00:23 2019 (r344460) @@ -1390,8 +1390,8 @@ get_terminal_emulator(int i, struct term_info *tip) tip->ti_index = i; if (ioctl(0, CONS_GETTERM, tip) == 0) return (1); - strlcpy((unsigned char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); - strlcpy((unsigned char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); + strlcpy((char *)tip->ti_name, "unknown", sizeof(tip->ti_name)); + strlcpy((char *)tip->ti_desc, "unknown", sizeof(tip->ti_desc)); return (0); } @@ -1415,7 +1415,7 @@ set_terminal_emulator(const char *name) struct term_info old_ti, ti; get_terminal_emulator(0, &old_ti); - strlcpy((unsigned char *)ti.ti_name, name, sizeof(ti.ti_name)); + strlcpy((char *)ti.ti_name, name, sizeof(ti.ti_name)); if (ioctl(0, CONS_SETTERM, &ti) != 0) warn("SETTERM '%s'", name); get_terminal_emulator(0, &ti); From owner-svn-src-all@freebsd.org Fri Feb 22 08:04: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 DF17414DFC31; Fri, 22 Feb 2019 08:04:51 +0000 (UTC) (envelope-from avos@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 8276C88153; Fri, 22 Feb 2019 08:04:51 +0000 (UTC) (envelope-from avos@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 758D125D4; Fri, 22 Feb 2019 08:04:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M84pjP011494; Fri, 22 Feb 2019 08:04:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M84pnx011493; Fri, 22 Feb 2019 08:04:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902220804.x1M84pnx011493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 22 Feb 2019 08:04:51 +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: r344461 - stable/12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/tools/build/mk X-SVN-Commit-Revision: 344461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8276C88153 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]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 08:04:52 -0000 Author: avos Date: Fri Feb 22 08:04:50 2019 New Revision: 344461 URL: https://svnweb.freebsd.org/changeset/base/344461 Log: MFC r344214: Refresh OptionalObsoleteFiles.inc for MK_PMC: - Add missing /usr/sbin/pmc, pmcformat.h, libpmcstat.h and pmc.haswellxeon.3 to the list. - Correct man page section for pmcstudy.8. - Include recently added libipt and libopencsd for corresponding TARGET_ARCH Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 22 07:00:23 2019 (r344460) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 22 08:04:50 2019 (r344461) @@ -7370,8 +7370,76 @@ OLD_FILES+=usr/share/man/man7/pkg.7.gz .if ${MK_PMC} == no OLD_FILES+=usr/bin/pmcstudy +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/include/libipt/pt_last_ip.h +OLD_FILES+=usr/include/libipt/intel-pt.h +OLD_FILES+=usr/include/libipt/pt_time.h +OLD_FILES+=usr/include/libipt/pt_cpu.h +OLD_FILES+=usr/include/libipt/pt_compiler.h +OLD_DIRS+=usr/include/libipt +.endif +.if ${TARGET_ARCH} == "aarch64" +OLD_FILES+=usr/include/opencsd/c_api/opencsd_c_api.h +OLD_FILES+=usr/include/opencsd/c_api/ocsd_c_api_cust_impl.h +OLD_FILES+=usr/include/opencsd/c_api/ocsd_c_api_types.h +OLD_FILES+=usr/include/opencsd/c_api/ocsd_c_api_cust_fact.h +OLD_FILES+=usr/include/opencsd/c_api/ocsd_c_api_custom.h +OLD_DIRS+=usr/include/opencsd/c_api +OLD_FILES+=usr/include/opencsd/ocsd_if_types.h +OLD_FILES+=usr/include/opencsd/ptm/trc_dcd_mngr_ptm.h +OLD_FILES+=usr/include/opencsd/ptm/trc_pkt_proc_ptm.h +OLD_FILES+=usr/include/opencsd/ptm/trc_cmp_cfg_ptm.h +OLD_FILES+=usr/include/opencsd/ptm/ptm_decoder.h +OLD_FILES+=usr/include/opencsd/ptm/trc_pkt_elem_ptm.h +OLD_FILES+=usr/include/opencsd/ptm/trc_pkt_decode_ptm.h +OLD_FILES+=usr/include/opencsd/ptm/trc_pkt_types_ptm.h +OLD_DIRS+=usr/include/opencsd/ptm +OLD_FILES+=usr/include/opencsd/trc_gen_elem_types.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_proc_etmv4.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_etmv4_stack_elem.h +OLD_FILES+=usr/include/opencsd/etmv4/etmv4_decoder.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_dcd_mngr_etmv4i.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_types_etmv4.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h +OLD_FILES+=usr/include/opencsd/etmv4/trc_cmp_cfg_etmv4.h +OLD_DIRS+=usr/include/opencsd/etmv4 +OLD_FILES+=usr/include/opencsd/etmv3/trc_pkt_decode_etmv3.h +OLD_FILES+=usr/include/opencsd/etmv3/trc_cmp_cfg_etmv3.h +OLD_FILES+=usr/include/opencsd/etmv3/etmv3_decoder.h +OLD_FILES+=usr/include/opencsd/etmv3/trc_pkt_proc_etmv3.h +OLD_FILES+=usr/include/opencsd/etmv3/trc_pkt_elem_etmv3.h +OLD_FILES+=usr/include/opencsd/etmv3/trc_pkt_types_etmv3.h +OLD_FILES+=usr/include/opencsd/etmv3/trc_dcd_mngr_etmv3.h +OLD_DIRS+=usr/include/opencsd/etmv3 +OLD_FILES+=usr/include/opencsd/trc_pkt_types.h +OLD_FILES+=usr/include/opencsd/stm/trc_pkt_proc_stm.h +OLD_FILES+=usr/include/opencsd/stm/trc_pkt_types_stm.h +OLD_FILES+=usr/include/opencsd/stm/stm_decoder.h +OLD_FILES+=usr/include/opencsd/stm/trc_dcd_mngr_stm.h +OLD_FILES+=usr/include/opencsd/stm/trc_cmp_cfg_stm.h +OLD_FILES+=usr/include/opencsd/stm/trc_pkt_elem_stm.h +OLD_FILES+=usr/include/opencsd/stm/trc_pkt_decode_stm.h +OLD_DIRS+=usr/include/opencsd/stm +OLD_DIRS+=usr/include/opencsd +.endif OLD_FILES+=usr/include/pmc.h OLD_FILES+=usr/include/pmclog.h +OLD_FILES+=usr/include/pmcformat.h +OLD_FILES+=usr/include/libpmcstat.h +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib/libipt.a +OLD_FILES+=usr/lib/libipt.so +OLD_LIBS+=lib/libipt.so.0 +OLD_FILES+=usr/lib/libipt_p.a +.endif +.if ${TARGET_ARCH} == "aarch64" +OLD_FILES+=usr/lib/libopencsd.a +OLD_FILES+=usr/lib/libopencsd.so +OLD_LIBS+=lib/libopencsd.so.0 +OLD_FILES+=usr/lib/libopencsd_p.a +.endif OLD_FILES+=usr/lib/libpmc.a OLD_FILES+=usr/lib/libpmc.so OLD_LIBS+=usr/lib/libpmc.so.5 @@ -7380,10 +7448,10 @@ OLD_FILES+=usr/lib32/libpmc.a OLD_FILES+=usr/lib32/libpmc.so OLD_LIBS+=usr/lib32/libpmc.so.5 OLD_FILES+=usr/lib32/libpmc_p.a +OLD_FILES+=usr/sbin/pmc OLD_FILES+=usr/sbin/pmcannotate OLD_FILES+=usr/sbin/pmccontrol OLD_FILES+=usr/sbin/pmcstat -OLD_FILES+=usr/share/man/man1/pmcstudy.1.gz OLD_FILES+=usr/share/man/man3/pmc.3.gz OLD_FILES+=usr/share/man/man3/pmc.atom.3.gz OLD_FILES+=usr/share/man/man3/pmc.atomsilvermont.3.gz @@ -7393,6 +7461,7 @@ OLD_FILES+=usr/share/man/man3/pmc.corei7.3.gz OLD_FILES+=usr/share/man/man3/pmc.corei7uc.3.gz OLD_FILES+=usr/share/man/man3/pmc.haswell.3.gz OLD_FILES+=usr/share/man/man3/pmc.haswelluc.3.gz +OLD_FILES+=usr/share/man/man3/pmc.haswellxeon.3.gz OLD_FILES+=usr/share/man/man3/pmc.iaf.3.gz OLD_FILES+=usr/share/man/man3/pmc.ivybridge.3.gz OLD_FILES+=usr/share/man/man3/pmc.ivybridgexeon.3.gz @@ -7452,6 +7521,7 @@ OLD_FILES+=usr/share/man/man3/pmclog_read.3.gz OLD_FILES+=usr/share/man/man8/pmcannotate.8.gz OLD_FILES+=usr/share/man/man8/pmccontrol.8.gz OLD_FILES+=usr/share/man/man8/pmcstat.8.gz +OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .endif .if ${MK_PORTSNAP} == no From owner-svn-src-all@freebsd.org Fri Feb 22 08: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 D93CF14DFF91; Fri, 22 Feb 2019 08:10:59 +0000 (UTC) (envelope-from avos@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 7F91C8879B; Fri, 22 Feb 2019 08:10:59 +0000 (UTC) (envelope-from avos@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 362A2270B; Fri, 22 Feb 2019 08:10:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1M8AxO5013639; Fri, 22 Feb 2019 08:10:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1M8AxCI013638; Fri, 22 Feb 2019 08:10:59 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902220810.x1M8AxCI013638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 22 Feb 2019 08:10:59 +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: r344462 - stable/11/tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/tools/build/mk X-SVN-Commit-Revision: 344462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F91C8879B 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.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 08:11:00 -0000 Author: avos Date: Fri Feb 22 08:10:58 2019 New Revision: 344462 URL: https://svnweb.freebsd.org/changeset/base/344462 Log: MFC r344214: Refresh OptionalObsoleteFiles.inc for MK_PMC: - Add missing pmc.haswellxeon.3 to the list. - Correct man page section for pmcstudy.8. Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 22 08:04:50 2019 (r344461) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 22 08:10:58 2019 (r344462) @@ -7036,7 +7036,6 @@ OLD_FILES+=usr/lib32/libpmc_p.a OLD_FILES+=usr/sbin/pmcannotate OLD_FILES+=usr/sbin/pmccontrol OLD_FILES+=usr/sbin/pmcstat -OLD_FILES+=usr/share/man/man1/pmcstudy.1.gz OLD_FILES+=usr/share/man/man3/pmc.3.gz OLD_FILES+=usr/share/man/man3/pmc.atom.3.gz OLD_FILES+=usr/share/man/man3/pmc.atomsilvermont.3.gz @@ -7046,6 +7045,7 @@ OLD_FILES+=usr/share/man/man3/pmc.corei7.3.gz OLD_FILES+=usr/share/man/man3/pmc.corei7uc.3.gz OLD_FILES+=usr/share/man/man3/pmc.haswell.3.gz OLD_FILES+=usr/share/man/man3/pmc.haswelluc.3.gz +OLD_FILES+=usr/share/man/man3/pmc.haswellxeon.3.gz OLD_FILES+=usr/share/man/man3/pmc.iaf.3.gz OLD_FILES+=usr/share/man/man3/pmc.ivybridge.3.gz OLD_FILES+=usr/share/man/man3/pmc.ivybridgexeon.3.gz @@ -7105,6 +7105,7 @@ OLD_FILES+=usr/share/man/man3/pmclog_read.3.gz OLD_FILES+=usr/share/man/man8/pmcannotate.8.gz OLD_FILES+=usr/share/man/man8/pmccontrol.8.gz OLD_FILES+=usr/share/man/man8/pmcstat.8.gz +OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .endif .if ${MK_PORTSNAP} == no From owner-svn-src-all@freebsd.org Fri Feb 22 10:06: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 5AF9814E46DF; Fri, 22 Feb 2019 10:06:36 +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 F1FA88D180; Fri, 22 Feb 2019 10:06: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 E4E5B3CC5; Fri, 22 Feb 2019 10:06: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 x1MA6ZGA074611; Fri, 22 Feb 2019 10:06:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MA6YJN074607; Fri, 22 Feb 2019 10:06:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902221006.x1MA6YJN074607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Feb 2019 10:06:34 +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: r344463 - in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Commit-Revision: 344463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1FA88D180 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 10:06:36 -0000 Author: kib Date: Fri Feb 22 10:06:34 2019 New Revision: 344463 URL: https://svnweb.freebsd.org/changeset/base/344463 Log: Revert r344436, which was the merge of r344120. Currently stable/12 i386 installs old ld.bfd as ld (WITHOUT_LLD_IS_LD), which prevents ifunc relocations from working properly. If a static binary is linked, then it looses libc relocations needed. The stable i386 branch uses ld.lld for the world build (WITH_LLD_BOOTSTRAP), which is why static binaries from the base do not have the issue. Reported and diagnosted by: antoine Added: stable/12/lib/libc/amd64/gen/getcontextx.c - copied unchanged from r344435, stable/12/lib/libc/amd64/gen/getcontextx.c stable/12/lib/libc/i386/gen/getcontextx.c - copied unchanged from r344435, stable/12/lib/libc/i386/gen/getcontextx.c Deleted: stable/12/lib/libc/x86/gen/ Modified: stable/12/lib/libc/Makefile stable/12/lib/libc/amd64/gen/Makefile.inc stable/12/lib/libc/i386/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/Makefile ============================================================================== --- stable/12/lib/libc/Makefile Fri Feb 22 08:10:58 2019 (r344462) +++ stable/12/lib/libc/Makefile Fri Feb 22 10:06:34 2019 (r344463) @@ -120,7 +120,6 @@ NOASM= .endif .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" .include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" -.include "${LIBC_SRCTOP}/x86/gen/Makefile.inc" .endif .if ${MK_NIS} != "no" CFLAGS+= -DYP Modified: stable/12/lib/libc/amd64/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/gen/Makefile.inc Fri Feb 22 08:10:58 2019 (r344462) +++ stable/12/lib/libc/amd64/gen/Makefile.inc Fri Feb 22 10:06:34 2019 (r344463) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ - fabs.S \ + fabs.S getcontextx.c \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ fpgetround.c fpsetround.c fpgetsticky.c Copied: stable/12/lib/libc/amd64/gen/getcontextx.c (from r344435, stable/12/lib/libc/amd64/gen/getcontextx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/amd64/gen/getcontextx.c Fri Feb 22 10:06:34 2019 (r344463, copy of r344435, stable/12/lib/libc/amd64/gen/getcontextx.c) @@ -0,0 +1,113 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2011 Konstantin Belousov + * 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 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 + +static int xstate_sz = -1; + +int +__getcontextx_size(void) +{ + u_int p[4]; + + if (xstate_sz == -1) { + do_cpuid(1, p); + if ((p[2] & CPUID2_OSXSAVE) != 0) { + cpuid_count(0xd, 0x0, p); + xstate_sz = p[1] - sizeof(struct savefpu); + } else + xstate_sz = 0; + } + + return (sizeof(ucontext_t) + xstate_sz); +} + +int +__fillcontextx2(char *ctx) +{ + struct amd64_get_xfpustate xfpu; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (xstate_sz != 0) { + xfpu.addr = (char *)(ucp + 1); + xfpu.len = xstate_sz; + if (sysarch(AMD64_GET_XFPUSTATE, &xfpu) == -1) + return (-1); + ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr; + ucp->uc_mcontext.mc_xfpustate_len = xstate_sz; + ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE; + } else { + ucp->uc_mcontext.mc_xfpustate = 0; + ucp->uc_mcontext.mc_xfpustate_len = 0; + } + return (0); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: stable/12/lib/libc/i386/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/i386/gen/Makefile.inc Fri Feb 22 08:10:58 2019 (r344462) +++ stable/12/lib/libc/i386/gen/Makefile.inc Fri Feb 22 10:06:34 2019 (r344463) @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \ - flt_rounds.c infinity.c ldexp.c makecontext.c \ + flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \ rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S Copied: stable/12/lib/libc/i386/gen/getcontextx.c (from r344435, stable/12/lib/libc/i386/gen/getcontextx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/i386/gen/getcontextx.c Fri Feb 22 10:06:34 2019 (r344463, copy of r344435, stable/12/lib/libc/i386/gen/getcontextx.c) @@ -0,0 +1,145 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2011 Konstantin Belousov + * 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 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 + +static int xstate_sz = -1; + +int +__getcontextx_size(void) +{ + u_int p[4]; + int cpuid_supported; + + if (xstate_sz == -1) { + __asm __volatile( + " pushfl\n" + " popl %%eax\n" + " movl %%eax,%%ecx\n" + " xorl $0x200000,%%eax\n" + " pushl %%eax\n" + " popfl\n" + " pushfl\n" + " popl %%eax\n" + " xorl %%eax,%%ecx\n" + " je 1f\n" + " movl $1,%0\n" + " jmp 2f\n" + "1: movl $0,%0\n" + "2:\n" + : "=r" (cpuid_supported) : : "eax", "ecx"); + if (cpuid_supported) { + __asm __volatile( + " pushl %%ebx\n" + " cpuid\n" + " movl %%ebx,%1\n" + " popl %%ebx\n" + : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (0x1)); + if ((p[2] & CPUID2_OSXSAVE) != 0) { + __asm __volatile( + " pushl %%ebx\n" + " cpuid\n" + " movl %%ebx,%1\n" + " popl %%ebx\n" + : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), + "=d" (p[3]) + : "0" (0xd), "2" (0x0)); + xstate_sz = p[1] - sizeof(struct savexmm); + } else + xstate_sz = 0; + } else + xstate_sz = 0; + } + + return (sizeof(ucontext_t) + xstate_sz); +} + +int +__fillcontextx2(char *ctx) +{ + struct i386_get_xfpustate xfpu; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (xstate_sz != 0) { + xfpu.addr = (char *)(ucp + 1); + xfpu.len = xstate_sz; + if (sysarch(I386_GET_XFPUSTATE, &xfpu) == -1) + return (-1); + ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr; + ucp->uc_mcontext.mc_xfpustate_len = xstate_sz; + ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE; + } else { + ucp->uc_mcontext.mc_xfpustate = 0; + ucp->uc_mcontext.mc_xfpustate_len = 0; + } + return (0); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} From owner-svn-src-all@freebsd.org Fri Feb 22 11: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 29B2D14E7EFF; Fri, 22 Feb 2019 11:52:41 +0000 (UTC) (envelope-from bde@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 C22C169ACF; Fri, 22 Feb 2019 11:52:40 +0000 (UTC) (envelope-from bde@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 B75CA4F98; Fri, 22 Feb 2019 11:52:40 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MBqe3L032237; Fri, 22 Feb 2019 11:52:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MBqeNj032236; Fri, 22 Feb 2019 11:52:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902221152.x1MBqeNj032236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 22 Feb 2019 11:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344464 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C22C169ACF 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 11:52:41 -0000 Author: bde Date: Fri Feb 22 11:52:40 2019 New Revision: 344464 URL: https://svnweb.freebsd.org/changeset/base/344464 Log: Quick fix for building LINT on i386. A fix is needed on all arches and this one should also work on amd64 and sparc64. LINT was broken in r312910 with the removal of pc98 support, by changing the pathname in UKBD_DFLT_KEYBAP from a removed pc98 file to a nonexistent file. There are many bugs nearby. Some are: - the error is not properly detected and handled by make(1), because kbdcontrol(8) exits with status 0 after failing to find the keymap file - UKBD_DFLT_KEYBAP is supposed to be MI, and is in MI NOTES to try enforce this, but 5 out of 8 arches don't support it - LINT seems to have been broken by this in only 7 out of 8 arches. mips breaks test coverage instead, by killing this option in its MD NOTES. arm kills ukbd but that is not enough to configure an unsupported option used only by ukbd. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 22 10:06:34 2019 (r344463) +++ head/sys/conf/NOTES Fri Feb 22 11:52:40 2019 (r344464) @@ -2740,7 +2740,7 @@ options U3G_DEBUG # options for ukbd: options UKBD_DFLT_KEYMAP # specify the built-in keymap -makeoptions UKBD_DFLT_KEYMAP=jp +makeoptions UKBD_DFLT_KEYMAP=jp.106 # options for uplcom: options UPLCOM_INTR_INTERVAL=100 # interrupt pipe interval From owner-svn-src-all@freebsd.org Fri Feb 22 12:12: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 06F6914E9047; Fri, 22 Feb 2019 12:12:02 +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 9F2E06A7BE; Fri, 22 Feb 2019 12:12:01 +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 93D9651CB; Fri, 22 Feb 2019 12:12:01 +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 x1MCC1kE039793; Fri, 22 Feb 2019 12:12:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MCC1jp039792; Fri, 22 Feb 2019 12:12:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902221212.x1MCC1jp039792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Feb 2019 12:12: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: r344465 - stable/12/sys/x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/include X-SVN-Commit-Revision: 344465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F2E06A7BE 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.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 12:12:02 -0000 Author: kib Date: Fri Feb 22 12:12:01 2019 New Revision: 344465 URL: https://svnweb.freebsd.org/changeset/base/344465 Log: MFC r344293: Add definition for %cr4 PKRU enable bit. Modified: stable/12/sys/x86/include/specialreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Fri Feb 22 11:52:40 2019 (r344464) +++ stable/12/sys/x86/include/specialreg.h Fri Feb 22 12:12:01 2019 (r344465) @@ -77,6 +77,7 @@ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ #define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ #define CR4_SMAP 0x00200000 /* Supervisor-Mode Access Prevention */ +#define CR4_PKE 0x00400000 /* Protection Keys Enable */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From owner-svn-src-all@freebsd.org Fri Feb 22 12:26: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 14BF314E9D7D; Fri, 22 Feb 2019 12:26:29 +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 CEFDF6B0DE; Fri, 22 Feb 2019 12:26:28 +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 BFD7D54A0; Fri, 22 Feb 2019 12:26:28 +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 x1MCQSjY047910; Fri, 22 Feb 2019 12:26:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MCQSZE047908; Fri, 22 Feb 2019 12:26:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902221226.x1MCQSZE047908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Feb 2019 12:26:28 +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: r344466 - in stable/12/sys: amd64/include i386/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/include i386/include X-SVN-Commit-Revision: 344466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEFDF6B0DE 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,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, 22 Feb 2019 12:26:29 -0000 Author: kib Date: Fri Feb 22 12:26:28 2019 New Revision: 344466 URL: https://svnweb.freebsd.org/changeset/base/344466 Log: MFC r344296: Provide convenience C wrappers for RDPKRU and WRPKRU instructions. Modified: stable/12/sys/amd64/include/cpufunc.h stable/12/sys/i386/include/cpufunc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/cpufunc.h ============================================================================== --- stable/12/sys/amd64/include/cpufunc.h Fri Feb 22 12:12:01 2019 (r344465) +++ stable/12/sys/amd64/include/cpufunc.h Fri Feb 22 12:26:28 2019 (r344466) @@ -627,6 +627,22 @@ cpu_mwait(u_long extensions, u_int hints) __asm __volatile("mwait" : : "a" (hints), "c" (extensions)); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #ifdef _KERNEL /* This is defined in but is too painful to get to */ #ifndef MSR_FSBASE Modified: stable/12/sys/i386/include/cpufunc.h ============================================================================== --- stable/12/sys/i386/include/cpufunc.h Fri Feb 22 12:12:01 2019 (r344465) +++ stable/12/sys/i386/include/cpufunc.h Fri Feb 22 12:26:28 2019 (r344466) @@ -726,6 +726,22 @@ intr_restore(register_t eflags) write_eflags(eflags); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); From owner-svn-src-all@freebsd.org Fri Feb 22 12:27: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 AA5B614E9E8E; Fri, 22 Feb 2019 12:27:26 +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 4D06A6B253; Fri, 22 Feb 2019 12:27:26 +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 4227354A2; Fri, 22 Feb 2019 12:27: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 x1MCRQnq048016; Fri, 22 Feb 2019 12:27:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MCRQ9b048015; Fri, 22 Feb 2019 12:27:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902221227.x1MCRQ9b048015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Feb 2019 12:27: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: r344467 - stable/12/usr.bin/mkuzip X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/mkuzip X-SVN-Commit-Revision: 344467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D06A6B253 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.943,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 12:27:26 -0000 Author: kib Date: Fri Feb 22 12:27:25 2019 New Revision: 344467 URL: https://svnweb.freebsd.org/changeset/base/344467 Log: MFC r344303: Minor cleanup for mkuzip(8) man page. Modified: stable/12/usr.bin/mkuzip/mkuzip.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/mkuzip/mkuzip.8 ============================================================================== --- stable/12/usr.bin/mkuzip/mkuzip.8 Fri Feb 22 12:26:28 2019 (r344466) +++ stable/12/usr.bin/mkuzip/mkuzip.8 Fri Feb 22 12:27:25 2019 (r344467) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2006 +.Dd February 19, 2019 .Dt MKUZIP 8 .Os .Sh NAME @@ -35,10 +35,10 @@ class .Sh SYNOPSIS .Nm -.Op Fl v +.Op Fl dLSsvZ +.Op Fl j Ar compression_jobs .Op Fl o Ar outfile .Op Fl s Ar cluster_size -.Op Fl j Ar compression_jobs .Ar infile .Sh DESCRIPTION The @@ -68,6 +68,33 @@ locating each individual cluster is written to the out .Pp The options are: .Bl -tag -width indent +.It Fl j Ar compression_jobs +Specify the number of compression jobs that +.Nm +runs in parallel to speed up compression. +When option is not specified the number of jobs set to be equal +to the value of +.Va hw.ncpu +.Xr sysctl 8 +variable. +.It Fl d +Enable de-duplication. +When the option is enabled the +.Nm +detects identical blocks in the input and replaces each subsequent occurence +of such block with pointer to the very first one in the output. +Setting this option results is moderate decrease of compressed image size, +typically around 3-5% of a final size of the compressed image. +.It Fl L +Use +.Xr lzma 3 +compression algorithm instead of the default +.Xr zlib 3 . +The +.Xr lzma 3 +provides noticeable better compression levels on the same data set +at the expense of much slower compression speed (10-20x) and somewhat slower +decompression (2-3x). .It Fl o Ar outfile Name of the output file .Ar outfile . @@ -79,16 +106,9 @@ compression or .Pa .ulzma for the .Xr lzma 3 . -.It Fl L -Use -.Xr lzma 3 -compression algorithm instead of the default -.Xr zlib 3 . -The -.Xr lzma 3 -provides noticeable better compression levels on the same data set -at the expense of much slower compression speed (10-20x) and somewhat slower -decompression (2-3x). +.It Fl S +Print summary about the compression ratio as well as output +file size after file has been processed. .It Fl s Ar cluster_size Split the image into clusters of .Ar cluster_size @@ -111,26 +131,6 @@ Setting .Fl Z results is slight increase of compressed image size, typically less than 0.1% of a final size of the compressed image. -.It Fl d -Enable de-duplication. -When the option is enabled the -.Nm -detects identical blocks in the input and replaces each subsequent occurence -of such block with pointer to the very first one in the output. -Setting this option results is moderate decrease of compressed image size, -typically around 3-5% of a final size of the compressed image. -.It Fl S -Print summary about the compression ratio as well as output -file size after file has been processed. -.It Fl j Ar compression_jobs -Specify the number of compression jobs that -.Nm -runs in parallel to speed up compression. -When option is not specified the number of jobs set to be equal -to the value of -.Va hw.ncpu -.Xr sysctl 8 -variable. .El .Sh NOTES The compression ratio largely depends on the cluster size used. From owner-svn-src-all@freebsd.org Fri Feb 22 14:59: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 DEA9E14EE9B5; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@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 863D26FEBB; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@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 797746DF6; Fri, 22 Feb 2019 14:59:40 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MExemk026300; Fri, 22 Feb 2019 14:59:40 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MExegD026299; Fri, 22 Feb 2019 14:59:40 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221459.x1MExegD026299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 14:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344468 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 863D26FEBB 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)[-0.999,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, 22 Feb 2019 14:59:41 -0000 Author: dab Date: Fri Feb 22 14:59:40 2019 New Revision: 344468 URL: https://svnweb.freebsd.org/changeset/base/344468 Log: Revert r344389 & r343906 - Fix Coverity errors in newsyslog It was pointed out that a couple of the "memory leak" CIDs that I fixed were arguably Coverity errors rather than errors in the newsyslog code and the cure was worse than the disease. Revert both changes. The first change, which included fixes for other Coverity errors, will be re-worked to omit the troublesome changes and then re-committed with the remaining fixes. Reported by: bde Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 12:27:25 2019 (r344467) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 14:59:40 2019 (r344468) @@ -253,7 +253,7 @@ static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry **defconf, struct ilist *inclist); + struct conf_entry *defconf_p, struct ilist *inclist); static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); @@ -374,8 +374,6 @@ main(int argc, char **argv) while (wait(NULL) > 0 || errno == EINTR) ; - free(timefnamefmt); - free(requestor); return (0); } @@ -793,9 +791,6 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); - /* Free global dynamically-allocated storage. */ - free(timefnamefmt); - free(requestor); exit(1); } @@ -846,7 +841,7 @@ get_worklist(char **files) if (verbose) printf("Processing %s\n", inc->file); - parse_file(f, filelist, globlist, &defconf, &inclist); + parse_file(f, filelist, globlist, defconf, &inclist); (void) fclose(f); } @@ -863,6 +858,7 @@ get_worklist(char **files) if (defconf != NULL) free_entry(defconf); return (filelist); + /* NOTREACHED */ } /* @@ -919,7 +915,7 @@ get_worklist(char **files) * for a "glob" entry which does match. */ gmatch = 0; - if (verbose > 2) + if (verbose > 2 && globlist != NULL) printf("\t+ Checking globs for %s\n", *given); STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); @@ -1050,7 +1046,7 @@ expand_globs(struct cflist *work_p, struct cflist *glo */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry **defconf_p, struct ilist *inclist) + struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; @@ -1141,12 +1137,12 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (*defconf_p != NULL) { + if (defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - *defconf_p = working; + defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); @@ -1361,8 +1357,7 @@ no_trimat: q = NULL; else { q = parse = sob(parse + 1); /* Optional field */ - parse = son(parse); - *parse = '\0'; + *(parse = son(parse)) = '\0'; } working->sig = SIGHUP; @@ -2015,6 +2010,7 @@ do_zipwork(struct zipwork_entry *zwork) const char **args, *pgm_name, *pgm_path; char *zresult; + command = NULL; assert(zwork != NULL); assert(zwork->zw_conf != NULL); assert(zwork->zw_conf->compress > COMPRESS_NONE); @@ -2118,7 +2114,8 @@ do_zipwork(struct zipwork_entry *zwork) change_attrs(zresult, zwork->zw_conf); out: - sbuf_delete(command); + if (command != NULL) + sbuf_delete(command); free(args); free(zresult); } From owner-svn-src-all@freebsd.org Fri Feb 22 15:03: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 5DCDA14EEDF3; Fri, 22 Feb 2019 15:03:43 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFACB704EF; Fri, 22 Feb 2019 15:03:42 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: by mail-it1-x12b.google.com with SMTP id m137so3357292ita.0; Fri, 22 Feb 2019 07:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=GqIEBhx8C25T7neNHDFf07DbOxBxYPpOIUcZOEHSTYI=; b=hyu8U9Cw9I9VFxLTFH7FWjSo55g3TAvLIDkEe6CrzWoYO2m04yg0lZW4vXtStu1vUK 8LJndMYseraFj5QNmZ3BVPVyaRwTe4nQTppLZrjsbcuoeO5wzNvIu44ln4aLCOqWYJ9g W7kqmqhRUlirbHeY+L/uuhy9FRxdBKn49GwR5O6m01I1BPjp3rZpWjhwtOyoIM/CHCqG aNsOvWNRu48AVmojjPKQAlB55b28pdPzDXXMOg8aPmUzPs9pODYDl1wS4Tt0MXDXkRMd F6KGCJCcyr62CvOv9vbg/0t3whLyVi/tzm7vlvpBJlLc1ZejdQsCZR4J90aZMrlCWOG8 A8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=GqIEBhx8C25T7neNHDFf07DbOxBxYPpOIUcZOEHSTYI=; b=blbzC5Evop8KPHBCGtKZZbvdUpx1pjF6abTqecxNyWIhEYW8/bfIek0sOZ4RhW8t/l xpBBwo/4+LOqFO5nKFBxlT9Nwv7Ando5FOzM94vCJRbjy2ylQiC0ksDrBo8L4t2ROh58 OB8tEtU9C/HmaDPhmjgLMKYiYgNUnjs9agAwp7o8YemKUxzjyRv7z1nTm2Uqv3ZNNnOH PmlBPivRkIptpImA+IaXUoHvrNb0mBrp0aVqhvcpfqycasGjZ48ZpwGHQSGMOuLjlrLH hgxCjpsLtuD7uF2+aFHuyMV6ok0L6XXBAi8yp/SQEiJv1CM++yI2Pd8BtBCo9uyfWnHH 9gGQ== X-Gm-Message-State: AHQUAuaaKx28QlO2MhWCPKbCVupECdNeDK+z9jszw27+CWx3ymYzycCk 7rTvD5rqZ3S1Isrwa91EXV8JWDuF X-Google-Smtp-Source: AHgI3IY7AVJr/rZzFyWYoJShPXImLSvOq8K1XgvaiUvI5K68h+XGL7O9/zHZxX6F6GKTwaDMNJJRLQ== X-Received: by 2002:a24:4a95:: with SMTP id k143mr2397177itb.77.1550847821991; Fri, 22 Feb 2019 07:03:41 -0800 (PST) Received: from ?IPv6:2601:442:4580:3ee3:d1f4:bd82:e7a5:4239? ([2601:442:4580:3ee3:d1f4:bd82:e7a5:4239]) by smtp.gmail.com with ESMTPSA id w13sm793099itb.10.2019.02.22.07.03.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 07:03:41 -0800 (PST) Sender: David Bright From: David Bright X-Google-Original-From: David Bright Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344389 - head/usr.sbin/newsyslog Date: Fri, 22 Feb 2019 09:03:39 -0600 In-Reply-To: Cc: Warner Losh , Garrett Cooper , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: John Baldwin References: <201902202205.x1KM5iZX036319@repo.freebsd.org> <20190221121712.Y989@besplex.bde.org> <3CD59489-0595-4D09-B5C9-C3F25D23BB8D@gmail.com> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: DFACB704EF 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] 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, 22 Feb 2019 15:03:43 -0000 [=E2=80=A6 other discussion omitted=E2=80=A6]=20 On Feb 21, 2019, at 12:22 PM, John Baldwin wrote: >=20 >=20 > I'm +1 on Bruce's point on this. I find it similar to the recent = spate of > adding pointless '__dead2' annotations to usage functions that = unconditionally > call exit() (and thus are already inferred as __dead2 by any compiler > written in this millenium) I=E2=80=99ve reverted (r344468) the two commits that contained the = memory leak fixes at issue.=20 Thanks for the feedback. --=20 David Bright dab@FreeBSD.org From owner-svn-src-all@freebsd.org Fri Feb 22 15:09: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 80AB614EF088; Fri, 22 Feb 2019 15:09:12 +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 E44B2707D3; Fri, 22 Feb 2019 15:09:11 +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 7A752436F52; Sat, 23 Feb 2019 02:09:08 +1100 (AEDT) Date: Sat, 23 Feb 2019 02:09:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Bright cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344468 - head/usr.sbin/newsyslog In-Reply-To: <201902221459.x1MExegD026299@repo.freebsd.org> Message-ID: <20190223020739.H33323@besplex.bde.org> References: <201902221459.x1MExegD026299@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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Mu5RLQuuxLdgbZ8lhckA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: E44B2707D3 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.937,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, 22 Feb 2019 15:09:12 -0000 On Fri, 22 Feb 2019, David Bright wrote: > Log: > Revert r344389 & r343906 - Fix Coverity errors in newsyslog > > It was pointed out that a couple of the "memory leak" CIDs that I > fixed were arguably Coverity errors rather than errors in the > newsyslog code and the cure was worse than the disease. Revert both > changes. The first change, which included fixes for other Coverity > errors, will be re-worked to omit the troublesome changes and then > re-committed with the remaining fixes. > > Reported by: bde > Sponsored by: Dell EMC Isilon Thanks. The other changes look OK. Bruce From owner-svn-src-all@freebsd.org Fri Feb 22 15:15: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 5BC2C14EF53C; Fri, 22 Feb 2019 15:15:37 +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 F3A8570E37; Fri, 22 Feb 2019 15:15:36 +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 E7449715A; Fri, 22 Feb 2019 15:15:36 +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 x1MFFa9r036711; Fri, 22 Feb 2019 15:15:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MFFahU036709; Fri, 22 Feb 2019 15:15:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902221515.x1MFFahU036709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Feb 2019 15:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344469 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 344469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3A8570E37 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)[-0.999,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, 22 Feb 2019 15:15:37 -0000 Author: imp Date: Fri Feb 22 15:15:36 2019 New Revision: 344469 URL: https://svnweb.freebsd.org/changeset/base/344469 Log: Rework logpage extensibility. Move from using a linker set to a constructor function that's called. This simplifies the code and is slightly more obvious. We now keep a list of page decoders rather than having an array we managed before. Commands will move to something similar in the future. Reviewed by: jhb@ Differential Revision: https://reviews.freebsd.org/D19275 Modified: head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/logpage.c Fri Feb 22 15:15:36 2019 (r344469) @@ -53,8 +53,15 @@ __FBSDID("$FreeBSD$"); #define MAX_FW_SLOTS (7) -SET_CONCAT_DEF(logpage, struct logpage_function); +static SLIST_HEAD(,logpage_function) logpages; +void +logpage_register(struct logpage_function *p) +{ + + SLIST_INSERT_HEAD(&logpages, p, link); +} + const char * kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key) { @@ -326,15 +333,15 @@ NVME_LOGPAGE(fw, static void logpage_help(void) { - const struct logpage_function * const *f; + const struct logpage_function *f; const char *v; fprintf(stderr, "\n"); fprintf(stderr, "%-8s %-10s %s\n", "Page", "Vendor","Page Name"); fprintf(stderr, "-------- ---------- ----------\n"); - for (f = logpage_begin(); f < logpage_limit(); f++) { - v = (*f)->vendor == NULL ? "-" : (*f)->vendor; - fprintf(stderr, "0x%02x %-10s %s\n", (*f)->log_page, v, (*f)->name); + SLIST_FOREACH(f, &logpages, link) { + v = f->vendor == NULL ? "-" : f->vendor; + fprintf(stderr, "0x%02x %-10s %s\n", f->log_page, v, f->name); } exit(1); @@ -352,7 +359,7 @@ logpage(const struct nvme_function *nf, int argc, char uint32_t nsid, size; void *buf; const char *vendor = NULL; - const struct logpage_function * const *f; + const struct logpage_function *f; struct nvme_controller_data cdata; print_fn_t print_fn; uint8_t ns_smart; @@ -438,14 +445,14 @@ logpage(const struct nvme_function *nf, int argc, char * the page is vendor specific, don't match the print function * unless the vendors match. */ - for (f = logpage_begin(); f < logpage_limit(); f++) { - if ((*f)->vendor != NULL && vendor != NULL && - strcmp((*f)->vendor, vendor) != 0) + SLIST_FOREACH(f, &logpages, link) { + if (f->vendor != NULL && vendor != NULL && + strcmp(f->vendor, vendor) != 0) continue; - if (log_page != (*f)->log_page) + if (log_page != f->log_page) continue; - print_fn = (*f)->print_fn; - size = (*f)->size; + print_fn = f->print_fn; + size = f->size; break; } } Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/nvmecontrol.c Fri Feb 22 15:15:36 2019 (r344469) @@ -312,19 +312,17 @@ load_dir(const char *dir) warnx("Can't load %s: %s", path, dlerror()); else { /* - * Add in the top (for cli commands) and logpage (for - * logpage parsing) linker sets. We have to do this by - * hand because linker sets aren't automatically merged. + * Add in the top (for cli commands)linker sets. We have + * to do this by hand because linker sets aren't + * automatically merged. */ void *begin, *limit; + begin = dlsym(h, "__start_set_top"); limit = dlsym(h, "__stop_set_top"); if (begin) add_to_top(begin, limit); - begin = dlsym(h, "__start_set_logpage"); - limit = dlsym(h, "__stop_set_logpage"); - if (begin) - add_to_logpage(begin, limit); + /* log pages use constructors so are done on load */ } free(path); path = NULL; @@ -337,7 +335,6 @@ main(int argc, char *argv[]) { add_to_top(NVME_CMD_BEGIN(top), NVME_CMD_LIMIT(top)); - add_to_logpage(NVME_LOGPAGE_BEGIN, NVME_LOGPAGE_LIMIT); load_dir("/lib/nvmecontrol"); load_dir("/usr/local/lib/nvmecontrol"); Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Fri Feb 22 14:59:40 2019 (r344468) +++ head/sbin/nvmecontrol/nvmecontrol.h Fri Feb 22 15:15:36 2019 (r344469) @@ -32,6 +32,7 @@ #define __NVMECONTROL_H__ #include +#include #include struct nvme_function; @@ -56,6 +57,7 @@ struct nvme_function { typedef void (*print_fn_t)(const struct nvme_controller_data *cdata, void *buf, uint32_t size); struct logpage_function { + SLIST_ENTRY(logpage_function) link; uint8_t log_page; const char *vendor; const char *name; @@ -64,7 +66,6 @@ struct logpage_function { }; -#define NVME_LOGPAGESET(sym) DATA_SET(NVME_SETNAME(logpage), sym) #define NVME_LOGPAGE(unique, lp, vend, nam, fn, sz) \ static struct logpage_function unique ## _lpf = { \ .log_page = lp, \ @@ -73,10 +74,8 @@ struct logpage_function { .print_fn = fn, \ .size = sz, \ } ; \ - NVME_LOGPAGESET(unique ## _lpf) -#define NVME_LOGPAGE_BEGIN SET_BEGIN(NVME_SETNAME(logpage)) -#define NVME_LOGPAGE_LIMIT SET_LIMIT(NVME_SETNAME(logpage)) -#define NVME_LOGPAGE_DECLARE(t) SET_DECLARE(NVME_SETNAME(logpage), t) + static void logpage_reg_##unique(void) __attribute__((constructor)); \ + static void logpage_reg_##unique(void) { logpage_register(&unique##_lpf); } #define DEFAULT_SIZE (4096) struct kv_name { @@ -87,7 +86,7 @@ struct kv_name { const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); NVME_CMD_DECLARE(top, struct nvme_function); -NVME_LOGPAGE_DECLARE(struct logpage_function); +void logpage_register(struct logpage_function *p); struct set_concat { void **begin; @@ -105,7 +104,6 @@ void add_to_ ## set(t **b, t **e) \ #define SET_CONCAT_DECL(set, t) \ void add_to_ ## set(t **b, t **e) SET_CONCAT_DECL(top, struct nvme_function); -SET_CONCAT_DECL(logpage, struct logpage_function); #define NVME_CTRLR_PREFIX "nvme" #define NVME_NS_PREFIX "ns" From owner-svn-src-all@freebsd.org Fri Feb 22 15: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 E9CBD14F0036; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@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 5881F71981; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@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 45AFF747B; Fri, 22 Feb 2019 15:31:51 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MFVpKU046081; Fri, 22 Feb 2019 15:31:51 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MFVpd4046080; Fri, 22 Feb 2019 15:31:51 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221531.x1MFVpd4046080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 15:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344470 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 344470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5881F71981 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)[-0.999,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, 22 Feb 2019 15:31:52 -0000 Author: dab Date: Fri Feb 22 15:31:50 2019 New Revision: 344470 URL: https://svnweb.freebsd.org/changeset/base/344470 Log: Fix several Coverity-detected issues in newsyslog. - CID 1394815, CID 1305673: Dereference before null check - memory was allocated and the allocation checked for NULL with a call to errx() if it failed. Code below that was guaranteed that the pointer was non-NULL, but there was another check for NULL at the exit of the function (after the memory had already been referenced). Eliminate the useless NULL check. - CID 1007452: Resource leak - Storage intended to be allocated and returned to the caller was never freed. This was the result of a regression in the function signature introduced in r208648 (2010) (thanks for that find, @cem!). Fixed by altering the function signature and passing the allocated memory to the caller as intended. This also fixes PR158794. - CID 1008620: Logically dead code in newsyslog.c - This was a direct result of CID 1007452. Since the memory allocated as described there was not returned to the caller, a subsequent check for the memory having been allocated was dead code. Returning the memory re-animates the code that is the subject of this CID. - CID 1006131: Unused value - in parsing a configuration file, a pointer to the end of the last field was saved, but not used after that. Rewrite to use the pointer value. This could have been fixed by avoiding the assignment altogether, but this solutions more closely follows the pattern used in the preceding code. PR: 158794 Reported by: Coverity, Ken-ichi EZURA (PR158794) Reviewed by: cem, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19105 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 15:15:36 2019 (r344469) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Feb 22 15:31:50 2019 (r344470) @@ -253,7 +253,7 @@ static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p, struct ilist *inclist); + struct conf_entry **defconf, struct ilist *inclist); static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); @@ -841,7 +841,7 @@ get_worklist(char **files) if (verbose) printf("Processing %s\n", inc->file); - parse_file(f, filelist, globlist, defconf, &inclist); + parse_file(f, filelist, globlist, &defconf, &inclist); (void) fclose(f); } @@ -858,7 +858,6 @@ get_worklist(char **files) if (defconf != NULL) free_entry(defconf); return (filelist); - /* NOTREACHED */ } /* @@ -915,7 +914,7 @@ get_worklist(char **files) * for a "glob" entry which does match. */ gmatch = 0; - if (verbose > 2 && globlist != NULL) + if (verbose > 2) printf("\t+ Checking globs for %s\n", *given); STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); @@ -1046,7 +1045,7 @@ expand_globs(struct cflist *work_p, struct cflist *glo */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p, struct ilist *inclist) + struct conf_entry **defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; @@ -1137,12 +1136,12 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (defconf_p != NULL) { + if (*defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - defconf_p = working; + *defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); @@ -1357,7 +1356,8 @@ no_trimat: q = NULL; else { q = parse = sob(parse + 1); /* Optional field */ - *(parse = son(parse)) = '\0'; + parse = son(parse); + *parse = '\0'; } working->sig = SIGHUP; @@ -2010,7 +2010,6 @@ do_zipwork(struct zipwork_entry *zwork) const char **args, *pgm_name, *pgm_path; char *zresult; - command = NULL; assert(zwork != NULL); assert(zwork->zw_conf != NULL); assert(zwork->zw_conf->compress > COMPRESS_NONE); @@ -2114,8 +2113,7 @@ do_zipwork(struct zipwork_entry *zwork) change_attrs(zresult, zwork->zw_conf); out: - if (command != NULL) - sbuf_delete(command); + sbuf_delete(command); free(args); free(zresult); } From owner-svn-src-all@freebsd.org Fri Feb 22 16:50: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 46C4014F30F6; Fri, 22 Feb 2019 16:50:33 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (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 DA87D752EC; Fri, 22 Feb 2019 16:50:32 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.183] (unknown [209.133.79.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id B313B27001A3; Fri, 22 Feb 2019 11:50:24 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu B313B27001A3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1550854225; bh=ZHmBPfZ+V4U+TkkgymRI0crZ+l71lc4Er4X2HWNGdeQ=; h=Subject:To:From:Date:From; b=tR+dTHjjPAcoEN34yxAxBpZgfTsKQr6zoePRlwali1CJKj6JXTRmyVh+clo9DId4E WCiuw8XJ+Nnbkv84C+COvsKxeQ8i/XIp9CE7OdUxvEHIg+E2cF37HOLsRUk+zsDj3b f3k0jmC73BhO8lvKOzWm6JcQAaPNIXZFLyS6oN7j2BI8XMmAJctZ4xkPKAphuoVvV5 QyFF3mU6xCajy2fmHLYBfk3rTUmjL01vFpxIjl1CKg9wNl4wyVbeUIQvXnrCuG0ZbD 8qgaE1Au7LMDMn9jxjhjp/nkyCzaDlw2bDPZ9aKb/IdIj9ZJmCHogIFK0pgpXgV8jt jkdEIfR/Ao2FA== Subject: Re: svn commit: r344099 - head/sys/net To: John Baldwin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> From: Andrew Gallatin Message-ID: <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> Date: Fri, 22 Feb 2019 11:50:23 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DA87D752EC 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.938,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: Fri, 22 Feb 2019 16:50:33 -0000 I think the misunderstanding here is that I think he's not getting the ifp from the route. My recollection is that he is holding the ifps when he enables HW pacing in BBR. Due to limitations in different NIC hardware, you can only have N different rates, etc. So he goes ahead and allocates those N rates up front so that he knows he can reserve them & know that he can always get them. Then when the system reboots, BBR has an eventhandler that goes ahead and frees those reservations. I think that he's using the ifp that he's holding here. In the case that tripped him up, that ifp was lagg. Your workaround would also work, but Randall does have a point about symmetric alloc/free especially when viewed from his perspective, Drew From owner-svn-src-all@freebsd.org Fri Feb 22 17: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 75B0B14F3D2B; Fri, 22 Feb 2019 17:09:40 +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 1BD3C75F81; Fri, 22 Feb 2019 17:09:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.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 E59FA15FDA; Fri, 22 Feb 2019 17:09:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344099 - head/sys/net To: Andrew Gallatin , Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902131457.x1DEvx9V051533@repo.freebsd.org> <99453977-0f52-6050-3f40-e0fd7ea43d7f@FreeBSD.org> <80314D46-6FEC-462D-8EC5-FCE1ECFF81EF@netflix.com> <89d15ffe-1bc9-adaf-9307-4bf6541cc5e1@FreeBSD.org> <1dcae85d-2a3a-1e7c-4692-c62f87020096@FreeBSD.org> <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> 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: <5651b9ff-fb79-d606-841e-ceb63936afdf@FreeBSD.org> Date: Fri, 22 Feb 2019 09:08:58 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <50bda411-2705-5a5d-2a0f-6bf3bfbfb2ef@cs.duke.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BD3C75F81 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.936,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: Fri, 22 Feb 2019 17:09:40 -0000 On 2/22/19 8:50 AM, Andrew Gallatin wrote: > I think the misunderstanding here is that I think he's not getting the > ifp from the route. > > My recollection is that he is holding the ifps when he enables HW pacing > in BBR. Due to limitations in different NIC hardware, you can only have > N different rates, etc. So he goes ahead and allocates those N rates up > front so that he knows he can reserve them & know that he can always get > them. > > Then when the system reboots, BBR has an eventhandler that goes ahead > and frees those reservations. I think that he's using the ifp that he's > holding here. > > In the case that tripped him up, that ifp was lagg. > > Your workaround would also work, but Randall does have a point about > symmetric alloc/free especially when viewed from his perspective, But it's not really an alloc. We have many other places in the kernel where an alloc routine is actually a "forward" to something else that allocates the real thing. For example, when you add a kevent on a file descriptor, that is routed to the 'file_filtops' in kern/kern_event.c, but that filtops only has an attach routine, it doesn't have a detach routine because it's attach routine is a forwarder to other filtops. It invokes the fo_kqfilter method that is responsible for setting up the right filtops to use. For sockets this routes to one of three filtops that all have detach methods but no attach methods. The way this is handled is that anytime a kevent is detached, the current filtops is used to find the detach event handler. We don't use the filter's type to get back to the original file_filtops and require that to forward the detach request on to the real filtops. Having the tag save the "real" ifp is similar to knote's storing the real filtops. Given your specific use case, it does seem that this commit is sufficient, but it's not the "always works" way to free a tag, and it might be used as a template that gets copied for use in another case where the extra guarantees of this specific use case don't hold. Given that I'd like to explore making lagg and vlan allocate real interposing tags to handle TLS, this may prove mostly academic as they would have "real" free routines then since their alloc routines would just be forwarders. -- John Baldwin                                                                              From owner-svn-src-all@freebsd.org Fri Feb 22 18:02: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 6E29914F527D; Fri, 22 Feb 2019 18:02:47 +0000 (UTC) (envelope-from shurd@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 13CC377F2C; Fri, 22 Feb 2019 18:02:47 +0000 (UTC) (envelope-from shurd@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 064328E39; Fri, 22 Feb 2019 18:02:47 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MI2ksa024772; Fri, 22 Feb 2019 18:02:46 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MI2kmu024771; Fri, 22 Feb 2019 18:02:46 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201902221802.x1MI2kmu024771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 22 Feb 2019 18:02: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: r344471 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 344471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13CC377F2C 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)[-0.999,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, 22 Feb 2019 18:02:47 -0000 Author: shurd Date: Fri Feb 22 18:02:46 2019 New Revision: 344471 URL: https://svnweb.freebsd.org/changeset/base/344471 Log: MFC r344162: iflib: Improve return values of interrupt handlers. iflib was returning FILTER_HANDLED, in cases where FILTER_STRAY was more correct. This potentially caused issues with shared legacy interrupts. Driver filters returning FILTER_STRAY are now properly handled. Submitted by: Augustin Cavalier Reviewed by: marius, gallatin Obtained from: Haiku (a84bb9, 4947d1) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D19201 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Fri Feb 22 15:31:50 2019 (r344470) +++ stable/12/sys/net/iflib.c Fri Feb 22 18:02:46 2019 (r344471) @@ -1466,12 +1466,17 @@ iflib_fast_intr(void *arg) { iflib_filter_info_t info = arg; struct grouptask *gtask = info->ifi_task; + int result; + if (!iflib_started) - return (FILTER_HANDLED); + return (FILTER_STRAY); DBG_COUNTER_INC(fast_intrs); - if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED) - return (FILTER_HANDLED); + if (info->ifi_filter != NULL) { + result = info->ifi_filter(info->ifi_filter_arg); + if ((result & FILTER_SCHEDULE_THREAD) == 0) + return (result); + } GROUPTASK_ENQUEUE(gtask); return (FILTER_HANDLED); @@ -1484,14 +1489,17 @@ iflib_fast_intr_rxtx(void *arg) struct grouptask *gtask = info->ifi_task; iflib_rxq_t rxq = (iflib_rxq_t)info->ifi_ctx; if_ctx_t ctx = NULL;; - int i, cidx; + int i, cidx, result; if (!iflib_started) - return (FILTER_HANDLED); + return (FILTER_STRAY); DBG_COUNTER_INC(fast_intrs); - if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED) - return (FILTER_HANDLED); + if (info->ifi_filter != NULL) { + result = info->ifi_filter(info->ifi_filter_arg); + if ((result & FILTER_SCHEDULE_THREAD) == 0) + return (result); + } MPASS(rxq->ifr_ntxqirq); for (i = 0; i < rxq->ifr_ntxqirq; i++) { @@ -1526,13 +1534,17 @@ iflib_fast_intr_ctx(void *arg) { iflib_filter_info_t info = arg; struct grouptask *gtask = info->ifi_task; + int result; if (!iflib_started) - return (FILTER_HANDLED); + return (FILTER_STRAY); DBG_COUNTER_INC(fast_intrs); - if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED) - return (FILTER_HANDLED); + if (info->ifi_filter != NULL) { + result = info->ifi_filter(info->ifi_filter_arg); + if ((result & FILTER_SCHEDULE_THREAD) == 0) + return (result); + } GROUPTASK_ENQUEUE(gtask); return (FILTER_HANDLED); From owner-svn-src-all@freebsd.org Fri Feb 22 18:24: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 B493C14F5E23; Fri, 22 Feb 2019 18:24:58 +0000 (UTC) (envelope-from shurd@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 5324080C1B; Fri, 22 Feb 2019 18:24:58 +0000 (UTC) (envelope-from shurd@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 46AF491BB; Fri, 22 Feb 2019 18:24:58 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MIOwSq035511; Fri, 22 Feb 2019 18:24:58 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MIOwWS035510; Fri, 22 Feb 2019 18:24:58 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201902221824.x1MIOwWS035510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 22 Feb 2019 18:24:58 +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: r344472 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 344472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5324080C1B 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.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 22 Feb 2019 18:24:58 -0000 Author: shurd Date: Fri Feb 22 18:24:57 2019 New Revision: 344472 URL: https://svnweb.freebsd.org/changeset/base/344472 Log: MFC r333131: Fix iflib_encap() EFBIG handling bugs 1) Don't give up if m_collapse() fails. Rather than giving up, try m_defrag() immediately. 2) Fix a leak where, if the NIC driver rejected the defrag'ed chain as having too many segments, we would fail to free the chain. Reviewed by: Matthew Macy (this version of patch) Submitted by: Matthew Macy (early version of leak fix) Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Fri Feb 22 18:02:46 2019 (r344471) +++ stable/11/sys/net/iflib.c Fri Feb 22 18:24:57 2019 (r344472) @@ -3229,8 +3229,12 @@ defrag: switch (err) { case EFBIG: /* try collapse once and defrag once */ - if (remap == 0) + if (remap == 0) { m_head = m_collapse(*m_headp, M_NOWAIT, max_segs); + /* try defrag if collapsing fails */ + if (m_head == NULL) + remap++; + } if (remap == 1) m_head = m_defrag(*m_headp, M_NOWAIT); remap++; @@ -3318,13 +3322,18 @@ defrag: */ txq->ift_pidx = pi.ipi_new_pidx; txq->ift_npending += pi.ipi_ndescs; - } else if (__predict_false(err == EFBIG && remap < 2)) { + } else { *m_headp = m_head = iflib_remove_mbuf(txq); - remap = 1; - txq->ift_txd_encap_efbig++; - goto defrag; - } else + if (err == EFBIG) { + txq->ift_txd_encap_efbig++; + if (remap < 2) { + remap = 1; + goto defrag; + } + } DBG_COUNTER_INC(encap_txd_encap_fail); + goto defrag_failed; + } return (err); defrag_failed: From owner-svn-src-all@freebsd.org Fri Feb 22 18: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 A749914F6799; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@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 45DE1819F7; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@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 32768952E; Fri, 22 Feb 2019 18:43:28 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MIhSjx045449; Fri, 22 Feb 2019 18:43:28 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MIhSjr045448; Fri, 22 Feb 2019 18:43:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902221843.x1MIhSjr045448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 22 Feb 2019 18:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344473 - head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini X-SVN-Commit-Revision: 344473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45DE1819F7 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.963,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, 22 Feb 2019 18:43:28 -0000 Author: dab Date: Fri Feb 22 18:43:27 2019 New Revision: 344473 URL: https://svnweb.freebsd.org/changeset/base/344473 Log: CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c A pointer is first tested for NULL. If non-NULL, another pointer is set equal to the first. The second pointer is then checked for NULL and an error path taken if so. This second test and the associated path is dead code as the pointer value, having just been checked for NULL, cannot be NULL at this point. Remove the dead code. Reported by: Coverity Reviewed by: daniel.william.ryan_gmail.com, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19165 Modified: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Modified: head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c ============================================================================== --- head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Fri Feb 22 18:24:57 2019 (r344472) +++ head/sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c Fri Feb 22 18:43:27 2019 (r344473) @@ -1820,12 +1820,6 @@ tiNumOfLunIOCTLreq( break; } tdIORequestBody = (tdIORequestBody_t *)tiRequestBody; - - if(tdIORequestBody == agNULL) - { - status = IOCTL_CALL_FAIL; - break; - } tdIORequestBody->tiIORequest = tiIORequest; /* save context if we need to abort later */ From owner-svn-src-all@freebsd.org Fri Feb 22 19:54: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 6F4C614F8C4C; Fri, 22 Feb 2019 19:54:31 +0000 (UTC) (envelope-from bwidawsk@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 0989684A10; Fri, 22 Feb 2019 19:54:31 +0000 (UTC) (envelope-from bwidawsk@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 84032A124; Fri, 22 Feb 2019 19:54:29 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsTKO083466; Fri, 22 Feb 2019 19:54:29 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsSMq083440; Fri, 22 Feb 2019 19:54:28 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsSMq083440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344476 - in head/sys: dev/nvdimm modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules/nvdimm X-SVN-Commit-Revision: 344476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0989684A10 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, 22 Feb 2019 19:54:31 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:28 2019 New Revision: 344476 URL: https://svnweb.freebsd.org/changeset/base/344476 Log: nvdimm: Simple namespace support Add support for simple NVDIMM v1.2 namespaces from the UEFI version 2.7 specification. The combination of NVDIMM regions and labels can lead to a wide variety of namespace layouts. Here we support a simple subset of namespaces where each NVDIMM SPA range is composed of a single region per member dimm. Submitted by: D Scott Phillips Discussed with: kib MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18736 Added: head/sys/dev/nvdimm/nvdimm_ns.c (contents, props changed) Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h head/sys/modules/nvdimm/Makefile Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:28 2019 (r344476) @@ -462,6 +462,7 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, A free(spa, M_NVDIMM); break; } + nvdimm_create_namespaces(spa_mapping, nfitbl); SLIST_INSERT_HEAD(&dev->spas, spa_mapping, link); } free(spas, M_NVDIMM); @@ -519,6 +520,7 @@ nvdimm_root_detach(device_t dev) root = device_get_softc(dev); SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { + nvdimm_destroy_namespaces(spa); nvdimm_spa_fini(spa); SLIST_REMOVE_HEAD(&root->spas, link); free(spa, M_NVDIMM); Added: head/sys/dev/nvdimm/nvdimm_ns.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm_ns.c Fri Feb 22 19:54:28 2019 (r344476) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2018 Intel Corporation + * 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 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 + +int +nvdimm_create_namespaces(struct SPA_mapping *spa, ACPI_TABLE_NFIT *nfitbl) +{ + ACPI_NFIT_MEMORY_MAP **regions; + struct nvdimm_dev *nv; + struct nvdimm_label_entry *e; + struct nvdimm_namespace *ns; + nfit_handle_t dimm_handle; + char *name; + int i, error, num_regions; + + acpi_nfit_get_region_mappings_by_spa_range(nfitbl, spa->spa_nfit_idx, + ®ions, &num_regions); + if (num_regions == 0 || num_regions != regions[0]->InterleaveWays) { + free(regions, M_NVDIMM); + return (ENXIO); + } + dimm_handle = regions[0]->DeviceHandle; + nv = nvdimm_find_by_handle(dimm_handle); + if (nv == NULL) { + free(regions, M_NVDIMM); + return (ENXIO); + } + i = 0; + error = 0; + SLIST_FOREACH(e, &nv->labels, link) { + ns = malloc(sizeof(struct nvdimm_namespace), M_NVDIMM, + M_WAITOK | M_ZERO); + ns->dev.spa_domain = spa->dev.spa_domain; + ns->dev.spa_phys_base = spa->dev.spa_phys_base + + regions[0]->RegionOffset + + num_regions * + (e->label.dimm_phys_addr - regions[0]->Address); + ns->dev.spa_len = num_regions * e->label.raw_size; + ns->dev.spa_efi_mem_flags = spa->dev.spa_efi_mem_flags; + asprintf(&name, M_NVDIMM, "spa%dns%d", spa->spa_nfit_idx, i); + error = nvdimm_spa_dev_init(&ns->dev, name); + free(name, M_NVDIMM); + if (error != 0) + break; + SLIST_INSERT_HEAD(&spa->namespaces, ns, link); + i++; + } + free(regions, M_NVDIMM); + return (error); +} + +void +nvdimm_destroy_namespaces(struct SPA_mapping *spa) +{ + struct nvdimm_namespace *ns, *next; + + SLIST_FOREACH_SAFE(ns, &spa->namespaces, link, next) { + SLIST_REMOVE_HEAD(&spa->namespaces, link); + nvdimm_spa_dev_fini(&ns->dev); + free(ns, M_NVDIMM); + } +} Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:28 2019 (r344476) @@ -139,11 +139,18 @@ struct g_spa { bool spa_g_proc_exiting; }; +struct nvdimm_namespace { + SLIST_ENTRY(nvdimm_namespace) link; + struct SPA_mapping *spa; + struct nvdimm_spa_dev dev; +}; + struct SPA_mapping { SLIST_ENTRY(SPA_mapping) link; enum SPA_mapping_type spa_type; int spa_nfit_idx; struct nvdimm_spa_dev dev; + SLIST_HEAD(, nvdimm_namespace) namespaces; }; MALLOC_DECLARE(M_NVDIMM); @@ -167,5 +174,7 @@ int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT void nvdimm_spa_fini(struct SPA_mapping *spa); int nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name); void nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev); +int nvdimm_create_namespaces(struct SPA_mapping *spa, ACPI_TABLE_NFIT *nfitbl); +void nvdimm_destroy_namespaces(struct SPA_mapping *spa); #endif /* __DEV_NVDIMM_VAR_H__ */ Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Fri Feb 22 19:54:24 2019 (r344475) +++ head/sys/modules/nvdimm/Makefile Fri Feb 22 19:54:28 2019 (r344476) @@ -5,6 +5,7 @@ KMOD= nvdimm SRCS= nvdimm.c \ nvdimm_nfit.c \ + nvdimm_ns.c \ nvdimm_spa.c SRCS+= acpi_if.h bus_if.h device_if.h From owner-svn-src-all@freebsd.org Fri Feb 22 19:54: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 C058414F8BD8; Fri, 22 Feb 2019 19:54:24 +0000 (UTC) (envelope-from bwidawsk@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 C19F28495C; Fri, 22 Feb 2019 19:54:23 +0000 (UTC) (envelope-from bwidawsk@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 B9AEFA120; Fri, 22 Feb 2019 19:54:21 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsLJu083123; Fri, 22 Feb 2019 19:54:21 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsLoK083122; Fri, 22 Feb 2019 19:54:21 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsLoK083122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344474 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 344474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C19F28495C 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: Fri, 22 Feb 2019 19:54:25 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:21 2019 New Revision: 344474 URL: https://svnweb.freebsd.org/changeset/base/344474 Log: nvdimm: split spa dev into a separate entity Separate code for exposing a device backed by a system physical address range away from the NVDIMM spa code. This will allow a future patch to add support for NVDIMM namespaces while using the same device code. Submitted by: D Scott Phillips Reviewed by: bwidawsk MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18736 Modified: head/sys/dev/nvdimm/nvdimm_spa.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Fri Feb 22 18:43:27 2019 (r344473) +++ head/sys/dev/nvdimm/nvdimm_spa.c Fri Feb 22 19:54:21 2019 (r344474) @@ -143,31 +143,31 @@ nvdimm_spa_type_from_uuid(struct uuid *uuid) } static vm_memattr_t -nvdimm_spa_memattr(struct SPA_mapping *spa) +nvdimm_spa_memattr(struct nvdimm_spa_dev *dev) { vm_memattr_t mode; - if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WB) != 0) + if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WB) != 0) mode = VM_MEMATTR_WRITE_BACK; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WT) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WT) != 0) mode = VM_MEMATTR_WRITE_THROUGH; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WC) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WC) != 0) mode = VM_MEMATTR_WRITE_COMBINING; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WP) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_WP) != 0) mode = VM_MEMATTR_WRITE_PROTECTED; - else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_UC) != 0) + else if ((dev->spa_efi_mem_flags & EFI_MD_ATTR_UC) != 0) mode = VM_MEMATTR_UNCACHEABLE; else { if (bootverbose) - printf("SPA%d mapping attr unsupported\n", - spa->spa_nfit_idx); + printf("SPA mapping attr %#lx unsupported\n", + dev->spa_efi_mem_flags); mode = VM_MEMATTR_UNCACHEABLE; } return (mode); } static int -nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *uio) +nvdimm_spa_uio(struct nvdimm_spa_dev *dev, struct uio *uio) { struct vm_page m, *ma; off_t off; @@ -175,14 +175,14 @@ nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *ui int error, n; error = 0; - if (spa->spa_kva == NULL) { - mattr = nvdimm_spa_memattr(spa); + if (dev->spa_kva == NULL) { + mattr = nvdimm_spa_memattr(dev); vm_page_initfake(&m, 0, mattr); ma = &m; while (uio->uio_resid > 0) { - if (uio->uio_offset >= spa->spa_len) + if (uio->uio_offset >= dev->spa_len) break; - off = spa->spa_phys_base + uio->uio_offset; + off = dev->spa_phys_base + uio->uio_offset; vm_page_updatefake(&m, trunc_page(off), mattr); n = PAGE_SIZE; if (n > uio->uio_resid) @@ -193,14 +193,14 @@ nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *ui } } else { while (uio->uio_resid > 0) { - if (uio->uio_offset >= spa->spa_len) + if (uio->uio_offset >= dev->spa_len) break; n = INT_MAX; if (n > uio->uio_resid) n = uio->uio_resid; - if (uio->uio_offset + n > spa->spa_len) - n = spa->spa_len - uio->uio_offset; - error = uiomove((char *)spa->spa_kva + uio->uio_offset, + if (uio->uio_offset + n > dev->spa_len) + n = dev->spa_len - uio->uio_offset; + error = uiomove((char *)dev->spa_kva + uio->uio_offset, n, uio); if (error != 0) break; @@ -217,20 +217,20 @@ nvdimm_spa_rw(struct cdev *dev, struct uio *uio, int i } static int -nvdimm_spa_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, +nvdimm_spa_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, struct thread *td) { - struct SPA_mapping *spa; + struct nvdimm_spa_dev *dev; int error; - spa = dev->si_drv1; + dev = cdev->si_drv1; error = 0; switch (cmd) { case DIOCGSECTORSIZE: *(u_int *)data = DEV_BSIZE; break; case DIOCGMEDIASIZE: - *(off_t *)data = spa->spa_len; + *(off_t *)data = dev->spa_len; break; default: error = ENOTTY; @@ -240,19 +240,19 @@ nvdimm_spa_ioctl(struct cdev *dev, u_long cmd, caddr_t } static int -nvdimm_spa_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, +nvdimm_spa_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, vm_size_t size, vm_object_t *objp, int nprot) { - struct SPA_mapping *spa; + struct nvdimm_spa_dev *dev; - spa = dev->si_drv1; - if (spa->spa_obj == NULL) + dev = cdev->si_drv1; + if (dev->spa_obj == NULL) return (ENXIO); - if (*offset >= spa->spa_len || *offset + size < *offset || - *offset + size > spa->spa_len) + if (*offset >= dev->spa_len || *offset + size < *offset || + *offset + size > dev->spa_len) return (EINVAL); - vm_object_reference(spa->spa_obj); - *objp = spa->spa_obj; + vm_object_reference(dev->spa_obj); + *objp = dev->spa_obj; return (0); } @@ -267,18 +267,17 @@ static struct cdevsw spa_cdevsw = { }; static void -nvdimm_spa_g_all_unmapped(struct SPA_mapping *spa, struct bio *bp, - int rw) +nvdimm_spa_g_all_unmapped(struct nvdimm_spa_dev *dev, struct bio *bp, int rw) { struct vm_page maa[bp->bio_ma_n]; vm_page_t ma[bp->bio_ma_n]; vm_memattr_t mattr; int i; - mattr = nvdimm_spa_memattr(spa); + mattr = nvdimm_spa_memattr(dev); for (i = 0; i < nitems(ma); i++) { maa[i].flags = 0; - vm_page_initfake(&maa[i], spa->spa_phys_base + + vm_page_initfake(&maa[i], dev->spa_phys_base + trunc_page(bp->bio_offset) + PAGE_SIZE * i, mattr); ma[i] = &maa[i]; } @@ -293,30 +292,30 @@ nvdimm_spa_g_all_unmapped(struct SPA_mapping *spa, str static void nvdimm_spa_g_thread(void *arg) { - struct SPA_mapping *spa; + struct g_spa *sc; struct bio *bp; struct uio auio; struct iovec aiovec; int error; - spa = arg; + sc = arg; for (;;) { - mtx_lock(&spa->spa_g_mtx); + mtx_lock(&sc->spa_g_mtx); for (;;) { - bp = bioq_takefirst(&spa->spa_g_queue); + bp = bioq_takefirst(&sc->spa_g_queue); if (bp != NULL) break; - msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, + msleep(&sc->spa_g_queue, &sc->spa_g_mtx, PRIBIO, "spa_g", 0); - if (!spa->spa_g_proc_run) { - spa->spa_g_proc_exiting = true; - wakeup(&spa->spa_g_queue); - mtx_unlock(&spa->spa_g_mtx); + if (!sc->spa_g_proc_run) { + sc->spa_g_proc_exiting = true; + wakeup(&sc->spa_g_queue); + mtx_unlock(&sc->spa_g_mtx); kproc_exit(0); } continue; } - mtx_unlock(&spa->spa_g_mtx); + mtx_unlock(&sc->spa_g_mtx); if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && bp->bio_cmd != BIO_FLUSH) { error = EOPNOTSUPP; @@ -325,13 +324,15 @@ nvdimm_spa_g_thread(void *arg) error = 0; if (bp->bio_cmd == BIO_FLUSH) { - if (spa->spa_kva != NULL) { - pmap_large_map_wb(spa->spa_kva, spa->spa_len); + if (sc->dev->spa_kva != NULL) { + pmap_large_map_wb(sc->dev->spa_kva, + sc->dev->spa_len); } else { pmap_flush_cache_phys_range( - (vm_paddr_t)spa->spa_phys_base, - (vm_paddr_t)spa->spa_phys_base + - spa->spa_len, nvdimm_spa_memattr(spa)); + (vm_paddr_t)sc->dev->spa_phys_base, + (vm_paddr_t)sc->dev->spa_phys_base + + sc->dev->spa_len, + nvdimm_spa_memattr(sc->dev)); } /* * XXX flush IMC @@ -340,8 +341,8 @@ nvdimm_spa_g_thread(void *arg) } if ((bp->bio_flags & BIO_UNMAPPED) != 0) { - if (spa->spa_kva != NULL) { - aiovec.iov_base = (char *)spa->spa_kva + + if (sc->dev->spa_kva != NULL) { + aiovec.iov_base = (char *)sc->dev->spa_kva + bp->bio_offset; aiovec.iov_len = bp->bio_length; auio.uio_iov = &aiovec; @@ -356,7 +357,8 @@ nvdimm_spa_g_thread(void *arg) bp->bio_ma_offset, bp->bio_length, &auio); bp->bio_resid = auio.uio_resid; } else { - nvdimm_spa_g_all_unmapped(spa, bp, bp->bio_cmd); + nvdimm_spa_g_all_unmapped(sc->dev, bp, + bp->bio_cmd); bp->bio_resid = bp->bio_length; error = 0; } @@ -371,11 +373,11 @@ nvdimm_spa_g_thread(void *arg) auio.uio_rw = bp->bio_cmd == BIO_READ ? UIO_READ : UIO_WRITE; auio.uio_td = curthread; - error = nvdimm_spa_uio(spa, &auio); + error = nvdimm_spa_uio(sc->dev, &auio); bp->bio_resid = auio.uio_resid; } bp->bio_bcount = bp->bio_length; - devstat_end_transaction_bio(spa->spa_g_devstat, bp); + devstat_end_transaction_bio(sc->spa_g_devstat, bp); completed: bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); @@ -385,18 +387,18 @@ completed: static void nvdimm_spa_g_start(struct bio *bp) { - struct SPA_mapping *spa; + struct g_spa *sc; - spa = bp->bio_to->geom->softc; + sc = bp->bio_to->geom->softc; if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - mtx_lock(&spa->spa_g_stat_mtx); - devstat_start_transaction_bio(spa->spa_g_devstat, bp); - mtx_unlock(&spa->spa_g_stat_mtx); + mtx_lock(&sc->spa_g_stat_mtx); + devstat_start_transaction_bio(sc->spa_g_devstat, bp); + mtx_unlock(&sc->spa_g_stat_mtx); } - mtx_lock(&spa->spa_g_mtx); - bioq_disksort(&spa->spa_g_queue, bp); - wakeup(&spa->spa_g_queue); - mtx_unlock(&spa->spa_g_mtx); + mtx_lock(&sc->spa_g_mtx); + bioq_disksort(&sc->spa_g_queue, bp); + wakeup(&sc->spa_g_queue); + mtx_unlock(&sc->spa_g_mtx); } static int @@ -406,11 +408,16 @@ nvdimm_spa_g_access(struct g_provider *pp, int r, int return (0); } +static struct g_geom * nvdimm_spa_g_create(struct nvdimm_spa_dev *dev, + const char *name); +static g_ctl_destroy_geom_t nvdimm_spa_g_destroy_geom; + struct g_class nvdimm_spa_g_class = { .name = "SPA", .version = G_VERSION, .start = nvdimm_spa_g_start, .access = nvdimm_spa_g_access, + .destroy_geom = nvdimm_spa_g_destroy_geom, }; DECLARE_GEOM_CLASS(nvdimm_spa_g_class, g_spa); @@ -418,49 +425,63 @@ int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, enum SPA_mapping_type spa_type) { - struct make_dev_args mda; - struct sglist *spa_sg; - int error, error1; + char *name; + int error; spa->spa_type = spa_type; - spa->spa_domain = ((nfitaddr->Flags & ACPI_NFIT_PROXIMITY_VALID) != 0) ? - nfitaddr->ProximityDomain : -1; spa->spa_nfit_idx = nfitaddr->RangeIndex; - spa->spa_phys_base = nfitaddr->Address; - spa->spa_len = nfitaddr->Length; - spa->spa_efi_mem_flags = nfitaddr->MemoryMapping; + spa->dev.spa_domain = + ((nfitaddr->Flags & ACPI_NFIT_PROXIMITY_VALID) != 0) ? + nfitaddr->ProximityDomain : -1; + spa->dev.spa_phys_base = nfitaddr->Address; + spa->dev.spa_len = nfitaddr->Length; + spa->dev.spa_efi_mem_flags = nfitaddr->MemoryMapping; if (bootverbose) { printf("NVDIMM SPA%d base %#016jx len %#016jx %s fl %#jx\n", spa->spa_nfit_idx, - (uintmax_t)spa->spa_phys_base, (uintmax_t)spa->spa_len, + (uintmax_t)spa->dev.spa_phys_base, + (uintmax_t)spa->dev.spa_len, nvdimm_SPA_uuid_list[spa_type].u_name, - spa->spa_efi_mem_flags); + spa->dev.spa_efi_mem_flags); } if (!nvdimm_SPA_uuid_list[spa_type].u_usr_acc) return (0); - error1 = pmap_large_map(spa->spa_phys_base, spa->spa_len, - &spa->spa_kva, nvdimm_spa_memattr(spa)); + asprintf(&name, M_NVDIMM, "spa%d", spa->spa_nfit_idx); + error = nvdimm_spa_dev_init(&spa->dev, name); + free(name, M_NVDIMM); + return (error); +} + +int +nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name) +{ + struct make_dev_args mda; + struct sglist *spa_sg; + char *devname; + int error, error1; + + error1 = pmap_large_map(dev->spa_phys_base, dev->spa_len, + &dev->spa_kva, nvdimm_spa_memattr(dev)); if (error1 != 0) { - printf("NVDIMM SPA%d cannot map into KVA, error %d\n", - spa->spa_nfit_idx, error1); - spa->spa_kva = NULL; + printf("NVDIMM %s cannot map into KVA, error %d\n", name, + error1); + dev->spa_kva = NULL; } spa_sg = sglist_alloc(1, M_WAITOK); - error = sglist_append_phys(spa_sg, spa->spa_phys_base, - spa->spa_len); + error = sglist_append_phys(spa_sg, dev->spa_phys_base, + dev->spa_len); if (error == 0) { - spa->spa_obj = vm_pager_allocate(OBJT_SG, spa_sg, spa->spa_len, + dev->spa_obj = vm_pager_allocate(OBJT_SG, spa_sg, dev->spa_len, VM_PROT_ALL, 0, NULL); - if (spa->spa_obj == NULL) { - printf("NVDIMM SPA%d failed to alloc vm object", - spa->spa_nfit_idx); + if (dev->spa_obj == NULL) { + printf("NVDIMM %s failed to alloc vm object", name); sglist_free(spa_sg); } } else { - printf("NVDIMM SPA%d failed to init sglist, error %d", - spa->spa_nfit_idx, error); + printf("NVDIMM %s failed to init sglist, error %d", name, + error); sglist_free(spa_sg); } @@ -471,78 +492,112 @@ nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYS mda.mda_uid = UID_ROOT; mda.mda_gid = GID_OPERATOR; mda.mda_mode = 0660; - mda.mda_si_drv1 = spa; - error = make_dev_s(&mda, &spa->spa_dev, "nvdimm_spa%d", - spa->spa_nfit_idx); + mda.mda_si_drv1 = dev; + asprintf(&devname, M_NVDIMM, "nvdimm_%s", name); + error = make_dev_s(&mda, &dev->spa_dev, "%s", devname); + free(devname, M_NVDIMM); if (error != 0) { - printf("NVDIMM SPA%d cannot create devfs node, error %d\n", - spa->spa_nfit_idx, error); + printf("NVDIMM %s cannot create devfs node, error %d\n", name, + error); if (error1 == 0) error1 = error; } + dev->spa_g = nvdimm_spa_g_create(dev, name); + if (dev->spa_g == NULL && error1 == 0) + error1 = ENXIO; + return (error1); +} - bioq_init(&spa->spa_g_queue); - mtx_init(&spa->spa_g_mtx, "spag", NULL, MTX_DEF); - mtx_init(&spa->spa_g_stat_mtx, "spagst", NULL, MTX_DEF); - spa->spa_g_proc_run = true; - spa->spa_g_proc_exiting = false; - error = kproc_create(nvdimm_spa_g_thread, spa, &spa->spa_g_proc, 0, 0, - "g_spa%d", spa->spa_nfit_idx); +static struct g_geom * +nvdimm_spa_g_create(struct nvdimm_spa_dev *dev, const char *name) +{ + struct g_geom *gp; + struct g_spa *sc; + int error; + + gp = NULL; + sc = malloc(sizeof(struct g_spa), M_NVDIMM, M_WAITOK | M_ZERO); + sc->dev = dev; + bioq_init(&sc->spa_g_queue); + mtx_init(&sc->spa_g_mtx, "spag", NULL, MTX_DEF); + mtx_init(&sc->spa_g_stat_mtx, "spagst", NULL, MTX_DEF); + sc->spa_g_proc_run = true; + sc->spa_g_proc_exiting = false; + error = kproc_create(nvdimm_spa_g_thread, sc, &sc->spa_g_proc, 0, 0, + "g_spa"); if (error != 0) { - printf("NVDIMM SPA%d cannot create geom worker, error %d\n", - spa->spa_nfit_idx, error); - if (error1 == 0) - error1 = error; + mtx_destroy(&sc->spa_g_mtx); + mtx_destroy(&sc->spa_g_stat_mtx); + free(sc, M_NVDIMM); + printf("NVDIMM %s cannot create geom worker, error %d\n", name, + error); } else { g_topology_lock(); - spa->spa_g = g_new_geomf(&nvdimm_spa_g_class, "spa%d", - spa->spa_nfit_idx); - spa->spa_g->softc = spa; - spa->spa_p = g_new_providerf(spa->spa_g, "spa%d", - spa->spa_nfit_idx); - spa->spa_p->mediasize = spa->spa_len; - spa->spa_p->sectorsize = DEV_BSIZE; - spa->spa_p->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | + gp = g_new_geomf(&nvdimm_spa_g_class, "%s", name); + gp->softc = sc; + sc->spa_p = g_new_providerf(gp, "%s", name); + sc->spa_p->mediasize = dev->spa_len; + sc->spa_p->sectorsize = DEV_BSIZE; + sc->spa_p->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | G_PF_ACCEPT_UNMAPPED; - g_error_provider(spa->spa_p, 0); - spa->spa_g_devstat = devstat_new_entry("spa", spa->spa_nfit_idx, - DEV_BSIZE, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, + g_error_provider(sc->spa_p, 0); + sc->spa_g_devstat = devstat_new_entry("spa", -1, DEV_BSIZE, + DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); g_topology_unlock(); } - return (error1); + return (gp); } void nvdimm_spa_fini(struct SPA_mapping *spa) { - mtx_lock(&spa->spa_g_mtx); - spa->spa_g_proc_run = false; - wakeup(&spa->spa_g_queue); - while (!spa->spa_g_proc_exiting) - msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, "spa_e", 0); - mtx_unlock(&spa->spa_g_mtx); - if (spa->spa_g != NULL) { + nvdimm_spa_dev_fini(&spa->dev); +} + +void +nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev) +{ + + if (dev->spa_g != NULL) { g_topology_lock(); - g_wither_geom(spa->spa_g, ENXIO); + nvdimm_spa_g_destroy_geom(NULL, dev->spa_g->class, dev->spa_g); g_topology_unlock(); - spa->spa_g = NULL; - spa->spa_p = NULL; } - if (spa->spa_g_devstat != NULL) { - devstat_remove_entry(spa->spa_g_devstat); - spa->spa_g_devstat = NULL; + if (dev->spa_dev != NULL) { + destroy_dev(dev->spa_dev); + dev->spa_dev = NULL; } - if (spa->spa_dev != NULL) { - destroy_dev(spa->spa_dev); - spa->spa_dev = NULL; + vm_object_deallocate(dev->spa_obj); + if (dev->spa_kva != NULL) { + pmap_large_unmap(dev->spa_kva, dev->spa_len); + dev->spa_kva = NULL; } - vm_object_deallocate(spa->spa_obj); - if (spa->spa_kva != NULL) { - pmap_large_unmap(spa->spa_kva, spa->spa_len); - spa->spa_kva = NULL; +} + +static int +nvdimm_spa_g_destroy_geom(struct gctl_req *req, struct g_class *cp, + struct g_geom *gp) +{ + struct g_spa *sc; + + sc = gp->softc; + mtx_lock(&sc->spa_g_mtx); + sc->spa_g_proc_run = false; + wakeup(&sc->spa_g_queue); + while (!sc->spa_g_proc_exiting) + msleep(&sc->spa_g_queue, &sc->spa_g_mtx, PRIBIO, "spa_e", 0); + mtx_unlock(&sc->spa_g_mtx); + g_topology_assert(); + g_wither_geom(gp, ENXIO); + sc->spa_p = NULL; + if (sc->spa_g_devstat != NULL) { + devstat_remove_entry(sc->spa_g_devstat); + sc->spa_g_devstat = NULL; } - mtx_destroy(&spa->spa_g_mtx); - mtx_destroy(&spa->spa_g_stat_mtx); + mtx_destroy(&sc->spa_g_mtx); + mtx_destroy(&sc->spa_g_stat_mtx); + free(sc, M_NVDIMM); + return (0); } Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 18:43:27 2019 (r344473) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:21 2019 (r344474) @@ -67,28 +67,36 @@ enum SPA_mapping_type { SPA_TYPE_UNKNOWN = 127, }; -struct SPA_mapping { - SLIST_ENTRY(SPA_mapping) link; - enum SPA_mapping_type spa_type; +struct nvdimm_spa_dev { int spa_domain; - int spa_nfit_idx; uint64_t spa_phys_base; uint64_t spa_len; uint64_t spa_efi_mem_flags; void *spa_kva; + struct vm_object *spa_obj; struct cdev *spa_dev; struct g_geom *spa_g; +}; + +struct g_spa { + struct nvdimm_spa_dev *dev; struct g_provider *spa_p; struct bio_queue_head spa_g_queue; struct mtx spa_g_mtx; struct mtx spa_g_stat_mtx; struct devstat *spa_g_devstat; struct proc *spa_g_proc; - struct vm_object *spa_obj; bool spa_g_proc_run; bool spa_g_proc_exiting; }; +struct SPA_mapping { + SLIST_ENTRY(SPA_mapping) link; + enum SPA_mapping_type spa_type; + int spa_nfit_idx; + struct nvdimm_spa_dev dev; +}; + MALLOC_DECLARE(M_NVDIMM); void acpi_nfit_get_dimm_ids(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t **listp, @@ -108,5 +116,7 @@ struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, enum SPA_mapping_type spa_type); void nvdimm_spa_fini(struct SPA_mapping *spa); +int nvdimm_spa_dev_init(struct nvdimm_spa_dev *dev, const char *name); +void nvdimm_spa_dev_fini(struct nvdimm_spa_dev *dev); #endif /* __DEV_NVDIMM_VAR_H__ */ From owner-svn-src-all@freebsd.org Fri Feb 22 19:54: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 B64EE14F8BEF; Fri, 22 Feb 2019 19:54:26 +0000 (UTC) (envelope-from bwidawsk@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 5648F8498D; Fri, 22 Feb 2019 19:54:26 +0000 (UTC) (envelope-from bwidawsk@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 3439BA122; Fri, 22 Feb 2019 19:54:25 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MJsPfP083293; Fri, 22 Feb 2019 19:54:25 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MJsOVU083291; Fri, 22 Feb 2019 19:54:24 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201902221954.x1MJsOVU083291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Fri, 22 Feb 2019 19:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344475 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 344475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5648F8498D 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, 22 Feb 2019 19:54:27 -0000 Author: bwidawsk Date: Fri Feb 22 19:54:24 2019 New Revision: 344475 URL: https://svnweb.freebsd.org/changeset/base/344475 Log: nvdimm: Read NVDIMM namespace labels When attaching to NVDIMM devices, read and verify the namespace labels from the special namespace label storage area. A later change will expose NVDIMM namespaces derived from this label data. Submitted by: D Scott Phillips Discussed with: kib MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18735 Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:21 2019 (r344474) +++ head/sys/dev/nvdimm/nvdimm.c Fri Feb 22 19:54:24 2019 (r344475) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,10 +52,240 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("NVDIMM") +static struct uuid intel_nvdimm_dsm_uuid = + {0x4309AC30,0x0D11,0x11E4,0x91,0x91,{0x08,0x00,0x20,0x0C,0x9A,0x66}}; +#define INTEL_NVDIMM_DSM_REV 1 +#define INTEL_NVDIMM_DSM_GET_LABEL_SIZE 4 +#define INTEL_NVDIMM_DSM_GET_LABEL_DATA 5 + static devclass_t nvdimm_devclass; static devclass_t nvdimm_root_devclass; MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); +static int +read_label_area_size(struct nvdimm_dev *nv) +{ + ACPI_OBJECT *result_buffer; + ACPI_HANDLE handle; + ACPI_STATUS status; + ACPI_BUFFER result; + uint32_t *out; + int error; + + handle = nvdimm_root_get_acpi_handle(nv->nv_dev); + if (handle == NULL) + return (ENODEV); + result.Length = ACPI_ALLOCATE_BUFFER; + result.Pointer = NULL; + status = acpi_EvaluateDSM(handle, (uint8_t *)&intel_nvdimm_dsm_uuid, + INTEL_NVDIMM_DSM_REV, INTEL_NVDIMM_DSM_GET_LABEL_SIZE, NULL, + &result); + error = ENXIO; + if (ACPI_SUCCESS(status) && result.Pointer != NULL && + result.Length >= sizeof(ACPI_OBJECT)) { + result_buffer = result.Pointer; + if (result_buffer->Type == ACPI_TYPE_BUFFER && + result_buffer->Buffer.Length >= 12) { + out = (uint32_t *)result_buffer->Buffer.Pointer; + nv->label_area_size = out[1]; + nv->max_label_xfer = out[2]; + error = 0; + } + } + if (result.Pointer != NULL) + AcpiOsFree(result.Pointer); + return (error); +} + +static int +read_label_area(struct nvdimm_dev *nv, uint8_t *dest, off_t offset, + off_t length) +{ + ACPI_BUFFER result; + ACPI_HANDLE handle; + ACPI_OBJECT params_pkg, params_buf, *result_buf; + ACPI_STATUS status; + uint32_t params[2]; + off_t to_read; + int error; + + error = 0; + handle = nvdimm_root_get_acpi_handle(nv->nv_dev); + if (offset < 0 || length <= 0 || + offset + length > nv->label_area_size || + handle == NULL) + return (ENODEV); + params_pkg.Type = ACPI_TYPE_PACKAGE; + params_pkg.Package.Count = 1; + params_pkg.Package.Elements = ¶ms_buf; + params_buf.Type = ACPI_TYPE_BUFFER; + params_buf.Buffer.Length = sizeof(params); + params_buf.Buffer.Pointer = (UINT8 *)params; + while (length > 0) { + to_read = MIN(length, nv->max_label_xfer); + params[0] = offset; + params[1] = to_read; + result.Length = ACPI_ALLOCATE_BUFFER; + result.Pointer = NULL; + status = acpi_EvaluateDSM(handle, + (uint8_t *)&intel_nvdimm_dsm_uuid, INTEL_NVDIMM_DSM_REV, + INTEL_NVDIMM_DSM_GET_LABEL_DATA, ¶ms_pkg, &result); + if (ACPI_FAILURE(status) || + result.Length < sizeof(ACPI_OBJECT) || + result.Pointer == NULL) { + error = ENXIO; + break; + } + result_buf = (ACPI_OBJECT *)result.Pointer; + if (result_buf->Type != ACPI_TYPE_BUFFER || + result_buf->Buffer.Pointer == NULL || + result_buf->Buffer.Length != 4 + to_read || + ((uint16_t *)result_buf->Buffer.Pointer)[0] != 0) { + error = ENXIO; + break; + } + bcopy(result_buf->Buffer.Pointer + 4, dest, to_read); + dest += to_read; + offset += to_read; + length -= to_read; + if (result.Pointer != NULL) { + AcpiOsFree(result.Pointer); + result.Pointer = NULL; + } + } + if (result.Pointer != NULL) + AcpiOsFree(result.Pointer); + return (error); +} + +static uint64_t +fletcher64(const void *data, size_t length) +{ + size_t i; + uint32_t a, b; + const uint32_t *d; + + a = 0; + b = 0; + d = (const uint32_t *)data; + length = length / sizeof(uint32_t); + for (i = 0; i < length; i++) { + a += d[i]; + b += a; + } + return ((uint64_t)b << 32 | a); +} + +static bool +label_index_is_valid(struct nvdimm_label_index *index, uint32_t max_labels, + size_t size, size_t offset) +{ + uint64_t checksum; + + index = (struct nvdimm_label_index *)((uint8_t *)index + offset); + if (strcmp(index->signature, NVDIMM_INDEX_BLOCK_SIGNATURE) != 0) + return false; + checksum = index->checksum; + index->checksum = 0; + if (checksum != fletcher64(index, size) || + index->this_offset != size * offset || index->this_size != size || + index->other_offset != size * (offset == 0 ? 1 : 0) || + index->seq == 0 || index->seq > 3 || index->slot_cnt > max_labels || + index->label_size != 1) + return false; + return true; +} + +static int +read_label(struct nvdimm_dev *nv, int num) +{ + struct nvdimm_label_entry *entry, *i, *next; + uint64_t checksum; + off_t offset; + int error; + + offset = nv->label_index->label_offset + + num * (128 << nv->label_index->label_size); + entry = malloc(sizeof(*entry), M_NVDIMM, M_WAITOK); + error = read_label_area(nv, (uint8_t *)&entry->label, offset, + sizeof(struct nvdimm_label)); + if (error != 0) { + free(entry, M_NVDIMM); + return (error); + } + checksum = entry->label.checksum; + entry->label.checksum = 0; + if (checksum != fletcher64(&entry->label, sizeof(entry->label)) || + entry->label.slot != num) { + free(entry, M_NVDIMM); + return (ENXIO); + } + + /* Insertion ordered by dimm_phys_addr */ + if (SLIST_EMPTY(&nv->labels) || + entry->label.dimm_phys_addr <= + SLIST_FIRST(&nv->labels)->label.dimm_phys_addr) { + SLIST_INSERT_HEAD(&nv->labels, entry, link); + return (0); + } + SLIST_FOREACH_SAFE(i, &nv->labels, link, next) { + if (next == NULL || + entry->label.dimm_phys_addr <= next->label.dimm_phys_addr) { + SLIST_INSERT_AFTER(i, entry, link); + return (0); + } + } + __unreachable(); +} + +static int +read_labels(struct nvdimm_dev *nv) +{ + struct nvdimm_label_index *indices; + size_t bitfield_size, index_size, num_labels; + int error, n; + bool index_0_valid, index_1_valid; + + for (index_size = 256; ; index_size += 256) { + num_labels = 8 * (index_size - + sizeof(struct nvdimm_label_index)); + if (index_size + num_labels * sizeof(struct nvdimm_label) >= + nv->label_area_size) + break; + } + num_labels = (nv->label_area_size - index_size) / + sizeof(struct nvdimm_label); + bitfield_size = roundup2(num_labels, 8) / 8; + indices = malloc(2 * index_size, M_NVDIMM, M_WAITOK); + error = read_label_area(nv, (void *)indices, 0, 2 * index_size); + if (error != 0) { + free(indices, M_NVDIMM); + return (error); + } + index_0_valid = label_index_is_valid(indices, num_labels, index_size, + 0); + index_1_valid = label_index_is_valid(indices, num_labels, index_size, + 1); + if (!index_0_valid && !index_1_valid) { + free(indices, M_NVDIMM); + return (ENXIO); + } + if (index_0_valid && index_1_valid && + (indices[1].seq > indices[0].seq || + (indices[1].seq == 1 && indices[0].seq == 3))) + index_0_valid = false; + nv->label_index = malloc(index_size, M_NVDIMM, M_WAITOK); + bcopy(indices + (index_0_valid ? 0 : 1), nv->label_index, index_size); + free(indices, M_NVDIMM); + for (bit_ffc_at((bitstr_t *)nv->label_index->free, 0, num_labels, &n); + n >= 0; + bit_ffc_at((bitstr_t *)nv->label_index->free, n + 1, num_labels, + &n)) { + read_label(nv, n); + } + return (0); +} + struct nvdimm_dev * nvdimm_find_by_handle(nfit_handle_t nv_handle) { @@ -90,6 +321,7 @@ nvdimm_attach(device_t dev) ACPI_TABLE_NFIT *nfitbl; ACPI_HANDLE handle; ACPI_STATUS status; + int error; nv = device_get_softc(dev); handle = nvdimm_root_get_acpi_handle(dev); @@ -107,6 +339,14 @@ nvdimm_attach(device_t dev) acpi_nfit_get_flush_addrs(nfitbl, nv->nv_handle, &nv->nv_flush_addr, &nv->nv_flush_addr_cnt); AcpiPutTable(&nfitbl->Header); + error = read_label_area_size(nv); + if (error == 0) { + /* + * Ignoring errors reading labels. Not all NVDIMMs + * support labels and namespaces. + */ + read_labels(nv); + } return (0); } @@ -114,9 +354,15 @@ static int nvdimm_detach(device_t dev) { struct nvdimm_dev *nv; + struct nvdimm_label_entry *label, *next; nv = device_get_softc(dev); free(nv->nv_flush_addr, M_NVDIMM); + free(nv->label_index, M_NVDIMM); + SLIST_FOREACH_SAFE(label, &nv->labels, link, next) { + SLIST_REMOVE_HEAD(&nv->labels, link); + free(label, M_NVDIMM); + } return (0); } Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:21 2019 (r344474) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Feb 22 19:54:24 2019 (r344475) @@ -33,6 +33,51 @@ #ifndef __DEV_NVDIMM_VAR_H__ #define __DEV_NVDIMM_VAR_H__ +#define NVDIMM_INDEX_BLOCK_SIGNATURE "NAMESPACE_INDEX" + +struct nvdimm_label_index { + char signature[16]; + uint8_t flags[3]; + uint8_t label_size; + uint32_t seq; + uint64_t this_offset; + uint64_t this_size; + uint64_t other_offset; + uint64_t label_offset; + uint32_t slot_cnt; + uint16_t rev_major; + uint16_t rev_minor; + uint64_t checksum; + uint8_t free[0]; +}; + +struct nvdimm_label { + struct uuid uuid; + char name[64]; + uint32_t flags; + uint16_t nlabel; + uint16_t position; + uint64_t set_cookie; + uint64_t lba_size; + uint64_t dimm_phys_addr; + uint64_t raw_size; + uint32_t slot; + uint8_t alignment; + uint8_t reserved[3]; + struct uuid type_guid; + struct uuid address_abstraction_guid; + uint8_t reserved1[88]; + uint64_t checksum; +}; + +struct nvdimm_label_entry { + SLIST_ENTRY(nvdimm_label_entry) link; + struct nvdimm_label label; +}; + +_Static_assert(sizeof(struct nvdimm_label_index) == 72, "Incorrect layout"); +_Static_assert(sizeof(struct nvdimm_label) == 256, "Incorrect layout"); + typedef uint32_t nfit_handle_t; enum nvdimm_root_ivar { @@ -53,6 +98,10 @@ struct nvdimm_dev { nfit_handle_t nv_handle; uint64_t **nv_flush_addr; int nv_flush_addr_cnt; + uint32_t label_area_size; + uint32_t max_label_xfer; + struct nvdimm_label_index *label_index; + SLIST_HEAD(, nvdimm_label_entry) labels; }; enum SPA_mapping_type { From owner-svn-src-all@freebsd.org Fri Feb 22 21:57: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 4E3FF14FC3B6; Fri, 22 Feb 2019 21:57:28 +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 E0FC08A027; Fri, 22 Feb 2019 21:57:27 +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 D53B7B5FF; Fri, 22 Feb 2019 21:57:27 +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 x1MLvR5t048789; Fri, 22 Feb 2019 21:57:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MLvRJK048787; Fri, 22 Feb 2019 21:57:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201902222157.x1MLvRJK048787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Feb 2019 21:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344477 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 344477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0FC08A027 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.973,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: Fri, 22 Feb 2019 21:57:28 -0000 Author: hselasky Date: Fri Feb 22 21:57:27 2019 New Revision: 344477 URL: https://svnweb.freebsd.org/changeset/base/344477 Log: Add new USB quirk. PR: 235897 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Feb 22 19:54:28 2019 (r344476) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Feb 22 21:57:27 2019 (r344477) @@ -396,6 +396,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDCZ4_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), + USB_QUIRK(SANDISK, SDCZ48_32, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, + UQ_MSC_NO_TEST_UNIT_READY), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Feb 22 19:54:28 2019 (r344476) +++ head/sys/dev/usb/usbdevs Fri Feb 22 21:57:27 2019 (r344477) @@ -4067,6 +4067,7 @@ product SANDISK SDCZ2_128 0x7100 Cruzer Mini 128MB product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK SDCZ48_32 0x5581 Ultra 32GB product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ From owner-svn-src-all@freebsd.org Fri Feb 22 23:15: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 0C34914FDE7A; Fri, 22 Feb 2019 23:15:34 +0000 (UTC) (envelope-from mmacy@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 9C3BC8C834; Fri, 22 Feb 2019 23:15:33 +0000 (UTC) (envelope-from mmacy@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 46AFEC57D; Fri, 22 Feb 2019 23:15:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1MNFXpI090307; Fri, 22 Feb 2019 23:15:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1MNFWrZ090303; Fri, 22 Feb 2019 23:15:32 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902222315.x1MNFWrZ090303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 22 Feb 2019 23:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344478 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src kern sys X-SVN-Commit-Revision: 344478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C3BC8C834 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.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: Fri, 22 Feb 2019 23:15:34 -0000 Author: mmacy Date: Fri Feb 22 23:15:32 2019 New Revision: 344478 URL: https://svnweb.freebsd.org/changeset/base/344478 Log: lkpi: allow late binding of linux_alloc_current Some consumers may be loosely coupled with the lkpi. This allows them to call linux_alloc_current without having a static dependency. Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19257 Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h head/sys/compat/linuxkpi/common/src/linux_current.c head/sys/kern/init_main.c head/sys/sys/systm.h Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compat.h Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/compat/linuxkpi/common/include/linux/compat.h Fri Feb 22 23:15:32 2019 (r344478) @@ -41,18 +41,19 @@ struct task_struct; extern int linux_alloc_current(struct thread *, int flags); extern void linux_free_current(struct task_struct *); + static inline void linux_set_current(struct thread *td) { if (__predict_false(td->td_lkpi_task == NULL)) - linux_alloc_current(td, M_WAITOK); + lkpi_alloc_current(td, M_WAITOK); } static inline int linux_set_current_flags(struct thread *td, int flags) { if (__predict_false(td->td_lkpi_task == NULL)) - return (linux_alloc_current(td, flags)); + return (lkpi_alloc_current(td, flags)); return (0); } Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Fri Feb 22 23:15:32 2019 (r344478) @@ -218,6 +218,7 @@ linux_get_pid_task(pid_t pid) static void linux_current_init(void *arg __unused) { + lkpi_alloc_current = linux_alloc_current; linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); } @@ -242,7 +243,7 @@ linux_current_uninit(void *arg __unused) PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); - EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); + lkpi_alloc_current = linux_alloc_current_noop; } SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/kern/init_main.c Fri Feb 22 23:15:32 2019 (r344478) @@ -107,6 +107,14 @@ struct thread0_storage thread0_st __aligned(32); struct vmspace vmspace0; struct proc *initproc; +int +linux_alloc_current_noop(struct thread *td __unused, int flags __unused) +{ + return (0); +} +int (*lkpi_alloc_current)(struct thread *, int) = linux_alloc_current_noop; + + #ifndef BOOTHOWTO #define BOOTHOWTO 0 #endif @@ -454,7 +462,7 @@ proc0_init(void *dummy __unused) GIANT_REQUIRED; p = &proc0; td = &thread0; - + /* * Initialize magic number and osrel. */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Feb 22 21:57:27 2019 (r344477) +++ head/sys/sys/systm.h Fri Feb 22 23:15:32 2019 (r344478) @@ -237,6 +237,13 @@ void init_param2(long physpages); void init_static_kenv(char *, size_t); void tablefull(const char *); +/* + * Allocate per-thread "current" state in the linuxkpi + */ +extern int (*lkpi_alloc_current)(struct thread *, int); +int linux_alloc_current_noop(struct thread *, int); + + #if defined(KLD_MODULE) || defined(KTR_CRITICAL) || !defined(_KERNEL) || defined(GENOFFSET) #define critical_enter() critical_enter_KBI() #define critical_exit() critical_exit_KBI() From owner-svn-src-all@freebsd.org Sat Feb 23 00:00: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 CFB5C14FECE3; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@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 6F9B08DCE6; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@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 48C07CC73; Sat, 23 Feb 2019 00:00:51 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1N00pri011363; Sat, 23 Feb 2019 00:00:51 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N00o8R011357; Sat, 23 Feb 2019 00:00:50 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201902230000.x1N00o8R011357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Feb 2019 00:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344479 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 344479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F9B08DCE6 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, 23 Feb 2019 00:00:52 -0000 Author: sobomax Date: Sat Feb 23 00:00:49 2019 New Revision: 344479 URL: https://svnweb.freebsd.org/changeset/base/344479 Log: o Get rid of silly comment which seems to have got life of its own via copy-and-paste process; o Return geom_uzip(4) usage back to how manual page prescribes it to be used while I am here. Modified: head/sys/mips/conf/AP94 head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/ROUTERSTATION_MFS head/sys/mips/conf/RSPRO_MFS head/sys/mips/conf/WZR-300HP head/sys/mips/conf/WZR-HPAG300H Modified: head/sys/mips/conf/AP94 ============================================================================== --- head/sys/mips/conf/AP94 Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/AP94 Sat Feb 23 00:00:49 2019 (r344479) @@ -21,7 +21,6 @@ hints "AP94.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/DIR-825B1 Sat Feb 23 00:00:49 2019 (r344479) @@ -47,7 +47,6 @@ nooptions INET6 # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options GEOM_PART_GPT Modified: head/sys/mips/conf/ROUTERSTATION_MFS ============================================================================== --- head/sys/mips/conf/ROUTERSTATION_MFS Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/ROUTERSTATION_MFS Sat Feb 23 00:00:49 2019 (r344479) @@ -12,7 +12,6 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/RSPRO_MFS ============================================================================== --- head/sys/mips/conf/RSPRO_MFS Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/RSPRO_MFS Sat Feb 23 00:00:49 2019 (r344479) @@ -15,7 +15,6 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP # Boot from the first MFS uzip Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/WZR-300HP Sat Feb 23 00:00:49 2019 (r344479) @@ -26,7 +26,7 @@ options BOOTVERBOSE # GEOM modules device geom_map # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/WZR-HPAG300H ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H Fri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/WZR-HPAG300H Sat Feb 23 00:00:49 2019 (r344479) @@ -25,7 +25,7 @@ options AR71XX_ENV_UBOOT options BOOTVERBOSE # GEOM modules -device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP device geom_map # to get access to the SPI flash partitions options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" From owner-svn-src-all@freebsd.org Sat Feb 23 03:05: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 44F1D1503BDE; Sat, 23 Feb 2019 03:05:29 +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 86F906E5B7; Sat, 23 Feb 2019 03:05:28 +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 5C5A93D8C5B; Sat, 23 Feb 2019 14:05:25 +1100 (AEDT) Date: Sat, 23 Feb 2019 14:05:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344479 - head/sys/mips/conf In-Reply-To: <201902230000.x1N00o8R011357@repo.freebsd.org> Message-ID: <20190223125748.S909@besplex.bde.org> References: <201902230000.x1N00o8R011357@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 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=60YepAZSkRJpfBsUMC8A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 86F906E5B7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 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.98)[-0.977,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, 23 Feb 2019 03:05:29 -0000 On Sat, 23 Feb 2019, Maxim Sobolev wrote: > Log: > o Get rid of silly comment which seems to have got life of its own via > copy-and-paste process; It is perhaps better than no comment on a misformatted options line. > o Return geom_uzip(4) usage back to how manual page prescribes it to be > used while I am here. Section 4 man pages unfortunately don't usually have examples of comments on options line, and never have correct formatting. > Modified: head/sys/mips/conf/AP94 > ============================================================================== > --- head/sys/mips/conf/AP94 Fri Feb 22 23:15:32 2019 (r344478) > +++ head/sys/mips/conf/AP94 Sat Feb 23 00:00:49 2019 (r344479) > @@ -21,7 +21,6 @@ hints "AP94.hints" > > # GEOM modules > device geom_redboot # to get access to the SPI flash partitions > -device geom_uzip # compressed in-memory filesystem hackery! > options GEOM_UZIP > > options ROOTDEVNAME=\"ufs:md0.uzip\" Now there is no comment on the remaining GEOM_UZIP line. "device foo" is sometimes abused to access an unsupported option (an option that is not listed in conf/options*). "foo" is then not available as a macro, but it is available as a keyword for selecting files from conf/files. Also, if DEV_FOO is listed in conf/options, then this is a syntax error if "foo" is _not_ used as a keyword in conf/files, but if "foo" is so used then DEV_FOO is not a syntax error and a #define of it is generated. Everything seems to be case-sensitive, except there is no way to prevent the conversion of "foo" to "FOO" in DEV_FOO. "device loop" is an example of use of this. This just selects the file if_loop.c, and there are no messy ifdefs, so DEV_LOOP is not needed and is not an option and not generated. "device bpf" is a messier example which needs ifdefs on DEV_BPF, so DEV_BPF must be an option. "device gzip" is an example of abuse of this. gzip is very far from being a device. > Modified: head/sys/mips/conf/DIR-825B1 > Modified: head/sys/mips/conf/ROUTERSTATION_MFS > Modified: head/sys/mips/conf/RSPRO_MFS > Modified: head/sys/mips/conf/WZR-300HP 4 more removals leaving no comment. > ============================================================================== > --- head/sys/mips/conf/WZR-300HP Fri Feb 22 23:15:32 2019 (r344478) > +++ head/sys/mips/conf/WZR-300HP Sat Feb 23 00:00:49 2019 (r344479) > @@ -26,7 +26,7 @@ options BOOTVERBOSE > > # GEOM modules > device geom_map # to get access to the SPI flash partitions > -device geom_uzip # compressed in-memory filesystem hackery! > +options GEOM_UZIP > > options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" This is an addition with a misformatted options line and no comment. conf/NOTES provides an example with correct formatting. It even provides a comment suitable for copying. conf/NOTES has many misformatted options lines (27 with the keyword followed by 2 tabs and 1 with it followed by 1 tab), but all GEOM_FOO lines are formatted normally. */NOTES has too many lines not suitable for copying since they have no comment. NOTES tends to have more verbose comments written in separate paragraphs and lists. The lists are better made up of options lines with short comments. > Modified: head/sys/mips/conf/WZR-HPAG300H Another addition with a misformatted options line and no comment. Normal formatting of options lines lines things up nicely, but wastes 8 or 16 columns which would be better used for comments. Many options names are too long. GENERIC is more consistent than NOTES in wasting an extra 8 columns for short option names so as to line up the comments. device names are better, and not wasting an extra 8 columns to line up the comments for device directives gives another set of inconsistencies. Bruce From owner-svn-src-all@freebsd.org Sat Feb 23 04:24: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 0FDDD1505F48; Sat, 23 Feb 2019 04:24:46 +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 A848270EEE; Sat, 23 Feb 2019 04:24:45 +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 9BA28180D4; Sat, 23 Feb 2019 04:24:45 +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 x1N4OjlM053235; Sat, 23 Feb 2019 04:24:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N4OiCv053232; Sat, 23 Feb 2019 04:24:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902230424.x1N4OiCv053232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 23 Feb 2019 04:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344480 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A848270EEE 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.939,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, 23 Feb 2019 04:24:46 -0000 Author: mav Date: Sat Feb 23 04:24:44 2019 New Revision: 344480 URL: https://svnweb.freebsd.org/changeset/base/344480 Log: Remove disabled CTL_LEGACY_STATS support. It was not only disabled for quite a while, but also appeared to be broken at r325517, when maximum number of ports was made configurable. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 04:24:44 2019 (r344480) @@ -2743,39 +2743,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #endif /* CTL_IO_DELAY */ break; } -#ifdef CTL_LEGACY_STATS - case CTL_GETSTATS: { - struct ctl_stats *stats = (struct ctl_stats *)addr; - int i; - - /* - * XXX KDM no locking here. If the LUN list changes, - * things can blow up. - */ - i = 0; - stats->status = CTL_SS_OK; - stats->fill_len = 0; - STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (stats->fill_len + sizeof(lun->legacy_stats) > - stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - break; - } - retval = copyout(&lun->legacy_stats, &stats->lun_stats[i++], - sizeof(lun->legacy_stats)); - if (retval != 0) - break; - stats->fill_len += sizeof(lun->legacy_stats); - } - stats->num_luns = softc->num_luns; - stats->flags = CTL_STATS_FLAG_NONE; -#ifdef CTL_TIME_IO - stats->flags |= CTL_STATS_FLAG_TIME_VALID; -#endif - getnanouptime(&stats->timestamp); - break; - } -#endif /* CTL_LEGACY_STATS */ case CTL_ERROR_INJECT: { struct ctl_error_desc *err_desc, *new_err_desc; @@ -4758,17 +4725,6 @@ fail: ctl_init_log_page_index(lun); /* Setup statistics gathering */ -#ifdef CTL_LEGACY_STATS - lun->legacy_stats.device_type = be_lun->lun_type; - lun->legacy_stats.lun_number = lun_number; - lun->legacy_stats.blocksize = be_lun->blocksize; - if (be_lun->blocksize == 0) - lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * - ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < ctl_max_ports; len++) - lun->legacy_stats.ports[len].targ_port = len; -#endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; /* @@ -13078,21 +13034,6 @@ ctl_process_done(union ctl_io *io) type = CTL_STATS_WRITE; else type = CTL_STATS_NO_IO; - -#ifdef CTL_LEGACY_STATS - uint32_t targ_port = port->targ_port; - lun->legacy_stats.ports[targ_port].bytes[type] += - io->scsiio.kern_total_len; - lun->legacy_stats.ports[targ_port].operations[type] ++; - lun->legacy_stats.ports[targ_port].num_dmas[type] += - io->io_hdr.num_dmas; -#ifdef CTL_TIME_IO - bintime_add(&lun->legacy_stats.ports[targ_port].dma_time[type], - &io->io_hdr.dma_bt); - bintime_add(&lun->legacy_stats.ports[targ_port].time[type], - &bt); -#endif -#endif /* CTL_LEGACY_STATS */ lun->stats.bytes[type] += io->scsiio.kern_total_len; lun->stats.operations[type] ++; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl_ioctl.h Sat Feb 23 04:24:44 2019 (r344480) @@ -69,9 +69,6 @@ /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 -/* Legacy statistics accumulated for every port for every LU. */ -//#define CTL_LEGACY_STATS 1 - typedef enum { CTL_DELAY_TYPE_NONE, CTL_DELAY_TYPE_CONT, @@ -119,39 +116,6 @@ typedef enum { CTL_STATS_FLAG_TIME_VALID = 0x01 } ctl_stats_flags; -#ifdef CTL_LEGACY_STATS -typedef enum { - CTL_LUN_STATS_NO_BLOCKSIZE = 0x01 -} ctl_lun_stats_flags; - -struct ctl_lun_io_port_stats { - uint32_t targ_port; - uint64_t bytes[CTL_STATS_NUM_TYPES]; - uint64_t operations[CTL_STATS_NUM_TYPES]; - struct bintime time[CTL_STATS_NUM_TYPES]; - uint64_t num_dmas[CTL_STATS_NUM_TYPES]; - struct bintime dma_time[CTL_STATS_NUM_TYPES]; -}; - -struct ctl_lun_io_stats { - uint8_t device_type; - uint64_t lun_number; - uint32_t blocksize; - ctl_lun_stats_flags flags; - struct ctl_lun_io_port_stats *ports; -}; - -struct ctl_stats { - int alloc_len; /* passed to kernel */ - struct ctl_lun_io_stats *lun_stats; /* passed to/from kernel */ - int fill_len; /* passed to userland */ - int num_luns; /* passed to userland */ - ctl_stats_status status; /* passed to userland */ - ctl_stats_flags flags; /* passed to userland */ - struct timespec timestamp; /* passed to userland */ -}; -#endif /* CTL_LEGACY_STATS */ - struct ctl_io_stats { uint32_t item; uint64_t bytes[CTL_STATS_NUM_TYPES]; @@ -795,7 +759,6 @@ struct ctl_lun_map { #define CTL_ENABLE_PORT _IOW(CTL_MINOR, 0x04, struct ctl_port_entry) #define CTL_DISABLE_PORT _IOW(CTL_MINOR, 0x05, struct ctl_port_entry) #define CTL_DELAY_IO _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info) -#define CTL_GETSTATS _IOWR(CTL_MINOR, 0x15, struct ctl_stats) #define CTL_ERROR_INJECT _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc) #define CTL_GET_OOA _IOWR(CTL_MINOR, 0x18, struct ctl_ooa) #define CTL_DUMP_STRUCTS _IO(CTL_MINOR, 0x19) Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Sat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl_private.h Sat Feb 23 04:24:44 2019 (r344480) @@ -403,9 +403,6 @@ struct ctl_lun { struct callout ie_callout; /* INTERVAL TIMER */ struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; -#ifdef CTL_LEGACY_STATS - struct ctl_lun_io_stats legacy_stats; -#endif /* CTL_LEGACY_STATS */ struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation; From owner-svn-src-all@freebsd.org Sat Feb 23 06:03: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 33C371508809; Sat, 23 Feb 2019 06:03:19 +0000 (UTC) (envelope-from glebius@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 C08A7742C7; Sat, 23 Feb 2019 06:03:18 +0000 (UTC) (envelope-from glebius@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 ACBE5191D3; Sat, 23 Feb 2019 06:03:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1N63IMl005735; Sat, 23 Feb 2019 06:03:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N63IUa005733; Sat, 23 Feb 2019 06:03:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902230603.x1N63IUa005733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 23 Feb 2019 06:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344481 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 344481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C08A7742C7 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.939,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, 23 Feb 2019 06:03:19 -0000 Author: glebius Date: Sat Feb 23 06:03:18 2019 New Revision: 344481 URL: https://svnweb.freebsd.org/changeset/base/344481 Log: Support struct ip_mreqn as argument for IP_ADD_MEMBERSHIP. Legacy support for struct ip_mreq remains in place. The struct ip_mreqn is Linux extension to classic BSD multicast API. It has extra field allowing to specify the interface index explicitly. In Linux it used as argument for IP_MULTICAST_IF and IP_ADD_MEMBERSHIP. FreeBSD kernel also declares this structure and supports it as argument to IP_MULTICAST_IF since r170613. So, we have structure declared but not fully supported, this confused third party application configure scripts. Code handling IP_ADD_MEMBERSHIP was mixed together with code for IP_ADD_SOURCE_MEMBERSHIP. Bringing legacy and new structure support into the mess would made the "argument switcharoo" intolerable, so code was separated into its own switch case clause. MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D19276 Modified: head/share/man/man4/ip.4 head/sys/netinet/in_mcast.c Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Sat Feb 23 04:24:44 2019 (r344480) +++ head/share/man/man4/ip.4 Sat Feb 23 06:03:18 2019 (r344481) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd February 22, 2019 .Dt IP 4 .Os .Sh NAME @@ -571,32 +571,55 @@ To join a multicast group, use the .Dv IP_ADD_MEMBERSHIP option: .Bd -literal -struct ip_mreq mreq; -setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +struct ip_mreqn mreqn; +setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreqn, sizeof(mreqn)); .Ed .Pp where -.Fa mreq +.Fa mreqn is the following structure: .Bd -literal -struct ip_mreq { +struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ + int imr_ifindex; /* interface index */ } .Ed .Pp -.Va imr_interface -should be set to the -.Tn IP -address of a particular multicast-capable interface if +.Va imr_ifindex +should be set to the index of a particular multicast-capable interface if the host is multihomed. -It may be set to -.Dv INADDR_ANY -to choose the default interface, although this is not recommended; -this is considered to be the first interface corresponding -to the default route. -Otherwise, the first multicast-capable interface -configured in the system will be used. +If +.Va imr_ifindex +is non-zero, value of +.Va imr_interface +is ignored. +Otherwise, if +.Va imr_ifindex +is 0, kernel will use IP address from +.Va imr_interface +to lookup the interface. +Value of +.Va imr_interface +may be set to +.Va INADDR_ANY +to choose the default interface, although this is not recommended; this is +considered to be the first interface corresponding to the default route. +Otherwise, the first multicast-capable interface configured in the system +will be used. +.Pp +Legacy +.Vt "struct ip_mreq" , +that lacks +.Va imr_ifindex +field is also supported by +.Dv IP_ADD_MEMBERSHIP +setsockopt. +In this case kernel would behave as if +.Va imr_ifindex +was set to zero: +.Va imr_interface +will be used to lookup interface. .Pp Prior to .Fx 7.0 , Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat Feb 23 04:24:44 2019 (r344480) +++ head/sys/netinet/in_mcast.c Sat Feb 23 06:03:18 2019 (r344481) @@ -2049,40 +2049,49 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt ssa->ss.ss_family = AF_UNSPEC; switch (sopt->sopt_name) { - case IP_ADD_MEMBERSHIP: - case IP_ADD_SOURCE_MEMBERSHIP: { - struct ip_mreq_source mreqs; + case IP_ADD_MEMBERSHIP: { + struct ip_mreqn mreqn; - if (sopt->sopt_name == IP_ADD_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq), - sizeof(struct ip_mreq)); - /* - * Do argument switcharoo from ip_mreq into - * ip_mreq_source to avoid using two instances. - */ - mreqs.imr_interface = mreqs.imr_sourceaddr; - mreqs.imr_sourceaddr.s_addr = INADDR_ANY; - } else if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq_source), - sizeof(struct ip_mreq_source)); - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreqn), sizeof(struct ip_mreqn)); + else + error = sooptcopyin(sopt, &mreqn, + sizeof(struct ip_mreq), sizeof(struct ip_mreq)); if (error) return (error); gsa->sin.sin_family = AF_INET; gsa->sin.sin_len = sizeof(struct sockaddr_in); - gsa->sin.sin_addr = mreqs.imr_multiaddr; + gsa->sin.sin_addr = mreqn.imr_multiaddr; + if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) + return (EINVAL); - if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - ssa->sin.sin_family = AF_INET; - ssa->sin.sin_len = sizeof(struct sockaddr_in); - ssa->sin.sin_addr = mreqs.imr_sourceaddr; - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn) && + mreqn.imr_ifindex != 0) + ifp = ifnet_byindex(mreqn.imr_ifindex); + else + ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, + mreqn.imr_address); + break; + } + case IP_ADD_SOURCE_MEMBERSHIP: { + struct ip_mreq_source mreqs; + error = sooptcopyin(sopt, &mreqs, sizeof(struct ip_mreq_source), + sizeof(struct ip_mreq_source)); + if (error) + return (error); + + gsa->sin.sin_family = ssa->sin.sin_family = AF_INET; + gsa->sin.sin_len = ssa->sin.sin_len = + sizeof(struct sockaddr_in); + + gsa->sin.sin_addr = mreqs.imr_multiaddr; if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + + ssa->sin.sin_addr = mreqs.imr_sourceaddr; ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); From owner-svn-src-all@freebsd.org Sat Feb 23 09:35: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 57CB8150E75E; Sat, 23 Feb 2019 09:35:06 +0000 (UTC) (envelope-from brueffer@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 CCB6E82BF1; Sat, 23 Feb 2019 09:35:05 +0000 (UTC) (envelope-from brueffer@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 9413F1B6DD; Sat, 23 Feb 2019 09:35:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1N9Z5OR015125; Sat, 23 Feb 2019 09:35:05 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1N9YwMn015075; Sat, 23 Feb 2019 09:34:58 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201902230934.x1N9YwMn015075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sat, 23 Feb 2019 09:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344482 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: brueffer X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 344482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCB6E82BF1 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.959,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, 23 Feb 2019 09:35:06 -0000 Author: brueffer Date: Sat Feb 23 09:34:57 2019 New Revision: 344482 URL: https://svnweb.freebsd.org/changeset/base/344482 Log: Fix a slew of mdoc errors and warnings. MFC after: 1 week Modified: head/share/man/man4/cc_newreno.4 head/share/man/man4/ctl.4 head/share/man/man4/ehci.4 head/share/man/man4/em.4 head/share/man/man4/ena.4 head/share/man/man4/ips.4 head/share/man/man4/liquidio.4 head/share/man/man4/nda.4 head/share/man/man4/ng_nat.4 head/share/man/man4/ohci.4 head/share/man/man4/pci.4 head/share/man/man4/sctp.4 head/share/man/man4/ses.4 head/share/man/man4/siftr.4 head/share/man/man4/smartpqi.4 head/share/man/man4/sysmouse.4 head/share/man/man4/tcp.4 head/share/man/man4/uath.4 head/share/man/man4/ucom.4 head/share/man/man4/ugen.4 head/share/man/man4/uhci.4 head/share/man/man4/uhid.4 head/share/man/man4/ukbd.4 head/share/man/man4/umoscom.4 head/share/man/man4/ums.4 head/share/man/man4/uplcom.4 head/share/man/man4/usb.4 head/share/man/man4/uvscom.4 head/share/man/man4/vale.4 head/share/man/man4/vmci.4 head/share/man/man4/vmm.4 head/share/man/man4/wi.4 head/share/man/man4/xe.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/cc_newreno.4 ============================================================================== --- head/share/man/man4/cc_newreno.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/cc_newreno.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -75,6 +75,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * CC_NEWRENO_BETA_ECN) / 100. Default is 80. +.El .Sh MIB Variables The algorithm exposes these variables in the .Va net.inet.tcp.cc.newreno @@ -93,6 +94,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. +.El .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ctl.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -202,6 +202,7 @@ The default value is 1024. .It Va kern.cam.ctl.max_ports Specifies the maximum number of ports we support, must be a power of 2. The default value is 256. +.El .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ehci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -88,6 +88,7 @@ The default value is 0 (off). .It Va hw.usb.ehci.no_hs This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller. The default value is 0 (off). +.El .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/em.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -264,6 +264,7 @@ If .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. +.El .Sh FILES .Bl -tag -width /dev/led/em* .It Pa /dev/led/em* Modified: head/share/man/man4/ena.4 ============================================================================== --- head/share/man/man4/ena.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ena.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -239,6 +239,7 @@ for more details. .Pp Packet with unsupported number of segments was queued for sending to the device; packet will be dropped. +.El .Sh SUPPORT If an issue is identified with the released source code with a supported adapter email the specific information related to the issue to Modified: head/share/man/man4/ips.4 ============================================================================== --- head/share/man/man4/ips.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ips.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -114,7 +114,7 @@ Unable to obtain adapter or drive configuration. A buffer input/output error has occurred. .Bq Er ENXIO .El -.Ss General adapter errors: +.Ss General adapter errors : .Bl -diag .It Attaching bus failed .Pp @@ -146,7 +146,7 @@ The adapter is disabled. .Pp The driver was unable to allocate resources for the device. .El -.Ss Error messages due to DMA: +.Ss Error messages due to DMA : .Bl -diag .It can't alloc command dma tag .It can't alloc SG dma tag @@ -155,7 +155,7 @@ The driver was unable to allocate resources for the de .Pp Failure to map or allocate DMA resources. .El -.Ss Cache, buffer, and command errors: +.Ss Cache, buffer, and command errors : .Bl -diag .It failed to initialize command buffers .It no mem for command slots! Modified: head/share/man/man4/liquidio.4 ============================================================================== --- head/share/man/man4/liquidio.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/liquidio.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -110,6 +110,7 @@ To enable/disable driver RSS support .It Va hw.lio.hwlro .Pp To enable/disable hardware LRO +.El .Sh SUPPORT For general information and support, go to the Cavium support website at: Modified: head/share/man/man4/nda.4 ============================================================================== --- head/share/man/man4/nda.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/nda.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -70,14 +70,15 @@ It's value is hard coded to 0 indicating flash. This variable reports whether the .Nm driver accepts unmapped I/O for this unit. +.El .Sh FILES .Bl -tag -width ".Pa /dev/nda*" -compact .It Pa /dev/nda* NVMe storage device nodes .El .Sh SEE ALSO -.Xr nvme 4 , -.Xr nvd 4 +.Xr nvd 4 , +.Xr nvme 4 .Sh HISTORY The .Nm Modified: head/share/man/man4/ng_nat.4 ============================================================================== --- head/share/man/man4/ng_nat.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ng_nat.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -387,6 +387,7 @@ route add default x.y.0.1 msg igb0_NAT: setdlt 1 msg igb0_NAT: setaliasaddr x.y.8.35 SEQ +.Ed .Sh SEE ALSO .Xr libalias 3 , .Xr ng_ipfw 4 , Modified: head/share/man/man4/ohci.4 ============================================================================== --- head/share/man/man4/ohci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ohci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -70,6 +70,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr uhci 4 , Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/pci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -386,7 +386,7 @@ specified by the member, otherwise fail. .It PCIIO_BAR_MMAP_EXCL Must be used together with -.Vd PCIIO_BAR_MMAP_FIXED +.Dv PCIIO_BAR_MMAP_FIXED If the specified base contains already established mappings, the operation fails instead of implicitly unmapping them. .It PCIIO_BAR_MMAP_RW Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/sctp.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -176,7 +176,7 @@ and tested with .Xr getsockopt 2 or .Xr sctp_opt_info 3 : -.Bl -tag -indent +.Bl -tag -width indent .It Dv SCTP_NODELAY Under most circumstances, .Tn SCTP Modified: head/share/man/man4/ses.4 ============================================================================== --- head/share/man/man4/ses.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ses.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 05, 2015 +.Dd September 5, 2015 .Dt SES 4 .Os .Sh NAME Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/siftr.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -399,11 +399,15 @@ The summation of num_inbound_tcp_pkts and num_outbound .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc -Number of inbound packets that were not processed because of failed malloc() calls. +Number of inbound packets that were not processed because of failed +.Fn malloc +calls. .El .Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc -Number of outbound packets that were not processed because of failed malloc() calls. +Number of outbound packets that were not processed because of failed +.Fn malloc +calls. .El .Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx @@ -759,8 +763,10 @@ Ideally, .Nm should intercept packets after they have been processed by the TCP layer i.e. intercept packets coming up the stack after they have been processed by -tcp_input(), and intercept packets coming down the stack after they have been -processed by tcp_output(). +.Fn tcp_input , +and intercept packets coming down the stack after they have been +processed by +.Fn tcp_output . The current code still gives satisfactory granularity though, as inbound events tend to trigger outbound events, allowing the cause-and-effect to be observed indirectly by capturing the state on outbound events as well. Modified: head/share/man/man4/smartpqi.4 ============================================================================== --- head/share/man/man4/smartpqi.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/smartpqi.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ stable/10/share/man/man4/smartpqi.4 195614 2017-01-11 08:10:18Z jkim $ -.Dd April 06, 2018 +.Dd April 6, 2018 .Dt SMARTPQI 4 .Os .Sh NAME @@ -37,6 +37,7 @@ kernel configuration file: .Cd device pci .Cd device scbus .Cd device smartpqi +.Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in @@ -81,10 +82,10 @@ smartpqi management interface .Xr kld 4 , .Xr linux 4 , .Xr scsi 4 , -.Xr kldload 8 -.Xr pass 4 -.Xr xpt 4 -.Xr loader.conf 5 +.Xr kldload 8 , +.Xr pass 4 , +.Xr xpt 4 , +.Xr loader.conf 5 , .Xr camcontrol 8 .Rs .%T "Microsemi Website" @@ -95,7 +96,7 @@ The .Nm driver first appeared in .Fx 11.1 . -.Sh AUTHOR +.Sh AUTHORS .An Murthy Bhat .Aq murthy.bhat@microsemi.com .Sh BUGS Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/sysmouse.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -55,7 +55,6 @@ Make sure that .Xr moused 8 is running, otherwise the user process will not see any data coming from the mouse. -.Pp .Ss Operation Levels The .Nm Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/tcp.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -597,8 +597,7 @@ The default TCP function block (TCP stack). .It Va functions_inherit_listen_socket_stack Determines whether to inherit listen socket's tcp stack or use the current system default tcp stack, as defined by -.Va functions_default -.Pc . +.Va functions_default . Default is true. .It Va insecure_rst Use criteria defined in RFC793 instead of RFC5961 for accepting RST segments. Modified: head/share/man/man4/uath.4 ============================================================================== --- head/share/man/man4/uath.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uath.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -76,7 +76,7 @@ This is normally done by the utility that is launched by .Xr devd 8 when the device is inserted. -.Xr uathload +.Xr uathload 8 includes the firmware in the binary program. This firmware is licensed for general use and is included in the base system. .Sh HARDWARE Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ucom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -81,6 +81,7 @@ driver will mark terminals as console devices when ope Default is 1. .It Va hw.usb.ucom.pps_mode Enables and configure PPS capture mode as described below. +.El .Sh Pulse Per Second (PPS) Timing Interface The .Nm Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ugen.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -302,6 +302,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact .It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E Modified: head/share/man/man4/uhci.4 ============================================================================== --- head/share/man/man4/uhci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uhci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -60,6 +60,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uhid.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -155,6 +155,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/uhid?" .It Pa /dev/uhid? Modified: head/share/man/man4/ukbd.4 ============================================================================== --- head/share/man/man4/ukbd.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ukbd.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -147,6 +147,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width ".Pa /dev/kbd*" -compact .It Pa /dev/kbd* Modified: head/share/man/man4/umoscom.4 ============================================================================== --- head/share/man/man4/umoscom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/umoscom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -77,4 +77,7 @@ corresponding callout initial-state and lock-state dev .Sh HISTORY The .Nm -driver appeared in OpenBSD and was ported to FreeBSD. +driver appeared in +.Ox +and was ported to +.Fx . Modified: head/share/man/man4/ums.4 ============================================================================== --- head/share/man/man4/ums.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/ums.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -75,6 +75,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width /dev/ums0 -compact .It Pa /dev/ums0 Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uplcom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -191,6 +191,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/usb.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -142,6 +142,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO The .Tn USB @@ -173,7 +174,7 @@ specifications can be found at: .Xr uvscom 4 , .Xr xhci 4 .Xr usbconfig 8 , -.Xr usbdi 9 , +.Xr usbdi 9 .Sh STANDARDS The .Nm Modified: head/share/man/man4/uvscom.4 ============================================================================== --- head/share/man/man4/uvscom.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/uvscom.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -90,6 +90,7 @@ for callout ports .It Pa /dev/cuaU*.init .It Pa /dev/cuaU*.lock corresponding callout initial-state and lock-state devices +.El .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , Modified: head/share/man/man4/vale.4 ============================================================================== --- head/share/man/man4/vale.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vale.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" $Id: $ .\" -.Dd Jan 9, 2019 +.Dd January 9, 2019 .Dt VALE 4 .Os .Sh NAME Modified: head/share/man/man4/vmci.4 ============================================================================== --- head/share/man/man4/vmci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vmci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -59,6 +59,7 @@ virtual machine itself. .Rs .%T "VMware vSockets Documentation" .%U https://www.vmware.com/support/developer/vmci-sdk/ +.Re .Sh HISTORY The .Nm Modified: head/share/man/man4/vmm.4 ============================================================================== --- head/share/man/man4/vmm.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/vmm.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -31,7 +31,6 @@ .Nm vmm.ko .Nd "bhyve virtual machine monitor" .Sh SYNOPSIS -.Pp To load the driver as a module at boot, add this line to .Xr loader.conf 5 : .Bd -literal -offset indent @@ -47,7 +46,7 @@ kldload vmm .Nm provides the kernel portion of the .Xr bhyve 4 -hypervisor. +hypervisor. .Pp An Intel CPU with VT-x/EPT or AMD CPU with SVM support is required. .Pp Modified: head/share/man/man4/wi.4 ============================================================================== --- head/share/man/man4/wi.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/wi.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -316,7 +316,7 @@ command. .Xr wlan_xauth 4 , .Xr hostapd 8 , .Xr ifconfig 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Rs .%T HCF Light programming specification .%U http://web.archive.org/web/20040130141721/http://wavelan.com/ Modified: head/share/man/man4/xe.4 ============================================================================== --- head/share/man/man4/xe.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/xe.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24 2018 +.Dd October 24, 2018 .Dt XE 4 .Os .Sh NAME Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/xhci.4 Sat Feb 23 09:34:57 2019 (r344482) @@ -67,6 +67,7 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.El .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , From owner-svn-src-all@freebsd.org Sat Feb 23 10:30: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 5D1DA15102EC; Sat, 23 Feb 2019 10:30:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 62D1684D82; Sat, 23 Feb 2019 10:30:39 +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 x1NAUWgA022189 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Feb 2019 12:30:35 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1NAUWgA022189 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1NAUWop022188; Sat, 23 Feb 2019 12:30:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Feb 2019 12:30:32 +0200 From: Konstantin Belousov To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344479 - head/sys/mips/conf Message-ID: <20190223103032.GG2420@kib.kiev.ua> References: <201902230000.x1N00o8R011357@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902230000.x1N00o8R011357@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) 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: Sat, 23 Feb 2019 10:30:40 -0000 On Sat, Feb 23, 2019 at 12:00:50AM +0000, Maxim Sobolev wrote: > Author: sobomax > Date: Sat Feb 23 00:00:49 2019 > New Revision: 344479 > URL: https://svnweb.freebsd.org/changeset/base/344479 > > Log: > o Get rid of silly comment which seems to have got life of its own via > copy-and-paste process; > > o Return geom_uzip(4) usage back to how manual page prescribes it to be > used while I am here. > > Modified: > head/sys/mips/conf/AP94 > head/sys/mips/conf/DIR-825B1 > head/sys/mips/conf/ROUTERSTATION_MFS > head/sys/mips/conf/RSPRO_MFS > head/sys/mips/conf/WZR-300HP > head/sys/mips/conf/WZR-HPAG300H To put this commit into some perspective: - removal of 'device geom_uzip' is the part of the still discussed https://reviews.freebsd.org/D19266; - of course the removal there conflicts with the uncommitted patch, requiring me to spend time handling the conflict; - as a happy coincidence the patch is incomplete leaving a lot more 'device geom_uzip' in sys/mips/conf files - I have to explain all of that to some people outside the svn-src@ (see the tag line in the review) and try to smooth out the naturally uprising attitude. I am curious, do you think that the rush to remove the comment worth the outcome ? From owner-svn-src-all@freebsd.org Sat Feb 23 14:27: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 4A06C1517D3C; Sat, 23 Feb 2019 14:27:11 +0000 (UTC) (envelope-from dim@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 C61E98CE7E; Sat, 23 Feb 2019 14:27:10 +0000 (UTC) (envelope-from dim@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 AAB1F1E8A8; Sat, 23 Feb 2019 14:27:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NERALp067537; Sat, 23 Feb 2019 14:27:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NERAL2067536; Sat, 23 Feb 2019 14:27:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902231427.x1NERAL2067536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 23 Feb 2019 14:27:10 +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: r344483 - in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Commit-Revision: 344483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C61E98CE7E 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)[-0.999,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: Sat, 23 Feb 2019 14:27:11 -0000 Author: dim Date: Sat Feb 23 14:27:09 2019 New Revision: 344483 URL: https://svnweb.freebsd.org/changeset/base/344483 Log: MFC r344386: Pull in r354515 from upstream libc++ trunk: Fix the build with gcc when `-Wredundant-decls` is passed Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and ``, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of ``, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 Submitted by: ngie Modified: stable/11/contrib/libc++/include/__locale Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/libc++/include/__locale Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/libc++/include/__locale ============================================================================== --- stable/11/contrib/libc++/include/__locale Sat Feb 23 09:34:57 2019 (r344482) +++ stable/11/contrib/libc++/include/__locale Sat Feb 23 14:27:09 2019 (r344483) @@ -1230,8 +1230,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); - template struct __narrow_to_utf8 { From owner-svn-src-all@freebsd.org Sat Feb 23 14:27: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 4CD081517D3D; Sat, 23 Feb 2019 14:27:11 +0000 (UTC) (envelope-from dim@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 733888CE7D; Sat, 23 Feb 2019 14:27:10 +0000 (UTC) (envelope-from dim@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 60E4C1E8A7; Sat, 23 Feb 2019 14:27:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NERA5G067531; Sat, 23 Feb 2019 14:27:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NERAKY067530; Sat, 23 Feb 2019 14:27:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902231427.x1NERAKY067530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 23 Feb 2019 14:27: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: r344483 - in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/libc++/include 12/contrib/libc++/include X-SVN-Commit-Revision: 344483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 733888CE7D 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)[-0.999,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: Sat, 23 Feb 2019 14:27:11 -0000 Author: dim Date: Sat Feb 23 14:27:09 2019 New Revision: 344483 URL: https://svnweb.freebsd.org/changeset/base/344483 Log: MFC r344386: Pull in r354515 from upstream libc++ trunk: Fix the build with gcc when `-Wredundant-decls` is passed Summary: gcc warns that `__throw_runtime_error` is declared both in `<__locale>` and ``, if `-Wredundant-decls` is passed on the command line; this is the case with FreeBSD when ${WARNS} == 6. Since `<__locale>` gets its first declaration via a transitive include of ``, and the second declaration is after the first invocation of `__throw_runtime_error`, delete that second declaration. Signed-off-by: Enji Cooper Reviewers: kristina, MaskRay, EricWF, ldionne, ngie Reviewed By: EricWF Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58425 Submitted by: ngie Modified: stable/12/contrib/libc++/include/__locale Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/libc++/include/__locale Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/libc++/include/__locale ============================================================================== --- stable/12/contrib/libc++/include/__locale Sat Feb 23 09:34:57 2019 (r344482) +++ stable/12/contrib/libc++/include/__locale Sat Feb 23 14:27:09 2019 (r344483) @@ -1230,8 +1230,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname) -_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); - template struct __narrow_to_utf8 { From owner-svn-src-all@freebsd.org Sat Feb 23 20:45: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 004741505432; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@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 963BE6ECFF; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@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 845C4228BA; Sat, 23 Feb 2019 20:45:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NKjknu069913; Sat, 23 Feb 2019 20:45:46 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NKjkFO069911; Sat, 23 Feb 2019 20:45:46 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232045.x1NKjkFO069911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 20:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344484 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 344484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 963BE6ECFF 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, 23 Feb 2019 20:45:47 -0000 Author: mmacy Date: Sat Feb 23 20:45:45 2019 New Revision: 344484 URL: https://svnweb.freebsd.org/changeset/base/344484 Log: linux/fs: simplify interop and correct definition of loff_t - offsets can be negative, loff_t needs to be signed, it also simplifies interop with the rest of the code base to use off_t than the actual linux definition "long long" - don't rely on the defining "file" to "linux_file" in interface definitions as that causes heartache with includes Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19274 Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 14:27:09 2019 (r344483) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 20:45:45 2019 (r344484) @@ -129,25 +129,25 @@ do { \ pgsigio(*(queue), (sig), 0); \ } while (0) -typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); +typedef int (*filldir_t)(void *, const char *, int, off_t, u64, unsigned); struct file_operations { struct module *owner; - ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); - ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); - unsigned int (*poll) (struct file *, struct poll_table_struct *); - long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); - long (*compat_ioctl)(struct file *, unsigned int, unsigned long); - int (*mmap)(struct file *, struct vm_area_struct *); + ssize_t (*read)(struct linux_file *, char __user *, size_t, off_t *); + ssize_t (*write)(struct linux_file *, const char __user *, size_t, off_t *); + unsigned int (*poll) (struct linux_file *, struct poll_table_struct *); + long (*unlocked_ioctl)(struct linux_file *, unsigned int, unsigned long); + long (*compat_ioctl)(struct linux_file *, unsigned int, unsigned long); + int (*mmap)(struct linux_file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); - int (*release)(struct inode *, struct file *); - int (*fasync)(int, struct file *, int); + int (*release)(struct inode *, struct linux_file *); + int (*fasync)(int, struct linux_file *, int); /* Although not supported in FreeBSD, to align with Linux code * we are adding llseek() only when it is mapped to no_llseek which returns * an illegal seek error */ - loff_t (*llseek)(struct file *, loff_t, int); + off_t (*llseek)(struct linux_file *, off_t, int); #if 0 /* We do not support these methods. Don't permit them to compile. */ loff_t (*llseek)(struct file *, loff_t, int); Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 14:27:09 2019 (r344483) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 20:45:45 2019 (r344484) @@ -55,7 +55,7 @@ typedef uint64_t __be64; typedef unsigned int uint; typedef unsigned gfp_t; -typedef uint64_t loff_t; +typedef off_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; From owner-svn-src-all@freebsd.org Sat Feb 23 20:56: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 9DBF31505879; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@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 1DFA96F31F; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@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 1134F22A65; Sat, 23 Feb 2019 20:56:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NKugPG075480; Sat, 23 Feb 2019 20:56:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NKufKt075476; Sat, 23 Feb 2019 20:56:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232056.x1NKufKt075476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 20:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344485 - in head/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Commit-Revision: 344485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DFA96F31F 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, 23 Feb 2019 20:56:42 -0000 Author: mmacy Date: Sat Feb 23 20:56:41 2019 New Revision: 344485 URL: https://svnweb.freebsd.org/changeset/base/344485 Log: import linux debugfs support Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19258 Added: head/sys/compat/lindebugfs/ head/sys/compat/lindebugfs/lindebugfs.c (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/debugfs.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/seq_file.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_seq_file.c (contents, props changed) Added: head/sys/compat/lindebugfs/lindebugfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/lindebugfs/lindebugfs.c Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,309 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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 +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +MALLOC_DEFINE(M_DFSINT, "debugfsint", "Linux debugfs internal"); + +static struct pfs_node *debugfs_root; + +#define DM_SYMLINK 0x1 +#define DM_DIR 0x2 +#define DM_FILE 0x3 + +struct dentry_meta { + struct dentry dm_dnode; + const struct file_operations *dm_fops; + void *dm_data; + umode_t dm_mode; + int dm_type; +}; + +static int +debugfs_attr(PFS_ATTR_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + + vap->va_mode = dm->dm_mode; + return (0); +} + +static int +debugfs_destroy(PFS_DESTROY_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + if (dm->dm_type == DM_SYMLINK) + free(dm->dm_data, M_DFSINT); + + free(dm, M_DFSINT); + return (0); +} + +static int +debugfs_fill(PFS_FILL_ARGS) +{ + struct dentry_meta *d; + struct linux_file lf; + struct seq_file *sf; + struct vnode vn; + void *buf; + int rc; + size_t len; + off_t off; + + d = pn->pn_data; + + if ((rc = linux_set_current_flags(curthread, M_NOWAIT))) + return (rc); + vn.v_data = d->dm_data; + buf = uio->uio_iov[0].iov_base; + len = min(uio->uio_iov[0].iov_len, uio->uio_resid); + off = 0; + lf.private_data = NULL; + rc = d->dm_fops->open(&vn, &lf); + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d open failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + sf = lf.private_data; + sf->buf = sb; + if (uio->uio_rw == UIO_READ) + rc = d->dm_fops->read(&lf, NULL, len, &off); + else + rc = d->dm_fops->write(&lf, buf, len, &off); + if (d->dm_fops->release) + d->dm_fops->release(&vn, &lf); + else + single_release(&vn, &lf); + + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d read/write failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + return (0); +} + +static int +debugfs_fill_data(PFS_FILL_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + sbuf_printf(sb, "%s", (char *)dm->dm_data); + return (0); +} + +struct dentry * +debugfs_create_file(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + int flags; + + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + return (NULL); + dnode = &dm->dm_dnode; + dm->dm_fops = fops; + dm->dm_data = data; + dm->dm_mode = mode; + dm->dm_type = DM_FILE; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + flags = fops->write ? PFS_RDWR : PFS_RD; + dnode->d_pfs_node = pfs_create_file(pnode, name, debugfs_fill, + debugfs_attr, NULL, debugfs_destroy, flags | PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) { + free(dm, M_DFSINT); + return (NULL); + } + dnode->d_pfs_node->pn_data = dm; + + return (dnode); +} + +struct dentry * +debugfs_create_dir(const char *name, struct dentry *parent) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + return (NULL); + dnode = &dm->dm_dnode; + dm->dm_mode = 0700; + dm->dm_type = DM_DIR; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + dnode->d_pfs_node = pfs_create_dir(pnode, name, debugfs_attr, NULL, debugfs_destroy, PFS_RD | PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) { + free(dm, M_DFSINT); + return (NULL); + } + dnode->d_pfs_node->pn_data = dm; + return (dnode); +} + +struct dentry * +debugfs_create_symlink(const char *name, struct dentry *parent, + const char *dest) +{ + struct dentry_meta *dm; + struct dentry *dnode; + struct pfs_node *pnode; + void *data; + + data = strdup_flags(dest, M_DFSINT, M_NOWAIT); + if (data == NULL) + return (NULL); + dm = malloc(sizeof(*dm), M_DFSINT, M_NOWAIT | M_ZERO); + if (dm == NULL) + goto fail1; + dnode = &dm->dm_dnode; + dm->dm_mode = 0700; + dm->dm_type = DM_SYMLINK; + dm->dm_data = data; + if (parent != NULL) + pnode = parent->d_pfs_node; + else + pnode = debugfs_root; + + dnode->d_pfs_node = pfs_create_link(pnode, name, &debugfs_fill_data, NULL, NULL, NULL, PFS_NOWAIT); + if (dnode->d_pfs_node == NULL) + goto fail; + dnode->d_pfs_node->pn_data = dm; + return (dnode); + fail: + free(dm, M_DFSINT); + fail1: + free(data, M_DFSINT); + return (NULL); +} + +void +debugfs_remove(struct dentry *dnode) +{ + if (dnode == NULL) + return; + + pfs_destroy(dnode->d_pfs_node); +} + +void +debugfs_remove_recursive(struct dentry *dnode) +{ + if (dnode == NULL) + return; + + pfs_destroy(dnode->d_pfs_node); +} + + +static int +debugfs_init(PFS_INIT_ARGS) +{ + + debugfs_root = pi->pi_root; + return (0); +} + +static int +debugfs_uninit(PFS_INIT_ARGS) +{ + return (0); +} + +#ifdef PR_ALLOW_MOUNT_LINSYSFS +PSEUDOFS(debugfs, 1, PR_ALLOW_MOUNT_LINSYSFS); +#else +PSEUDOFS(debugfs, 1, VFCF_JAIL); +#endif Added: head/sys/compat/linuxkpi/common/include/linux/debugfs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/debugfs.h Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_DEBUGFS_H_ +#define _LINUX_DEBUGFS_H_ + +#include +#include + +#include + +void debugfs_remove(struct dentry *dentry); + +struct dentry *debugfs_create_file(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops); + +struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); + +struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, + const char *dest); + +void debugfs_remove_recursive(struct dentry *dentry); + +#endif Added: head/sys/compat/linuxkpi/common/include/linux/seq_file.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/seq_file.h Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,71 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SEQ_FILE_H_ +#define _LINUX_SEQ_FILE_H_ + +#include + +struct seq_operations; +struct linux_file; + +#define inode vnode + +struct seq_file { + struct sbuf *buf; + + const struct seq_operations *op; + const struct linux_file *file; + void *private; +}; + +struct seq_operations { + void * (*start) (struct seq_file *m, off_t *pos); + void (*stop) (struct seq_file *m, void *v); + void * (*next) (struct seq_file *m, void *v, off_t *pos); + int (*show) (struct seq_file *m, void *v); +}; + +ssize_t seq_read(struct linux_file *, char *, size_t, off_t *); +int seq_write(struct seq_file *seq, const void *data, size_t len); + +int seq_open(struct linux_file *f, const struct seq_operations *op); +int seq_release(struct inode *inode, struct linux_file *file); + +off_t seq_lseek(struct linux_file *file, off_t offset, int whence); +int single_open(struct linux_file *, int (*)(struct seq_file *, void *), void *); +int single_release(struct inode *, struct linux_file *); + +#define seq_printf(m, fmt, ...) sbuf_printf((m)->buf, (fmt), ##__VA_ARGS__) + +#define seq_puts(m, str) sbuf_printf((m)->buf, str) +#define seq_putc(m, str) sbuf_putc((m)->buf, str) + + +#endif /* _LINUX_SEQ_FILE_H_ */ Added: head/sys/compat/linuxkpi/common/src/linux_seq_file.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/src/linux_seq_file.c Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * 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 + +#undef file +MALLOC_DEFINE(M_LSEQ, "seq_file", "seq_file"); + +ssize_t +seq_read(struct linux_file *f, char *ubuf, size_t size, off_t *ppos) +{ + struct seq_file *m = f->private_data; + void *p; + int rc; + off_t pos = 0; + + p = m->op->start(m, &pos); + rc = m->op->show(m, p); + if (rc) + return (rc); + return (size); +} + +int +seq_write(struct seq_file *seq, const void *data, size_t len) +{ + + return (sbuf_bcpy(seq->buf, data, len)); +} + +/* + * This only needs to be a valid address for lkpi + * drivers it should never actually be called + */ +off_t +seq_lseek(struct linux_file *file, off_t offset, int whence) +{ + + panic("%s not supported\n", __FUNCTION__); + return (0); +} + +static void * +single_start(struct seq_file *p, off_t *pos) +{ + + return ((void *)(uintptr_t)(*pos == 0)); +} + +static void * +single_next(struct seq_file *p, void *v, off_t *pos) +{ + + ++*pos; + return (NULL); +} + +static void +single_stop(struct seq_file *p, void *v) +{ +} + +int +seq_open(struct linux_file *f, const struct seq_operations *op) +{ + struct seq_file *p; + + if (f->private_data != NULL) + log(LOG_WARNING, "%s private_data not NULL", __func__); + + if ((p = malloc(sizeof(*p), M_LSEQ, M_NOWAIT|M_ZERO)) == NULL) + return (-ENOMEM); + + f->private_data = p; + p->op = op; + p->file = f; + return (0); +} + +int +single_open(struct linux_file *f, int (*show)(struct seq_file *, void *), void *d) +{ + struct seq_operations *op; + int rc = -ENOMEM; + + op = malloc(sizeof(*op), M_LSEQ, M_NOWAIT); + if (op) { + op->start = single_start; + op->next = single_next; + op->stop = single_stop; + op->show = show; + rc = seq_open(f, op); + if (rc) + free(op, M_LSEQ); + else + ((struct seq_file *)f->private_data)->private = d; + + } + return (rc); +} + +int +seq_release(struct inode *inode __unused, struct linux_file *file) +{ + struct seq_file *m; + + m = file->private_data; + free(m, M_LSEQ); + return (0); +} + +int +single_release(struct vnode *v, struct linux_file *f) +{ + const struct seq_operations *op = ((struct seq_file *)f->private_data)->op; + int rc; + + rc = seq_release(v, f); + free(__DECONST(void *, op), M_LSEQ); + return (rc); +} From owner-svn-src-all@freebsd.org Sat Feb 23 21: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 78B371505AD5; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@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 179126F7E9; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@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 0806822C0F; Sat, 23 Feb 2019 21:04:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NL4m4Z080372; Sat, 23 Feb 2019 21:04:48 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NL4m68080370; Sat, 23 Feb 2019 21:04:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232104.x1NL4m68080370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 21:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344486 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 344486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 179126F7E9 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, 23 Feb 2019 21:04:49 -0000 Author: mmacy Date: Sat Feb 23 21:04:48 2019 New Revision: 344486 URL: https://svnweb.freebsd.org/changeset/base/344486 Log: Change seq_read to seq_load to avoid namespace conflicts with lkpi MFC after: 1 week Sponsored by: iX Systems Modified: head/sys/kern/kern_descrip.c head/sys/sys/seq.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 23 20:56:41 2019 (r344485) +++ head/sys/kern/kern_descrip.c Sat Feb 23 21:04:48 2019 (r344486) @@ -2629,7 +2629,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ for (;;) { #ifdef CAPABILITIES - seq = seq_read(fd_seq(fdt, fd)); + seq = seq_load(fd_seq(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; Modified: head/sys/sys/seq.h ============================================================================== --- head/sys/sys/seq.h Sat Feb 23 20:56:41 2019 (r344485) +++ head/sys/sys/seq.h Sat Feb 23 21:04:48 2019 (r344486) @@ -121,7 +121,7 @@ seq_write_end(seq_t *seqp) } static __inline seq_t -seq_read(const seq_t *seqp) +seq_load(const seq_t *seqp) { seq_t ret; From owner-svn-src-all@freebsd.org Sat Feb 23 21: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 8014E1505CCC; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@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 2E1146FD95; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@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 2176C22DC6; Sat, 23 Feb 2019 21:14:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NLE25e085355; Sat, 23 Feb 2019 21:14:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NLE0cH085345; Sat, 23 Feb 2019 21:14:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201902232114.x1NLE0cH085345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Feb 2019 21:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344487 - in head/sys: conf gnu/gcov X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf gnu/gcov X-SVN-Commit-Revision: 344487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E1146FD95 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: Sat, 23 Feb 2019 21:14:02 -0000 Author: mmacy Date: Sat Feb 23 21:14:00 2019 New Revision: 344487 URL: https://svnweb.freebsd.org/changeset/base/344487 Log: gcov support add gcov support and export results as files in debugfs Reviewed by: hps@ MFC after: 1 week Sponsored by: iX Systems Differential Revision: https://reviews.freebsd.org/D19260 Added: head/sys/gnu/gcov/ head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) head/sys/gnu/gcov/gcov.h (contents, props changed) head/sys/gnu/gcov/gcov_fs.c (contents, props changed) head/sys/gnu/gcov/gcov_subr.c (contents, props changed) Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 fs/cd9660/cd9660_vfsops.c optional cd9660 fs/cd9660/cd9660_vnops.c optional cd9660 fs/cd9660/cd9660_iconv.c optional cd9660_iconv +gnu/gcov/gcc_4_7.c optional gcov +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ + compile-with "${LINUXKPI_C}" +gnu/gcov/gcov_subr.c optional gcov + kern/bus_if.m standard kern/clock_if.m standard kern/cpufreq_if.m standard @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" + +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ + compile-with "${LINUXKPI_C}" + +compat/lindebugfs/lindebugfs.c optional lindebugfs \ compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=maybe-uninitialized \ -Wno-error=overflow \ -Wno-error=sequence-point \ - -Wno-error=unused-but-set-variable + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >= 60100 CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" .endif +.if defined(GCOV_CFLAGS) +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" +.endif + # Allow overriding the kernel debug directory, so kernel and user debug may be # installed in different directories. Setting it to "" restores the historical # behavior of installing debug files in the kernel directory. Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc CFLAGS+= ${SAN_CFLAGS} +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + # Put configuration-specific C flags last (except for ${PROF}) so that they # can override the others. CFLAGS+= ${CONF_CFLAGS} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) @@ -380,6 +380,9 @@ ${_src}: # Add the sanitizer C flags CFLAGS+= ${SAN_CFLAGS} +# Add the gcov flags +CFLAGS+= ${GCOV_CFLAGS} + # Respect configuration-specific C flags. CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h # amdsbwd options AMDSBWD_DEBUG opt_amdsbwd.h + +# gcov support +GCOV opt_global.h +LINDEBUGFS Added: head/sys/gnu/gcov/gcc_4_7.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,597 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This code provides functions to handle gcc's profiling data format + * introduced with gcc 4.7. + * + * This file is based heavily on gcc_3_4.c file. + * + * For a better understanding, refer to gcc source: + * gcc/gcov-io.h + * libgcc/libgcov.c + * + * Uses gcc-internal data definitions. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + + +#if (__GNUC__ >= 7) +#define GCOV_COUNTERS 9 +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) +#define GCOV_COUNTERS 10 +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +#define GCOV_COUNTERS 9 +#else +#define GCOV_COUNTERS 8 +#endif + +#define GCOV_TAG_FUNCTION_LENGTH 3 + +static struct gcov_info *gcov_info_head; + +/** + * struct gcov_ctr_info - information about counters for a single function + * @num: number of counter values for this type + * @values: array of counter values for this type + * + * This data is generated by gcc during compilation and doesn't change + * at run-time with the exception of the values array. + */ +struct gcov_ctr_info { + unsigned int num; + gcov_type *values; +}; + +/** + * struct gcov_fn_info - profiling meta data per function + * @key: comdat key + * @ident: unique ident of function + * @lineno_checksum: function lineo_checksum + * @cfg_checksum: function cfg checksum + * @ctrs: instrumented counters + * + * This data is generated by gcc during compilation and doesn't change + * at run-time. + * + * Information about a single function. This uses the trailing array + * idiom. The number of counters is determined from the merge pointer + * array in gcov_info. The key is used to detect which of a set of + * comdat functions was selected -- it points to the gcov_info object + * of the object file containing the selected comdat function. + */ +struct gcov_fn_info { + const struct gcov_info *key; + unsigned int ident; + unsigned int lineno_checksum; + unsigned int cfg_checksum; + struct gcov_ctr_info ctrs[0]; +}; + +/** + * struct gcov_info - profiling data per object file + * @version: gcov version magic indicating the gcc version used for compilation + * @next: list head for a singly-linked list + * @stamp: uniquifying time stamp + * @filename: name of the associated gcov data file + * @merge: merge functions (null for unused counter type) + * @n_functions: number of instrumented functions + * @functions: pointer to pointers to function information + * + * This data is generated by gcc during compilation and doesn't change + * at run-time with the exception of the next pointer. + */ +struct gcov_info { + unsigned int version; + struct gcov_info *next; + unsigned int stamp; + const char *filename; + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); + unsigned int n_functions; + struct gcov_fn_info **functions; +}; + +/** + * gcov_info_filename - return info filename + * @info: profiling data set + */ +const char * +gcov_info_filename(struct gcov_info *info) +{ + return (info->filename); +} + +/** + * gcov_info_version - return info version + * @info: profiling data set + */ +unsigned int +gcov_info_version(struct gcov_info *info) +{ + return (info->version); +} + +/** + * gcov_info_next - return next profiling data set + * @info: profiling data set + * + * Returns next gcov_info following @info or first gcov_info in the chain if + * @info is %NULL. + */ +struct gcov_info * +gcov_info_next(struct gcov_info *info) +{ + if (!info) + return gcov_info_head; + + return (info->next); +} + +/** + * gcov_info_link - link/add profiling data set to the list + * @info: profiling data set + */ +void +gcov_info_link(struct gcov_info *info) +{ + info->next = gcov_info_head; + gcov_info_head = info; +} + +/** + * gcov_info_unlink - unlink/remove profiling data set from the list + * @prev: previous profiling data set + * @info: profiling data set + */ +void +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) +{ + if (prev) + prev->next = info->next; + else + gcov_info_head = info->next; +} + +/* Symbolic links to be created for each profiling data file. */ +const struct gcov_link gcov_link[] = { + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ + { 0, NULL}, +}; + +/* + * Determine whether a counter is active. Doesn't change at run-time. + */ +static int +counter_active(struct gcov_info *info, unsigned int type) +{ + return (info->merge[type] ? 1 : 0); +} + +/* Determine number of active counters. Based on gcc magic. */ +static unsigned int +num_counter_active(struct gcov_info *info) +{ + unsigned int i; + unsigned int result = 0; + + for (i = 0; i < GCOV_COUNTERS; i++) { + if (counter_active(info, i)) + result++; + } + return (result); +} + +/** + * gcov_info_reset - reset profiling data to zero + * @info: profiling data set + */ +void +gcov_info_reset(struct gcov_info *info) +{ + struct gcov_ctr_info *ci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + ci_ptr = info->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(info, ct_idx)) + continue; + + memset(ci_ptr->values, 0, + sizeof(gcov_type) * ci_ptr->num); + ci_ptr++; + } + } +} + +/** + * gcov_info_is_compatible - check if profiling data can be added + * @info1: first profiling data set + * @info2: second profiling data set + * + * Returns non-zero if profiling data can be added, zero otherwise. + */ +int +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) +{ + return (info1->stamp == info2->stamp); +} + +/** + * gcov_info_add - add up profiling data + * @dest: profiling data set to which data is added + * @source: profiling data set which is added + * + * Adds profiling counts of @source to @dest. + */ +void +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) +{ + struct gcov_ctr_info *dci_ptr; + struct gcov_ctr_info *sci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + unsigned int val_idx; + + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { + dci_ptr = dst->functions[fi_idx]->ctrs; + sci_ptr = src->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(src, ct_idx)) + continue; + + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) + dci_ptr->values[val_idx] += + sci_ptr->values[val_idx]; + + dci_ptr++; + sci_ptr++; + } + } +} + +/** + * gcov_info_dup - duplicate profiling data set + * @info: profiling data set to duplicate + * + * Return newly allocated duplicate on success, %NULL on error. + */ +struct gcov_info * +gcov_info_dup(struct gcov_info *info) +{ + struct gcov_info *dup; + struct gcov_ctr_info *dci_ptr; /* dst counter info */ + struct gcov_ctr_info *sci_ptr; /* src counter info */ + unsigned int active; + unsigned int fi_idx; /* function info idx */ + unsigned int ct_idx; /* counter type idx */ + size_t fi_size; /* function info size */ + size_t cv_size; /* counter values size */ + + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) + return (NULL); + memcpy(dup, info, sizeof(*dup)); + + dup->next = NULL; + dup->filename = NULL; + dup->functions = NULL; + + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); + if (dup->filename == NULL) + goto err_free; + + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); + if (dup->functions == NULL) + goto err_free; + active = num_counter_active(info); + fi_size = sizeof(struct gcov_fn_info); + fi_size += sizeof(struct gcov_ctr_info) * active; + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); + if (!dup->functions[fi_idx]) + goto err_free; + + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); + + sci_ptr = info->functions[fi_idx]->ctrs; + dci_ptr = dup->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < active; ct_idx++) { + + cv_size = sizeof(gcov_type) * sci_ptr->num; + + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); + + if (!dci_ptr->values) + goto err_free; + + dci_ptr->num = sci_ptr->num; + memcpy(dci_ptr->values, sci_ptr->values, cv_size); + + sci_ptr++; + dci_ptr++; + } + } + + return (dup); +err_free: + gcov_info_free(dup); + return (NULL); +} + +/** + * gcov_info_free - release memory for profiling data set duplicate + * @info: profiling data set duplicate to free + */ +void +gcov_info_free(struct gcov_info *info) +{ + unsigned int active; + unsigned int fi_idx; + unsigned int ct_idx; + struct gcov_ctr_info *ci_ptr; + + if (!info->functions) + goto free_info; + + active = num_counter_active(info); + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + if (!info->functions[fi_idx]) + continue; + + ci_ptr = info->functions[fi_idx]->ctrs; + + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) + free(ci_ptr->values, M_GCOV); + + free(info->functions[fi_idx], M_GCOV); + } + +free_info: + free(info->functions, M_GCOV); + free(__DECONST(char *, info->filename), M_GCOV); + free(info, M_GCOV); + } + +#define ITER_STRIDE PAGE_SIZE + +/** + * struct gcov_iterator - specifies current file position in logical records + * @info: associated profiling data + * @buffer: buffer containing file data + * @size: size of buffer + * @pos: current position in file + */ +struct gcov_iterator { + struct gcov_info *info; + caddr_t buffer; + size_t size; + off_t pos; +}; + +/** + * store_gcov_uint32 - store 32 bit number in gcov format to buffer + * @buffer: target buffer or NULL + * @off: offset into the buffer + * @v: value to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't + * store anything. + */ +static size_t +store_gcov_uint32(void *buffer, size_t off, uint32_t v) +{ + uint32_t *data; + + if (buffer) { + data = (void*)((caddr_t)buffer + off); + *data = v; + } + + return sizeof(*data); +} + +/** + * store_gcov_uint64 - store 64 bit number in gcov format to buffer + * @buffer: target buffer or NULL + * @off: offset into the buffer + * @v: value to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. 64 bit numbers are stored as two 32 bit numbers, the low part + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store + * anything. + */ + +static size_t +store_gcov_uint64(void *buffer, size_t off, uint64_t v) +{ + uint32_t *data; + + if (buffer) { + data = (void*)((caddr_t)buffer + off); + + data[0] = (v & 0xffffffffUL); + data[1] = (v >> 32); + } + + return sizeof(*data) * 2; +} + +/** + * convert_to_gcda - convert profiling data set to gcda file format + * @buffer: the buffer to store file data or %NULL if no data should be stored + * @info: profiling data set to be converted + * + * Returns the number of bytes that were/would have been stored into the buffer. + */ +static size_t +convert_to_gcda(char *buffer, struct gcov_info *info) +{ + struct gcov_fn_info *fi_ptr; + struct gcov_ctr_info *ci_ptr; + unsigned int fi_idx; + unsigned int ct_idx; + unsigned int cv_idx; + size_t pos = 0; + + /* File header. */ + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); + pos += store_gcov_uint32(buffer, pos, info->version); + pos += store_gcov_uint32(buffer, pos, info->stamp); + + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { + fi_ptr = info->functions[fi_idx]; + + /* Function record. */ + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); + + ci_ptr = fi_ptr->ctrs; + + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { + if (!counter_active(info, ct_idx)) + continue; + + /* Counter record. */ + pos += store_gcov_uint32(buffer, pos, + GCOV_TAG_FOR_COUNTER(ct_idx)); + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); + + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { + pos += store_gcov_uint64(buffer, pos, + ci_ptr->values[cv_idx]); + } + + ci_ptr++; + } + } + + return (pos); +} + +/** + * gcov_iter_new - allocate and initialize profiling data iterator + * @info: profiling data set to be iterated + * + * Return file iterator on success, %NULL otherwise. + */ +struct gcov_iterator * +gcov_iter_new(struct gcov_info *info) +{ + struct gcov_iterator *iter; + + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); + if (iter == NULL) + goto err_free; + + iter->info = info; + /* Dry-run to get the actual buffer size. */ + iter->size = convert_to_gcda(NULL, info); + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); + if (!iter->buffer) + goto err_free; + + convert_to_gcda(iter->buffer, info); + + return iter; + +err_free: + free(iter, M_GCOV); + return (NULL); +} + + +/** + * gcov_iter_get_info - return profiling data set for given file iterator + * @iter: file iterator + */ +void +gcov_iter_free(struct gcov_iterator *iter) +{ + free(iter->buffer, M_GCOV); + free(iter, M_GCOV); +} + +/** + * gcov_iter_get_info - return profiling data set for given file iterator + * @iter: file iterator + */ +struct gcov_info * +gcov_iter_get_info(struct gcov_iterator *iter) +{ + return (iter->info); +} + +/** + * gcov_iter_start - reset file iterator to starting position + * @iter: file iterator + */ +void +gcov_iter_start(struct gcov_iterator *iter) +{ + iter->pos = 0; +} + +/** + * gcov_iter_next - advance file iterator to next logical record + * @iter: file iterator + * + * Return zero if new position is valid, non-zero if iterator has reached end. + */ +int +gcov_iter_next(struct gcov_iterator *iter) +{ + if (iter->pos < iter->size) + iter->pos += ITER_STRIDE; + + if (iter->pos >= iter->size) + return (EINVAL); + + return 0; +} + +/** + * gcov_iter_write - write data for current pos to seq_file + * @iter: file iterator + * @seq: seq_file handle + * + * Return zero on success, non-zero otherwise. + */ +int +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) +{ + size_t len; + + if (iter->pos >= iter->size) + return (EINVAL); + + len = ITER_STRIDE; + if (iter->pos + len > iter->size) + len = iter->size - iter->pos; + + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); + + return (0); +} Added: head/sys/gnu/gcov/gcov.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019, Matthew Macy + * + * 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. + * + * $FreeBSD$ + * + */ + +#ifndef _SYS_GCOV_H_ +#define _SYS_GCOV_H_ + +MALLOC_DECLARE(M_GCOV); + +/* + * Profiling data types used for gcc 3.4 and above - these are defined by + * gcc and need to be kept as close to the original definition as possible to + * remain compatible. + */ +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) +#define GCOV_TAG_FOR_COUNTER(count) \ + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) + +typedef uint64_t gcov_type; + +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so + * we cannot use full definition here and they need to be placed in gcc specific + * implementation of gcov. This also means no direct access to the members in + * generic code and usage of the interface below.*/ +struct gcov_info; + +/* Interface to access gcov_info data */ +const char *gcov_info_filename(struct gcov_info *info); +unsigned int gcov_info_version(struct gcov_info *info); +struct gcov_info *gcov_info_next(struct gcov_info *info); +void gcov_info_link(struct gcov_info *info); +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); + +/* Base interface. */ +enum gcov_action { + GCOV_ADD, + GCOV_REMOVE, +}; + +/* Iterator control. */ +struct gcov_iterator; + +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); +void gcov_iter_free(struct gcov_iterator *iter); +void gcov_iter_start(struct gcov_iterator *iter); +int gcov_iter_next(struct gcov_iterator *iter); +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); + +/* gcov_info control. */ +void gcov_info_reset(struct gcov_info *info); +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); +struct gcov_info *gcov_info_dup(struct gcov_info *info); +void gcov_info_free(struct gcov_info *info); +void gcov_stats_reset(void); +void gcov_enable_events(void); +void gcov_module_unload(void *, module_t); +void gcov_fs_init(void); + +int within_module(vm_offset_t addr, module_t mod); + +struct gcov_link { + enum { + OBJ_TREE, + SRC_TREE, + } dir; + const char *ext; +}; +extern const struct gcov_link gcov_link[]; +#endif Added: head/sys/gnu/gcov/gcov_fs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) @@ -0,0 +1,945 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This code exports profiling data as debugfs files to userspace. + * + * Copyright IBM Corp. 2009 + * Author(s): Peter Oberparleiter + * + * Uses gcc-internal data definitions. + * Based on the gcov-kernel patch by: + * Hubertus Franke + * Nigel Hinds + * Rajan Ravindran + * Peter Oberparleiter + * Paul Larson + * Yi CDL Yang + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +extern int gcov_events_enabled; +static int gcov_persist; +static struct mtx gcov_mtx; +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); + +void __gcov_init(struct gcov_info *info); +void __gcov_flush(void); +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); +void __gcov_exit(void); + +static void gcov_event(enum gcov_action action, struct gcov_info *info); + + +/* + * Private copy taken from libc + */ +static char * +(basename)(char *path) +{ + char *ptr; + + /* + * If path is a null pointer or points to an empty string, + * basename() shall return a pointer to the string ".". + */ + if (path == NULL || *path == '\0') + return (__DECONST(char *, ".")); + + /* Find end of last pathname component and null terminate it. */ + ptr = path + strlen(path); + while (ptr > path + 1 && *(ptr - 1) == '/') + --ptr; + *ptr-- = '\0'; + + /* Find beginning of last pathname component. */ + while (ptr > path && *(ptr - 1) != '/') + --ptr; + return (ptr); +} + +/* + * __gcov_init is called by gcc-generated constructor code for each object + * file compiled with -fprofile-arcs. + */ +void +__gcov_init(struct gcov_info *info) +{ + static unsigned int gcov_version; + + mtx_lock(&gcov_mtx); + if (gcov_version == 0) { + gcov_version = gcov_info_version(info); + /* + * Printing gcc's version magic may prove useful for debugging + * incompatibility reports. + */ + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); + } + /* + * Add new profiling data structure to list and inform event + * listener. + */ + gcov_info_link(info); + if (gcov_events_enabled) + gcov_event(GCOV_ADD, info); + mtx_unlock(&gcov_mtx); +} + +/* + * These functions may be referenced by gcc-generated profiling code but serve + * no function for kernel profiling. + */ +void +__gcov_flush(void) +{ + /* Unused. */ +} + +void +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) +{ + /* Unused. */ +} + +void +__gcov_exit(void) +{ + /* Unused. */ +} + + +/** + * struct gcov_node - represents a debugfs entry + * @entry: list entry for parent's child node list + * @children: child nodes + * @all_entry: list entry for list of all nodes + * @parent: parent node + * @loaded_info: array of pointers to profiling data sets for loaded object + * files. + * @num_loaded: number of profiling data sets for loaded object files. + * @unloaded_info: accumulated copy of profiling data sets for unloaded + * object files. Used only when gcov_persist=1. + * @dentry: main debugfs entry, either a directory or data file + * @links: associated symbolic links + * @name: data file basename + * + * struct gcov_node represents an entity within the gcov/ subdirectory + * of debugfs. There are directory and data file nodes. The latter represent + * the actual synthesized data file plus any associated symbolic links which + * are needed by the gcov tool to work correctly. + */ +struct gcov_node { + LIST_ENTRY(gcov_node) children_entry; + LIST_ENTRY(gcov_node) all_entry; + struct { + struct gcov_node *lh_first; + } children; + struct gcov_node *parent; + struct gcov_info **loaded_info; + struct gcov_info *unloaded_info; + struct dentry *dentry; + struct dentry **links; + int num_loaded; + char name[0]; +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 23 21: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 1ACF61506706; Sat, 23 Feb 2019 21:50:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 E987970D67; Sat, 23 Feb 2019 21:49:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1NLnuLd032112; Sat, 23 Feb 2019 13:49:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1NLnute032111; Sat, 23 Feb 2019 13:49:56 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902232149.x1NLnute032111@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <201902232114.x1NLE0cH085345@repo.freebsd.org> To: Matt Macy Date: Sat, 23 Feb 2019 13:49:56 -0800 (PST) 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: E987970D67 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]; 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: Sat, 23 Feb 2019 21:50:01 -0000 > Author: mmacy > Date: Sat Feb 23 21:14:00 2019 > New Revision: 344487 > URL: https://svnweb.freebsd.org/changeset/base/344487 > > Log: > gcov support > > add gcov support and export results as files in debugfs > > Reviewed by: hps@ > MFC after: 1 week > Sponsored by: iX Systems > Differential Revision: https://reviews.freebsd.org/D19260 > > Added: > head/sys/gnu/gcov/ > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > head/sys/gnu/gcov/gcov.h (contents, props changed) > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/conf/options > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 > fs/cd9660/cd9660_vfsops.c optional cd9660 > fs/cd9660/cd9660_vnops.c optional cd9660 > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > +gnu/gcov/gcc_4_7.c optional gcov > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > + compile-with "${LINUXKPI_C}" > +gnu/gcov/gcov_subr.c optional gcov > + > kern/bus_if.m standard > kern/clock_if.m standard > kern/cpufreq_if.m standard > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp > compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ > compile-with "${LINUXKPI_C}" > compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ > + compile-with "${LINUXKPI_C}" > + > +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ > + compile-with "${LINUXKPI_C}" > + > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > compile-with "${LINUXKPI_C}" > > # OpenFabrics Enterprise Distribution (Infiniband) > > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ > -Wno-error=maybe-uninitialized \ > -Wno-error=overflow \ > -Wno-error=sequence-point \ > - -Wno-error=unused-but-set-variable > + -Wno-unused-but-set-variable > .if ${COMPILER_VERSION} >= 60100 > CWARNEXTRA+= -Wno-error=misleading-indentation \ > -Wno-error=nonnull-compare \ > > Modified: head/sys/conf/kern.post.mk > ============================================================================== > --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > .endif > > +.if defined(GCOV_CFLAGS) > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > +.endif > + > # Allow overriding the kernel debug directory, so kernel and user debug may be > # installed in different directories. Setting it to "" restores the historical > # behavior of installing debug files in the kernel directory. > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > CFLAGS+= ${SAN_CFLAGS} > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > +.if !empty(GCOV_ENABLED) > +.if ${COMPILER_TYPE} == "gcc" > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > +.endif > +.endif > + > +CFLAGS+= ${GCOV_CFLAGS} > + > # Put configuration-specific C flags last (except for ${PROF}) so that they > # can override the others. > CFLAGS+= ${CONF_CFLAGS} > > Modified: head/sys/conf/kmod.mk > ============================================================================== > --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) > @@ -380,6 +380,9 @@ ${_src}: > # Add the sanitizer C flags > CFLAGS+= ${SAN_CFLAGS} > > +# Add the gcov flags > +CFLAGS+= ${GCOV_CFLAGS} > + > # Respect configuration-specific C flags. > CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} > > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) > +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) > @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h > > # amdsbwd options > AMDSBWD_DEBUG opt_amdsbwd.h > + > +# gcov support > +GCOV opt_global.h > +LINDEBUGFS > > Added: head/sys/gnu/gcov/gcc_4_7.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,597 @@ > +// SPDX-License-Identifier: GPL-2.0 The open item on the SPDX only use needs to be dealt with on a repository of local tag to file location, etc. I still feel very uncorftable with most of that, especially given the GPL 2 itsel clearly says to place "this body of text" in your file. I do not know that you can modify that aspect of it and have it still be called gpl 2.0. > +/* > + * This code provides functions to handle gcc's profiling data format > + * introduced with gcc 4.7. > + * > + * This file is based heavily on gcc_3_4.c file. > + * > + * For a better understanding, refer to gcc source: > + * gcc/gcov-io.h > + * libgcc/libgcov.c > + * > + * Uses gcc-internal data definitions. > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +#if (__GNUC__ >= 7) > +#define GCOV_COUNTERS 9 > +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) > +#define GCOV_COUNTERS 10 > +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 > +#define GCOV_COUNTERS 9 > +#else > +#define GCOV_COUNTERS 8 > +#endif > + > +#define GCOV_TAG_FUNCTION_LENGTH 3 > + > +static struct gcov_info *gcov_info_head; > + > +/** > + * struct gcov_ctr_info - information about counters for a single function > + * @num: number of counter values for this type > + * @values: array of counter values for this type > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time with the exception of the values array. > + */ > +struct gcov_ctr_info { > + unsigned int num; > + gcov_type *values; > +}; > + > +/** > + * struct gcov_fn_info - profiling meta data per function > + * @key: comdat key > + * @ident: unique ident of function > + * @lineno_checksum: function lineo_checksum > + * @cfg_checksum: function cfg checksum > + * @ctrs: instrumented counters > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time. > + * > + * Information about a single function. This uses the trailing array > + * idiom. The number of counters is determined from the merge pointer > + * array in gcov_info. The key is used to detect which of a set of > + * comdat functions was selected -- it points to the gcov_info object > + * of the object file containing the selected comdat function. > + */ > +struct gcov_fn_info { > + const struct gcov_info *key; > + unsigned int ident; > + unsigned int lineno_checksum; > + unsigned int cfg_checksum; > + struct gcov_ctr_info ctrs[0]; > +}; > + > +/** > + * struct gcov_info - profiling data per object file > + * @version: gcov version magic indicating the gcc version used for compilation > + * @next: list head for a singly-linked list > + * @stamp: uniquifying time stamp > + * @filename: name of the associated gcov data file > + * @merge: merge functions (null for unused counter type) > + * @n_functions: number of instrumented functions > + * @functions: pointer to pointers to function information > + * > + * This data is generated by gcc during compilation and doesn't change > + * at run-time with the exception of the next pointer. > + */ > +struct gcov_info { > + unsigned int version; > + struct gcov_info *next; > + unsigned int stamp; > + const char *filename; > + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); > + unsigned int n_functions; > + struct gcov_fn_info **functions; > +}; > + > +/** > + * gcov_info_filename - return info filename > + * @info: profiling data set > + */ > +const char * > +gcov_info_filename(struct gcov_info *info) > +{ > + return (info->filename); > +} > + > +/** > + * gcov_info_version - return info version > + * @info: profiling data set > + */ > +unsigned int > +gcov_info_version(struct gcov_info *info) > +{ > + return (info->version); > +} > + > +/** > + * gcov_info_next - return next profiling data set > + * @info: profiling data set > + * > + * Returns next gcov_info following @info or first gcov_info in the chain if > + * @info is %NULL. > + */ > +struct gcov_info * > +gcov_info_next(struct gcov_info *info) > +{ > + if (!info) > + return gcov_info_head; > + > + return (info->next); > +} > + > +/** > + * gcov_info_link - link/add profiling data set to the list > + * @info: profiling data set > + */ > +void > +gcov_info_link(struct gcov_info *info) > +{ > + info->next = gcov_info_head; > + gcov_info_head = info; > +} > + > +/** > + * gcov_info_unlink - unlink/remove profiling data set from the list > + * @prev: previous profiling data set > + * @info: profiling data set > + */ > +void > +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) > +{ > + if (prev) > + prev->next = info->next; > + else > + gcov_info_head = info->next; > +} > + > +/* Symbolic links to be created for each profiling data file. */ > +const struct gcov_link gcov_link[] = { > + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ > + { 0, NULL}, > +}; > + > +/* > + * Determine whether a counter is active. Doesn't change at run-time. > + */ > +static int > +counter_active(struct gcov_info *info, unsigned int type) > +{ > + return (info->merge[type] ? 1 : 0); > +} > + > +/* Determine number of active counters. Based on gcc magic. */ > +static unsigned int > +num_counter_active(struct gcov_info *info) > +{ > + unsigned int i; > + unsigned int result = 0; > + > + for (i = 0; i < GCOV_COUNTERS; i++) { > + if (counter_active(info, i)) > + result++; > + } > + return (result); > +} > + > +/** > + * gcov_info_reset - reset profiling data to zero > + * @info: profiling data set > + */ > +void > +gcov_info_reset(struct gcov_info *info) > +{ > + struct gcov_ctr_info *ci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + ci_ptr = info->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(info, ct_idx)) > + continue; > + > + memset(ci_ptr->values, 0, > + sizeof(gcov_type) * ci_ptr->num); > + ci_ptr++; > + } > + } > +} > + > +/** > + * gcov_info_is_compatible - check if profiling data can be added > + * @info1: first profiling data set > + * @info2: second profiling data set > + * > + * Returns non-zero if profiling data can be added, zero otherwise. > + */ > +int > +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) > +{ > + return (info1->stamp == info2->stamp); > +} > + > +/** > + * gcov_info_add - add up profiling data > + * @dest: profiling data set to which data is added > + * @source: profiling data set which is added > + * > + * Adds profiling counts of @source to @dest. > + */ > +void > +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) > +{ > + struct gcov_ctr_info *dci_ptr; > + struct gcov_ctr_info *sci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + unsigned int val_idx; > + > + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { > + dci_ptr = dst->functions[fi_idx]->ctrs; > + sci_ptr = src->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(src, ct_idx)) > + continue; > + > + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) > + dci_ptr->values[val_idx] += > + sci_ptr->values[val_idx]; > + > + dci_ptr++; > + sci_ptr++; > + } > + } > +} > + > +/** > + * gcov_info_dup - duplicate profiling data set > + * @info: profiling data set to duplicate > + * > + * Return newly allocated duplicate on success, %NULL on error. > + */ > +struct gcov_info * > +gcov_info_dup(struct gcov_info *info) > +{ > + struct gcov_info *dup; > + struct gcov_ctr_info *dci_ptr; /* dst counter info */ > + struct gcov_ctr_info *sci_ptr; /* src counter info */ > + unsigned int active; > + unsigned int fi_idx; /* function info idx */ > + unsigned int ct_idx; /* counter type idx */ > + size_t fi_size; /* function info size */ > + size_t cv_size; /* counter values size */ > + > + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) > + return (NULL); > + memcpy(dup, info, sizeof(*dup)); > + > + dup->next = NULL; > + dup->filename = NULL; > + dup->functions = NULL; > + > + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); > + if (dup->filename == NULL) > + goto err_free; > + > + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); > + if (dup->functions == NULL) > + goto err_free; > + active = num_counter_active(info); > + fi_size = sizeof(struct gcov_fn_info); > + fi_size += sizeof(struct gcov_ctr_info) * active; > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); > + if (!dup->functions[fi_idx]) > + goto err_free; > + > + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); > + > + sci_ptr = info->functions[fi_idx]->ctrs; > + dci_ptr = dup->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < active; ct_idx++) { > + > + cv_size = sizeof(gcov_type) * sci_ptr->num; > + > + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); > + > + if (!dci_ptr->values) > + goto err_free; > + > + dci_ptr->num = sci_ptr->num; > + memcpy(dci_ptr->values, sci_ptr->values, cv_size); > + > + sci_ptr++; > + dci_ptr++; > + } > + } > + > + return (dup); > +err_free: > + gcov_info_free(dup); > + return (NULL); > +} > + > +/** > + * gcov_info_free - release memory for profiling data set duplicate > + * @info: profiling data set duplicate to free > + */ > +void > +gcov_info_free(struct gcov_info *info) > +{ > + unsigned int active; > + unsigned int fi_idx; > + unsigned int ct_idx; > + struct gcov_ctr_info *ci_ptr; > + > + if (!info->functions) > + goto free_info; > + > + active = num_counter_active(info); > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + if (!info->functions[fi_idx]) > + continue; > + > + ci_ptr = info->functions[fi_idx]->ctrs; > + > + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) > + free(ci_ptr->values, M_GCOV); > + > + free(info->functions[fi_idx], M_GCOV); > + } > + > +free_info: > + free(info->functions, M_GCOV); > + free(__DECONST(char *, info->filename), M_GCOV); > + free(info, M_GCOV); > + } > + > +#define ITER_STRIDE PAGE_SIZE > + > +/** > + * struct gcov_iterator - specifies current file position in logical records > + * @info: associated profiling data > + * @buffer: buffer containing file data > + * @size: size of buffer > + * @pos: current position in file > + */ > +struct gcov_iterator { > + struct gcov_info *info; > + caddr_t buffer; > + size_t size; > + off_t pos; > +}; > + > +/** > + * store_gcov_uint32 - store 32 bit number in gcov format to buffer > + * @buffer: target buffer or NULL > + * @off: offset into the buffer > + * @v: value to be stored > + * > + * Number format defined by gcc: numbers are recorded in the 32 bit > + * unsigned binary form of the endianness of the machine generating the > + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't > + * store anything. > + */ > +static size_t > +store_gcov_uint32(void *buffer, size_t off, uint32_t v) > +{ > + uint32_t *data; > + > + if (buffer) { > + data = (void*)((caddr_t)buffer + off); > + *data = v; > + } > + > + return sizeof(*data); > +} > + > +/** > + * store_gcov_uint64 - store 64 bit number in gcov format to buffer > + * @buffer: target buffer or NULL > + * @off: offset into the buffer > + * @v: value to be stored > + * > + * Number format defined by gcc: numbers are recorded in the 32 bit > + * unsigned binary form of the endianness of the machine generating the > + * file. 64 bit numbers are stored as two 32 bit numbers, the low part > + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store > + * anything. > + */ > + > +static size_t > +store_gcov_uint64(void *buffer, size_t off, uint64_t v) > +{ > + uint32_t *data; > + > + if (buffer) { > + data = (void*)((caddr_t)buffer + off); > + > + data[0] = (v & 0xffffffffUL); > + data[1] = (v >> 32); > + } > + > + return sizeof(*data) * 2; > +} > + > +/** > + * convert_to_gcda - convert profiling data set to gcda file format > + * @buffer: the buffer to store file data or %NULL if no data should be stored > + * @info: profiling data set to be converted > + * > + * Returns the number of bytes that were/would have been stored into the buffer. > + */ > +static size_t > +convert_to_gcda(char *buffer, struct gcov_info *info) > +{ > + struct gcov_fn_info *fi_ptr; > + struct gcov_ctr_info *ci_ptr; > + unsigned int fi_idx; > + unsigned int ct_idx; > + unsigned int cv_idx; > + size_t pos = 0; > + > + /* File header. */ > + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); > + pos += store_gcov_uint32(buffer, pos, info->version); > + pos += store_gcov_uint32(buffer, pos, info->stamp); > + > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > + fi_ptr = info->functions[fi_idx]; > + > + /* Function record. */ > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); > + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); > + > + ci_ptr = fi_ptr->ctrs; > + > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > + if (!counter_active(info, ct_idx)) > + continue; > + > + /* Counter record. */ > + pos += store_gcov_uint32(buffer, pos, > + GCOV_TAG_FOR_COUNTER(ct_idx)); > + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); > + > + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { > + pos += store_gcov_uint64(buffer, pos, > + ci_ptr->values[cv_idx]); > + } > + > + ci_ptr++; > + } > + } > + > + return (pos); > +} > + > +/** > + * gcov_iter_new - allocate and initialize profiling data iterator > + * @info: profiling data set to be iterated > + * > + * Return file iterator on success, %NULL otherwise. > + */ > +struct gcov_iterator * > +gcov_iter_new(struct gcov_info *info) > +{ > + struct gcov_iterator *iter; > + > + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); > + if (iter == NULL) > + goto err_free; > + > + iter->info = info; > + /* Dry-run to get the actual buffer size. */ > + iter->size = convert_to_gcda(NULL, info); > + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); > + if (!iter->buffer) > + goto err_free; > + > + convert_to_gcda(iter->buffer, info); > + > + return iter; > + > +err_free: > + free(iter, M_GCOV); > + return (NULL); > +} > + > + > +/** > + * gcov_iter_get_info - return profiling data set for given file iterator > + * @iter: file iterator > + */ > +void > +gcov_iter_free(struct gcov_iterator *iter) > +{ > + free(iter->buffer, M_GCOV); > + free(iter, M_GCOV); > +} > + > +/** > + * gcov_iter_get_info - return profiling data set for given file iterator > + * @iter: file iterator > + */ > +struct gcov_info * > +gcov_iter_get_info(struct gcov_iterator *iter) > +{ > + return (iter->info); > +} > + > +/** > + * gcov_iter_start - reset file iterator to starting position > + * @iter: file iterator > + */ > +void > +gcov_iter_start(struct gcov_iterator *iter) > +{ > + iter->pos = 0; > +} > + > +/** > + * gcov_iter_next - advance file iterator to next logical record > + * @iter: file iterator > + * > + * Return zero if new position is valid, non-zero if iterator has reached end. > + */ > +int > +gcov_iter_next(struct gcov_iterator *iter) > +{ > + if (iter->pos < iter->size) > + iter->pos += ITER_STRIDE; > + > + if (iter->pos >= iter->size) > + return (EINVAL); > + > + return 0; > +} > + > +/** > + * gcov_iter_write - write data for current pos to seq_file > + * @iter: file iterator > + * @seq: seq_file handle > + * > + * Return zero on success, non-zero otherwise. > + */ > +int > +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) > +{ > + size_t len; > + > + if (iter->pos >= iter->size) > + return (EINVAL); > + > + len = ITER_STRIDE; > + if (iter->pos + len > iter->size) > + len = iter->size - iter->pos; > + > + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); > + > + return (0); > +} > > Added: head/sys/gnu/gcov/gcov.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,99 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2019, Matthew Macy > + * > + * 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. > + * > + * $FreeBSD$ > + * > + */ > + > +#ifndef _SYS_GCOV_H_ > +#define _SYS_GCOV_H_ > + > +MALLOC_DECLARE(M_GCOV); > + > +/* > + * Profiling data types used for gcc 3.4 and above - these are defined by > + * gcc and need to be kept as close to the original definition as possible to > + * remain compatible. > + */ > +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) > +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) > +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) > +#define GCOV_TAG_FOR_COUNTER(count) \ > + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) > + > +typedef uint64_t gcov_type; > + > +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so > + * we cannot use full definition here and they need to be placed in gcc specific > + * implementation of gcov. This also means no direct access to the members in > + * generic code and usage of the interface below.*/ > +struct gcov_info; > + > +/* Interface to access gcov_info data */ > +const char *gcov_info_filename(struct gcov_info *info); > +unsigned int gcov_info_version(struct gcov_info *info); > +struct gcov_info *gcov_info_next(struct gcov_info *info); > +void gcov_info_link(struct gcov_info *info); > +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); > + > +/* Base interface. */ > +enum gcov_action { > + GCOV_ADD, > + GCOV_REMOVE, > +}; > + > +/* Iterator control. */ > +struct gcov_iterator; > + > +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); > +void gcov_iter_free(struct gcov_iterator *iter); > +void gcov_iter_start(struct gcov_iterator *iter); > +int gcov_iter_next(struct gcov_iterator *iter); > +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); > +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); > + > +/* gcov_info control. */ > +void gcov_info_reset(struct gcov_info *info); > +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); > +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); > +struct gcov_info *gcov_info_dup(struct gcov_info *info); > +void gcov_info_free(struct gcov_info *info); > +void gcov_stats_reset(void); > +void gcov_enable_events(void); > +void gcov_module_unload(void *, module_t); > +void gcov_fs_init(void); > + > +int within_module(vm_offset_t addr, module_t mod); > + > +struct gcov_link { > + enum { > + OBJ_TREE, > + SRC_TREE, > + } dir; > + const char *ext; > +}; > +extern const struct gcov_link gcov_link[]; > +#endif > > Added: head/sys/gnu/gcov/gcov_fs.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) > @@ -0,0 +1,945 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * This code exports profiling data as debugfs files to userspace. > + * > + * Copyright IBM Corp. 2009 > + * Author(s): Peter Oberparleiter > + * > + * Uses gcc-internal data definitions. > + * Based on the gcov-kernel patch by: > + * Hubertus Franke > + * Nigel Hinds > + * Rajan Ravindran > + * Peter Oberparleiter > + * Paul Larson > + * Yi CDL Yang > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +extern int gcov_events_enabled; > +static int gcov_persist; > +static struct mtx gcov_mtx; > +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); > +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); > + > +void __gcov_init(struct gcov_info *info); > +void __gcov_flush(void); > +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); > +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); > +void __gcov_exit(void); > + > +static void gcov_event(enum gcov_action action, struct gcov_info *info); > + > + > +/* > + * Private copy taken from libc > + */ > +static char * > +(basename)(char *path) > +{ > + char *ptr; > + > + /* > + * If path is a null pointer or points to an empty string, > + * basename() shall return a pointer to the string ".". > + */ > + if (path == NULL || *path == '\0') > + return (__DECONST(char *, ".")); > + > + /* Find end of last pathname component and null terminate it. */ > + ptr = path + strlen(path); > + while (ptr > path + 1 && *(ptr - 1) == '/') > + --ptr; > + *ptr-- = '\0'; > + > + /* Find beginning of last pathname component. */ > + while (ptr > path && *(ptr - 1) != '/') > + --ptr; > + return (ptr); > +} > + > +/* > + * __gcov_init is called by gcc-generated constructor code for each object > + * file compiled with -fprofile-arcs. > + */ > +void > +__gcov_init(struct gcov_info *info) > +{ > + static unsigned int gcov_version; > + > + mtx_lock(&gcov_mtx); > + if (gcov_version == 0) { > + gcov_version = gcov_info_version(info); > + /* > + * Printing gcc's version magic may prove useful for debugging > + * incompatibility reports. > + */ > + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); > + } > + /* > + * Add new profiling data structure to list and inform event > + * listener. > + */ > + gcov_info_link(info); > + if (gcov_events_enabled) > + gcov_event(GCOV_ADD, info); > + mtx_unlock(&gcov_mtx); > +} > + > +/* > + * These functions may be referenced by gcc-generated profiling code but serve > + * no function for kernel profiling. > + */ > +void > +__gcov_flush(void) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) > +{ > + /* Unused. */ > +} > + > +void > +__gcov_exit(void) > +{ > + /* Unused. */ > +} > + > + > +/** > + * struct gcov_node - represents a debugfs entry > + * @entry: list entry for parent's child node list > + * @children: child nodes > + * @all_entry: list entry for list of all nodes > + * @parent: parent node > + * @loaded_info: array of pointers to profiling data sets for loaded object > + * files. > + * @num_loaded: number of profiling data sets for loaded object files. > + * @unloaded_info: accumulated copy of profiling data sets for unloaded > + * object files. Used only when gcov_persist=1. > + * @dentry: main debugfs entry, either a directory or data file > + * @links: associated symbolic links > + * @name: data file basename > + * > + * struct gcov_node represents an entity within the gcov/ subdirectory > + * of debugfs. There are directory and data file nodes. The latter represent > + * the actual synthesized data file plus any associated symbolic links which > + * are needed by the gcov tool to work correctly. > + */ > +struct gcov_node { > + LIST_ENTRY(gcov_node) children_entry; > + LIST_ENTRY(gcov_node) all_entry; > + struct { > + struct gcov_node *lh_first; > + } children; > + struct gcov_node *parent; > + struct gcov_info **loaded_info; > + struct gcov_info *unloaded_info; > + struct dentry *dentry; > + struct dentry **links; > + int num_loaded; > + char name[0]; > +}; > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Feb 23 21:52: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 D47A91506A04; Sat, 23 Feb 2019 21:52:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 F07DA711F1; Sat, 23 Feb 2019 21:52:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x1NLqjLc032129; Sat, 23 Feb 2019 13:52:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x1NLqjKG032128; Sat, 23 Feb 2019 13:52:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <201902232149.x1NLnute032111@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Sat, 23 Feb 2019 13:52:45 -0800 (PST) CC: Matt Macy , 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: F07DA711F1 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_SHORT(-0.97)[-0.975,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: Sat, 23 Feb 2019 21:52:49 -0000 > > Author: mmacy > > Date: Sat Feb 23 21:14:00 2019 > > New Revision: 344487 > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > Log: > > gcov support > > > > add gcov support and export results as files in debugfs > > > > Reviewed by: hps@ > > MFC after: 1 week > > Sponsored by: iX Systems > > Differential Revision: https://reviews.freebsd.org/D19260 And an additional nit, we can never becomre GPL free if we continue to add GPL code to the system. > > > > Added: > > head/sys/gnu/gcov/ > > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > > head/sys/gnu/gcov/gcov.h (contents, props changed) > > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > > Modified: > > head/sys/conf/files > > head/sys/conf/kern.mk > > head/sys/conf/kern.post.mk > > head/sys/conf/kern.pre.mk > > head/sys/conf/kmod.mk > > head/sys/conf/options > > > > Modified: head/sys/conf/files > > ============================================================================== > > --- head/sys/conf/files Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019 (r344487) > > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 > > fs/cd9660/cd9660_vfsops.c optional cd9660 > > fs/cd9660/cd9660_vnops.c optional cd9660 > > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > > +gnu/gcov/gcc_4_7.c optional gcov > > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > +gnu/gcov/gcov_subr.c optional gcov > > + > > kern/bus_if.m standard > > kern/clock_if.m standard > > kern/cpufreq_if.m standard > > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp > > compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ > > compile-with "${LINUXKPI_C}" > > compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > > compile-with "${LINUXKPI_C}" > > > > # OpenFabrics Enterprise Distribution (Infiniband) > > > > Modified: head/sys/conf/kern.mk > > ============================================================================== > > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ > > -Wno-error=maybe-uninitialized \ > > -Wno-error=overflow \ > > -Wno-error=sequence-point \ > > - -Wno-error=unused-but-set-variable > > + -Wno-unused-but-set-variable > > .if ${COMPILER_VERSION} >= 60100 > > CWARNEXTRA+= -Wno-error=misleading-indentation \ > > -Wno-error=nonnull-compare \ > > > > Modified: head/sys/conf/kern.post.mk > > ============================================================================== > > --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > > .endif > > > > +.if defined(GCOV_CFLAGS) > > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > > +.endif > > + > > # Allow overriding the kernel debug directory, so kernel and user debug may be > > # installed in different directories. Setting it to "" restores the historical > > # behavior of installing debug files in the kernel directory. > > > > Modified: head/sys/conf/kern.pre.mk > > ============================================================================== > > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > > > CFLAGS+= ${SAN_CFLAGS} > > > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > > +.if !empty(GCOV_ENABLED) > > +.if ${COMPILER_TYPE} == "gcc" > > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > > +.endif > > +.endif > > + > > +CFLAGS+= ${GCOV_CFLAGS} > > + > > # Put configuration-specific C flags last (except for ${PROF}) so that they > > # can override the others. > > CFLAGS+= ${CONF_CFLAGS} > > > > Modified: head/sys/conf/kmod.mk > > ============================================================================== > > --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019 (r344487) > > @@ -380,6 +380,9 @@ ${_src}: > > # Add the sanitizer C flags > > CFLAGS+= ${SAN_CFLAGS} > > > > +# Add the gcov flags > > +CFLAGS+= ${GCOV_CFLAGS} > > + > > # Respect configuration-specific C flags. > > CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} > > > > > > Modified: head/sys/conf/options > > ============================================================================== > > --- head/sys/conf/options Sat Feb 23 21:04:48 2019 (r344486) > > +++ head/sys/conf/options Sat Feb 23 21:14:00 2019 (r344487) > > @@ -1013,3 +1013,7 @@ NVME_USE_NVD opt_nvme.h > > > > # amdsbwd options > > AMDSBWD_DEBUG opt_amdsbwd.h > > + > > +# gcov support > > +GCOV opt_global.h > > +LINDEBUGFS > > > > Added: head/sys/gnu/gcov/gcc_4_7.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcc_4_7.c Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,597 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > The open item on the SPDX only use needs to be dealt with on a repository > of local tag to file location, etc. I still feel very uncorftable with > most of that, especially given the GPL 2 itsel clearly says to place > "this body of text" in your file. I do not know that you can modify that > aspect of it and have it still be called gpl 2.0. > > > +/* > > + * This code provides functions to handle gcc's profiling data format > > + * introduced with gcc 4.7. > > + * > > + * This file is based heavily on gcc_3_4.c file. > > + * > > + * For a better understanding, refer to gcc source: > > + * gcc/gcov-io.h > > + * libgcc/libgcov.c > > + * > > + * Uses gcc-internal data definitions. > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > + > > +#if (__GNUC__ >= 7) > > +#define GCOV_COUNTERS 9 > > +#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) > > +#define GCOV_COUNTERS 10 > > +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 > > +#define GCOV_COUNTERS 9 > > +#else > > +#define GCOV_COUNTERS 8 > > +#endif > > + > > +#define GCOV_TAG_FUNCTION_LENGTH 3 > > + > > +static struct gcov_info *gcov_info_head; > > + > > +/** > > + * struct gcov_ctr_info - information about counters for a single function > > + * @num: number of counter values for this type > > + * @values: array of counter values for this type > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time with the exception of the values array. > > + */ > > +struct gcov_ctr_info { > > + unsigned int num; > > + gcov_type *values; > > +}; > > + > > +/** > > + * struct gcov_fn_info - profiling meta data per function > > + * @key: comdat key > > + * @ident: unique ident of function > > + * @lineno_checksum: function lineo_checksum > > + * @cfg_checksum: function cfg checksum > > + * @ctrs: instrumented counters > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time. > > + * > > + * Information about a single function. This uses the trailing array > > + * idiom. The number of counters is determined from the merge pointer > > + * array in gcov_info. The key is used to detect which of a set of > > + * comdat functions was selected -- it points to the gcov_info object > > + * of the object file containing the selected comdat function. > > + */ > > +struct gcov_fn_info { > > + const struct gcov_info *key; > > + unsigned int ident; > > + unsigned int lineno_checksum; > > + unsigned int cfg_checksum; > > + struct gcov_ctr_info ctrs[0]; > > +}; > > + > > +/** > > + * struct gcov_info - profiling data per object file > > + * @version: gcov version magic indicating the gcc version used for compilation > > + * @next: list head for a singly-linked list > > + * @stamp: uniquifying time stamp > > + * @filename: name of the associated gcov data file > > + * @merge: merge functions (null for unused counter type) > > + * @n_functions: number of instrumented functions > > + * @functions: pointer to pointers to function information > > + * > > + * This data is generated by gcc during compilation and doesn't change > > + * at run-time with the exception of the next pointer. > > + */ > > +struct gcov_info { > > + unsigned int version; > > + struct gcov_info *next; > > + unsigned int stamp; > > + const char *filename; > > + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); > > + unsigned int n_functions; > > + struct gcov_fn_info **functions; > > +}; > > + > > +/** > > + * gcov_info_filename - return info filename > > + * @info: profiling data set > > + */ > > +const char * > > +gcov_info_filename(struct gcov_info *info) > > +{ > > + return (info->filename); > > +} > > + > > +/** > > + * gcov_info_version - return info version > > + * @info: profiling data set > > + */ > > +unsigned int > > +gcov_info_version(struct gcov_info *info) > > +{ > > + return (info->version); > > +} > > + > > +/** > > + * gcov_info_next - return next profiling data set > > + * @info: profiling data set > > + * > > + * Returns next gcov_info following @info or first gcov_info in the chain if > > + * @info is %NULL. > > + */ > > +struct gcov_info * > > +gcov_info_next(struct gcov_info *info) > > +{ > > + if (!info) > > + return gcov_info_head; > > + > > + return (info->next); > > +} > > + > > +/** > > + * gcov_info_link - link/add profiling data set to the list > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_link(struct gcov_info *info) > > +{ > > + info->next = gcov_info_head; > > + gcov_info_head = info; > > +} > > + > > +/** > > + * gcov_info_unlink - unlink/remove profiling data set from the list > > + * @prev: previous profiling data set > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info) > > +{ > > + if (prev) > > + prev->next = info->next; > > + else > > + gcov_info_head = info->next; > > +} > > + > > +/* Symbolic links to be created for each profiling data file. */ > > +const struct gcov_link gcov_link[] = { > > + { OBJ_TREE, "gcno" }, /* Link to .gcno file in $(objtree). */ > > + { 0, NULL}, > > +}; > > + > > +/* > > + * Determine whether a counter is active. Doesn't change at run-time. > > + */ > > +static int > > +counter_active(struct gcov_info *info, unsigned int type) > > +{ > > + return (info->merge[type] ? 1 : 0); > > +} > > + > > +/* Determine number of active counters. Based on gcc magic. */ > > +static unsigned int > > +num_counter_active(struct gcov_info *info) > > +{ > > + unsigned int i; > > + unsigned int result = 0; > > + > > + for (i = 0; i < GCOV_COUNTERS; i++) { > > + if (counter_active(info, i)) > > + result++; > > + } > > + return (result); > > +} > > + > > +/** > > + * gcov_info_reset - reset profiling data to zero > > + * @info: profiling data set > > + */ > > +void > > +gcov_info_reset(struct gcov_info *info) > > +{ > > + struct gcov_ctr_info *ci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + ci_ptr = info->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(info, ct_idx)) > > + continue; > > + > > + memset(ci_ptr->values, 0, > > + sizeof(gcov_type) * ci_ptr->num); > > + ci_ptr++; > > + } > > + } > > +} > > + > > +/** > > + * gcov_info_is_compatible - check if profiling data can be added > > + * @info1: first profiling data set > > + * @info2: second profiling data set > > + * > > + * Returns non-zero if profiling data can be added, zero otherwise. > > + */ > > +int > > +gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2) > > +{ > > + return (info1->stamp == info2->stamp); > > +} > > + > > +/** > > + * gcov_info_add - add up profiling data > > + * @dest: profiling data set to which data is added > > + * @source: profiling data set which is added > > + * > > + * Adds profiling counts of @source to @dest. > > + */ > > +void > > +gcov_info_add(struct gcov_info *dst, struct gcov_info *src) > > +{ > > + struct gcov_ctr_info *dci_ptr; > > + struct gcov_ctr_info *sci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + unsigned int val_idx; > > + > > + for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { > > + dci_ptr = dst->functions[fi_idx]->ctrs; > > + sci_ptr = src->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(src, ct_idx)) > > + continue; > > + > > + for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) > > + dci_ptr->values[val_idx] += > > + sci_ptr->values[val_idx]; > > + > > + dci_ptr++; > > + sci_ptr++; > > + } > > + } > > +} > > + > > +/** > > + * gcov_info_dup - duplicate profiling data set > > + * @info: profiling data set to duplicate > > + * > > + * Return newly allocated duplicate on success, %NULL on error. > > + */ > > +struct gcov_info * > > +gcov_info_dup(struct gcov_info *info) > > +{ > > + struct gcov_info *dup; > > + struct gcov_ctr_info *dci_ptr; /* dst counter info */ > > + struct gcov_ctr_info *sci_ptr; /* src counter info */ > > + unsigned int active; > > + unsigned int fi_idx; /* function info idx */ > > + unsigned int ct_idx; /* counter type idx */ > > + size_t fi_size; /* function info size */ > > + size_t cv_size; /* counter values size */ > > + > > + if ((dup = malloc(sizeof(*dup), M_GCOV, M_NOWAIT|M_ZERO)) == NULL) > > + return (NULL); > > + memcpy(dup, info, sizeof(*dup)); > > + > > + dup->next = NULL; > > + dup->filename = NULL; > > + dup->functions = NULL; > > + > > + dup->filename = strdup_flags(info->filename, M_GCOV, M_NOWAIT); > > + if (dup->filename == NULL) > > + goto err_free; > > + > > + dup->functions = malloc(info->n_functions * sizeof(struct gcov_fn_info *), M_GCOV, M_NOWAIT|M_ZERO); > > + if (dup->functions == NULL) > > + goto err_free; > > + active = num_counter_active(info); > > + fi_size = sizeof(struct gcov_fn_info); > > + fi_size += sizeof(struct gcov_ctr_info) * active; > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + dup->functions[fi_idx] = malloc(fi_size, M_GCOV, M_NOWAIT|M_ZERO); > > + if (!dup->functions[fi_idx]) > > + goto err_free; > > + > > + *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); > > + > > + sci_ptr = info->functions[fi_idx]->ctrs; > > + dci_ptr = dup->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < active; ct_idx++) { > > + > > + cv_size = sizeof(gcov_type) * sci_ptr->num; > > + > > + dci_ptr->values = malloc(cv_size, M_GCOV, M_NOWAIT); > > + > > + if (!dci_ptr->values) > > + goto err_free; > > + > > + dci_ptr->num = sci_ptr->num; > > + memcpy(dci_ptr->values, sci_ptr->values, cv_size); > > + > > + sci_ptr++; > > + dci_ptr++; > > + } > > + } > > + > > + return (dup); > > +err_free: > > + gcov_info_free(dup); > > + return (NULL); > > +} > > + > > +/** > > + * gcov_info_free - release memory for profiling data set duplicate > > + * @info: profiling data set duplicate to free > > + */ > > +void > > +gcov_info_free(struct gcov_info *info) > > +{ > > + unsigned int active; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + struct gcov_ctr_info *ci_ptr; > > + > > + if (!info->functions) > > + goto free_info; > > + > > + active = num_counter_active(info); > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + if (!info->functions[fi_idx]) > > + continue; > > + > > + ci_ptr = info->functions[fi_idx]->ctrs; > > + > > + for (ct_idx = 0; ct_idx < active; ct_idx++, ci_ptr++) > > + free(ci_ptr->values, M_GCOV); > > + > > + free(info->functions[fi_idx], M_GCOV); > > + } > > + > > +free_info: > > + free(info->functions, M_GCOV); > > + free(__DECONST(char *, info->filename), M_GCOV); > > + free(info, M_GCOV); > > + } > > + > > +#define ITER_STRIDE PAGE_SIZE > > + > > +/** > > + * struct gcov_iterator - specifies current file position in logical records > > + * @info: associated profiling data > > + * @buffer: buffer containing file data > > + * @size: size of buffer > > + * @pos: current position in file > > + */ > > +struct gcov_iterator { > > + struct gcov_info *info; > > + caddr_t buffer; > > + size_t size; > > + off_t pos; > > +}; > > + > > +/** > > + * store_gcov_uint32 - store 32 bit number in gcov format to buffer > > + * @buffer: target buffer or NULL > > + * @off: offset into the buffer > > + * @v: value to be stored > > + * > > + * Number format defined by gcc: numbers are recorded in the 32 bit > > + * unsigned binary form of the endianness of the machine generating the > > + * file. Returns the number of bytes stored. If @buffer is %NULL, doesn't > > + * store anything. > > + */ > > +static size_t > > +store_gcov_uint32(void *buffer, size_t off, uint32_t v) > > +{ > > + uint32_t *data; > > + > > + if (buffer) { > > + data = (void*)((caddr_t)buffer + off); > > + *data = v; > > + } > > + > > + return sizeof(*data); > > +} > > + > > +/** > > + * store_gcov_uint64 - store 64 bit number in gcov format to buffer > > + * @buffer: target buffer or NULL > > + * @off: offset into the buffer > > + * @v: value to be stored > > + * > > + * Number format defined by gcc: numbers are recorded in the 32 bit > > + * unsigned binary form of the endianness of the machine generating the > > + * file. 64 bit numbers are stored as two 32 bit numbers, the low part > > + * first. Returns the number of bytes stored. If @buffer is %NULL, doesn't store > > + * anything. > > + */ > > + > > +static size_t > > +store_gcov_uint64(void *buffer, size_t off, uint64_t v) > > +{ > > + uint32_t *data; > > + > > + if (buffer) { > > + data = (void*)((caddr_t)buffer + off); > > + > > + data[0] = (v & 0xffffffffUL); > > + data[1] = (v >> 32); > > + } > > + > > + return sizeof(*data) * 2; > > +} > > + > > +/** > > + * convert_to_gcda - convert profiling data set to gcda file format > > + * @buffer: the buffer to store file data or %NULL if no data should be stored > > + * @info: profiling data set to be converted > > + * > > + * Returns the number of bytes that were/would have been stored into the buffer. > > + */ > > +static size_t > > +convert_to_gcda(char *buffer, struct gcov_info *info) > > +{ > > + struct gcov_fn_info *fi_ptr; > > + struct gcov_ctr_info *ci_ptr; > > + unsigned int fi_idx; > > + unsigned int ct_idx; > > + unsigned int cv_idx; > > + size_t pos = 0; > > + > > + /* File header. */ > > + pos += store_gcov_uint32(buffer, pos, GCOV_DATA_MAGIC); > > + pos += store_gcov_uint32(buffer, pos, info->version); > > + pos += store_gcov_uint32(buffer, pos, info->stamp); > > + > > + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { > > + fi_ptr = info->functions[fi_idx]; > > + > > + /* Function record. */ > > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION); > > + pos += store_gcov_uint32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->ident); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->lineno_checksum); > > + pos += store_gcov_uint32(buffer, pos, fi_ptr->cfg_checksum); > > + > > + ci_ptr = fi_ptr->ctrs; > > + > > + for (ct_idx = 0; ct_idx < GCOV_COUNTERS; ct_idx++) { > > + if (!counter_active(info, ct_idx)) > > + continue; > > + > > + /* Counter record. */ > > + pos += store_gcov_uint32(buffer, pos, > > + GCOV_TAG_FOR_COUNTER(ct_idx)); > > + pos += store_gcov_uint32(buffer, pos, ci_ptr->num * 2); > > + > > + for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { > > + pos += store_gcov_uint64(buffer, pos, > > + ci_ptr->values[cv_idx]); > > + } > > + > > + ci_ptr++; > > + } > > + } > > + > > + return (pos); > > +} > > + > > +/** > > + * gcov_iter_new - allocate and initialize profiling data iterator > > + * @info: profiling data set to be iterated > > + * > > + * Return file iterator on success, %NULL otherwise. > > + */ > > +struct gcov_iterator * > > +gcov_iter_new(struct gcov_info *info) > > +{ > > + struct gcov_iterator *iter; > > + > > + iter = malloc(sizeof(struct gcov_iterator), M_GCOV, M_NOWAIT|M_ZERO); > > + if (iter == NULL) > > + goto err_free; > > + > > + iter->info = info; > > + /* Dry-run to get the actual buffer size. */ > > + iter->size = convert_to_gcda(NULL, info); > > + iter->buffer = malloc(iter->size, M_GCOV, M_NOWAIT); > > + if (!iter->buffer) > > + goto err_free; > > + > > + convert_to_gcda(iter->buffer, info); > > + > > + return iter; > > + > > +err_free: > > + free(iter, M_GCOV); > > + return (NULL); > > +} > > + > > + > > +/** > > + * gcov_iter_get_info - return profiling data set for given file iterator > > + * @iter: file iterator > > + */ > > +void > > +gcov_iter_free(struct gcov_iterator *iter) > > +{ > > + free(iter->buffer, M_GCOV); > > + free(iter, M_GCOV); > > +} > > + > > +/** > > + * gcov_iter_get_info - return profiling data set for given file iterator > > + * @iter: file iterator > > + */ > > +struct gcov_info * > > +gcov_iter_get_info(struct gcov_iterator *iter) > > +{ > > + return (iter->info); > > +} > > + > > +/** > > + * gcov_iter_start - reset file iterator to starting position > > + * @iter: file iterator > > + */ > > +void > > +gcov_iter_start(struct gcov_iterator *iter) > > +{ > > + iter->pos = 0; > > +} > > + > > +/** > > + * gcov_iter_next - advance file iterator to next logical record > > + * @iter: file iterator > > + * > > + * Return zero if new position is valid, non-zero if iterator has reached end. > > + */ > > +int > > +gcov_iter_next(struct gcov_iterator *iter) > > +{ > > + if (iter->pos < iter->size) > > + iter->pos += ITER_STRIDE; > > + > > + if (iter->pos >= iter->size) > > + return (EINVAL); > > + > > + return 0; > > +} > > + > > +/** > > + * gcov_iter_write - write data for current pos to seq_file > > + * @iter: file iterator > > + * @seq: seq_file handle > > + * > > + * Return zero on success, non-zero otherwise. > > + */ > > +int > > +gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf) > > +{ > > + size_t len; > > + > > + if (iter->pos >= iter->size) > > + return (EINVAL); > > + > > + len = ITER_STRIDE; > > + if (iter->pos + len > iter->size) > > + len = iter->size - iter->pos; > > + > > + sbuf_bcat(sbuf, iter->buffer + iter->pos, len); > > + > > + return (0); > > +} > > > > Added: head/sys/gnu/gcov/gcov.h > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcov.h Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,99 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2019, Matthew Macy > > + * > > + * 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. > > + * > > + * $FreeBSD$ > > + * > > + */ > > + > > +#ifndef _SYS_GCOV_H_ > > +#define _SYS_GCOV_H_ > > + > > +MALLOC_DECLARE(M_GCOV); > > + > > +/* > > + * Profiling data types used for gcc 3.4 and above - these are defined by > > + * gcc and need to be kept as close to the original definition as possible to > > + * remain compatible. > > + */ > > +#define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) > > +#define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) > > +#define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) > > +#define GCOV_TAG_FOR_COUNTER(count) \ > > + (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) > > + > > +typedef uint64_t gcov_type; > > + > > +/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so > > + * we cannot use full definition here and they need to be placed in gcc specific > > + * implementation of gcov. This also means no direct access to the members in > > + * generic code and usage of the interface below.*/ > > +struct gcov_info; > > + > > +/* Interface to access gcov_info data */ > > +const char *gcov_info_filename(struct gcov_info *info); > > +unsigned int gcov_info_version(struct gcov_info *info); > > +struct gcov_info *gcov_info_next(struct gcov_info *info); > > +void gcov_info_link(struct gcov_info *info); > > +void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info); > > + > > +/* Base interface. */ > > +enum gcov_action { > > + GCOV_ADD, > > + GCOV_REMOVE, > > +}; > > + > > +/* Iterator control. */ > > +struct gcov_iterator; > > + > > +struct gcov_iterator *gcov_iter_new(struct gcov_info *info); > > +void gcov_iter_free(struct gcov_iterator *iter); > > +void gcov_iter_start(struct gcov_iterator *iter); > > +int gcov_iter_next(struct gcov_iterator *iter); > > +int gcov_iter_write(struct gcov_iterator *iter, struct sbuf *sbuf); > > +struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter); > > + > > +/* gcov_info control. */ > > +void gcov_info_reset(struct gcov_info *info); > > +int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2); > > +void gcov_info_add(struct gcov_info *dest, struct gcov_info *source); > > +struct gcov_info *gcov_info_dup(struct gcov_info *info); > > +void gcov_info_free(struct gcov_info *info); > > +void gcov_stats_reset(void); > > +void gcov_enable_events(void); > > +void gcov_module_unload(void *, module_t); > > +void gcov_fs_init(void); > > + > > +int within_module(vm_offset_t addr, module_t mod); > > + > > +struct gcov_link { > > + enum { > > + OBJ_TREE, > > + SRC_TREE, > > + } dir; > > + const char *ext; > > +}; > > +extern const struct gcov_link gcov_link[]; > > +#endif > > > > Added: head/sys/gnu/gcov/gcov_fs.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/gnu/gcov/gcov_fs.c Sat Feb 23 21:14:00 2019 (r344487) > > @@ -0,0 +1,945 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * This code exports profiling data as debugfs files to userspace. > > + * > > + * Copyright IBM Corp. 2009 > > + * Author(s): Peter Oberparleiter > > + * > > + * Uses gcc-internal data definitions. > > + * Based on the gcov-kernel patch by: > > + * Hubertus Franke > > + * Nigel Hinds > > + * Rajan Ravindran > > + * Peter Oberparleiter > > + * Paul Larson > > + * Yi CDL Yang > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +extern int gcov_events_enabled; > > +static int gcov_persist; > > +static struct mtx gcov_mtx; > > +MTX_SYSINIT(gcov_init, &gcov_mtx, "gcov_mtx", MTX_DEF); > > +MALLOC_DEFINE(M_GCOV, "gcov", "gcov"); > > + > > +void __gcov_init(struct gcov_info *info); > > +void __gcov_flush(void); > > +void __gcov_merge_add(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_single(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters); > > +void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters); > > +void __gcov_exit(void); > > + > > +static void gcov_event(enum gcov_action action, struct gcov_info *info); > > + > > + > > +/* > > + * Private copy taken from libc > > + */ > > +static char * > > +(basename)(char *path) > > +{ > > + char *ptr; > > + > > + /* > > + * If path is a null pointer or points to an empty string, > > + * basename() shall return a pointer to the string ".". > > + */ > > + if (path == NULL || *path == '\0') > > + return (__DECONST(char *, ".")); > > + > > + /* Find end of last pathname component and null terminate it. */ > > + ptr = path + strlen(path); > > + while (ptr > path + 1 && *(ptr - 1) == '/') > > + --ptr; > > + *ptr-- = '\0'; > > + > > + /* Find beginning of last pathname component. */ > > + while (ptr > path && *(ptr - 1) != '/') > > + --ptr; > > + return (ptr); > > +} > > + > > +/* > > + * __gcov_init is called by gcc-generated constructor code for each object > > + * file compiled with -fprofile-arcs. > > + */ > > +void > > +__gcov_init(struct gcov_info *info) > > +{ > > + static unsigned int gcov_version; > > + > > + mtx_lock(&gcov_mtx); > > + if (gcov_version == 0) { > > + gcov_version = gcov_info_version(info); > > + /* > > + * Printing gcc's version magic may prove useful for debugging > > + * incompatibility reports. > > + */ > > + log(LOG_INFO, "version magic: 0x%x\n", gcov_version); > > + } > > + /* > > + * Add new profiling data structure to list and inform event > > + * listener. > > + */ > > + gcov_info_link(info); > > + if (gcov_events_enabled) > > + gcov_event(GCOV_ADD, info); > > + mtx_unlock(&gcov_mtx); > > +} > > + > > +/* > > + * These functions may be referenced by gcc-generated profiling code but serve > > + * no function for kernel profiling. > > + */ > > +void > > +__gcov_flush(void) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_add(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_single(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_delta(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_ior(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) > > +{ > > + /* Unused. */ > > +} > > + > > +void > > +__gcov_exit(void) > > +{ > > + /* Unused. */ > > +} > > + > > + > > +/** > > + * struct gcov_node - represents a debugfs entry > > + * @entry: list entry for parent's child node list > > + * @children: child nodes > > + * @all_entry: list entry for list of all nodes > > + * @parent: parent node > > + * @loaded_info: array of pointers to profiling data sets for loaded object > > + * files. > > + * @num_loaded: number of profiling data sets for loaded object files. > > + * @unloaded_info: accumulated copy of profiling data sets for unloaded > > + * object files. Used only when gcov_persist=1. > > + * @dentry: main debugfs entry, either a directory or data file > > + * @links: associated symbolic links > > + * @name: data file basename > > + * > > + * struct gcov_node represents an entity within the gcov/ subdirectory > > + * of debugfs. There are directory and data file nodes. The latter represent > > + * the actual synthesized data file plus any associated symbolic links which > > + * are needed by the gcov tool to work correctly. > > + */ > > +struct gcov_node { > > + LIST_ENTRY(gcov_node) children_entry; > > + LIST_ENTRY(gcov_node) all_entry; > > + struct { > > + struct gcov_node *lh_first; > > + } children; > > + struct gcov_node *parent; > > + struct gcov_info **loaded_info; > > + struct gcov_info *unloaded_info; > > + struct dentry *dentry; > > + struct dentry **links; > > + int num_loaded; > > + char name[0]; > > +}; > > + > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > > > > -- > Rod Grimes rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Feb 23 23:17: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 8BE331507E70; Sat, 23 Feb 2019 23:17:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 82F0F73097; Sat, 23 Feb 2019 23:17:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id xgXOgHMhAHbf8xgXPgQX2p; Sat, 23 Feb 2019 16:16:56 -0700 X-Authority-Analysis: v=2.3 cv=MKgeZ/Rl c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=ax2tO9aOw4QCizSa25QA: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 E75971DA; Sat, 23 Feb 2019 15:16:53 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1NNGrEP089742; Sat, 23 Feb 2019 15:16:53 -0800 (PST) (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 x1NNGrhD089735; Sat, 23 Feb 2019 15:16:53 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902232316.x1NNGrhD089735@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 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: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: Message from "Rodney W. Grimes" of "Sat, 23 Feb 2019 13:52:45 -0800." <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 23 Feb 2019 15:16:53 -0800 X-CMAE-Envelope: MS4wfMi0a6oHBH6fgiOmqiyZ2AjpocISjGkt3MBoScRVTycwQi8faNGNZ3SAotMy49RnWcOExWqE4XRxnHyXiz78xnyhBv1on12HtkZnDz+LGrq2AdR8hbvR RUqkBuXVaD5Hog42Cf5iWlHrFKoWjpffsWaMz1/0BsYj78v4QHSN8pDSA2hmq/NM00LPixmUe2NLBX+P6fL2YhYll18yubaIio+P9C8+npGI4t0Ot5Px7/pN pGsW71PHee9IDUb14v5Vr0OVWo1LLNM2xwkryKy+ehhrBZCSrBz1bX2JT6eWUKqTiTYwdrNDzKM0IDwirvYuXA== X-Rspamd-Queue-Id: 82F0F73097 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.58 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; 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)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.89)[-0.887,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:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-1.98)[ip: (-5.19), ipnet: 64.59.128.0/20(-2.61), asn: 6327(-2.04), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[9.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: Sat, 23 Feb 2019 23:17:05 -0000 In message <201902232152.x1NLqjKG032128@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > > Author: mmacy > > > Date: Sat Feb 23 21:14:00 2019 > > > New Revision: 344487 > > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > > > Log: > > > gcov support > > > > > > add gcov support and export results as files in debugfs > > > > > > Reviewed by: hps@ > > > MFC after: 1 week > > > Sponsored by: iX Systems > > > Differential Revision: https://reviews.freebsd.org/D19260 > > And an additional nit, we can never becomre GPL free > if we continue to add GPL code to the system. +1 on adding GPL code to the system. The thing that comes to mind with this commit is that we generally try to commit to the vendor branch externally obtained code and merge. That this was committed directly suggests that we will be the maintainers of this code, also suggesting that this GPL code is here to stay. Or, are there plans to replace this with BSD licensed code. As this is external, obtained from should have been documented in the commit message. Ccould this not be put into ports? Those wishing to use this feature could install it as desired. Not to heap it on, just a bunch of questions coming to mind as I write this: What about DTrace, can't we do the same with it? Which once again argues against GPL in base, especially the kernel. -- 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 Sat Feb 23 23:31: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 2F9E5150812E; Sat, 23 Feb 2019 23:31:14 +0000 (UTC) (envelope-from sobomax@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 B363E73611; Sat, 23 Feb 2019 23:31:13 +0000 (UTC) (envelope-from sobomax@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 9B55C244EE; Sat, 23 Feb 2019 23:31:13 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1NNVD9K059333; Sat, 23 Feb 2019 23:31:13 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NNVDdm059332; Sat, 23 Feb 2019 23:31:13 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201902232331.x1NNVDdm059332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 23 Feb 2019 23:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344488 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 344488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B363E73611 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: Sat, 23 Feb 2019 23:31:14 -0000 Author: sobomax Date: Sat Feb 23 23:31:13 2019 New Revision: 344488 URL: https://svnweb.freebsd.org/changeset/base/344488 Log: Further refine r336195: do not even attempt to verify/update interface's MTU if we've set it once and there were no changes on the DHCP server side since the last refresh. This is consistent I believe with how dhclient handles other settings like IP address, mask etc. Approved by: cem, eugen Differential Revision: https://reviews.freebsd.org/D18546 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Sat Feb 23 21:14:00 2019 (r344487) +++ head/sbin/dhclient/dhclient.c Sat Feb 23 23:31:13 2019 (r344488) @@ -863,6 +863,7 @@ bind_lease(struct interface_info *ip) opt = &ip->client->new->options[DHO_INTERFACE_MTU]; if (opt->len == sizeof(u_int16_t)) { u_int16_t mtu = 0; + u_int16_t old_mtu = 0; bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] == ACTION_SUPERSEDE); @@ -871,12 +872,19 @@ bind_lease(struct interface_info *ip) else mtu = be16dec(opt->data); + if (ip->client->active) { + opt = &ip->client->active->options[DHO_INTERFACE_MTU]; + if (opt->len == sizeof(u_int16_t)) { + old_mtu = be16dec(opt->data); + } + } + if (mtu < MIN_MTU) { /* Treat 0 like a user intentionally doesn't want to change MTU and, * therefore, warning is not needed */ if (!supersede || mtu != 0) warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); - } else { + } else if (ip->client->state != S_RENEWING || mtu != old_mtu) { interface_set_mtu_unpriv(privfd, mtu); } } From owner-svn-src-all@freebsd.org Sat Feb 23 23:35: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 BB9C415082E7; Sat, 23 Feb 2019 23:35:53 +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 59561739DC; Sat, 23 Feb 2019 23:35:53 +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 469F324576; Sat, 23 Feb 2019 23:35:53 +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 x1NNZrA1061019; Sat, 23 Feb 2019 23:35:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1NNZqDW061017; Sat, 23 Feb 2019 23:35:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902232335.x1NNZqDW061017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 23 Feb 2019 23:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344489 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59561739DC 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.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: Sat, 23 Feb 2019 23:35:54 -0000 Author: mav Date: Sat Feb 23 23:35:52 2019 New Revision: 344489 URL: https://svnweb.freebsd.org/changeset/base/344489 Log: Free some space in struct ctl_io_hdr for better use. - Collapse original_sc and serializing_sc fields into one, since they are never used simultanously, we have only one local I/O and one remote. - Move remote_sglist and local_sglist fields into CTL_PRIV_BACKEND, since they are used only on Originating SC in XFER mode, where requests don't ever reach backends, so we can reuse backend's private storage. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Feb 23 23:31:13 2019 (r344488) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 23:35:52 2019 (r344489) @@ -651,7 +651,7 @@ ctl_ha_datamove(union ctl_io *io) memset(&msg.dt, 0, sizeof(msg.dt)); msg.hdr.msg_type = CTL_MSG_DATAMOVE; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.serializing_sc = io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; @@ -766,7 +766,7 @@ ctl_ha_done(union ctl_io *io) if (io->io_hdr.io_type == CTL_IO_SCSI) { memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_FINISH_IO; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; msg.scsi.scsi_status = io->scsiio.scsi_status; @@ -1439,7 +1439,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e // populate ctsio from msg io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.msg_type = CTL_MSG_SERIALIZE; - io->io_hdr.original_sc = msg->hdr.original_sc; + io->io_hdr.remote_io = msg->hdr.original_sc; io->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC | CTL_FLAG_IO_ACTIVE; /* @@ -1495,7 +1495,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e * Keep track of this, we need to send it back over * when the datamove is complete. */ - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; if (msg->hdr.status == CTL_SUCCESS) io->io_hdr.status = msg->hdr.status; @@ -1508,9 +1508,8 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e CTL_HA_DATAMOVE_SEGMENT + 1; sgl = malloc(sizeof(*sgl) * i, M_CTL, M_WAITOK | M_ZERO); - io->io_hdr.remote_sglist = sgl; - io->io_hdr.local_sglist = - &sgl[msg->dt.kern_sg_entries]; + CTL_RSGL(io) = sgl; + CTL_LSGL(io) = &sgl[msg->dt.kern_sg_entries]; io->scsiio.kern_data_ptr = (uint8_t *)sgl; @@ -1597,7 +1596,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e } io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; io->io_hdr.msg_type = CTL_MSG_R2R; - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; ctl_enqueue_isc(io); break; @@ -2369,7 +2368,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) mtx_unlock(&lun->lun_lock); /* send msg back to other side */ - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = (union ctl_io *)ctsio; msg_info.hdr.msg_type = CTL_MSG_R2R; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -2395,7 +2394,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) /*retry_count*/ 0); badjuju: ctl_copy_sense_data_back((union ctl_io *)ctsio, &msg_info); - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = NULL; msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -11043,7 +11042,7 @@ ctl_check_blocked(struct ctl_lun *lun) cur_blocked->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; msg_info.hdr.original_sc = - cur_blocked->io_hdr.original_sc; + cur_blocked->io_hdr.remote_io; msg_info.hdr.serializing_sc = cur_blocked; msg_info.hdr.msg_type = CTL_MSG_R2R; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -12480,7 +12479,7 @@ ctl_send_datamove_done(union ctl_io *io, int have_lock memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_DATAMOVE_DONE; msg.hdr.original_sc = io; - msg.hdr.serializing_sc = io->io_hdr.serializing_sc; + msg.hdr.serializing_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; msg.scsi.kern_data_resid = io->scsiio.kern_data_resid; @@ -12531,10 +12530,10 @@ ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq) ctl_dt_req_free(rq); for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; /* * The data is in local and remote memory, so now we need to send @@ -12574,7 +12573,7 @@ ctl_datamove_remote_write(union ctl_io *io) return; /* Switch the pointer over so the FETD knows what to do */ - io->scsiio.kern_data_ptr = (uint8_t *)io->io_hdr.local_sglist; + io->scsiio.kern_data_ptr = (uint8_t *)CTL_LSGL(io); /* * Use a custom move done callback, since we need to send completion @@ -12597,10 +12596,10 @@ ctl_datamove_remote_dm_read_cb(union ctl_io *io) uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; #if 0 scsi_path_string(io, path_str, sizeof(path_str)); @@ -12647,7 +12646,7 @@ ctl_datamove_remote_read_cb(struct ctl_ha_dt_req *rq) ctl_dt_req_free(rq); /* Switch the pointer over so the FETD knows what to do */ - io->scsiio.kern_data_ptr = (uint8_t *)io->io_hdr.local_sglist; + io->scsiio.kern_data_ptr = (uint8_t *)CTL_LSGL(io); /* * Use a custom move done callback, since we need to send completion @@ -12670,7 +12669,7 @@ ctl_datamove_remote_sgl_setup(union ctl_io *io) int i; retval = 0; - local_sglist = io->io_hdr.local_sglist; + local_sglist = CTL_LSGL(io); len_to_go = io->scsiio.kern_data_len; /* @@ -12741,8 +12740,8 @@ ctl_datamove_remote_xfer(union ctl_io *io, unsigned co return (1); } - local_sglist = io->io_hdr.local_sglist; - remote_sglist = io->io_hdr.remote_sglist; + local_sglist = CTL_LSGL(io); + remote_sglist = CTL_RSGL(io); local_used = 0; remote_used = 0; total_used = 0; @@ -12855,10 +12854,10 @@ ctl_datamove_remote_read(union ctl_io *io) * error if there is a problem. */ for (i = 0; i < io->scsiio.kern_sg_entries; i++) - free(io->io_hdr.local_sglist[i].addr, M_CTL); - free(io->io_hdr.remote_sglist, M_CTL); - io->io_hdr.remote_sglist = NULL; - io->io_hdr.local_sglist = NULL; + free(CTL_LSGLT(io)[i].addr, M_CTL); + free(CTL_RSGL(io), M_CTL); + CTL_RSGL(io) = NULL; + CTL_LSGL(io) = NULL; } } @@ -13106,7 +13105,7 @@ bailout: (io->io_hdr.flags & CTL_FLAG_SENT_2OTHER_SC)) { memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_FINISH_IO; - msg.hdr.serializing_sc = io->io_hdr.serializing_sc; + msg.hdr.serializing_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, sizeof(msg.scsi) - sizeof(msg.scsi.sense_data), Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sat Feb 23 23:31:13 2019 (r344488) +++ head/sys/cam/ctl/ctl_io.h Sat Feb 23 23:35:52 2019 (r344489) @@ -167,6 +167,15 @@ union ctl_priv { #define CTL_PORT(io) (((struct ctl_softc *)CTL_SOFTC(io))-> \ ctl_ports[(io)->io_hdr.nexus.targ_port]) +/* + * These are used only on Originating SC in XFER mode, where requests don't + * ever reach backends, so we can reuse backend's private storage. + */ +#define CTL_RSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[0]) +#define CTL_LSGL(io) ((io)->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptrs[1]) +#define CTL_RSGLT(io) ((struct ctl_sg_entry *)CTL_RSGL(io)) +#define CTL_LSGLT(io) ((struct ctl_sg_entry *)CTL_LSGL(io)) + #define CTL_INVALID_PORTNAME 0xFF #define CTL_UNMAPPED_IID 0xFF @@ -229,12 +238,12 @@ struct ctl_io_hdr { struct bintime dma_bt; /* DMA total ticks */ #endif /* CTL_TIME_IO */ uint32_t num_dmas; /* Number of DMAs */ - union ctl_io *original_sc; - union ctl_io *serializing_sc; + union ctl_io *remote_io; /* I/O counterpart on remote HA side */ + void *pad1; void *pool; /* I/O pool */ union ctl_priv ctl_private[CTL_NUM_PRIV];/* CTL private area */ - struct ctl_sg_entry *remote_sglist; - struct ctl_sg_entry *local_sglist; + void *pad2; + void *pad3; STAILQ_ENTRY(ctl_io_hdr) links; /* linked list pointer */ TAILQ_ENTRY(ctl_io_hdr) ooa_links; TAILQ_ENTRY(ctl_io_hdr) blocked_links;