From owner-svn-src-head@freebsd.org Sun Apr 21 00:21:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E51E157A705; Sun, 21 Apr 2019 00:21:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0DE81452; Sun, 21 Apr 2019 00:21:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id x3so7005178iol.10; Sat, 20 Apr 2019 17:21:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=0Zi5eQMaN/SydMFwMj6UjeDaEn36JJeThI/FnrVgtVY=; b=rFn2HY4LUuEw+GkYKRunlwjgHzjT1+CvsZHV6Ivns13wptt8AiC+LDhPyJ2TEA+4yL aN1dDh6rgPFjR2xDuJ71bF2A9unjTOi1H8yYG8MVhLyJQqJxi5Uxr19+8ori3xalYjGX TZauyLmb2T2JzcuTG/0JxUB/b3m+qXiK1W7mPVil08amLc+ihipiYOFw8wi253LDhiTI 7P4sLxR2NYKgULtJF1FUKKYf9NPdIC+kk4jiSN4+/O1RL+XZ9gJs9Oem3xbpOOTBvMFi wkeV1/wfd+6Jr3/iRrde/uWCQpUhNviXm5tOZuBjsws00QjV/6DZOXSs1tbf08/7NE9w 6LNA== X-Gm-Message-State: APjAAAUexs8beuVMmBn+cUNeDSd/ZfZF0zgrWZkZg9Jmr+7fs1gp5VKa WnRbzNcKvST08y491F8/WtYqJHzl X-Google-Smtp-Source: APXvYqwtZvy4YBwHzI8mTPHMwCYSziTnTWBlGzDI2zZQSeUnBqdz7JhgDyRhgi+J/X/DTAGkUk6lyg== X-Received: by 2002:a6b:630b:: with SMTP id p11mr7841685iog.168.1555805639166; Sat, 20 Apr 2019 17:13:59 -0700 (PDT) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id n17sm4398387itn.31.2019.04.20.17.13.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Apr 2019 17:13:58 -0700 (PDT) Received: by mail-it1-f174.google.com with SMTP id s3so13254585itk.1; Sat, 20 Apr 2019 17:13:58 -0700 (PDT) X-Received: by 2002:a05:660c:10:: with SMTP id q16mr8598458itj.149.1555805638606; Sat, 20 Apr 2019 17:13:58 -0700 (PDT) MIME-Version: 1.0 References: <201904201543.x3KFhSAl037969@repo.freebsd.org> <3dc61795-3802-513e-93ff-3d6493eabe36@FreeBSD.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 20 Apr 2019 17:13:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto To: John Baldwin Cc: Enji Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 9A0DE81452 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.966,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 00:21:07 -0000 On Sat, Apr 20, 2019 at 9:54 AM John Baldwin wrote: > To be clear, I prefer the _new_ indentation. I kept having to go back and > manually > use tabify in emacs to work with the current scripts, so once my pending > stuff is > drained I will appreciate having it converted. > +1 as someone else who has interacted with this file. Have to change vim tab settings every time. Cheers, Conrad From owner-svn-src-head@freebsd.org Sun Apr 21 01:58:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6F4157D107; Sun, 21 Apr 2019 01:58:43 +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 4100C854EB; Sun, 21 Apr 2019 01:58: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 1AEA51EA0B; Sun, 21 Apr 2019 01:58: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 x3L1wgYn067713; Sun, 21 Apr 2019 01:58:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3L1wgqH067712; Sun, 21 Apr 2019 01:58:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904210158.x3L1wgqH067712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 21 Apr 2019 01:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346469 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 346469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4100C854EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 01:58:43 -0000 Author: kevans Date: Sun Apr 21 01:58:42 2019 New Revision: 346469 URL: https://svnweb.freebsd.org/changeset/base/346469 Log: dtc(1): Pull in fix for segfault-upon-error condition Specifically, parse errors within a node would lead to a segfault due to an unconditional dereference after emitting the error. Obtained from: https://github.com/davidchisnall/dtc/commit/e5ecf9319fd3f MFC after: 3 days Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Sun Apr 21 01:33:13 2019 (r346468) +++ head/usr.bin/dtc/fdt.cc Sun Apr 21 01:58:42 2019 (r346469) @@ -1622,7 +1622,10 @@ device_tree::parse_file(text_input_buffer &input, } input.next_token(); n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); - n->name_is_path_reference = name_is_path_reference; + if (n) + { + n->name_is_path_reference = name_is_path_reference; + } } else { From owner-svn-src-head@freebsd.org Sun Apr 21 02:36:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CC85157DD6B; Sun, 21 Apr 2019 02:36:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B922863F7; Sun, 21 Apr 2019 02:36:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02F501F0B8; Sun, 21 Apr 2019 02:36:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3L2a4Es088652; Sun, 21 Apr 2019 02:36:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3L2a13V088637; Sun, 21 Apr 2019 02:36:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201904210236.x3L2a13V088637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 21 Apr 2019 02:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346470 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416 X-SVN-Commit-Revision: 346470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B922863F7 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 02:36:05 -0000 Author: adrian Date: Sun Apr 21 02:36:01 2019 New Revision: 346470 URL: https://svnweb.freebsd.org/changeset/base/346470 Log: [ath] [ath_hal] [ath_hal_9300] Extend the start PCU receive to handle resetting ANI. One of the fun issues with scanning has been how the existing ANI values were programmed into the hardware when channels were changed. If you're on a really crappy channel and ANI has made you deaf then when you scan you continue to be deaf on all channels. This code passes in a flag to startpcureceive which in AR5416 and later is also used to enable ANI. This allows it to know if it's a normal operation or a scan operation. This fixes my situation at home where a temporary spot of a device going deaf due to interference starts scanning and .. can't hear anything until I restart. Now, this isn't the full fix - ideally: (a) all the ANI config and per-channel information would be migrated to the shared HAL stuff and enabled for all of the NICs; (b) when a station reassociates and some other error conditions (like missed beacons, NF calibration failures, etc) a knob to reset ANI parameters would likely help recovery. But hey, I'm committing bits of code again! woo! Tested: * AR9344 (2G), STA operation Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Apr 21 02:36:01 2019 (r346470) @@ -355,7 +355,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah) ah->ah_setRxDP = ar9300_set_rx_dp; ah->ah_enableReceive = ar9300_enable_receive; ah->ah_stopDmaReceive = ar9300_stop_dma_receive_freebsd; - ah->ah_startPcuReceive = ar9300_start_pcu_receive_freebsd; + ah->ah_startPcuReceive = ar9300_start_pcu_receive; ah->ah_stopPcuReceive = ar9300_stop_pcu_receive; ah->ah_setMulticastFilter = ar9300_set_multicast_filter; ah->ah_setMulticastFilterIndex = ar9300SetMulticastFilterIndex; @@ -678,14 +678,6 @@ ar9300_reset_cal_valid_freebsd(struct ath_hal *ah, return (is_cal_done); } - -void -ar9300_start_pcu_receive_freebsd(struct ath_hal *ah) -{ - - /* is_scanning flag == NULL */ - ar9300_start_pcu_receive(ah, AH_FALSE); -} /* * FreeBSD will just pass in the descriptor value as 'pa'. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Sun Apr 21 02:36:01 2019 (r346470) @@ -691,7 +691,7 @@ ar9300_Stub_StopDmaReceive(struct ath_hal *ah) } void -ar9300_Stub_StartPcuReceive(struct ath_hal *ah) +ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { ath_hal_printf(ah, "%s: called\n", __func__); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Sun Apr 21 02:36:01 2019 (r346470) @@ -112,7 +112,7 @@ extern void ar9300_Stub_SetRxDP(struct ath_hal *ah, ui HAL_RX_QUEUE); extern void ar9300_Stub_EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar9300_Stub_StopDmaReceive(struct ath_hal *ah); -extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah); +extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar9300_Stub_StopPcuReceive(struct ath_hal *ah); extern void ar9300_Stub_SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1); Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ah.h Sun Apr 21 02:36:01 2019 (r346470) @@ -1314,7 +1314,7 @@ struct ath_hal { void __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp, HAL_RX_QUEUE); void __ahdecl(*ah_enableReceive)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_stopDmaReceive)(struct ath_hal*); - void __ahdecl(*ah_startPcuReceive)(struct ath_hal*); + void __ahdecl(*ah_startPcuReceive)(struct ath_hal*, HAL_BOOL); void __ahdecl(*ah_stopPcuReceive)(struct ath_hal*); void __ahdecl(*ah_setMulticastFilter)(struct ath_hal*, uint32_t filter0, uint32_t filter1); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Sun Apr 21 02:36:01 2019 (r346470) @@ -195,7 +195,7 @@ extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5210EnableReceive(struct ath_hal *); extern HAL_BOOL ar5210StopDmaReceive(struct ath_hal *); -extern void ar5210StartPcuReceive(struct ath_hal *); +extern void ar5210StartPcuReceive(struct ath_hal *, HAL_BOOL); extern void ar5210StopPcuReceive(struct ath_hal *); extern void ar5210SetMulticastFilter(struct ath_hal *, uint32_t filter0, uint32_t filter1); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Sun Apr 21 02:36:01 2019 (r346470) @@ -86,7 +86,7 @@ ar5210StopDmaReceive(struct ath_hal *ah) * Start Transmit at the PCU engine (unpause receive) */ void -ar5210StartPcuReceive(struct ath_hal *ah) +ar5210StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { ar5210UpdateDiagReg(ah, OS_REG_READ(ah, AR_DIAG_SW) & ~(AR_DIAG_SW_DIS_RX)); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Sun Apr 21 02:36:01 2019 (r346470) @@ -218,7 +218,7 @@ extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5211EnableReceive(struct ath_hal *); extern HAL_BOOL ar5211StopDmaReceive(struct ath_hal *); -extern void ar5211StartPcuReceive(struct ath_hal *); +extern void ar5211StartPcuReceive(struct ath_hal *, HAL_BOOL); extern void ar5211StopPcuReceive(struct ath_hal *); extern void ar5211SetMulticastFilter(struct ath_hal *, uint32_t filter0, uint32_t filter1); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Sun Apr 21 02:36:01 2019 (r346470) @@ -87,7 +87,7 @@ ar5211StopDmaReceive(struct ath_hal *ah) * Start Transmit at the PCU engine (unpause receive) */ void -ar5211StartPcuReceive(struct ath_hal *ah) +ar5211StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { OS_REG_WRITE(ah, AR_DIAG_SW, OS_REG_READ(ah, AR_DIAG_SW) & ~(AR_DIAG_SW_DIS_RX)); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Sun Apr 21 02:36:01 2019 (r346470) @@ -539,7 +539,7 @@ extern uint32_t ar5212GetRxDP(struct ath_hal *ath, HAL extern void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5212EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar5212StopDmaReceive(struct ath_hal *ah); -extern void ar5212StartPcuReceive(struct ath_hal *ah); +extern void ar5212StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar5212StopPcuReceive(struct ath_hal *ah); extern void ar5212SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sun Apr 21 02:36:01 2019 (r346470) @@ -87,7 +87,7 @@ ar5212StopDmaReceive(struct ath_hal *ah) * Start Transmit at the PCU engine (unpause receive) */ void -ar5212StartPcuReceive(struct ath_hal *ah) +ar5212StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { struct ath_hal_private *ahp = AH_PRIVATE(ah); @@ -95,8 +95,8 @@ ar5212StartPcuReceive(struct ath_hal *ah) OS_REG_WRITE(ah, AR_DIAG_SW, OS_REG_READ(ah, AR_DIAG_SW) &~ AR_DIAG_RX_DIS); ar5212EnableMibCounters(ah); - /* NB: restore current settings */ - ar5212AniReset(ah, ahp->ah_curchan, ahp->ah_opmode, AH_TRUE); + /* NB: restore current settings if we're not scanning */ + ar5212AniReset(ah, ahp->ah_curchan, ahp->ah_opmode, !is_scanning); } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 21 02:36:01 2019 (r346470) @@ -289,7 +289,7 @@ extern HAL_BOOL ar5416SetKeyCacheEntry(struct ath_hal extern uint32_t ar5416GetRxFilter(struct ath_hal *ah); extern void ar5416SetRxFilter(struct ath_hal *ah, uint32_t bits); extern HAL_BOOL ar5416StopDmaReceive(struct ath_hal *ah); -extern void ar5416StartPcuReceive(struct ath_hal *ah); +extern void ar5416StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar5416StopPcuReceive(struct ath_hal *ah); extern HAL_BOOL ar5416SetupRxDesc(struct ath_hal *, struct ath_desc *, uint32_t size, u_int flags); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Sun Apr 21 02:36:01 2019 (r346470) @@ -106,14 +106,14 @@ ar5416StopDmaReceive(struct ath_hal *ah) * Start receive at the PCU engine */ void -ar5416StartPcuReceive(struct ath_hal *ah) +ar5416StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { struct ath_hal_private *ahp = AH_PRIVATE(ah); HALDEBUG(ah, HAL_DEBUG_RX, "%s: Start PCU Receive \n", __func__); ar5212EnableMibCounters(ah); - /* NB: restore current settings */ - ar5416AniReset(ah, ahp->ah_curchan, ahp->ah_opmode, AH_TRUE); + /* NB: restore current settings if we're not scanning */ + ar5416AniReset(ah, ahp->ah_curchan, ahp->ah_opmode, ! is_scanning); /* * NB: must do after enabling phy errors to avoid rx * frames w/ corrupted descriptor status. Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/if_ath_rx.c Sun Apr 21 02:36:01 2019 (r346470) @@ -1228,7 +1228,7 @@ rx_proc_next: ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ - ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ + ath_hal_startpcurecv(ah, (!! sc->sc_scanning)); /* re-enable PCU/DMA engine */ #endif ath_hal_intrset(ah, sc->sc_imask); @@ -1444,7 +1444,7 @@ ath_legacy_startrecv(struct ath_softc *sc) ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ - ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ + ath_hal_startpcurecv(ah, (!! sc->sc_scanning)); /* re-enable PCU/DMA engine */ ATH_RX_UNLOCK(sc); return 0; Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/if_ath_rx_edma.c Sun Apr 21 02:36:01 2019 (r346470) @@ -282,7 +282,7 @@ ath_edma_startrecv(struct ath_softc *sc) sc->sc_rxedma[HAL_RX_QUEUE_LP].m_fifolen); ath_mode_init(sc); - ath_hal_startpcurecv(ah); + ath_hal_startpcurecv(ah, (!! sc->sc_scanning)); /* * We're now doing RX DMA! Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Apr 21 01:58:42 2019 (r346469) +++ head/sys/dev/ath/if_athvar.h Sun Apr 21 02:36:01 2019 (r346470) @@ -1155,8 +1155,8 @@ void ath_intr(void *); ((*(_ah)->ah_stopTxDma)((_ah), (_qnum))) #define ath_hal_stoppcurecv(_ah) \ ((*(_ah)->ah_stopPcuReceive)((_ah))) -#define ath_hal_startpcurecv(_ah) \ - ((*(_ah)->ah_startPcuReceive)((_ah))) +#define ath_hal_startpcurecv(_ah, _is_scanning) \ + ((*(_ah)->ah_startPcuReceive)((_ah), (_is_scanning))) #define ath_hal_stopdmarecv(_ah) \ ((*(_ah)->ah_stopDmaReceive)((_ah))) #define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize) \ From owner-svn-src-head@freebsd.org Sun Apr 21 07:42:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16DC91585040 for ; Sun, 21 Apr 2019 07:42:01 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-22.consmr.mail.ne1.yahoo.com (sonic309-22.consmr.mail.ne1.yahoo.com [66.163.184.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 249F98F363 for ; Sun, 21 Apr 2019 07:42:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: aG4NqCQVM1mCbliH0hqBEV48PkFO1zsLx2Hyk3MHkwGpl9UL6zoWk4bP9.816nU dEvTTo9sdU7vuB93xYavIYoyxjhkWr.a.kxXEkrNfP39ILBwkqEz3qe4bbUJnfL6fc.PQjNYxNmh pdRyVihtbPOTKCPZIoUcdXr1OZQD4kzjZdwxHBzZS7iGBHu1WWvBQX8E8nGD3GljnqhfOc3MGzES hVGIcSczO7KHPfXbKuYcB.3VS45qXLzCTudh0FhmHv_lEO1j76nMK0IIGtzTO7UygerzEDURtsex Zsnwqk2IBeGGneqkzvx2yxNJ1peTJVP0sSUGyEAoNnRy2tiyJzs8s_918ye4_JtwV5lglgSF31Qt EpeG7bnnJZ1A9JpAPdfvm8Vypd_j._Oatp03qK.VcHGu9qlsHWUKRiKklWKsceJnovlXI3cLee3J vj9LKz524Sv26VG1cJh1WXWPAjnLEEtSMWTNBgA6z1s6wSdwxzNalRr2vdR53MDCcQuBzCMRKVPH CGJsqJq4l7QZSf7oPRuCJ6_jP26DWQ8X5utGyjecAQabiHG2GidLv8jXuJjgvmbMM44_bmyNUkfW ijneTmfqkZWGhOZD1U_p5DZOkrlWMylr6xD57_mbv8dnA_E0c9ocRFkohQg3OL1jyXuIj4q8cmkW WZXbgki6fffFaF54FXCw0Anl3iShS7_b5t7a9KMqbIEG4mmXa76ZiIlEvXhey_MJql_vAbrSv8zh 4u_Iaaoxw1Sy_YvECAvgltYlJbscgfQpchRtFWc80Gjd9BvYIL1plp9mw0bIM.zp.t3XbHl4X2hO X2P0hK6Nh0u99EZNFefYLVRYaHQaL2wIk9I94asKUmSX2uPiU.zCITNq1HTVWXMzkRXgCu12SZ7L 3biR4CF.zDX8JOwrvlVIqs15QtOPqEUNsXyXdGsePpSGw8gZFDFs_iUHucU2Bj8o7edDEeHtGtUq V94xuQfCj51Zd1kt6nC8_2PdBE41IH7PkkLg0tPTKziRoyjZ_u8tNcimy5oZeNa1L8z.UJEZzHSZ __tOQVWRQNaf2960hedcx1qDNkO75fWP9DEdRYxb2bWyq8Mvph.cBsZlx5OriYtYoBHk0p2obeO0 6MOZR4aFCHIrKtu9LmtkUqWEAK8N8kiAi Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Sun, 21 Apr 2019 07:41:53 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp412.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 68c8dbc27deda934f3b6dff44cc40385; Sun, 21 Apr 2019 07:41:52 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf Message-Id: <575E6A06-BEA9-4559-A523-826B06C10D52@yahoo.com> Date: Sun, 21 Apr 2019 00:41:50 -0700 Cc: Sean Bruno , ian@freebsd.org To: svn-src-head@freebsd.org, Alan Somers X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 249F98F363 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.25 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-0.11)[-0.106,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.72)[0.717,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.25)[ip: (3.77), ipnet: 66.163.184.0/21(1.43), asn: 36646(1.14), country: US(-0.06)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.90)[0.897,0]; RCVD_IN_DNSWL_NONE(0.00)[148.184.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 07:42:01 -0000 Using if_igb.ko and if_em.ko as examples: -r324406 (2017-Oct-7) used relative symbolic links (via a different = technique) [sbruno] -r324500 (3 days later) used hard links (ian, with sbruno submitting) -r346441 (2019-Apr-20) is back to relative symbolic links. (asomers) Sbruno or Ian might want to comment on why relative links only lasted 3 days last time they were tried. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sun Apr 21 10:33:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0A791588CAE; Sun, 21 Apr 2019 10:33:10 +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 762D46CE92; Sun, 21 Apr 2019 10:33:10 +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 4BCEC24218; Sun, 21 Apr 2019 10:33:10 +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 x3LAXAjL040281; Sun, 21 Apr 2019 10:33:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LAX9vF040274; Sun, 21 Apr 2019 10:33:09 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904211033.x3LAX9vF040274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 21 Apr 2019 10:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346486 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 762D46CE92 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 10:33:11 -0000 Author: bde Date: Sun Apr 21 10:33:09 2019 New Revision: 346486 URL: https://svnweb.freebsd.org/changeset/base/346486 Log: Fix missing restoring of the mouse cursor position, the border color and the blank state after a screen switch. Modified: head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/main.c Sun Apr 21 10:33:09 2019 (r346486) @@ -436,6 +436,9 @@ VGLCheckSwitch() VGLDisplay->Xsize = VGLModeInfo.vi_width; VGLDisplay->Ysize = VGLModeInfo.vi_height; VGLSetVScreenSize(VGLDisplay, VGLDisplay->VXsize, VGLDisplay->VYsize); + VGLRestoreBlank(); + VGLRestoreBorder(); + VGLMouseRestore(); VGLPanScreen(VGLDisplay, VGLDisplay->Xorigin, VGLDisplay->Yorigin); switch (VGLDisplay->Type) { case VIDBUF4S: Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/mouse.c Sun Apr 21 10:33:09 2019 (r346486) @@ -272,6 +272,22 @@ VGLMouseInit(int mode) return 0; } +void +VGLMouseRestore(void) +{ + struct mouse_info mouseinfo; + + INTOFF(); + mouseinfo.operation = MOUSE_GETINFO; + if (ioctl(0, CONS_MOUSECTL, &mouseinfo) == 0) { + mouseinfo.operation = MOUSE_MOVEABS; + mouseinfo.u.data.x = VGLMouseXpos; + mouseinfo.u.data.y = VGLMouseYpos; + ioctl(0, CONS_MOUSECTL, &mouseinfo); + } + INTON(); +} + int VGLMouseStatus(int *x, int *y, char *buttons) { Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/simple.c Sun Apr 21 10:33:09 2019 (r346486) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" +static int VGLBlank; +static byte VGLBorderColor; static byte VGLSavePaletteRed[256]; static byte VGLSavePaletteGreen[256]; static byte VGLSavePaletteBlue[256]; @@ -637,6 +639,12 @@ VGLSetPaletteIndex(byte color, byte red, byte green, b } void +VGLRestoreBorder(void) +{ + VGLSetBorder(VGLBorderColor); +} + +void VGLSetBorder(byte color) { if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0)) @@ -646,11 +654,18 @@ VGLSetBorder(byte color) outb(0x3C0,0x11); outb(0x3C0, color); inb(0x3DA); outb(0x3C0, 0x20); + VGLBorderColor = color; if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT) ioctl(0, KDDISABIO, 0); } void +VGLRestoreBlank(void) +{ + VGLBlankDisplay(VGLBlank); +} + +void VGLBlankDisplay(int blank) { byte val; @@ -660,6 +675,7 @@ VGLBlankDisplay(int blank) VGLCheckSwitch(); outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01); outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF))); + VGLBlank = blank; if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT) ioctl(0, KDDISABIO, 0); } Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Sun Apr 21 09:13:56 2019 (r346485) +++ head/lib/libvgl/vgl.h Sun Apr 21 10:33:09 2019 (r346486) @@ -130,6 +130,7 @@ void VGLMouseAction(int dummy); void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); +void VGLMouseRestore(void); int VGLMouseStatus(int *x, int *y, char *buttons); int VGLMouseFreeze(int x, int y, int width, int hight, u_long color); void VGLMouseUnFreeze(void); @@ -142,6 +143,8 @@ void VGLFilledBox(VGLBitmap *object, int x1, int y1, i void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); void VGLClear(VGLBitmap *object, u_long color); +void VGLRestoreBlank(void); +void VGLRestoreBorder(void); void VGLRestorePalette(void); void VGLSavePalette(void); void VGLSetPalette(byte *red, byte *green, byte *blue); From owner-svn-src-head@freebsd.org Sun Apr 21 16:17:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 014D91590CDE; Sun, 21 Apr 2019 16:17:37 +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 A9FE3770E2; Sun, 21 Apr 2019 16:17:36 +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 8535C27BF7; Sun, 21 Apr 2019 16:17:36 +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 x3LGHanZ019370; Sun, 21 Apr 2019 16:17:36 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LGHZ4i019365; Sun, 21 Apr 2019 16:17:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904211617.x3LGHZ4i019365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 21 Apr 2019 16:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346488 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9FE3770E2 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 16:17:37 -0000 Author: bde Date: Sun Apr 21 16:17:35 2019 New Revision: 346488 URL: https://svnweb.freebsd.org/changeset/base/346488 Log: Use a shadow buffer and never read from the frame buffer. Remove large slow code for reading from the frame buffer. Reading from the frame buffer is usually much slower than writing to the frame buffer. Typically 10 to 100 times slower. It old modes, it takes many more PIOs, and in newer modes with no PIOs writes are often write-combined while reads remain uncached. Reading from the frame buffer is not very common, so this change doesn't give speedups of 10 to 100 times. My main test case is a floodfill() function that reads about as many pixels as it writes. The speedups are typically a factor of 2 to 4. Duplicating writes to the shadow buffer is slower when no reads from the frame buffer are done, but reads are often done for the pixels under the mouse cursor, and doing these reads from the shadow buffer more than compensates for the overhead of writing the shadow buffer in at least the slower modes. Management of the mouse cursor also becomes simpler. The shadow buffer doesn't take any extra memory, except twice as much in old 4-plane modes. A buffer for holding a copy of the frame buffer was allocated up front for use in the screen switching signal handler. This wasn't changed when the handler was made async-signal safe. Use the same buffer the shadow (but make it twice as large in the 4-plane modes), and remove large special code for writing it as well as large special code for reading ut. It used to have a rawer format in the 4-plane modes. Now it has a bitmap format which takes twice as much memory but can be written almost as fast without special code. VIDBUFs that are not the whole frame buffer were never supported, and the change depends on this. Check for invalid VIDBUFs in some places and do nothing. The removed code did something not so good. Modified: head/lib/libvgl/bitmap.c head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Sun Apr 21 14:45:18 2019 (r346487) +++ head/lib/libvgl/bitmap.c Sun Apr 21 16:17:35 2019 (r346488) @@ -163,108 +163,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi } } -static void -ReadVerticalLine(VGLBitmap *src, int x, int y, int width, byte *line) -{ - int i, bit, pos, count, planepos, start_offset, end_offset, offset; - int width2, len; - byte *address; - byte *VGLPlane[4]; - - switch (src->Type) { - case VIDBUF4S: - start_offset = (x & 0x07); - end_offset = (x + width) & 0x07; - count = (width + start_offset) / 8; - if (end_offset) - count++; - VGLPlane[0] = VGLBuf; - VGLPlane[1] = VGLPlane[0] + count; - VGLPlane[2] = VGLPlane[1] + count; - VGLPlane[3] = VGLPlane[2] + count; - for (i=0; i<4; i++) { - outb(0x3ce, 0x04); - outb(0x3cf, i); - pos = VGLAdpInfo.va_line_width*y + x/8; - for (width2 = count; width2 > 0; ) { - offset = VGLSetSegment(pos); - len = min(VGLAdpInfo.va_window_size - offset, width2); - bcopy(src->Bitmap + offset, &VGLPlane[i][count - width2], len); - pos += len; - width2 -= len; - } - } - goto read_planar; - case VIDBUF4: - address = src->Bitmap + VGLAdpInfo.va_line_width * y + x/8; - start_offset = (x & 0x07); - end_offset = (x + width) & 0x07; - count = (width + start_offset) / 8; - if (end_offset) - count++; - VGLPlane[0] = VGLBuf; - VGLPlane[1] = VGLPlane[0] + count; - VGLPlane[2] = VGLPlane[1] + count; - VGLPlane[3] = VGLPlane[2] + count; - for (i=0; i<4; i++) { - outb(0x3ce, 0x04); - outb(0x3cf, i); - bcopy(address, &VGLPlane[i][0], count); - } -read_planar: - pos = 0; - planepos = 0; - bit = 7 - start_offset; - while (pos < width) { - for (; bit >= 0 && pos < width; bit--, pos++) { - line[pos] = (VGLPlane[0][planepos] & (1<Bitmap + VGLAdpInfo.va_line_width * y + x/4; - for (i=0; i<4; i++) { - outb(0x3ce, 0x04); - outb(0x3cf, (x + i)%4); - for (planepos=0, pos=i; posPixelBytes; - pos = (src->VXsize * y + x) * src->PixelBytes; - while (width > 0) { - offset = VGLSetSegment(pos); - i = min(VGLAdpInfo.va_window_size - offset, width); - bcopy(src->Bitmap + offset, line, i); - line += i; - pos += i; - width -= i; - } - break; - case MEMBUF: - case VIDBUF8: - case VIDBUF16: - case VIDBUF24: - case VIDBUF32: - address = src->Bitmap + (src->VXsize * y + x) * src->PixelBytes; - bcopy(address, line, width * src->PixelBytes); - break; - default: - ; - } -} - int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight) @@ -304,38 +202,11 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, yextra = hight - 1; ystep = -1; } - if (src->Type == MEMBUF) { - for (srcline = srcy + yextra, dstline = dsty + yextra; srcline != yend; - srcline += ystep, dstline += ystep) { - WriteVerticalLine(dst, dstx, dstline, width, - src->Bitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes); - } + for (srcline = srcy + yextra, dstline = dsty + yextra; srcline != yend; + srcline += ystep, dstline += ystep) { + WriteVerticalLine(dst, dstx, dstline, width, + src->Bitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes); } - else if (dst->Type == MEMBUF) { - for (srcline=srcy, dstline=dsty; srclineBitmap+(dstline*dst->VXsize+dstx)*src->PixelBytes); - } - } - else { - byte buffer[2048]; /* XXX */ - byte *p; - - if (width * src->PixelBytes > sizeof(buffer)) { - p = malloc(width * src->PixelBytes); - if (p == NULL) - return 1; - } else { - p = buffer; - } - for (srcline = srcy + yextra, dstline = dsty + yextra; srcline != yend; - srcline += ystep, dstline += ystep) { - ReadVerticalLine(src, srcx, srcline, width, p); - WriteVerticalLine(dst, dstx, dstline, width, p); - } - if (width * src->PixelBytes > sizeof(buffer)) - free(p); - } return 0; } @@ -345,12 +216,20 @@ VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, { int error; + if (src == VGLDisplay) + src = &VGLVDisplay; if (src->Type != MEMBUF) - VGLMouseFreeze(srcx, srcy, width, hight, 0); - if (dst->Type != MEMBUF) + return -1; /* invalid */ + if (dst == VGLDisplay) { VGLMouseFreeze(dstx, dsty, width, hight, 0); + __VGLBitmapCopy(src, srcx, srcy, &VGLVDisplay, dstx, dsty, width, hight); + src = &VGLVDisplay; + srcx = dstx; + srcy = dsty; + } else if (dst->Type != MEMBUF) + return -1; /* invalid */ error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, hight); - if (src->Type != MEMBUF || dst->Type != MEMBUF) + if (dst == VGLDisplay) VGLMouseUnFreeze(); return error; } Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Sun Apr 21 14:45:18 2019 (r346487) +++ head/lib/libvgl/main.c Sun Apr 21 16:17:35 2019 (r346488) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #define max(x, y) (((x) > (y)) ? (x) : (y)) VGLBitmap *VGLDisplay; +VGLBitmap VGLVDisplay; video_info_t VGLModeInfo; video_adapter_info_t VGLAdpInfo; byte *VGLBuf; @@ -334,6 +335,13 @@ VGLInit(int mode) } VGLDisplay->Bitmap = VGLMem; + VGLVDisplay = *VGLDisplay; + VGLVDisplay.Type = MEMBUF; + if (VGLModeInfo.vi_depth < 8) + VGLVDisplay.Bitmap = malloc(2 * VGLBufSize); + else + VGLVDisplay.Bitmap = VGLBuf; + VGLSavePalette(); #ifdef LIBVGL_DEBUG @@ -365,10 +373,6 @@ VGLCheckSwitch() exit(0); } while (VGLSwitchPending) { - unsigned int offset; - unsigned int len; - int i; - VGLSwitchPending = 0; if (VGLOnDisplay) { if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) @@ -440,98 +444,12 @@ VGLCheckSwitch() VGLRestoreBorder(); VGLMouseRestore(); VGLPanScreen(VGLDisplay, VGLDisplay->Xorigin, VGLDisplay->Yorigin); - switch (VGLDisplay->Type) { - case VIDBUF4S: - outb(0x3c6, 0xff); - outb(0x3ce, 0x01); outb(0x3cf, 0x00); /* set/reset enable */ - outb(0x3ce, 0x08); outb(0x3cf, 0xff); /* bit mask */ - for (offset = 0; offset < VGLBufSize/VGLModeInfo.vi_planes; - offset += len) { - VGLSetSegment(offset); - len = min(VGLBufSize/VGLModeInfo.vi_planes - offset, - VGLAdpInfo.va_window_size); - for (i = 0; i < VGLModeInfo.vi_planes; i++) { - outb(0x3c4, 0x02); - outb(0x3c5, 0x01<VXsize, VGLDisplay->VYsize); VGLRestorePalette(); ioctl(0, VT_RELDISP, VT_ACKACQ); } else { - switch (VGLDisplay->Type) { - case VIDBUF4S: - for (offset = 0; offset < VGLBufSize/VGLModeInfo.vi_planes; - offset += len) { - VGLSetSegment(offset); - len = min(VGLBufSize/VGLModeInfo.vi_planes - offset, - VGLAdpInfo.va_window_size); - for (i = 0; i < VGLModeInfo.vi_planes; i++) { - outb(0x3ce, 0x04); - outb(0x3cf, i); - bcopy(VGLMem, &VGLBuf[i*VGLBufSize/VGLModeInfo.vi_planes + offset], - len); - } - } - break; - case VIDBUF4: - case VIDBUF8X: - /* - * NOTE: the saved buffer is NOT in the MEMBUF format which - * the ordinary memory bitmap object is stored in. XXX - */ - for (i = 0; i < VGLModeInfo.vi_planes; i++) { - outb(0x3ce, 0x04); - outb(0x3cf, i); - bcopy(VGLMem, &VGLBuf[i*VGLAdpInfo.va_window_size], - VGLAdpInfo.va_window_size); - } - break; - case VIDBUF8: - case VIDBUF8S: - case VIDBUF16: - case VIDBUF16S: - case VIDBUF24: - case VIDBUF24S: - case VIDBUF32: - case VIDBUF32S: - for (offset = 0; offset < VGLBufSize; offset += len) { - VGLSetSegment(offset); - len = min(VGLBufSize - offset, VGLAdpInfo.va_window_size); - bcopy(VGLMem, &VGLBuf[offset], len); - } - break; - } VGLMem = MAP_FAILED; munmap(VGLDisplay->Bitmap, VGLAdpInfo.va_window_size); ioctl(0, VGLOldMode, 0); Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Sun Apr 21 14:45:18 2019 (r346487) +++ head/lib/libvgl/mouse.c Sun Apr 21 16:17:35 2019 (r346488) @@ -82,9 +82,6 @@ static VGLBitmap VGLMouseStdAndMask = static VGLBitmap VGLMouseStdOrMask = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; -static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4]; -static VGLBitmap VGLMouseSave = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, map); static int VGLMouseVisible = 0; static int VGLMouseShown = 0; static int VGLMouseXpos = 0; @@ -117,10 +114,9 @@ VGLMousePointerShow() gdcidx = inb(0x3ce); gdcval = inb(0x3cf); } - __VGLBitmapCopy(VGLDisplay, VGLMouseXpos, VGLMouseYpos, - &VGLMouseSave, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - bcopy(VGLMouseSave.Bitmap, buffer.Bitmap, - MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*VGLDisplay->PixelBytes); + buffer.PixelBytes = VGLDisplay->PixelBytes; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + &buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); for (pos = 0; pos < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; pos++) for (i = 0; i < VGLDisplay->PixelBytes; i++) { pos1 = pos * VGLDisplay->PixelBytes + i; @@ -154,8 +150,8 @@ VGLMousePointerHide() gdcidx = inb(0x3ce); gdcval = inb(0x3cf); } - __VGLBitmapCopy(&VGLMouseSave, 0, 0, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { outb(0x3c4, crtcidx); outb(0x3c5, crtcval); @@ -302,8 +298,6 @@ VGLMouseStatus(int *x, int *y, char *buttons) int VGLMouseFreeze(int x, int y, int width, int hight, u_long color) { - int i, xstride, ystride; - INTOFF(); if (width > 1 || hight > 1 || (color & 0xc0000000) == 0) { /* bitmap */ if (VGLMouseShown == 1) { @@ -327,20 +321,7 @@ VGLMouseFreeze(int x, int y, int width, int hight, u_l if (VGLMouseShown && x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE) { - xstride = VGLDisplay->PixelBytes; - ystride = MOUSE_IMG_SIZE * xstride; - if (color & 0x40000000) { /* Get */ - color = 0; - for (i = xstride - 1; i >= 0; i--) - color = (color << 8) | - VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+ - (x-VGLMouseXpos)*xstride+i]; - return 0x40000000 | (color & 0xffffff); - } else { /* Set */ - color &= 0xffffff; /* discard flag and other garbage */ - for (i = 0; i < xstride; i++, color >>= 8) - VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+ - (x-VGLMouseXpos)*xstride+i] = color; + if (color & 0x80000000) { /* Set */ if (VGLMouseAndMask->Bitmap [(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) { return 1; Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Sun Apr 21 14:45:18 2019 (r346487) +++ head/lib/libvgl/simple.c Sun Apr 21 16:17:35 2019 (r346488) @@ -55,6 +55,8 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { + if (object == VGLDisplay) + VGLSetXY(&VGLVDisplay, x, y, color); if (object->Type == MEMBUF || !VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) { offset = (y * object->VXsize + x) * object->PixelBytes; @@ -113,78 +115,37 @@ static u_long __VGLGetXY(VGLBitmap *object, int x, int y) { int offset; - int i; u_long color; - byte mask; offset = (y * object->VXsize + x) * object->PixelBytes; - switch (object->Type) { - case VIDBUF8S: - case VIDBUF16S: - case VIDBUF24S: - case VIDBUF32S: - offset = VGLSetSegment(offset); - /* FALLTHROUGH */ - case MEMBUF: - case VIDBUF8: - case VIDBUF16: - case VIDBUF24: - case VIDBUF32: - switch (object->PixelBytes) { - case 1: - memcpy(&color, &object->Bitmap[offset], 1); - return le32toh(color) & 0xff; - case 2: - memcpy(&color, &object->Bitmap[offset], 2); - return le32toh(color) & 0xffff; - case 3: - memcpy(&color, &object->Bitmap[offset], 3); - return le32toh(color) & 0xffffff; - case 4: - memcpy(&color, &object->Bitmap[offset], 4); - return le32toh(color); - } - break; - case VIDBUF8X: - outb(0x3ce, 0x04); outb(0x3cf, x & 0x3); - return object->Bitmap[(unsigned)(VGLAdpInfo.va_line_width*y)+(x/4)]; - case VIDBUF4S: - offset = VGLSetSegment(y*VGLAdpInfo.va_line_width + x/8); - goto get_planar; - case VIDBUF4: - offset = y*VGLAdpInfo.va_line_width + x/8; -get_planar: - color = 0; - mask = 0x80 >> (x%8); - for (i = 0; i < VGLModeInfo.vi_planes; i++) { - outb(0x3ce, 0x04); outb(0x3cf, i); - color |= (((volatile VGLBitmap *)object)->Bitmap[offset] & mask) ? - (1 << i) : 0; - } - return color; + switch (object->PixelBytes) { + case 1: + memcpy(&color, &object->Bitmap[offset], 1); + return le32toh(color) & 0xff; + case 2: + memcpy(&color, &object->Bitmap[offset], 2); + return le32toh(color) & 0xffff; + case 3: + memcpy(&color, &object->Bitmap[offset], 3); + return le32toh(color) & 0xffffff; + case 4: + memcpy(&color, &object->Bitmap[offset], 4); + return le32toh(color); } - return 0; /* XXX black? */ + return 0; /* invalid */ } u_long VGLGetXY(VGLBitmap *object, int x, int y) { - u_long color; - VGLCheckSwitch(); if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) return 0; - if (object->Type != MEMBUF) { - color = VGLMouseFreeze(x, y, 1, 1, 0x40000000); - if (color & 0x40000000) { - VGLMouseUnFreeze(); - return color & 0xffffff; - } - } - color = __VGLGetXY(object, x, y); + if (object == VGLDisplay) + object = &VGLVDisplay; if (object->Type != MEMBUF) - VGLMouseUnFreeze(); - return color; + return 0; /* invalid */ + return __VGLGetXY(object, x, y); } /* @@ -493,8 +454,11 @@ VGLClear(VGLBitmap *object, u_long color) int i; VGLCheckSwitch(); - if (object->Type != MEMBUF) + if (object == VGLDisplay) { VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); + VGLClear(&VGLVDisplay, color); + } else if (object->Type != MEMBUF) + return; /* invalid */ switch (object->Type) { case MEMBUF: case VIDBUF8: @@ -545,7 +509,7 @@ VGLClear(VGLBitmap *object, u_long color) outb(0x3ce, 0x05); outb(0x3cf, 0x00); break; } - if (object->Type != MEMBUF) + if (object == VGLDisplay) VGLMouseUnFreeze(); } Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Sun Apr 21 14:45:18 2019 (r346487) +++ head/lib/libvgl/vgl.h Sun Apr 21 16:17:35 2019 (r346488) @@ -100,6 +100,7 @@ typedef struct VGLObject { extern video_adapter_info_t VGLAdpInfo; extern video_info_t VGLModeInfo; extern VGLBitmap *VGLDisplay; +extern VGLBitmap VGLVDisplay; extern byte *VGLBuf; /* From owner-svn-src-head@freebsd.org Sun Apr 21 17:39:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD310159295A; Sun, 21 Apr 2019 17:39:02 +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 50B1C81672; Sun, 21 Apr 2019 17:39:02 +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 34D9BA28; Sun, 21 Apr 2019 17:39:02 +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 x3LHd1LK061748; Sun, 21 Apr 2019 17:39:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LHd1ce061747; Sun, 21 Apr 2019 17:39:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904211739.x3LHd1ce061747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Apr 2019 17:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346489 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 346489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50B1C81672 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 17:39:02 -0000 Author: ian Date: Sun Apr 21 17:39:01 2019 New Revision: 346489 URL: https://svnweb.freebsd.org/changeset/base/346489 Log: Move the reporting of spurious interrupts under bootverbose control, because occasional spurious interrupts are a normal thing on this hardware. Also, change the name of the cpu-local interrupt controller driver from local_intc to lintc, because the name gets built into interrupt names, which have to fit into a 19-byte field for stats reporting (so this allows 5 more bytes of the actual interrupt name to be displayed). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2836.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sun Apr 21 16:17:35 2019 (r346488) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sun Apr 21 17:39:01 2019 (r346489) @@ -230,7 +230,7 @@ bcm2835_intc_intr(void *arg) } arm_irq_memory_barrier(0); /* XXX */ } - if (num == 0) + if (num == 0 && bootverbose) device_printf(sc->sc_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Sun Apr 21 16:17:35 2019 (r346488) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Sun Apr 21 17:39:01 2019 (r346489) @@ -421,7 +421,7 @@ bcm_lintc_intr(void *arg) reg &= ~BCM_LINTC_PENDING_MASK; if (reg != 0) device_printf(sc->bls_dev, "Unknown interrupt(s) %x\n", reg); - else if (num == 0) + else if (num == 0 && bootverbose) device_printf(sc->bls_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); @@ -730,12 +730,12 @@ static device_method_t bcm_lintc_methods[] = { }; static driver_t bcm_lintc_driver = { - "local_intc", + "lintc", bcm_lintc_methods, sizeof(struct bcm_lintc_softc), }; static devclass_t bcm_lintc_devclass; -EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, +EARLY_DRIVER_MODULE(lintc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, 0, 0, BUS_PASS_INTERRUPT); From owner-svn-src-head@freebsd.org Sun Apr 21 18:27:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82BFC1580936; Sun, 21 Apr 2019 18:27:14 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13B7D832CB; Sun, 21 Apr 2019 18:27:14 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C515712C2; Sun, 21 Apr 2019 18:27:13 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3LIRDlJ088724; Sun, 21 Apr 2019 18:27:13 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LIRDQ7088723; Sun, 21 Apr 2019 18:27:13 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201904211827.x3LIRDQ7088723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 21 Apr 2019 18:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346490 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 346490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13B7D832CB 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 18:27:14 -0000 Author: bcr (doc committer) Date: Sun Apr 21 18:27:13 2019 New Revision: 346490 URL: https://svnweb.freebsd.org/changeset/base/346490 Log: Typo fix in ipfw.8: amd -> and There is an (obvious) typo in the following sentence: "Please note, that keep-state amd limit imply implicit check-state for ..." Replace the "amd" with "and", bump .Dd. PR: 237438 Submitted by: michael@galassi.us MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sun Apr 21 17:39:01 2019 (r346489) +++ head/sbin/ipfw/ipfw.8 Sun Apr 21 18:27:13 2019 (r346490) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2019 +.Dd April 21, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -250,7 +250,7 @@ rule, and are typically used to open the firewall on-d legitimate traffic only. Please note, that .Cm keep-state -amd +and .Cm limit imply implicit .Cm check-state From owner-svn-src-head@freebsd.org Sun Apr 21 19:07:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6329A1581A70; Sun, 21 Apr 2019 19:07:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C0B384890; Sun, 21 Apr 2019 19:07:04 +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 DB5881971; Sun, 21 Apr 2019 19:07:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3LJ739r010296; Sun, 21 Apr 2019 19:07:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LJ73vc010293; Sun, 21 Apr 2019 19:07:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904211907.x3LJ73vc010293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 21 Apr 2019 19:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346491 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 346491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C0B384890 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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 19:07:04 -0000 Author: mav Date: Sun Apr 21 19:07:03 2019 New Revision: 346491 URL: https://svnweb.freebsd.org/changeset/base/346491 Log: Polish SCSI sense data validity checks. According to specs and common sense, all sense data reported in descriptor format should be valid. But practice shows different, some devices return descriptors with invalid data, resulting in error messages looking worse. Decouple block/stream commands sense data and information field printing. Looking on present specs, there are much more cases when those fields are not related, and incomplete old code was not printing valid sense data and leaving empty lines for invalid. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sun Apr 21 18:27:13 2019 (r346490) +++ head/sys/cam/scsi/scsi_all.c Sun Apr 21 19:07:03 2019 (r346491) @@ -4061,6 +4061,10 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data struct scsi_sense_info *info_desc; info_desc = (struct scsi_sense_info *)desc; + + if ((info_desc->byte2 & SSD_INFO_VALID) == 0) + goto bailout; + *info = scsi_8btou64(info_desc->info); if (signed_info != NULL) *signed_info = *info; @@ -4081,6 +4085,9 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data fru_desc = (struct scsi_sense_fru *)desc; + if (fru_desc->fru == 0) + goto bailout; + *info = fru_desc->fru; if (signed_info != NULL) *signed_info = (int8_t)fru_desc->fru; @@ -4181,10 +4188,9 @@ scsi_get_sks(struct scsi_sense_data *sense_data, u_int if (desc == NULL) goto bailout; - /* - * No need to check the SKS valid bit for descriptor sense. - * If the descriptor is present, it is valid. - */ + if ((desc->sense_key_spec[0] & SSD_SKS_VALID) == 0) + goto bailout; + bcopy(desc->sense_key_spec, sks, sizeof(desc->sense_key_spec)); break; } @@ -4261,9 +4267,6 @@ scsi_get_block_info(struct scsi_sense_data *sense_data if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & SSD_ILI) == 0) - goto bailout; - *block_bits = sense->flags & SSD_ILI; break; } @@ -4317,9 +4320,6 @@ scsi_get_stream_info(struct scsi_sense_data *sense_dat if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK)) == 0) - goto bailout; - *stream_bits = sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK); break; } @@ -4361,8 +4361,6 @@ scsi_progress_sbuf(struct sbuf *sb, uint16_t progress) int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks) { - if ((sks[0] & SSD_SKS_VALID) == 0) - return (1); switch (sense_key) { case SSD_KEY_ILLEGAL_REQUEST: { @@ -4459,7 +4457,7 @@ scsi_fru_sbuf(struct sbuf *sb, uint64_t fru) } void -scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info) +scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits) { int need_comma; @@ -4467,6 +4465,7 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, /* * XXX KDM this needs more descriptive decoding. */ + sbuf_printf(sb, "Stream Command Sense Data: "); if (stream_bits & SSD_DESC_STREAM_FM) { sbuf_printf(sb, "Filemark"); need_comma = 1; @@ -4479,15 +4478,15 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, if (stream_bits & SSD_DESC_STREAM_ILI) sbuf_printf(sb, "%sILI", (need_comma) ? "," : ""); - - sbuf_printf(sb, ": Info: %#jx", (uintmax_t) info); } void -scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info) +scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits) { + + sbuf_printf(sb, "Block Command Sense Data: "); if (block_bits & SSD_DESC_BLOCK_ILI) - sbuf_printf(sb, "ILI: residue %#jx", (uintmax_t) info); + sbuf_printf(sb, "ILI"); } void @@ -4500,6 +4499,9 @@ scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sens info = (struct scsi_sense_info *)header; + if ((info->byte2 & SSD_INFO_VALID) == 0) + return; + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, scsi_8btou64(info->info)); } @@ -4528,6 +4530,9 @@ scsi_sense_sks_sbuf(struct sbuf *sb, struct scsi_sense sks = (struct scsi_sense_sks *)header; + if ((sks->sense_key_spec[0] & SSD_SKS_VALID) == 0) + return; + scsi_extract_sense_len(sense, sense_len, &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); @@ -4544,6 +4549,9 @@ scsi_sense_fru_sbuf(struct sbuf *sb, struct scsi_sense fru = (struct scsi_sense_fru *)header; + if (fru->fru == 0) + return; + scsi_fru_sbuf(sb, (uint64_t)fru->fru); } @@ -4554,14 +4562,9 @@ scsi_sense_stream_sbuf(struct sbuf *sb, struct scsi_se struct scsi_sense_desc_header *header) { struct scsi_sense_stream *stream; - uint64_t info; stream = (struct scsi_sense_stream *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_stream_sbuf(sb, stream->byte3, info); + scsi_stream_sbuf(sb, stream->byte3); } void @@ -4571,14 +4574,9 @@ scsi_sense_block_sbuf(struct sbuf *sb, struct scsi_sen struct scsi_sense_desc_header *header) { struct scsi_sense_block *block; - uint64_t info; block = (struct scsi_sense_block *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_block_sbuf(sb, block->byte3, info); + scsi_block_sbuf(sb, block->byte3); } void @@ -4863,7 +4861,7 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ const char *asc_desc; uint8_t sks[3]; uint64_t val; - int info_valid; + uint8_t bits; /* * Get descriptions for the sense key, ASC, and ASCQ. If @@ -4882,42 +4880,28 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ sbuf_printf(sb, " asc:%x,%x (%s)\n", asc, ascq, asc_desc); /* - * Get the info field if it is valid. + * Print any block or stream device-specific information. */ - if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, - &val, NULL) == 0) - info_valid = 1; - else - info_valid = 0; + if (scsi_get_block_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_block_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } else if (scsi_get_stream_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_stream_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } - if (info_valid != 0) { - uint8_t bits; - - /* - * Determine whether we have any block or stream - * device-specific information. - */ - if (scsi_get_block_info(sense, sense_len, inq_data, - &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_block_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (scsi_get_stream_info(sense, sense_len, - inq_data, &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_stream_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (val != 0) { - /* - * The information field can be valid but 0. - * If the block or stream bits aren't set, - * and this is 0, it isn't terribly useful - * to print it out. - */ - sbuf_cat(sb, path_str); - scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); - sbuf_printf(sb, "\n"); - } + /* + * Print the info field. + */ + if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, + &val, NULL) == 0) { + sbuf_cat(sb, path_str); + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); + sbuf_printf(sb, "\n"); } /* Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Sun Apr 21 18:27:13 2019 (r346490) +++ head/sys/cam/scsi/scsi_all.h Sun Apr 21 19:07:03 2019 (r346491) @@ -3749,8 +3749,8 @@ void scsi_command_sbuf(struct sbuf *sb, uint8_t *cdb, void scsi_progress_sbuf(struct sbuf *sb, uint16_t progress); int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks); void scsi_fru_sbuf(struct sbuf *sb, uint64_t fru); -void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info); -void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info); +void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits); +void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits); void scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, From owner-svn-src-head@freebsd.org Sun Apr 21 22:53:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F2B71588036; Sun, 21 Apr 2019 22:53:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1A098DFE9; Sun, 21 Apr 2019 22:53:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6DD44378; Sun, 21 Apr 2019 22:53:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3LMrpoC041238; Sun, 21 Apr 2019 22:53:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LMrpZx041237; Sun, 21 Apr 2019 22:53:51 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904212253.x3LMrpZx041237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 21 Apr 2019 22:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346506 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 346506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1A098DFE9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 22:53:52 -0000 Author: rmacklem Date: Sun Apr 21 22:53:51 2019 New Revision: 346506 URL: https://svnweb.freebsd.org/changeset/base/346506 Log: Add #ifdef INET as requested by bz@. Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Apr 21 22:31:52 2019 (r346505) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Apr 21 22:53:51 2019 (r346506) @@ -898,15 +898,19 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i APPLESTATIC int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { +#ifdef INET struct sockaddr_in *inetaddr; +#endif switch (family) { +#ifdef INET case AF_INET: inetaddr = NFSSOCKADDR(nam, struct sockaddr_in *); if (inetaddr->sin_family == AF_INET && inetaddr->sin_addr.s_addr == haddr->had_inet.s_addr) return (1); break; +#endif #ifdef INET6 case AF_INET6: { From owner-svn-src-head@freebsd.org Mon Apr 22 01:08:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17298158A765; Mon, 22 Apr 2019 01:08:16 +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 A41DA6A805; Mon, 22 Apr 2019 01:08: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 8AD3E591A; Mon, 22 Apr 2019 01:08: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 x3M18FZ7009811; Mon, 22 Apr 2019 01:08:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3M18FgG009809; Mon, 22 Apr 2019 01:08:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904220108.x3M18FgG009809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Apr 2019 01:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346511 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 346511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A41DA6A805 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 01:08:16 -0000 Author: mav Date: Mon Apr 22 01:08:14 2019 New Revision: 346511 URL: https://svnweb.freebsd.org/changeset/base/346511 Log: Report DIF protection type the disk is formatted with. Some disks formatted with protection report errors if written without protection used. This should help to diagnose the problem. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Mon Apr 22 00:49:13 2019 (r346510) +++ head/sys/cam/scsi/scsi_all.h Mon Apr 22 01:08:14 2019 (r346511) @@ -2931,6 +2931,7 @@ struct scsi_read_capacity_data_long uint8_t length[4]; #define SRC16_PROT_EN 0x01 #define SRC16_P_TYPE 0x0e +#define SRC16_P_TYPE_SHIFT 1 #define SRC16_PTYPE_1 0x00 #define SRC16_PTYPE_2 0x02 #define SRC16_PTYPE_3 0x04 Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Apr 22 00:49:13 2019 (r346510) +++ head/sys/cam/scsi/scsi_da.c Mon Apr 22 01:08:14 2019 (r346511) @@ -344,6 +344,7 @@ struct da_softc { da_delete_func_t *delete_func; int unmappedio; int rotating; + int p_type; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -2292,7 +2293,7 @@ dasysctlinit(void *context, int pending) CTLFLAG_RD, &softc->unmappedio, 0, - "Unmapped I/O leaf"); + "Unmapped I/O support"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), @@ -2303,6 +2304,15 @@ dasysctlinit(void *context, int pending) 0, "Rotating media"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, + "p_type", + CTLFLAG_RD, + &softc->p_type, + 0, + "DIF protection type"); + #ifdef CAM_TEST_FAILURE SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "invalidate", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, @@ -4649,7 +4659,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d da_ccb_state state; char *announce_buf; u_int32_t priority; - int lbp; + int lbp, n; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_proberc\n")); @@ -4731,11 +4741,17 @@ dadone_proberc(struct cam_periph *periph, union ccb *d rcaplong, sizeof(*rcaplong)); lbp = (lalba & SRC16_LBPME_A); dp = &softc->params; - snprintf(announce_buf, DA_ANNOUNCETMP_SZ, - "%juMB (%ju %u byte sectors)", + n = snprintf(announce_buf, DA_ANNOUNCETMP_SZ, + "%juMB (%ju %u byte sectors", ((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), (uintmax_t)dp->sectors, dp->secsize); + if (softc->p_type != 0) { + n += snprintf(announce_buf + n, + DA_ANNOUNCETMP_SZ - n, + ", DIF type %d", softc->p_type); + } + snprintf(announce_buf + n, DA_ANNOUNCETMP_SZ - n, ")"); } } else { int error; @@ -5983,9 +5999,15 @@ dasetgeom(struct cam_periph *periph, uint32_t block_le lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; lalba = scsi_2btoul(rcaplong->lalba_lbp); lalba &= SRC16_LALBA_A; + if (rcaplong->prot & SRC16_PROT_EN) + softc->p_type = ((rcaplong->prot & SRC16_P_TYPE) >> + SRC16_P_TYPE_SHIFT) + 1; + else + softc->p_type = 0; } else { lbppbe = 0; lalba = 0; + softc->p_type = 0; } if (lbppbe > 0) { From owner-svn-src-head@freebsd.org Mon Apr 22 03:25:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A10158D513; Mon, 22 Apr 2019 03:25:51 +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 E3D2B6EBA0; Mon, 22 Apr 2019 03:25:49 +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 B70BE711D; Mon, 22 Apr 2019 03:25:49 +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 x3M3PnUM083804; Mon, 22 Apr 2019 03:25:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3M3Pnu0083803; Mon, 22 Apr 2019 03:25:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904220325.x3M3Pnu0083803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Apr 2019 03:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346516 - head/sys/geom/nop X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/nop X-SVN-Commit-Revision: 346516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3D2B6EBA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 03:25:51 -0000 Author: cem Date: Mon Apr 22 03:25:49 2019 New Revision: 346516 URL: https://svnweb.freebsd.org/changeset/base/346516 Log: gnop(8): Nopify configuration as a kernel dump device As a dummy / no-op dump device, to facilitate dumpon(8) testing. Reviewed by: markj (earlier version) Differential Revision: https://reviews.freebsd.org/D19991 Modified: head/sys/geom/nop/g_nop.c Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Mon Apr 22 03:19:40 2019 (r346515) +++ head/sys/geom/nop/g_nop.c Mon Apr 22 03:25:49 2019 (r346516) @@ -97,7 +97,43 @@ g_nop_resize(struct g_consumer *cp) g_resize_provider(pp, size); } +static int +g_nop_dumper(void *priv, void *virtual, vm_offset_t physical, off_t offset, + size_t length) +{ + return (0); +} + static void +g_nop_kerneldump(struct bio *bp, struct g_nop_softc *sc) +{ + struct g_kerneldump *gkd; + struct g_geom *gp; + struct g_provider *pp; + + gkd = (struct g_kerneldump *)bp->bio_data; + gp = bp->bio_to->geom; + g_trace(G_T_TOPOLOGY, "%s(%s, %jd, %jd)", __func__, gp->name, + (intmax_t)gkd->offset, (intmax_t)gkd->length); + + pp = LIST_FIRST(&gp->provider); + + gkd->di.dumper = g_nop_dumper; + gkd->di.priv = sc; + gkd->di.blocksize = pp->sectorsize; + gkd->di.maxiosize = DFLTPHYS; + gkd->di.mediaoffset = sc->sc_offset + gkd->offset; + if (gkd->offset > sc->sc_explicitsize) { + g_io_deliver(bp, ENODEV); + return; + } + if (gkd->offset + gkd->length > sc->sc_explicitsize) + gkd->length = sc->sc_explicitsize - gkd->offset; + gkd->di.mediasize = gkd->length; + g_io_deliver(bp, 0); +} + +static void g_nop_start(struct bio *bp) { struct g_nop_softc *sc; @@ -127,11 +163,18 @@ g_nop_start(struct bio *bp) case BIO_GETATTR: sc->sc_getattrs++; if (sc->sc_physpath && - g_handleattr_str(bp, "GEOM::physpath", sc->sc_physpath)) { - mtx_unlock(&sc->sc_lock); - return; - } - break; + g_handleattr_str(bp, "GEOM::physpath", sc->sc_physpath)) + ; + else if (strcmp(bp->bio_attribute, "GEOM::kerneldump") == 0) + g_nop_kerneldump(bp, sc); + else + /* + * Fallthrough to forwarding the GETATTR down to the + * lower level device. + */ + break; + mtx_unlock(&sc->sc_lock); + return; case BIO_FLUSH: sc->sc_flushes++; break; From owner-svn-src-head@freebsd.org Mon Apr 22 07:27:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13051591603; Mon, 22 Apr 2019 07:27:25 +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 5FA9A757ED; Mon, 22 Apr 2019 07:27:25 +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 479A49968; Mon, 22 Apr 2019 07:27:25 +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 x3M7RPog009731; Mon, 22 Apr 2019 07:27:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3M7ROpR009729; Mon, 22 Apr 2019 07:27:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904220727.x3M7ROpR009729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Apr 2019 07:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346530 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 346530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FA9A757ED 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 07:27:26 -0000 Author: hselasky Date: Mon Apr 22 07:27:24 2019 New Revision: 346530 URL: https://svnweb.freebsd.org/changeset/base/346530 Log: Fix panic in network stack due to memory use after free in relation to fragmented packets. When sending IPv4 and IPv6 fragmented packets and a fragment is lost, the mbuf making up the fragment will remain in the temporary hashed fragment list for a while. If the network interface departs before the so-called slow timeout clears the packet, the fragment causes a panic when the timeout kicks in due to accessing a freed network interface structure. Make sure that when a network device is departing, all hashed IPv4 and IPv6 fragments belonging to it, get freed. Backtrace: panic() icmp6_reflect() hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim; ^^^^ rcvif->if_afdata[AF_INET6] is NULL. icmp6_error() frag6_freef() frag6_slowtimo() pfslowtimo() softclock_call_cc() softclock() ithread_loop() Differential Revision: https://reviews.freebsd.org/D19622 Reviewed by: bz (network), adrian MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet/ip_reass.c head/sys/netinet6/frag6.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Mon Apr 22 07:17:10 2019 (r346529) +++ head/sys/netinet/ip_reass.c Mon Apr 22 07:27:24 2019 (r346530) @@ -46,7 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -605,6 +608,37 @@ ipreass_drain(void) IPQ_UNLOCK(i); } } + +/* + * Drain off all datagram fragments belonging to + * the given network interface. + */ +static void +ipreass_cleanup(void *arg __unused, struct ifnet *ifp) +{ + struct ipq *fp, *temp; + struct mbuf *m; + int i; + + KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + + CURVNET_SET_QUIET(ifp->if_vnet); + for (i = 0; i < IPREASS_NHASH; i++) { + IPQ_LOCK(i); + /* Scan fragment list. */ + TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) { + for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) { + if (m->m_pkthdr.rcvif == ifp) { + ipq_drop(&V_ipq[i], fp); + break; + } + } + } + IPQ_UNLOCK(i); + } + CURVNET_RESTORE(); +} +EVENTHANDLER_DEFINE(ifnet_departure_event, ipreass_cleanup, NULL, 0); #ifdef VIMAGE /* Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Apr 22 07:17:10 2019 (r346529) +++ head/sys/netinet6/frag6.c Mon Apr 22 07:27:24 2019 (r346530) @@ -81,7 +81,7 @@ static void frag6_deq(struct ip6asfrag *, uint32_t buc static void frag6_insque_head(struct ip6q *, struct ip6q *, uint32_t bucket); static void frag6_remque(struct ip6q *, uint32_t bucket); -static void frag6_freef(struct ip6q *, uint32_t bucket); +static void frag6_freef(struct ip6q *, uint32_t bucket, bool send_icmp); struct ip6qbucket { struct ip6q ip6q; @@ -594,7 +594,7 @@ insert: if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash); + frag6_freef(q6, hash, true); } IP6Q_UNLOCK(hash); return IPPROTO_DONE; @@ -604,7 +604,7 @@ insert: if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash); + frag6_freef(q6, hash, true); } IP6Q_UNLOCK(hash); return IPPROTO_DONE; @@ -731,7 +731,7 @@ insert: * associated datagrams. */ static void -frag6_freef(struct ip6q *q6, uint32_t bucket) +frag6_freef(struct ip6q *q6, uint32_t bucket, bool send_icmp) { struct ip6asfrag *af6, *down6; @@ -748,7 +748,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) * Return ICMP time exceeded error for the 1st fragment. * Just free other fragments. */ - if (af6->ip6af_off == 0) { + if (af6->ip6af_off == 0 && send_icmp != false) { struct ip6_hdr *ip6; /* adjust pointer */ @@ -864,7 +864,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragtimeout, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev, i); + frag6_freef(q6->ip6q_prev, i, true); } } /* @@ -883,7 +883,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i); + frag6_freef(head->ip6q_prev, i, true); } IP6Q_UNLOCK(i); } @@ -901,7 +901,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i); + frag6_freef(head->ip6q_prev, i, true); } IP6Q_UNLOCK(i); i = (i + 1) % IP6REASS_NHASH; @@ -931,7 +931,7 @@ frag6_drain(void) while (head->ip6q_next != head) { IP6STAT_INC(ip6s_fragdropped); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_next, i); + frag6_freef(head->ip6q_next, i, true); } IP6Q_UNLOCK(i); } @@ -939,6 +939,45 @@ frag6_drain(void) } VNET_LIST_RUNLOCK_NOSLEEP(); } + +/* + * Drain off all datagram fragments belonging to + * the given network interface. + */ +static void +frag6_cleanup(void *arg __unused, struct ifnet *ifp) +{ + struct ip6q *q6, *q6n, *head; + struct ip6asfrag *af6; + struct mbuf *m; + int i; + + KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + + CURVNET_SET_QUIET(ifp->if_vnet); + for (i = 0; i < IP6REASS_NHASH; i++) { + IP6Q_LOCK(i); + head = IP6Q_HEAD(i); + /* Scan fragment list. */ + for (q6 = head->ip6q_next; q6 != head; q6 = q6n) { + q6n = q6->ip6q_next; + + for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; + af6 = af6->ip6af_down) { + m = IP6_REASS_MBUF(af6); + + if (m->m_pkthdr.rcvif == ifp) { + IP6STAT_INC(ip6s_fragdropped); + frag6_freef(q6, i, false); + break; + } + } + } + IP6Q_UNLOCK(i); + } + CURVNET_RESTORE(); +} +EVENTHANDLER_DEFINE(ifnet_departure_event, frag6_cleanup, NULL, 0); int ip6_deletefraghdr(struct mbuf *m, int offset, int wait) From owner-svn-src-head@freebsd.org Mon Apr 22 07:52:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 331CD159214F; Mon, 22 Apr 2019 07:52:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6331768F8; Mon, 22 Apr 2019 07:52:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42d.google.com with SMTP id t21so5346985pfh.2; Mon, 22 Apr 2019 00:52:18 -0700 (PDT) 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=rnNJl65x1ba9iu7kjsqI60gaQg5pB2i8EccHZL+YQWM=; b=jXszu2gignB0IdFxmx+ZuXWST6U7rmOoRJasUT2rHVOhcdBRGGN+ryneVSPNKbW/pE WwPEnt1OexgWCJox/3pAYWpwmcpA+dPgT70+xngKrpGV7LNsQlvifa5LsPMnuEcPj+3e bEeFi9aR4AdIynl5VUp8VptCHo8IpWejN1kw5bqEM26E/ONSShMY5QISKOxNesRhtrCT fp9rlLg+C7P1+wzTwXQa03tjEaXa8/ZHhdxlkdkj10YEemezbBT7uQ4utbW31MtSPibp CBZ/tnh7EwovLRehbV805qytf9fP8LcSrl5LdENivE6riDeyV/AVC1mfyZ991hQuuABf fxLw== 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=rnNJl65x1ba9iu7kjsqI60gaQg5pB2i8EccHZL+YQWM=; b=J1VtKphQHvcK8ha5fVOssDhdaFPytsZBG2L8Ltjn2t6gp4LYRhew13VkFAUT0+9uia Lo6eWxuGL4+BuF1oX11fdnWsBD+dq4gsVzieNp11sOpHZOAJV0/XvqBGy197RLlE/s/4 b5g/2t1Vyruq2xthKfyxybcQ49FDK5dyt/AwAI9GbGLKizoT256TUcyA+AyKU/wWj03S sxar6SOSJcaV5Mdvxfh4II71uRLNGQeNMSDoNr0Eau+kO1ftIJBM7uWY51yafxXOL92S KZKSDW2iJ2hNlQPyAPd58Kcj/9EcAS/N7ni1YHWTtlHCqscleCP01KDmi+b3PZbwG1K3 ITlA== X-Gm-Message-State: APjAAAVNz8ct312AQTiEm6EehrzyKsMYjES/HdfPwCH5FFmt5rQrg73X n4pqqIUoYaQlpEvqJqH5pucReye0aVI= X-Google-Smtp-Source: APXvYqz9M79adZRpgek668u+XPbzRT96hFGjw8sUredWQ5jAArPMtgeqtYTJ+g6umaSxAwb0lVWepQ== X-Received: by 2002:a63:5a4b:: with SMTP id k11mr17491657pgm.119.1555919536976; Mon, 22 Apr 2019 00:52:16 -0700 (PDT) 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 a85sm21342417pfa.166.2019.04.22.00.52.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 00:52:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346530 - in head/sys: netinet netinet6 From: Enji Cooper In-Reply-To: <201904220727.x3M7ROpR009729@repo.freebsd.org> Date: Mon, 22 Apr 2019 00:52:15 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> References: <201904220727.x3M7ROpR009729@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: A6331768F8 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 07:52:19 -0000 > On Apr 22, 2019, at 12:27 AM, Hans Petter Selasky = wrote: >=20 > Author: hselasky > Date: Mon Apr 22 07:27:24 2019 > New Revision: 346530 > URL: https://svnweb.freebsd.org/changeset/base/346530 >=20 > Log: > Fix panic in network stack due to memory use after free in relation = to > fragmented packets. >=20 > When sending IPv4 and IPv6 fragmented packets and a fragment is lost, > the mbuf making up the fragment will remain in the temporary hashed > fragment list for a while. If the network interface departs before = the > so-called slow timeout clears the packet, the fragment causes a panic > when the timeout kicks in due to accessing a freed network interface > structure. >=20 > Make sure that when a network device is departing, all hashed IPv4 = and > IPv6 fragments belonging to it, get freed. >=20 > Backtrace: > panic() > icmp6_reflect() >=20 > hlim =3D ND_IFINFO(m->m_pkthdr.rcvif)->chlim; > ^^^^ rcvif->if_afdata[AF_INET6] is NULL. >=20 > icmp6_error() > frag6_freef() > frag6_slowtimo() > pfslowtimo() > softclock_call_cc() > softclock() > ithread_loop() >=20 > Differential Revision: https://reviews.freebsd.org/D19622 > Reviewed by: bz (network), adrian > MFC after: 1 week > Sponsored by: Mellanox Technologies This commit broke the build on mips, etc: 07:36:06=20 --- ip_reass.o --- 07:36:06=20 /usr/src/sys/netinet/ip_reass.c:641: error: expected ')' before '(' = token 07:36:06 *** [ip_reass.o] Error code 1 EVENTHANDLER_DEFINE looks like it doesn=E2=80=99t work with gcc? Thanks, -Enji= From owner-svn-src-head@freebsd.org Mon Apr 22 08:10:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA45B1592A46; Mon, 22 Apr 2019 08:10:58 +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 78D11774DF; Mon, 22 Apr 2019 08:10:58 +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 282F02601C2; Mon, 22 Apr 2019 10:10:56 +0200 (CEST) Subject: Re: svn commit: r346530 - in head/sys: netinet netinet6 To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head@freebsd.org References: <201904220727.x3M7ROpR009729@repo.freebsd.org> <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> From: Hans Petter Selasky Message-ID: <87917500-0381-79d8-a34b-819848abed32@selasky.org> Date: Mon, 22 Apr 2019 10:10:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78D11774DF 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.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 08:10:59 -0000 On 4/22/19 9:52 AM, Enji Cooper wrote: > >> On Apr 22, 2019, at 12:27 AM, Hans Petter Selasky wrote: >> >> Author: hselasky >> Date: Mon Apr 22 07:27:24 2019 >> New Revision: 346530 >> URL: https://svnweb.freebsd.org/changeset/base/346530 >> >> Log: >> Fix panic in network stack due to memory use after free in relation to >> fragmented packets. >> >> When sending IPv4 and IPv6 fragmented packets and a fragment is lost, >> the mbuf making up the fragment will remain in the temporary hashed >> fragment list for a while. If the network interface departs before the >> so-called slow timeout clears the packet, the fragment causes a panic >> when the timeout kicks in due to accessing a freed network interface >> structure. >> >> Make sure that when a network device is departing, all hashed IPv4 and >> IPv6 fragments belonging to it, get freed. >> >> Backtrace: >> panic() >> icmp6_reflect() >> >> hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim; >> ^^^^ rcvif->if_afdata[AF_INET6] is NULL. >> >> icmp6_error() >> frag6_freef() >> frag6_slowtimo() >> pfslowtimo() >> softclock_call_cc() >> softclock() >> ithread_loop() >> >> Differential Revision: https://reviews.freebsd.org/D19622 >> Reviewed by: bz (network), adrian >> MFC after: 1 week >> Sponsored by: Mellanox Technologies > > This commit broke the build on mips, etc: > > 07:36:06 > --- ip_reass.o --- > > 07:36:06 > /usr/src/sys/netinet/ip_reass.c:641: error: expected ')' before '(' token > > 07:36:06 *** [ip_reass.o] Error code 1 > > EVENTHANDLER_DEFINE looks like it doesn’t work with gcc? I'm looking into it. Thank you! --HPS From owner-svn-src-head@freebsd.org Mon Apr 22 08:32:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93EB01593269; Mon, 22 Apr 2019 08:32:01 +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 39F5E80293; Mon, 22 Apr 2019 08:32:01 +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 2AAB7A424; Mon, 22 Apr 2019 08:32:01 +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 x3M8W0MC045309; Mon, 22 Apr 2019 08:32:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3M8W0Xm045307; Mon, 22 Apr 2019 08:32:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904220832.x3M8W0Xm045307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Apr 2019 08:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346535 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 346535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39F5E80293 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 08:32:01 -0000 Author: hselasky Date: Mon Apr 22 08:32:00 2019 New Revision: 346535 URL: https://svnweb.freebsd.org/changeset/base/346535 Log: Fix build for mips and powerpc after r346530. Need to include sys/kernel.h to define SYSINIT() which is used by sys/eventhandler.h . MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet/ip_reass.c head/sys/netinet6/frag6.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Mon Apr 22 08:22:15 2019 (r346534) +++ head/sys/netinet/ip_reass.c Mon Apr 22 08:32:00 2019 (r346535) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Apr 22 08:22:15 2019 (r346534) +++ head/sys/netinet6/frag6.c Mon Apr 22 08:32:00 2019 (r346535) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Mon Apr 22 08:32:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E8815932B7; Mon, 22 Apr 2019 08:32:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 442928041B; Mon, 22 Apr 2019 08:32:44 +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 AE6892601C2; Mon, 22 Apr 2019 10:32:41 +0200 (CEST) Subject: Re: svn commit: r346530 - in head/sys: netinet netinet6 From: Hans Petter Selasky To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head@freebsd.org References: <201904220727.x3M7ROpR009729@repo.freebsd.org> <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> <87917500-0381-79d8-a34b-819848abed32@selasky.org> Message-ID: Date: Mon, 22 Apr 2019 10:32:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <87917500-0381-79d8-a34b-819848abed32@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 442928041B 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.960,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 08:32:44 -0000 On 4/22/19 10:10 AM, Hans Petter Selasky wrote: > On 4/22/19 9:52 AM, Enji Cooper wrote: >> >>> On Apr 22, 2019, at 12:27 AM, Hans Petter Selasky >>> wrote: >>> >>> Author: hselasky >>> Date: Mon Apr 22 07:27:24 2019 >>> New Revision: 346530 >>> URL: https://svnweb.freebsd.org/changeset/base/346530 >>> >>> Log: >>>   Fix panic in network stack due to memory use after free in relation to >>>   fragmented packets. >>> >>>   When sending IPv4 and IPv6 fragmented packets and a fragment is lost, >>>   the mbuf making up the fragment will remain in the temporary hashed >>>   fragment list for a while. If the network interface departs before the >>>   so-called slow timeout clears the packet, the fragment causes a panic >>>   when the timeout kicks in due to accessing a freed network interface >>>   structure. >>> >>>   Make sure that when a network device is departing, all hashed IPv4 and >>>   IPv6 fragments belonging to it, get freed. >>> >>>   Backtrace: >>>   panic() >>>   icmp6_reflect() >>> >>>   hlim = ND_IFINFO(m->m_pkthdr.rcvif)->chlim; >>>   ^^^^ rcvif->if_afdata[AF_INET6] is NULL. >>> >>>   icmp6_error() >>>   frag6_freef() >>>   frag6_slowtimo() >>>   pfslowtimo() >>>   softclock_call_cc() >>>   softclock() >>>   ithread_loop() >>> >>>   Differential Revision:    https://reviews.freebsd.org/D19622 >>>   Reviewed by:        bz (network), adrian >>>   MFC after:        1 week >>>   Sponsored by:        Mellanox Technologies >> >> This commit broke the build on mips, etc: >> >> 07:36:06 >> --- ip_reass.o --- >> >> 07:36:06 >> /usr/src/sys/netinet/ip_reass.c:641: error: expected ')' before '(' token >> >> 07:36:06 *** [ip_reass.o] Error code 1 >> >> EVENTHANDLER_DEFINE looks like it doesn’t work with gcc? > > I'm looking into it. > > Thank you! > > --HPS > > > Should be fixed by r346535 Else I'll revert. --HPS From owner-svn-src-head@freebsd.org Mon Apr 22 11:09:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88B9B15968B1; Mon, 22 Apr 2019 11:09:25 +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 2FBF68564C; Mon, 22 Apr 2019 11:09:25 +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 066A8C068; Mon, 22 Apr 2019 11:09:25 +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 x3MB9O6w028085; Mon, 22 Apr 2019 11:09:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MB9OjF028084; Mon, 22 Apr 2019 11:09:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221109.x3MB9OjF028084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 11:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346539 - 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: 346539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FBF68564C 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 11:09:25 -0000 Author: ngie Date: Mon Apr 22 11:09:24 2019 New Revision: 346539 URL: https://svnweb.freebsd.org/changeset/base/346539 Log: Fix `get_int_via_sysctlbyname(..)` on Jenkins Initialize `oldlen` to the size of the value, instead of leaving the value unitialized. Leaving it unitialized seems to work by accident on amd64 when running 64-bit programs, but not on i386. This matches patterns in use in other programs. PR: 237458 Approved by: emaste (mentor; implicit) MFC after: 1 week Tested on: ^/head (amd64), ^/stable/11 (i386) 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 Mon Apr 22 10:02:34 2019 (r346538) +++ head/lib/libc/tests/sys/sendfile_test.c Mon Apr 22 11:09:24 2019 (r346539) @@ -62,6 +62,8 @@ get_int_via_sysctlbyname(const char *oidname) size_t oldlen; int int_value; + oldlen = sizeof(int_value); + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); From owner-svn-src-head@freebsd.org Mon Apr 22 11:21:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A125E159705B; Mon, 22 Apr 2019 11:21:21 +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 44B93860A2; Mon, 22 Apr 2019 11:21:21 +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 185C9C2BB; Mon, 22 Apr 2019 11:21:21 +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 x3MBLKrP034707; Mon, 22 Apr 2019 11:21:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MBLKo0034706; Mon, 22 Apr 2019 11:21:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221121.x3MBLKo0034706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 11:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346542 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 346542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44B93860A2 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 11:21:21 -0000 Author: ngie Date: Mon Apr 22 11:21:20 2019 New Revision: 346542 URL: https://svnweb.freebsd.org/changeset/base/346542 Log: Fix sys.kern.coredump_phnum_test.coredump_phnum on i386 The zero-padding when printing out the Size field is on 32-bit architectures is 5, not 15. Adjust the regular expression to work with both the 32-bit and 64-bit case. MFC after: 1 week Reviewed by: lwhsu, markj Approved by: emaste (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D20005 Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Mon Apr 22 11:17:37 2019 (r346541) +++ head/tests/sys/kern/coredump_phnum_test.sh Mon Apr 22 11:21:20 2019 (r346542) @@ -65,7 +65,7 @@ EOF -x 'readelf -h coredump_phnum_helper.core | grep "Number of program headers:"' atf_check -o "match:There are 66[0-9]{3} program headers" \ -x 'readelf -l coredump_phnum_helper.core | grep -1 "program headers"' - atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ + atf_check -o "match: 00000(0000000000)?1 .* 66[0-9]{3} " \ -x 'readelf -S coredump_phnum_helper.core | grep -A1 "^ \[ 0\] "' atf_check -o "match:66[0-9]{3}" \ From owner-svn-src-head@freebsd.org Mon Apr 22 11:23:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 248A815970F3; Mon, 22 Apr 2019 11:23:36 +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 BE1DC86428; Mon, 22 Apr 2019 11:23:35 +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 98D93C42A; Mon, 22 Apr 2019 11:23:35 +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 x3MBNZbP038856; Mon, 22 Apr 2019 11:23:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MBNZ79038855; Mon, 22 Apr 2019 11:23:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904221123.x3MBNZ79038855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Apr 2019 11:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346543 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 346543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE1DC86428 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 11:23:36 -0000 Author: markj Date: Mon Apr 22 11:23:35 2019 New Revision: 346543 URL: https://svnweb.freebsd.org/changeset/base/346543 Log: Disable vm map consistency checking by default on INVARIANTS kernels. The checks are too expensive for a general-purpose kernel. Enable the checks when DIAGNOSTIC is defined and provide a sysctl to enable the checks in a non-DIAGNOSTIC INVARIANTS kernel. Reviewed by: kib Discussed with: Doug Moore MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19999 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Apr 22 11:21:20 2019 (r346542) +++ head/sys/vm/vm_map.c Mon Apr 22 11:23:35 2019 (r346543) @@ -670,6 +670,14 @@ _vm_map_assert_locked(vm_map_t map, const char *file, #define VM_MAP_ASSERT_LOCKED(map) \ _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) +#ifdef DIAGNOSTIC +static int enable_vmmap_check = 1; +#else +static int enable_vmmap_check = 0; +#endif +SYSCTL_INT(_debug, OID_AUTO, vmmap_check, CTLFLAG_RWTUN, + &enable_vmmap_check, 0, "Enable vm map consistency checking"); + static void _vm_map_assert_consistent(vm_map_t map) { @@ -677,6 +685,9 @@ _vm_map_assert_consistent(vm_map_t map) vm_map_entry_t child; vm_size_t max_left, max_right; + if (!enable_vmmap_check) + return; + for (entry = map->header.next; entry != &map->header; entry = entry->next) { KASSERT(entry->prev->end <= entry->start, @@ -714,7 +725,7 @@ _vm_map_assert_consistent(vm_map_t map) #else #define VM_MAP_ASSERT_LOCKED(map) #define VM_MAP_ASSERT_CONSISTENT(map) -#endif +#endif /* INVARIANTS */ /* * _vm_map_unlock_and_wait: From owner-svn-src-head@freebsd.org Mon Apr 22 11:25:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D01F0159719F; Mon, 22 Apr 2019 11:25:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3235C865A1; Mon, 22 Apr 2019 11:25:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x641.google.com with SMTP id w24so5702510plp.2; Mon, 22 Apr 2019 04:25:30 -0700 (PDT) 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=fHIktrEk9er+LLxwC69feHZT3nvs1eOw25g/mbv/KIk=; b=t2oAAcVA/cnpts16FQ0puPFRLWGgWkzw6ohirY/CEmhch5ZIDL5k/HzOnrjMJnM2qE zgsqwIOJ5fERRltuYm8ngaymO5RQx84SVVwOBTTsJyFNt/rEFPN2Out7ozXINKBJggSb RVU22R7PlFTTnQljqBB1JO2ZKgA6rFoHKv+8rVq53WnKel7Cd5hEv7llF67ZoFoP6b7i /qdZFMYcWcp0I5Co249QUptL1p+0MDyVaTAVpWky0WzPBnB21omdzC5R/XYHIcGuMAZ8 oZWhnUpnnaUXXO4kevp9tosOgU8uFu1lvnUcBvXrNH7s8ihnQvSy3iTEcjgDmBTx6Ai8 H2qg== 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=fHIktrEk9er+LLxwC69feHZT3nvs1eOw25g/mbv/KIk=; b=SU1qZhYWVq8ObbA1nx32cp/shmWpfUw4Lx4XBIFGG5gYRZOk2hQNeNsKFk+4aJo57X SWOSGK5YF31uP1h1nOiBxUb/+lWm3mBAHQ/a2/Uc2Xo8x0snBxHYchGNqbxuTjR5kBk1 gZBtpIQ8ILKfHRZwLRliKWW7KhJFnm4hPnGDEKinPwTIMnUR7kGXt84qMPJIrVfTOs5L JKTw6tgs6bZi4JoTw23n5jiJFUoJE77GcKUCGXLfmH62gkmdx03FrogvH05Q2qYZYuCv 5vkWtXk6im1/iaCTlmEtE6J41z+R0663M1W+475nDTqa7QT8G5ukjr/RMubTeXFQ3j8s VB6A== X-Gm-Message-State: APjAAAXVJqkBzI2ywePAm70/Z0Nkwp8p01cqPeAwZgFURFcvGJv3rpSs DvI51+mPmLD6q21xcGxkrngX0zhNQLw= X-Google-Smtp-Source: APXvYqze44MOEAzDMojKvzphAeIW+xmiPYCvmv2OFpTDzhjb3HjmEwRlhXA6hZMMrm+rFyXMeHIH5A== X-Received: by 2002:a17:902:42:: with SMTP id 60mr19754000pla.79.1555932328982; Mon, 22 Apr 2019 04:25:28 -0700 (PDT) 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 v12sm16904988pfe.148.2019.04.22.04.25.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 04:25:28 -0700 (PDT) From: Enji Cooper Message-Id: <8EAC0CFE-E22F-478F-813F-A07E68C0518D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Panic with r346530 [Re: svn commit: r346530 - in head/sys: netinet netinet6] Date: Mon, 22 Apr 2019 04:25:27 -0700 In-Reply-To: Cc: src-committers , svn-src-all , svn-src-head , FreeBSD CURRENT To: Hans Petter Selasky References: <201904220727.x3M7ROpR009729@repo.freebsd.org> <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> <87917500-0381-79d8-a34b-819848abed32@selasky.org> X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 3235C865A1 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.948,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 11:25:31 -0000 Hi Hans, > On Apr 22, 2019, at 1:32 AM, Hans Petter Selasky = wrote: >=20 > On 4/22/19 10:10 AM, Hans Petter Selasky wrote: >> On 4/22/19 9:52 AM, Enji Cooper wrote: >>>=20 >>>> On Apr 22, 2019, at 12:27 AM, Hans Petter Selasky = wrote: >>>>=20 >>>> Author: hselasky >>>> Date: Mon Apr 22 07:27:24 2019 >>>> New Revision: 346530 >>>> URL: https://svnweb.freebsd.org/changeset/base/346530 >>>>=20 >>>> Log: >>>> Fix panic in network stack due to memory use after free in = relation to >>>> fragmented packets. >>>>=20 >>>> When sending IPv4 and IPv6 fragmented packets and a fragment is = lost, >>>> the mbuf making up the fragment will remain in the temporary = hashed >>>> fragment list for a while. If the network interface departs = before the >>>> so-called slow timeout clears the packet, the fragment causes a = panic >>>> when the timeout kicks in due to accessing a freed network = interface >>>> structure. >>>>=20 >>>> Make sure that when a network device is departing, all hashed = IPv4 and >>>> IPv6 fragments belonging to it, get freed. >>>>=20 >>>> Backtrace: >>>> panic() >>>> icmp6_reflect() >>>>=20 >>>> hlim =3D ND_IFINFO(m->m_pkthdr.rcvif)->chlim; >>>> ^^^^ rcvif->if_afdata[AF_INET6] is NULL. >>>>=20 >>>> icmp6_error() >>>> frag6_freef() >>>> frag6_slowtimo() >>>> pfslowtimo() >>>> softclock_call_cc() >>>> softclock() >>>> ithread_loop() >>>>=20 >>>> Differential Revision: https://reviews.freebsd.org/D19622 >>>> Reviewed by: bz (network), adrian >>>> MFC after: 1 week >>>> Sponsored by: Mellanox Technologies >=20 > Should be fixed by >=20 > r346535 >=20 > Else I'll revert. ... The code compiles, but unfortunately panics when running the test suite. = =46rom https://ci.freebsd.org/job/FreeBSD-head-amd64-test/10926/console: 03:05:01 1st 0xffffffff820967f0 allprison (allprison) @ = /usr/src/sys/kern/kern_jail.c:966 03:05:01 2nd 0xffffffff820c47f0 vnet_sysinit_sxlock = (vnet_sysinit_sxlock) @ /usr/src/sys/net/vnet.c:575 03:05:01 stack backtrace: 03:05:01 #0 0xffffffff80c477f3 at witness_debugger+0x73 03:05:01 #1 0xffffffff80c4753d at witness_checkorder+0xa7d 03:05:01 #2 0xffffffff80be9088 at _sx_slock_int+0x68 03:05:01 #3 0xffffffff80d0ef97 at vnet_alloc+0x117 03:05:01 #4 0xffffffff80ba4111 at kern_jail_set+0x1bb1 03:05:01 #5 0xffffffff80ba5b70 at sys_jail_set+0x40 03:05:01 #6 0xffffffff810b2e16 at amd64_syscall+0x276 03:05:01 #7 0xffffffff8108b44d at fast_syscall_common+0x101 03:05:01 panic: mtx_lock() of destroyed mutex @ = /usr/src/sys/netinet/ip_reass.c:628 03:05:01 cpuid =3D 1 03:05:01 time =3D 1555927501 03:05:01 KDB: stack backtrace: 03:05:01 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame = 0xfffffe0030eec630 03:05:01 vpanic() at vpanic+0x19d/frame 0xfffffe0030eec680 03:05:01 panic() at panic+0x43/frame 0xfffffe0030eec6e0 03:05:02 __mtx_lock_flags() at __mtx_lock_flags+0x12e/frame = 0xfffffe0030eec730 03:05:02 ipreass_cleanup() at ipreass_cleanup+0x86/frame = 0xfffffe0030eec770 03:05:02 if_detach_internal() at if_detach_internal+0x786/frame = 0xfffffe0030eec7f0 03:05:02 if_detach() at if_detach+0x3d/frame 0xfffffe0030eec810 03:05:02 lo_clone_destroy() at lo_clone_destroy+0x16/frame = 0xfffffe0030eec830 03:05:02 if_clone_destroyif() at if_clone_destroyif+0x21f/frame = 0xfffffe0030eec880 03:05:02 if_clone_detach() at if_clone_detach+0xb8/frame = 0xfffffe0030eec8b0 03:05:02 vnet_loif_uninit() at vnet_loif_uninit+0x26/frame = 0xfffffe0030eec8d0 03:05:02 vnet_destroy() at vnet_destroy+0x124/frame 0xfffffe0030eec900 03:05:02 prison_deref() at prison_deref+0x29d/frame 0xfffffe0030eec940 03:05:02 sys_jail_remove() at sys_jail_remove+0x28f/frame = 0xfffffe0030eec990 03:05:02 amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe0030eecab0 03:05:02 fast_syscall_common() at fast_syscall_common+0x101/frame = 0xfffffe0030eecab0 03:05:02 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip =3D = 0x80031e12a, rsp =3D 0x7fffffffe998, rbp =3D 0x7fffffffea20 --- 03:05:02 KDB: enter: panic 03:05:02 [ thread pid 13109 tid 100150 ] 03:05:02 Stopped at kdb_enter+0x3b: movq $0,kdb_why 03:05:02 db:0:kdb.enter.panic> show pcpu 03:05:02 cpuid =3D 1 03:05:02 dynamic pcpu =3D 0xfffffe0080191800 03:05:02 curthread =3D 0xfffff80005c1f000: pid 13109 tid 100150 = "jail" 03:05:02 curpcb =3D 0xfffffe0030eecb80 03:05:02 fpcurthread =3D 0xfffff80005c1f000: pid 13109 "jail" 03:05:02 idlethread =3D 0xfffff800032765a0: tid 100004 "idle: cpu1" 03:05:02 curpmap =3D 0xfffff8013d837130 03:05:02 tssp =3D 0xffffffff821cd388 03:05:02 commontssp =3D 0xffffffff821cd388 03:05:02 rsp0 =3D 0xfffffe0030eecb80 03:05:02 gs32p =3D 0xffffffff821d3fc0 03:05:02 ldt =3D 0xffffffff821d4000 03:05:02 tss =3D 0xffffffff821d3ff0 03:05:02 tlb gen =3D 314416 03:05:02 curvnet =3D 0xfffff80139320200 03:05:02 spin locks held: 03:05:02 db:0:kdb.enter.panic> alltrace Either the sys/netinet/ or sys/netipsec/ tests triggered the = panic. Not sure which right now. Cheers, -Enji= From owner-svn-src-head@freebsd.org Mon Apr 22 11:31:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C03371597520; Mon, 22 Apr 2019 11:31: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 63E0886976; Mon, 22 Apr 2019 11:31: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 3D683C46B; Mon, 22 Apr 2019 11:31: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 x3MBVEfp039291; Mon, 22 Apr 2019 11:31:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MBVEDj039290; Mon, 22 Apr 2019 11:31:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904221131.x3MBVEDj039290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Apr 2019 11:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346544 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 346544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63E0886976 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 11:31:14 -0000 Author: markj Date: Mon Apr 22 11:31:13 2019 New Revision: 346544 URL: https://svnweb.freebsd.org/changeset/base/346544 Log: Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Apr 22 11:23:35 2019 (r346543) +++ head/sys/conf/NOTES Mon Apr 22 11:31:13 2019 (r346544) @@ -563,8 +563,10 @@ options KASSERT_PANIC_OPTIONAL # # The DIAGNOSTIC option is used to enable extra debugging information -# from some parts of the kernel. As this makes everything more noisy, -# it is disabled by default. +# and invariants checking. The added checks are too expensive or noisy +# for an INVARIANTS kernel and thus are disabled by default. It is +# expected that a kernel configured with DIAGNOSTIC will also have the +# INVARIANTS option enabled. # options DIAGNOSTIC From owner-svn-src-head@freebsd.org Mon Apr 22 13:28:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4F61599FCF; Mon, 22 Apr 2019 13:28:37 +0000 (UTC) (envelope-from kp@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 026EF8A7B3; Mon, 22 Apr 2019 13:28:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 98E81FAD7; Mon, 22 Apr 2019 13:28:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [137.50.17.195] (unknown [IPv6:2001:630:42:110:d1ea:c255:f4:4af0]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id B112331010; Mon, 22 Apr 2019 15:28:34 +0200 (CEST) From: "Kristof Provost" To: "Enji Cooper" Cc: "Hans Petter Selasky" , src-committers , svn-src-all , svn-src-head , "FreeBSD CURRENT" Subject: Re: Panic with r346530 [Re: svn commit: r346530 - in head/sys: netinet netinet6] Date: Mon, 22 Apr 2019 14:28:31 +0100 X-Mailer: MailMate (2.0BETAr6135) Message-ID: <1342BBD2-EE0F-4457-8752-659EA7F01725@FreeBSD.org> In-Reply-To: <8EAC0CFE-E22F-478F-813F-A07E68C0518D@gmail.com> References: <201904220727.x3M7ROpR009729@repo.freebsd.org> <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> <87917500-0381-79d8-a34b-819848abed32@selasky.org> <8EAC0CFE-E22F-478F-813F-A07E68C0518D@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 026EF8A7B3 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.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 13:28:37 -0000 On 22 Apr 2019, at 12:25, Enji Cooper wrote: > Either the sys/netinet/ or sys/netipsec/ tests triggered the panic. > Not sure which right now. > That looks to be happening during a vnet jail teardown, so it’s likely the sys/netipsec or sys/netpfil/pf tests. I’ve done a quick test with the pf tests, and they provoke this panic: panic: mtx_lock() of destroyed mutex @ /usr/src/sys/netinet/ip_reass.c:628 cpuid = 0 time = 1555939645 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0091d68530 vpanic() at vpanic+0x19d/frame 0xfffffe0091d68580 panic() at panic+0x43/frame 0xfffffe0091d685e0 __mtx_lock_flags() at __mtx_lock_flags+0x12e/frame 0xfffffe0091d68630 ipreass_cleanup() at ipreass_cleanup+0x86/frame 0xfffffe0091d68670 if_detach_internal() at if_detach_internal+0x786/frame 0xfffffe0091d686f0 if_detach() at if_detach+0x3d/frame 0xfffffe0091d68710 lo_clone_destroy() at lo_clone_destroy+0x16/frame 0xfffffe0091d68730 if_clone_destroyif() at if_clone_destroyif+0x21f/frame 0xfffffe0091d68780 if_clone_detach() at if_clone_detach+0xb8/frame 0xfffffe0091d687b0 vnet_loif_uninit() at vnet_loif_uninit+0x26/frame 0xfffffe0091d687d0 vnet_destroy() at vnet_destroy+0x124/frame 0xfffffe0091d68800 prison_deref() at prison_deref+0x29d/frame 0xfffffe0091d68840 sys_jail_remove() at sys_jail_remove+0x28f/frame 0xfffffe0091d68890 amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe0091d689b0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0091d689b0 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x80031e12a, rsp = 0x7fffffffe848, rbp = 0x7fffffffe8d0 --- KDB: enter: panic [ thread pid 1223 tid 100501 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> To reproduce: kldload pfsync cd /usr/tests/sys/netpfil/pf sudo kyua test Regards, Kristof From owner-svn-src-head@freebsd.org Mon Apr 22 13:43:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8703E159A5D6; Mon, 22 Apr 2019 13:43: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 29E2A8B2F0; Mon, 22 Apr 2019 13:43: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 05602DC10; Mon, 22 Apr 2019 13:43: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 x3MDhdTw018848; Mon, 22 Apr 2019 13:43:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MDhdvd018842; Mon, 22 Apr 2019 13:43:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904221343.x3MDhdvd018842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 22 Apr 2019 13:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346545 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 346545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29E2A8B2F0 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)[-1.000,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 13:43:40 -0000 Author: kevans Date: Mon Apr 22 13:43:38 2019 New Revision: 346545 URL: https://svnweb.freebsd.org/changeset/base/346545 Log: libbe(3): allow creation of arbitrary depth boot environments libbe currently only provides an API to create a recursive boot environment, without any formal support for intentionally limiting the depth. This changeset adds an API, be_create_depth, that may be used to arbitrarily restrict the depth of the new BE. Submitted by: Rob Fairbanks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18564 Modified: head/lib/libbe/be.c head/lib/libbe/be.h head/lib/libbe/be_impl.h head/lib/libbe/libbe.3 Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Apr 22 11:31:13 2019 (r346544) +++ head/lib/libbe/be.c Mon Apr 22 13:43:38 2019 (r346545) @@ -372,7 +372,6 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c sizeof(buf)) >= sizeof(buf)) return (set_error(lbh, BE_ERR_INVALIDNAME)); } - if ((err = zfs_snapshot(lbh->lzh, buf, recursive, NULL)) != 0) { switch (err) { case EZFS_INVALIDNAME: @@ -446,43 +445,78 @@ be_deep_clone_prop(int prop, void *cb) return (ZPROP_CONT); } +/* + * Return the corresponding boot environment path for a given + * dataset path, the constructed path is placed in 'result'. + * + * example: say our new boot environment name is 'bootenv' and + * the dataset path is 'zroot/ROOT/default/data/set'. + * + * result should produce: 'zroot/ROOT/bootenv/data/set' + */ static int -be_deep_clone(zfs_handle_t *ds, void *data) +be_get_path(struct libbe_deep_clone *ldc, const char *dspath, char *result, int result_size) { + char *pos; + char *child_dataset; + + /* match the root path for the boot environments */ + pos = strstr(dspath, ldc->lbh->root); + + /* no match, different pools? */ + if (pos == NULL) + return (BE_ERR_BADPATH); + + /* root path of the new boot environment */ + snprintf(result, result_size, "%s/%s", ldc->lbh->root, ldc->bename); + + /* gets us to the parent dataset, the +1 consumes a trailing slash */ + pos += strlen(ldc->lbh->root) + 1; + + /* skip the parent dataset */ + if ((child_dataset = strchr(pos, '/')) != NULL) + strlcat(result, child_dataset, result_size); + + return (BE_ERR_SUCCESS); +} + +static int +be_clone_cb(zfs_handle_t *ds, void *data) +{ int err; char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; const char *dspath; - char *dsname; zfs_handle_t *snap_hdl; nvlist_t *props; - struct libbe_deep_clone *isdc, sdc; + struct libbe_deep_clone *ldc; struct libbe_dccb dccb; - isdc = (struct libbe_deep_clone *)data; + ldc = (struct libbe_deep_clone *)data; dspath = zfs_get_name(ds); - if ((dsname = strrchr(dspath, '/')) == NULL) - return (BE_ERR_UNKNOWN); - dsname++; - if (isdc->bename == NULL) - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, dsname); - else - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, isdc->bename); + snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, ldc->snapname); - snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, isdc->snapname); + /* construct the boot environment path from the dataset we're cloning */ + if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) + return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); - if (zfs_dataset_exists(isdc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(isdc->lbh, BE_ERR_EXISTS)); + /* the dataset to be created (i.e. the boot environment) already exists */ + if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) + return (set_error(ldc->lbh, BE_ERR_EXISTS)); + /* no snapshot found for this dataset, silently skip it */ + if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) + return (0); + if ((snap_hdl = - zfs_open(isdc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(isdc->lbh, BE_ERR_ZFSOPEN)); + zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) + return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - dccb.lbh = isdc->lbh; + dccb.lbh = ldc->lbh; dccb.zhp = ds; dccb.props = props; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, @@ -490,58 +524,55 @@ be_deep_clone(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - err = BE_ERR_ZFSCLONE; + return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); nvlist_free(props); zfs_close(snap_hdl); - /* Failed to clone */ - if (err != BE_ERR_SUCCESS) - return (set_error(isdc->lbh, err)); + if (ldc->depth_limit == -1 || ldc->depth < ldc->depth_limit) { + ldc->depth++; + err = zfs_iter_filesystems(ds, be_clone_cb, ldc); + ldc->depth--; + } - sdc.lbh = isdc->lbh; - sdc.bename = NULL; - sdc.snapname = isdc->snapname; - sdc.be_root = (char *)&be_path; - - err = zfs_iter_filesystems(ds, be_deep_clone, &sdc); - - return (err); + return (set_error(ldc->lbh, err)); } /* - * Create the boot environment from pre-existing snapshot - */ -int -be_create_from_existing_snap(libbe_handle_t *lbh, const char *name, - const char *snap) + * Create a boot environment with a given name from a given snapshot. + * Snapshots can be in the format 'zroot/ROOT/default@snapshot' or + * 'default@snapshot'. In the latter case, 'default@snapshot' will be prepended + * with the root path that libbe was initailized with. +*/ +static int +be_clone(libbe_handle_t *lbh, const char *bename, const char *snapshot, int depth) { int err; - char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; - const char *bename; char *parentname, *snapname; zfs_handle_t *parent_hdl; - struct libbe_deep_clone sdc; + struct libbe_deep_clone ldc; - if ((err = be_validate_name(lbh, name)) != 0) + /* ensure the boot environment name is valid */ + if ((err = be_validate_name(lbh, bename)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, snap, snap_path)) != 0) + + /* + * prepend the boot environment root path if we're + * given a partial snapshot name. + */ + if ((err = be_root_concat(lbh, snapshot, snap_path)) != 0) return (set_error(lbh, err)); + + /* ensure the snapshot exists */ if ((err = be_validate_snap(lbh, snap_path)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, name, be_path)) != 0) - return (set_error(lbh, err)); - - if ((bename = strrchr(name, '/')) == NULL) - bename = name; - else - bename++; - + /* get a copy of the snapshot path so we can disect it */ if ((parentname = strdup(snap_path)) == NULL) return (set_error(lbh, BE_ERR_UNKNOWN)); + /* split dataset name from snapshot name */ snapname = strchr(parentname, '@'); if (snapname == NULL) { free(parentname); @@ -550,32 +581,56 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons *snapname = '\0'; snapname++; - sdc.lbh = lbh; - sdc.bename = bename; - sdc.snapname = snapname; - sdc.be_root = lbh->root; + /* set-up the boot environment */ + ldc.lbh = lbh; + ldc.bename = bename; + ldc.snapname = snapname; + ldc.depth = 0; + ldc.depth_limit = depth; + /* the boot environment will be cloned from this dataset */ parent_hdl = zfs_open(lbh->lzh, parentname, ZFS_TYPE_DATASET); - err = be_deep_clone(parent_hdl, &sdc); + /* create the boot environment */ + err = be_clone_cb(parent_hdl, &ldc); + free(parentname); return (set_error(lbh, err)); } +/* + * Create a boot environment from pre-existing snapshot, specifying a depth. + */ +int be_create_depth(libbe_handle_t *lbh, const char *bename, + const char *snap, int depth) +{ + return (be_clone(lbh, bename, snap, depth)); +} /* + * Create the boot environment from pre-existing snapshot + */ +int +be_create_from_existing_snap(libbe_handle_t *lbh, const char *bename, + const char *snap) +{ + return (be_clone(lbh, bename, snap, -1)); +} + + +/* * Create a boot environment from an existing boot environment */ int -be_create_from_existing(libbe_handle_t *lbh, const char *name, const char *old) +be_create_from_existing(libbe_handle_t *lbh, const char *bename, const char *old) { int err; - char buf[BE_MAXPATHLEN]; + char snap[BE_MAXPATHLEN]; - if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf)) != 0) + if ((err = be_snapshot(lbh, old, NULL, true, snap)) != 0) return (set_error(lbh, err)); - err = be_create_from_existing_snap(lbh, name, (char *)buf); + err = be_clone(lbh, bename, snap, -1); return (set_error(lbh, err)); } Modified: head/lib/libbe/be.h ============================================================================== --- head/lib/libbe/be.h Mon Apr 22 11:31:13 2019 (r346544) +++ head/lib/libbe/be.h Mon Apr 22 13:43:38 2019 (r346545) @@ -84,6 +84,7 @@ int be_activate(libbe_handle_t *, const char *, bool); /* Bootenv creation functions */ int be_create(libbe_handle_t *, const char *); +int be_create_depth(libbe_handle_t *, const char *, const char *, int); int be_create_from_existing(libbe_handle_t *, const char *, const char *); int be_create_from_existing_snap(libbe_handle_t *, const char *, const char *); int be_snapshot(libbe_handle_t *, const char *, const char *, bool, char *); Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Mon Apr 22 11:31:13 2019 (r346544) +++ head/lib/libbe/be_impl.h Mon Apr 22 13:43:38 2019 (r346545) @@ -50,7 +50,8 @@ struct libbe_deep_clone { libbe_handle_t *lbh; const char *bename; const char *snapname; - const char *be_root; + int depth; + int depth_limit; }; struct libbe_dccb { Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Mon Apr 22 11:31:13 2019 (r346544) +++ head/lib/libbe/libbe.3 Mon Apr 22 13:43:38 2019 (r346545) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2019 +.Dd April 22, 2019 .Dt LIBBE 3 .Os .Sh NAME @@ -63,6 +63,9 @@ .Fn be_create "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int +.Fn be_create_depth "libbe_handle_t *hdl" "const char *be_name" "const char *snap" "int depth" +.Pp +.Ft int .Fn be_create_from_existing "libbe_handle_t *hdl" "const char *be_name" "const char *be_origin" .Pp .Ft int @@ -213,19 +216,29 @@ function returns the boot environment root path. The .Fn be_create function creates a boot environment with the given name. -It will be created from a snapshot of the currently booted boot environment. +The new boot environment will be created from a recursive snapshot of the +currently booted boot environment. .Pp The +.Fn be_create_depth +function creates a boot environment with the given name from an existing +snapshot. +The depth parameter specifies the depth of recursion that will be cloned from +the existing snapshot. +A depth of '0' is no recursion and '-1' is unlimited (i.e., a recursive boot +environment). +.Pp +The .Fn be_create_from_existing function creates a boot environment with the given name from the name of an existing boot environment. -A snapshot will be made of the base boot environment, and the new boot -environment will be created from that. +A recursive snapshot will be made of the origin boot environment, and the new +boot environment will be created from that. .Pp The .Fn be_create_from_existing_snap -function creates a boot environment with the given name from an existing -snapshot. +function creates a recursive boot environment with the given name from an +existing snapshot. .Pp The .Fn be_rename From owner-svn-src-head@freebsd.org Mon Apr 22 13:45:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 041A2159A640; Mon, 22 Apr 2019 13:45:10 +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 9E8A68B45F; Mon, 22 Apr 2019 13:45:09 +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 91D1FDC23; Mon, 22 Apr 2019 13:45:09 +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 x3MDj9J8019134; Mon, 22 Apr 2019 13:45:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MDj8aN019111; Mon, 22 Apr 2019 13:45:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904221345.x3MDj8aN019111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 22 Apr 2019 13:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346546 - in head: etc/mtree lib/libbe lib/libbe/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree lib/libbe lib/libbe/tests X-SVN-Commit-Revision: 346546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E8A68B45F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 13:45:10 -0000 Author: kevans Date: Mon Apr 22 13:45:08 2019 New Revision: 346546 URL: https://svnweb.freebsd.org/changeset/base/346546 Log: libbe(3): Add a test for be creation Submitted by: Rob Fairbanks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18564 Added: head/lib/libbe/tests/ head/lib/libbe/tests/Makefile (contents, props changed) head/lib/libbe/tests/be_create.sh (contents, props changed) head/lib/libbe/tests/target_prog.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libbe/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Apr 22 13:43:38 2019 (r346545) +++ head/etc/mtree/BSD.tests.dist Mon Apr 22 13:45:08 2019 (r346546) @@ -290,6 +290,8 @@ .. libarchive .. + libbe + .. libc c063 .. Modified: head/lib/libbe/Makefile ============================================================================== --- head/lib/libbe/Makefile Mon Apr 22 13:43:38 2019 (r346545) +++ head/lib/libbe/Makefile Mon Apr 22 13:45:08 2019 (r346546) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE= lib${LIB} LIB= be SHLIBDIR?= /lib @@ -27,5 +29,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/ CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= YES +SUBDIR.${MK_TESTS}+= tests .include Added: head/lib/libbe/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbe/tests/Makefile Mon Apr 22 13:45:08 2019 (r346546) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH+= be_create + +PROGS= target_prog +SRCS_target_prog= target_prog.c +BINDIR_target_prog= ${TESTSDIR} + +LIBADD+= zfs +LIBADD+= nvpair +LIBADD+= be + +CFLAGS+= -I${SRCTOP}/lib/libbe +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common + +CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +.include Added: head/lib/libbe/tests/be_create.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbe/tests/be_create.sh Mon Apr 22 13:45:08 2019 (r346546) @@ -0,0 +1,178 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Rob Wing +# +# 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$ + +# The code for the following tests was copied from the +# bectl tests found in src/sbin/bectl/tests, modified as needed. + +ZPOOL_NAME_FILE=zpool_name +get_zpool_name() +{ + cat $ZPOOL_NAME_FILE +} +make_zpool_name() +{ + mktemp -u libbe_test_XXXXXX > $ZPOOL_NAME_FILE + get_zpool_name +} + +# Establishes a libbe zpool that can be used for some light testing; contains +# a 'default' BE and not much else. +libbe_create_setup() +{ + zpool=$1 + disk=$2 + mnt=$3 + + # Sanity check to make sure `make_zpool_name` succeeded + atf_check test -n "$zpool" + + kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" + atf_check mkdir -p ${mnt} + atf_check truncate -s 1G ${disk} + atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} + atf_check zfs create -o mountpoint=none ${zpool}/ROOT + atf_check zfs create -o mountpoint=/ -o canmount=noauto \ + ${zpool}/ROOT/default + atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ + ${zpool}/ROOT/default/usr + atf_check zfs create -o mountpoint=/usr/obj -o canmount=noauto \ + ${zpool}/ROOT/default/usr/obj +} + +libbe_cleanup() +{ + zpool=$1 + cwd=$(atf_get_srcdir) + + if [ -z "$zpool" ]; then + echo "Skipping cleanup; zpool not set up" + elif zpool get health ${zpool} >/dev/null 2>&1; then + zpool destroy -f ${zpool} + fi + + if [ -f "${cwd}/disk.img" ]; then + rm ${cwd}/disk.img + fi +} + +atf_test_case libbe_create cleanup +libbe_create_head() +{ + atf_set "descr" "check _be_create from libbe" + atf_set "require.user" root +} +libbe_create_body() +{ + cwd=$(atf_get_srcdir) + zpool=$(make_zpool_name) + disk=${cwd}/disk.img + mount=${cwd}/mnt + prog=${cwd}/./target_prog + + # preliminary setup/checks + atf_require_prog $prog + libbe_create_setup ${zpool} ${disk} ${mount} + + # a recursive and non-recursive snapshot to test against + atf_check zfs snapshot ${zpool}/ROOT/default@non-recursive + atf_check zfs snapshot -r ${zpool}/ROOT/default@recursive + + # create a dataset after snapshots were taken + atf_check zfs create -o mountpoint=/usr/src -o canmount=noauto \ + ${zpool}/ROOT/default/usr/src + + # test boot environment creation with depth of 0 (i.e. a non-recursive boot environment). + atf_check $prog "${zpool}/ROOT" \ + nonrecursive \ + "${zpool}/ROOT/default@non-recursive" \ + 0 + # the dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/nonrecursive" + # the child dataset should not exist. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/nonrecursive/usr" + + # test boot environment creation with unlimited depth (i.e. a recursive boot environment). + atf_check $prog "${zpool}/ROOT" \ + recursive \ + "${zpool}/ROOT/default@recursive" \ + -1 + # the dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive" + # the child dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive/usr" + # the child dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive/usr/obj" + # the child dataset should not exist. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/recursive/usr/src" + + # test boot environment creation with a depth of 1 + atf_check $prog "${zpool}/ROOT" \ + depth \ + "${zpool}/ROOT/default@recursive" \ + 1 + # the child dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/depth/usr" + # the child dataset should not exist. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/depth/usr/obj" + # the child dataset should not exist. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/depth/usr/src" + + + # create a recursive boot environment named 'relative-snap'. + # This test is to ensure that a relative snapshot label can be used, + # (i.e. the format: 'bootenvironment@snapshot') + atf_check $prog "${zpool}/ROOT" \ + relative-snap \ + default@recursive \ + -1 + # the dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/relative-snap" + # the child dataset should exist + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/relative-snap/usr" +} + +libbe_create_cleanup() +{ + libbe_cleanup $(get_zpool_name) +} + +atf_init_test_cases() +{ + atf_add_test_case libbe_create +} Added: head/lib/libbe/tests/target_prog.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbe/tests/target_prog.c Mon Apr 22 13:45:08 2019 (r346546) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Rob Wing + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/* + * argv[1] = root boot environment (e.g. zroot/ROOT), + * argv[2] = name of boot environment to create + * argv[3] = snapshot to create boot environment from + * argv[4] = depth + */ +int main(int argc, char *argv[]) { + + libbe_handle_t *lbh; + + if (argc != 5) + return -1; + + if ((lbh = libbe_init(argv[1])) == NULL) + return -1; + + libbe_print_on_error(lbh, true); + + return (be_create_depth(lbh, argv[2], argv[3], atoi(argv[4]))); +} From owner-svn-src-head@freebsd.org Mon Apr 22 13:57:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE944159ABF2; Mon, 22 Apr 2019 13:57: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 536D88BFA4; Mon, 22 Apr 2019 13:57: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 2F4AADDEA; Mon, 22 Apr 2019 13:57: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 x3MDvrCu024912; Mon, 22 Apr 2019 13:57:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MDvreI024911; Mon, 22 Apr 2019 13:57:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904221357.x3MDvreI024911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Apr 2019 13:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346550 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 346550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 536D88BFA4 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 13:57:53 -0000 Author: markj Date: Mon Apr 22 13:57:52 2019 New Revision: 346550 URL: https://svnweb.freebsd.org/changeset/base/346550 Log: Use separate descriptors in bhyve's stdio uart backend. bhyve was previously using stdin for both reading and writing to the console, which made it difficult to redirect console output. Use stdin for reading and stdout for writing. This makes it easier to use bhyve as a backend for syzkaller. As a side effect, the change fixes a minor bug which would cause bhyve to fail with ENOTCAPABLE if configured to use nmdm for com1 and stdio for com2. bhyveload already uses separate descriptors, as does the bvmcons driver. Reviewed by: jhb MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19788 Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Mon Apr 22 13:55:06 2019 (r346549) +++ head/usr.sbin/bhyve/uart_emul.c Mon Apr 22 13:57:52 2019 (r346550) @@ -100,8 +100,8 @@ struct fifo { struct ttyfd { bool opened; - int fd; /* tty device file descriptor */ - struct termios tio_orig, tio_new; /* I/O Terminals */ + int rfd; /* fd for reading */ + int wfd; /* fd for writing, may be == rfd */ }; struct uart_softc { @@ -141,16 +141,15 @@ ttyclose(void) static void ttyopen(struct ttyfd *tf) { + struct termios orig, new; - tcgetattr(tf->fd, &tf->tio_orig); - - tf->tio_new = tf->tio_orig; - cfmakeraw(&tf->tio_new); - tf->tio_new.c_cflag |= CLOCAL; - tcsetattr(tf->fd, TCSANOW, &tf->tio_new); - - if (tf->fd == STDIN_FILENO) { - tio_stdio_orig = tf->tio_orig; + tcgetattr(tf->rfd, &orig); + new = orig; + cfmakeraw(&new); + new.c_cflag |= CLOCAL; + tcsetattr(tf->rfd, TCSANOW, &new); + if (uart_stdio) { + tio_stdio_orig = orig; atexit(ttyclose); } } @@ -160,7 +159,7 @@ ttyread(struct ttyfd *tf) { unsigned char rb; - if (read(tf->fd, &rb, 1) == 1) + if (read(tf->rfd, &rb, 1) == 1) return (rb); else return (-1); @@ -170,7 +169,7 @@ static void ttywrite(struct ttyfd *tf, unsigned char wb) { - (void)write(tf->fd, &wb, 1); + (void)write(tf->wfd, &wb, 1); } static void @@ -190,7 +189,7 @@ rxfifo_reset(struct uart_softc *sc, int size) * Flush any unread input from the tty buffer. */ while (1) { - nread = read(sc->tty.fd, flushbuf, sizeof(flushbuf)); + nread = read(sc->tty.rfd, flushbuf, sizeof(flushbuf)); if (nread != sizeof(flushbuf)) break; } @@ -277,7 +276,7 @@ uart_opentty(struct uart_softc *sc) { ttyopen(&sc->tty); - sc->mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); + sc->mev = mevent_add(sc->tty.rfd, EVF_READ, uart_drain, sc); assert(sc->mev != NULL); } @@ -374,7 +373,7 @@ uart_drain(int fd, enum ev_type ev, void *arg) sc = arg; - assert(fd == sc->tty.fd); + assert(fd == sc->tty.rfd); assert(ev == EVF_READ); /* @@ -637,68 +636,79 @@ uart_init(uart_intr_func_t intr_assert, uart_intr_func } static int -uart_tty_backend(struct uart_softc *sc, const char *opts) +uart_stdio_backend(struct uart_softc *sc) { - int fd; - int retval; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif - retval = -1; + if (uart_stdio) + return (-1); - fd = open(opts, O_RDWR | O_NONBLOCK); - if (fd > 0 && isatty(fd)) { - sc->tty.fd = fd; - sc->tty.opened = true; - retval = 0; - } + sc->tty.rfd = STDIN_FILENO; + sc->tty.wfd = STDOUT_FILENO; + sc->tty.opened = true; - return (retval); + if (fcntl(sc->tty.rfd, F_SETFL, O_NONBLOCK) != 0) + return (-1); + if (fcntl(sc->tty.wfd, F_SETFL, O_NONBLOCK) != 0) + return (-1); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ); + if (caph_rights_limit(sc->tty.rfd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(sc->tty.rfd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + uart_stdio = true; + + return (0); } -int -uart_set_backend(struct uart_softc *sc, const char *opts) +static int +uart_tty_backend(struct uart_softc *sc, const char *opts) { - int retval; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; #endif + int fd; - retval = -1; + fd = open(opts, O_RDWR | O_NONBLOCK); + if (fd < 0 || !isatty(fd)) + return (-1); + sc->tty.rfd = sc->tty.wfd = fd; + sc->tty.opened = true; + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (caph_rights_limit(fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + return (0); +} + +int +uart_set_backend(struct uart_softc *sc, const char *opts) +{ + int retval; + if (opts == NULL) return (0); - if (strcmp("stdio", opts) == 0) { - if (!uart_stdio) { - sc->tty.fd = STDIN_FILENO; - sc->tty.opened = true; - uart_stdio = true; - retval = 0; - } - } else if (uart_tty_backend(sc, opts) == 0) { - retval = 0; - } - - /* Make the backend file descriptor non-blocking */ + if (strcmp("stdio", opts) == 0) + retval = uart_stdio_backend(sc); + else + retval = uart_tty_backend(sc, opts); if (retval == 0) - retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); - - if (retval == 0) { -#ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, - CAP_WRITE); - if (caph_rights_limit(sc->tty.fd, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (caph_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (!uart_stdio) { - if (caph_limit_stdin() == -1) - errx(EX_OSERR, - "Unable to apply rights for sandbox"); - } -#endif uart_opentty(sc); - } return (retval); } From owner-svn-src-head@freebsd.org Mon Apr 22 14:20:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E4BD159B61A; Mon, 22 Apr 2019 14:20:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02FD28D32D; Mon, 22 Apr 2019 14:20:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1338E287; Mon, 22 Apr 2019 14:20:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MEKnC2037422; Mon, 22 Apr 2019 14:20:49 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MEKn34037421; Mon, 22 Apr 2019 14:20:49 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201904221420.x3MEKn34037421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 22 Apr 2019 14:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346554 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02FD28D32D 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 14:20:50 -0000 Author: bz Date: Mon Apr 22 14:20:49 2019 New Revision: 346554 URL: https://svnweb.freebsd.org/changeset/base/346554 Log: Remove some excessive brackets. No functional change. MFC after: 10 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Apr 22 14:10:40 2019 (r346553) +++ head/sys/netinet/udp_usrreq.c Mon Apr 22 14:20:49 2019 (r346554) @@ -1280,12 +1280,12 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; - } else if ((sin != NULL && ( - (sin->sin_addr.s_addr == INADDR_ANY) || - (sin->sin_addr.s_addr == INADDR_BROADCAST) || - (inp->inp_laddr.s_addr == INADDR_ANY) || - (inp->inp_lport == 0))) || - (src.sin_family == AF_INET)) { + } else if ((sin != NULL && + (sin->sin_addr.s_addr == INADDR_ANY || + sin->sin_addr.s_addr == INADDR_BROADCAST || + inp->inp_laddr.s_addr == INADDR_ANY || + inp->inp_lport == 0)) || + src.sin_family == AF_INET) { INP_HASH_RLOCK_ET(pcbinfo, et); unlock_udbinfo = UH_RLOCKED; } else From owner-svn-src-head@freebsd.org Mon Apr 22 14:23:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D949159B6A1; Mon, 22 Apr 2019 14:23:58 +0000 (UTC) (envelope-from bz@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 A38E18D6EE; Mon, 22 Apr 2019 14:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 629071017A; Mon, 22 Apr 2019 14:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 506918D4A154; Mon, 22 Apr 2019 14:23:56 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D251BE70839; Mon, 22 Apr 2019 14:23:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id QvdJYfnY5ztM; Mon, 22 Apr 2019 14:23:54 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 91DA4E70812; Mon, 22 Apr 2019 14:23:54 +0000 (UTC) From: "Bjoern A. Zeeb" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346554 - head/sys/netinet Date: Mon, 22 Apr 2019 14:23:54 +0000 X-Mailer: MailMate (2.0BETAr6135) Message-ID: <7A9D3668-2949-45CF-B5A2-968F633FE285@FreeBSD.org> In-Reply-To: <201904221420.x3MEKn34037421@repo.freebsd.org> References: <201904221420.x3MEKn34037421@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A38E18D6EE 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.980,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 14:23:58 -0000 On 22 Apr 2019, at 14:20, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Apr 22 14:20:49 2019 > New Revision: 346554 > URL: https://svnweb.freebsd.org/changeset/base/346554 > > Log: > Remove some excessive brackets. > > No functional change. But it includes a stye bug; sorry; I had re-indented the lines to validate the change. I’ll remedy this with the follow-up commit which will split that block up anyway. /bz From owner-svn-src-head@freebsd.org Mon Apr 22 14:53:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94859159C16C; Mon, 22 Apr 2019 14:53:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 360AA8E70B; Mon, 22 Apr 2019 14:53:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10DE9E848; Mon, 22 Apr 2019 14:53:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MErrC3057476; Mon, 22 Apr 2019 14:53:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MErrgH057475; Mon, 22 Apr 2019 14:53:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201904221453.x3MErrgH057475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 22 Apr 2019 14:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346556 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 360AA8E70B 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 14:53:54 -0000 Author: bz Date: Mon Apr 22 14:53:53 2019 New Revision: 346556 URL: https://svnweb.freebsd.org/changeset/base/346556 Log: r297225 move the assignment of sin from add to the top of the function. sin is not changed after the initial assignment, so no need to set it again. MFC after: 10 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Apr 22 14:49:24 2019 (r346555) +++ head/sys/netinet/udp_usrreq.c Mon Apr 22 14:53:53 2019 (r346556) @@ -1275,7 +1275,6 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s */ pr = inp->inp_socket->so_proto->pr_protocol; pcbinfo = udp_get_inpcbinfo(pr); - sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_HASH_WLOCK(pcbinfo); From owner-svn-src-head@freebsd.org Mon Apr 22 14:55:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2174A159C249; Mon, 22 Apr 2019 14:55:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 996C48E8C3; Mon, 22 Apr 2019 14:55:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 04005C86C; Tue, 23 Apr 2019 00:55:22 +1000 (AEST) Date: Tue, 23 Apr 2019 00:55:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346554 - head/sys/netinet In-Reply-To: <7A9D3668-2949-45CF-B5A2-968F633FE285@FreeBSD.org> Message-ID: <20190423004413.E2402@besplex.bde.org> References: <201904221420.x3MEKn34037421@repo.freebsd.org> <7A9D3668-2949-45CF-B5A2-968F633FE285@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 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=8EedbDgTokVb82HiRtgA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 996C48E8C3 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.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 14:55:35 -0000 On Mon, 22 Apr 2019, Bjoern A. Zeeb wrote: > On 22 Apr 2019, at 14:20, Bjoern A. Zeeb wrote: >> Log: >> Remove some excessive brackets. >> >> No functional change. > > But it includes a stye bug; sorry; I had re-indented the lines to validate > the change. Ill remedy this with the follow-up commit which will split > that block up anyway. Also, it removes excessive parentheses, not excessive brackets. I think excessive brackets are just syntax errors. E.g., a[[i]]. Excessive braces are not syntax errors, but I've never more than single excessive ones. E.g., if (foo != 0) { bar(); } is a common style bug, but if (foo != 0) {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ bar(); }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} s unusual. Bruce From owner-svn-src-head@freebsd.org Mon Apr 22 16:26:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF5C5159E809; Mon, 22 Apr 2019 16:26:40 +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 793FB6BDCD; Mon, 22 Apr 2019 16:26:40 +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 68014F829; Mon, 22 Apr 2019 16:26:40 +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 x3MGQevs006174; Mon, 22 Apr 2019 16:26:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MGQeOx006173; Mon, 22 Apr 2019 16:26:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904221626.x3MGQeOx006173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Apr 2019 16:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346565 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 346565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 793FB6BDCD 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 16:26:41 -0000 Author: cem Date: Mon Apr 22 16:26:39 2019 New Revision: 346565 URL: https://svnweb.freebsd.org/changeset/base/346565 Log: rand.3: Match better recommendation language from random.3 Sponsored by: Dell EMC Isilon Modified: head/lib/libc/stdlib/rand.3 Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Mon Apr 22 15:44:21 2019 (r346564) +++ head/lib/libc/stdlib/rand.3 Mon Apr 22 16:26:39 2019 (r346565) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 2, 2013 +.Dd April 22, 2019 .Dt RAND 3 .Os .Sh NAME @@ -57,7 +57,7 @@ .Bf -symbolic The functions described in this manual page are not cryptographically secure. -Cryptographic applications should use +Applications which require unpredictable random numbers should use .Xr arc4random 3 instead. .Ef From owner-svn-src-head@freebsd.org Mon Apr 22 16:27:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D730159E89E; Mon, 22 Apr 2019 16:27:50 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B49F26BF50; Mon, 22 Apr 2019 16:27:49 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3MGRlSg032857; Mon, 22 Apr 2019 09:27:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3MGRlUi032856; Mon, 22 Apr 2019 09:27:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904221627.x3MGRlUi032856@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346550 - head/usr.sbin/bhyve In-Reply-To: <201904221357.x3MDvreI024911@repo.freebsd.org> To: Mark Johnston Date: Mon, 22 Apr 2019 09:27:47 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B49F26BF50 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.940,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 16:27:50 -0000 > Author: markj > Date: Mon Apr 22 13:57:52 2019 > New Revision: 346550 > URL: https://svnweb.freebsd.org/changeset/base/346550 > > Log: > Use separate descriptors in bhyve's stdio uart backend. > > bhyve was previously using stdin for both reading and writing to the > console, which made it difficult to redirect console output. Use > stdin for reading and stdout for writing. This makes it easier to use > bhyve as a backend for syzkaller. > > As a side effect, the change fixes a minor bug which would cause bhyve > to fail with ENOTCAPABLE if configured to use nmdm for com1 and stdio > for com2. > > bhyveload already uses separate descriptors, as does the bvmcons driver. > > Reviewed by: jhb > MFC after: 1 month We are approaching the 11.3 release slush, unless there is some high risk associated with this change I would like to see it in the early 11.3 alpha/beta tests rather than have it come in late in the test cycle. Thanks, Rod > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D19788 > > Modified: > head/usr.sbin/bhyve/uart_emul.c > > Modified: head/usr.sbin/bhyve/uart_emul.c > ============================================================================== > --- head/usr.sbin/bhyve/uart_emul.c Mon Apr 22 13:55:06 2019 (r346549) > +++ head/usr.sbin/bhyve/uart_emul.c Mon Apr 22 13:57:52 2019 (r346550) > @@ -100,8 +100,8 @@ struct fifo { > > struct ttyfd { > bool opened; > - int fd; /* tty device file descriptor */ > - struct termios tio_orig, tio_new; /* I/O Terminals */ > + int rfd; /* fd for reading */ > + int wfd; /* fd for writing, may be == rfd */ > }; > > struct uart_softc { > @@ -141,16 +141,15 @@ ttyclose(void) > static void > ttyopen(struct ttyfd *tf) > { > + struct termios orig, new; > > - tcgetattr(tf->fd, &tf->tio_orig); > - > - tf->tio_new = tf->tio_orig; > - cfmakeraw(&tf->tio_new); > - tf->tio_new.c_cflag |= CLOCAL; > - tcsetattr(tf->fd, TCSANOW, &tf->tio_new); > - > - if (tf->fd == STDIN_FILENO) { > - tio_stdio_orig = tf->tio_orig; > + tcgetattr(tf->rfd, &orig); > + new = orig; > + cfmakeraw(&new); > + new.c_cflag |= CLOCAL; > + tcsetattr(tf->rfd, TCSANOW, &new); > + if (uart_stdio) { > + tio_stdio_orig = orig; > atexit(ttyclose); > } > } > @@ -160,7 +159,7 @@ ttyread(struct ttyfd *tf) > { > unsigned char rb; > > - if (read(tf->fd, &rb, 1) == 1) > + if (read(tf->rfd, &rb, 1) == 1) > return (rb); > else > return (-1); > @@ -170,7 +169,7 @@ static void > ttywrite(struct ttyfd *tf, unsigned char wb) > { > > - (void)write(tf->fd, &wb, 1); > + (void)write(tf->wfd, &wb, 1); > } > > static void > @@ -190,7 +189,7 @@ rxfifo_reset(struct uart_softc *sc, int size) > * Flush any unread input from the tty buffer. > */ > while (1) { > - nread = read(sc->tty.fd, flushbuf, sizeof(flushbuf)); > + nread = read(sc->tty.rfd, flushbuf, sizeof(flushbuf)); > if (nread != sizeof(flushbuf)) > break; > } > @@ -277,7 +276,7 @@ uart_opentty(struct uart_softc *sc) > { > > ttyopen(&sc->tty); > - sc->mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); > + sc->mev = mevent_add(sc->tty.rfd, EVF_READ, uart_drain, sc); > assert(sc->mev != NULL); > } > > @@ -374,7 +373,7 @@ uart_drain(int fd, enum ev_type ev, void *arg) > > sc = arg; > > - assert(fd == sc->tty.fd); > + assert(fd == sc->tty.rfd); > assert(ev == EVF_READ); > > /* > @@ -637,68 +636,79 @@ uart_init(uart_intr_func_t intr_assert, uart_intr_func > } > > static int > -uart_tty_backend(struct uart_softc *sc, const char *opts) > +uart_stdio_backend(struct uart_softc *sc) > { > - int fd; > - int retval; > +#ifndef WITHOUT_CAPSICUM > + cap_rights_t rights; > + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; > +#endif > > - retval = -1; > + if (uart_stdio) > + return (-1); > > - fd = open(opts, O_RDWR | O_NONBLOCK); > - if (fd > 0 && isatty(fd)) { > - sc->tty.fd = fd; > - sc->tty.opened = true; > - retval = 0; > - } > + sc->tty.rfd = STDIN_FILENO; > + sc->tty.wfd = STDOUT_FILENO; > + sc->tty.opened = true; > > - return (retval); > + if (fcntl(sc->tty.rfd, F_SETFL, O_NONBLOCK) != 0) > + return (-1); > + if (fcntl(sc->tty.wfd, F_SETFL, O_NONBLOCK) != 0) > + return (-1); > + > +#ifndef WITHOUT_CAPSICUM > + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ); > + if (caph_rights_limit(sc->tty.rfd, &rights) == -1) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > + if (caph_ioctls_limit(sc->tty.rfd, cmds, nitems(cmds)) == -1) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > +#endif > + > + uart_stdio = true; > + > + return (0); > } > > -int > -uart_set_backend(struct uart_softc *sc, const char *opts) > +static int > +uart_tty_backend(struct uart_softc *sc, const char *opts) > { > - int retval; > #ifndef WITHOUT_CAPSICUM > cap_rights_t rights; > cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; > #endif > + int fd; > > - retval = -1; > + fd = open(opts, O_RDWR | O_NONBLOCK); > + if (fd < 0 || !isatty(fd)) > + return (-1); > > + sc->tty.rfd = sc->tty.wfd = fd; > + sc->tty.opened = true; > + > +#ifndef WITHOUT_CAPSICUM > + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); > + if (caph_rights_limit(fd, &rights) == -1) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > + if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > +#endif > + > + return (0); > +} > + > +int > +uart_set_backend(struct uart_softc *sc, const char *opts) > +{ > + int retval; > + > if (opts == NULL) > return (0); > > - if (strcmp("stdio", opts) == 0) { > - if (!uart_stdio) { > - sc->tty.fd = STDIN_FILENO; > - sc->tty.opened = true; > - uart_stdio = true; > - retval = 0; > - } > - } else if (uart_tty_backend(sc, opts) == 0) { > - retval = 0; > - } > - > - /* Make the backend file descriptor non-blocking */ > + if (strcmp("stdio", opts) == 0) > + retval = uart_stdio_backend(sc); > + else > + retval = uart_tty_backend(sc, opts); > if (retval == 0) > - retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); > - > - if (retval == 0) { > -#ifndef WITHOUT_CAPSICUM > - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, > - CAP_WRITE); > - if (caph_rights_limit(sc->tty.fd, &rights) == -1) > - errx(EX_OSERR, "Unable to apply rights for sandbox"); > - if (caph_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1) > - errx(EX_OSERR, "Unable to apply rights for sandbox"); > - if (!uart_stdio) { > - if (caph_limit_stdin() == -1) > - errx(EX_OSERR, > - "Unable to apply rights for sandbox"); > - } > -#endif > uart_opentty(sc); > - } > > return (retval); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Apr 22 16:29:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62942159E954; Mon, 22 Apr 2019 16:29:35 +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 049E66C0BF; Mon, 22 Apr 2019 16:29:35 +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 E66EFF82D; Mon, 22 Apr 2019 16:29:34 +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 x3MGTYfh006330; Mon, 22 Apr 2019 16:29:34 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MGTYVQ006329; Mon, 22 Apr 2019 16:29:34 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904221629.x3MGTYVQ006329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Apr 2019 16:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346566 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 346566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 049E66C0BF 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 16:29:35 -0000 Author: cem Date: Mon Apr 22 16:29:34 2019 New Revision: 346566 URL: https://svnweb.freebsd.org/changeset/base/346566 Log: random.3: Remove obsolete BUGS section Relative performance to rand(3) is sort of irrelevant; they do different things and a user with sensitivity to RNG performance won't use libc random(3) anyway. The historical note about bad seeding is long obsolete, referring to a 1996 or earlier version of FreeBSD. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Mon Apr 22 16:26:39 2019 (r346565) +++ head/lib/libc/stdlib/random.3 Mon Apr 22 16:29:34 2019 (r346566) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 15, 2019 +.Dd April 22, 2019 .Dt RANDOM 3 .Os .Sh NAME @@ -187,11 +187,3 @@ functions appeared in .Bx 4.2 . .Sh AUTHORS .An Earl T. Cohen -.Sh BUGS -About 2/3 the speed of -.Xr rand 3 . -.Pp -The historical implementation used to have a very weak seeding; the -random sequence did not vary much with the seed. -The current implementation employs a better pseudo-random number -generator for the initial state calculation. From owner-svn-src-head@freebsd.org Mon Apr 22 17:00:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26173159F1E1; Mon, 22 Apr 2019 17:00:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18306CF30; Mon, 22 Apr 2019 17:00:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A19CFD5D; Mon, 22 Apr 2019 17:00:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MH0Upi021528; Mon, 22 Apr 2019 17:00:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MH0U5W021527; Mon, 22 Apr 2019 17:00:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904221700.x3MH0U5W021527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 22 Apr 2019 17:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346567 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 346567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C18306CF30 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 17:00:31 -0000 Author: np Date: Mon Apr 22 17:00:30 2019 New Revision: 346567 URL: https://svnweb.freebsd.org/changeset/base/346567 Log: cxgbe(4): Make sure bundled_fw is always initialized before use. This fixes a bug that prevented the driver from auto-flashing the firmware when it didn't see one on the card. This feature was introduced in r321390 and this bug was introduced in r343269. Reported by: gallatin@ MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Apr 22 16:29:34 2019 (r346566) +++ head/sys/dev/cxgbe/t4_main.c Mon Apr 22 17:00:30 2019 (r346567) @@ -3529,19 +3529,6 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = false; fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; - if (reason != NULL) - goto install; - - if ((sc->flags & FW_OK) == 0) { - - if (c == 0xffffffff) { - reason = "missing"; - goto install; - } - - return (0); - } - memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); if (t4_fw_install < 0) { rc = load_fw_module(sc, &cfg, &fw); @@ -3557,6 +3544,20 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = true; } d = be32toh(bundled_fw.fw_ver); + + if (reason != NULL) + goto install; + + if ((sc->flags & FW_OK) == 0) { + + if (c == 0xffffffff) { + reason = "missing"; + goto install; + } + + rc = 0; + goto done; + } if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; From owner-svn-src-head@freebsd.org Mon Apr 22 17:25:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E23D159FC1F; Mon, 22 Apr 2019 17:25:01 +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 E89EF6DF22; Mon, 22 Apr 2019 17:25:00 +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 BF9E418276; Mon, 22 Apr 2019 17:25:00 +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 x3MHP0TA037063; Mon, 22 Apr 2019 17:25:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MHP0d2037062; Mon, 22 Apr 2019 17:25:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904221725.x3MHP0d2037062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Apr 2019 17:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346568 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 346568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E89EF6DF22 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 17:25:01 -0000 Author: emaste Date: Mon Apr 22 17:25:00 2019 New Revision: 346568 URL: https://svnweb.freebsd.org/changeset/base/346568 Log: ar: test for writing 64-bit format only if symbol count is nonzero This is a minor simplification; if we do not have any symbols the empty symbol table can be in 32-bit format. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Mon Apr 22 17:00:30 2019 (r346567) +++ head/usr.bin/ar/write.c Mon Apr 22 17:25:00 2019 (r346568) @@ -656,10 +656,7 @@ write_objs(struct bsdar *bsdar) * * absolute_offset = htobe32(relative_offset + size_of_pseudo_members) */ - w_sz = sizeof(uint32_t); - if (bsdar->s_so_max > UINT32_MAX) - w_sz = sizeof(uint64_t); if (bsdar->s_cnt != 0) { s_sz = (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz; pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz); From owner-svn-src-head@freebsd.org Mon Apr 22 17:29:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C59D159FD22; Mon, 22 Apr 2019 17:29:27 +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 B580E6E0E5; Mon, 22 Apr 2019 17:29:26 +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 9027218278; Mon, 22 Apr 2019 17:29:26 +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 x3MHTQ1O037275; Mon, 22 Apr 2019 17:29:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MHTQHB037274; Mon, 22 Apr 2019 17:29:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904221729.x3MHTQHB037274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Apr 2019 17:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346569 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 346569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B580E6E0E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 17:29:27 -0000 Author: emaste Date: Mon Apr 22 17:29:26 2019 New Revision: 346569 URL: https://svnweb.freebsd.org/changeset/base/346569 Log: ar: use array notation to access s_so This is somewhat more readable than pointer arithmetic. Also remove an unnecessary cast while here. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Mon Apr 22 17:25:00 2019 (r346568) +++ head/usr.bin/ar/write.c Mon Apr 22 17:29:26 2019 (r346569) @@ -673,11 +673,11 @@ write_objs(struct bsdar *bsdar) for (i = 0; (size_t)i < bsdar->s_cnt; i++) { if (w_sz == sizeof(uint32_t)) - *(bsdar->s_so + i) = - htobe32((uint32_t)(*(bsdar->s_so + i)) + pm_sz); + bsdar->s_so[i] = + htobe32(bsdar->s_so[i] + pm_sz); else - *(bsdar->s_so + i) = - htobe64(*(bsdar->s_so + i) + pm_sz); + bsdar->s_so[i] = + htobe64(bsdar->s_so[i] + pm_sz); } } From owner-svn-src-head@freebsd.org Mon Apr 22 17:48:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0419515A0321; Mon, 22 Apr 2019 17:48:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 984E76EEC9; Mon, 22 Apr 2019 17:48:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BBB2185E5; Mon, 22 Apr 2019 17:48:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MHmBMb048442; Mon, 22 Apr 2019 17:48:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MHmAxu048437; Mon, 22 Apr 2019 17:48:10 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904221748.x3MHmAxu048437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 22 Apr 2019 17:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346570 - in head/sys/dev/cxgbe: common tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: common tom X-SVN-Commit-Revision: 346570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 984E76EEC9 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 17:48:12 -0000 Author: np Date: Mon Apr 22 17:48:10 2019 New Revision: 346570 URL: https://svnweb.freebsd.org/changeset/base/346570 Log: cxgbe/t4_tom: Add a "TCB history" feature that samples hardware state for a tid and maintains a running history of some interesting events. Service TCP_INFO queries from the history when the tid is being tracked there. Modified: head/sys/dev/cxgbe/common/t4_msg.h head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Mon Apr 22 17:29:26 2019 (r346569) +++ head/sys/dev/cxgbe/common/t4_msg.h Mon Apr 22 17:48:10 2019 (r346570) @@ -923,7 +923,8 @@ struct cpl_get_tcb { WR_HDR; union opcode_tid ot; __be16 reply_ctrl; - __be16 cookie; + __u8 rsvd; + __u8 cookie; }; /* cpl_get_tcb.reply_ctrl fields */ Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 22 17:29:26 2019 (r346569) +++ head/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 22 17:48:10 2019 (r346570) @@ -386,55 +386,352 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int } } -static inline int -get_tcb_bit(u_char *tcb, int bit) +static inline uint64_t +get_tcb_tflags(const uint64_t *tcb) { - int ix, shift; - ix = 127 - (bit >> 3); - shift = bit & 0x7; - - return ((tcb[ix] >> shift) & 1); + return ((be64toh(tcb[14]) << 32) | (be64toh(tcb[15]) >> 32)); } -static inline uint64_t -get_tcb_bits(u_char *tcb, int hi, int lo) +static inline uint32_t +get_tcb_field(const uint64_t *tcb, u_int word, uint32_t mask, u_int shift) { - uint64_t rc = 0; +#define LAST_WORD ((TCB_SIZE / 4) - 1) + uint64_t t1, t2; + int flit_idx; - while (hi >= lo) { - rc = (rc << 1) | get_tcb_bit(tcb, hi); - --hi; + MPASS(mask != 0); + MPASS(word <= LAST_WORD); + MPASS(shift < 32); + + flit_idx = (LAST_WORD - word) / 2; + if (word & 0x1) + shift += 32; + t1 = be64toh(tcb[flit_idx]) >> shift; + t2 = 0; + if (fls(mask) > 64 - shift) { + /* + * Will spill over into the next logical flit, which is the flit + * before this one. The flit_idx before this one must be valid. + */ + MPASS(flit_idx > 0); + t2 = be64toh(tcb[flit_idx - 1]) << (64 - shift); } + return ((t2 | t1) & mask); +#undef LAST_WORD +} +#define GET_TCB_FIELD(tcb, F) \ + get_tcb_field(tcb, W_TCB_##F, M_TCB_##F, S_TCB_##F) +/* + * Issues a CPL_GET_TCB to read the entire TCB for the tid. + */ +static int +send_get_tcb(struct adapter *sc, u_int tid) +{ + struct cpl_get_tcb *cpl; + struct wrq_cookie cookie; + + MPASS(tid < sc->tids.ntids); + + cpl = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*cpl), 16), + &cookie); + if (__predict_false(cpl == NULL)) + return (ENOMEM); + bzero(cpl, sizeof(*cpl)); + INIT_TP_WR(cpl, tid); + OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_GET_TCB, tid)); + cpl->reply_ctrl = htobe16(V_REPLY_CHAN(0) | + V_QUEUENO(sc->sge.ofld_rxq[0].iq.cntxt_id)); + cpl->cookie = 0xff; + commit_wrq_wr(&sc->sge.ctrlq[0], cpl, &cookie); + + return (0); +} + +static struct tcb_histent * +alloc_tcb_histent(struct adapter *sc, u_int tid, int flags) +{ + struct tcb_histent *te; + + MPASS(flags == M_NOWAIT || flags == M_WAITOK); + + te = malloc(sizeof(*te), M_CXGBE, M_ZERO | flags); + if (te == NULL) + return (NULL); + mtx_init(&te->te_lock, "TCB entry", NULL, MTX_DEF); + callout_init_mtx(&te->te_callout, &te->te_lock, 0); + te->te_adapter = sc; + te->te_tid = tid; + + return (te); +} + +static void +free_tcb_histent(struct tcb_histent *te) +{ + + mtx_destroy(&te->te_lock); + free(te, M_CXGBE); +} + +/* + * Start tracking the tid in the TCB history. + */ +int +add_tid_to_history(struct adapter *sc, u_int tid) +{ + struct tcb_histent *te = NULL; + struct tom_data *td = sc->tom_softc; + int rc; + + MPASS(tid < sc->tids.ntids); + + if (td->tcb_history == NULL) + return (ENXIO); + + rw_wlock(&td->tcb_history_lock); + if (td->tcb_history[tid] != NULL) { + rc = EEXIST; + goto done; + } + te = alloc_tcb_histent(sc, tid, M_NOWAIT); + if (te == NULL) { + rc = ENOMEM; + goto done; + } + mtx_lock(&te->te_lock); + rc = send_get_tcb(sc, tid); + if (rc == 0) { + te->te_flags |= TE_RPL_PENDING; + td->tcb_history[tid] = te; + } else { + free(te, M_CXGBE); + } + mtx_unlock(&te->te_lock); +done: + rw_wunlock(&td->tcb_history_lock); return (rc); } +static void +remove_tcb_histent(struct tcb_histent *te) +{ + struct adapter *sc = te->te_adapter; + struct tom_data *td = sc->tom_softc; + + rw_assert(&td->tcb_history_lock, RA_WLOCKED); + mtx_assert(&te->te_lock, MA_OWNED); + MPASS(td->tcb_history[te->te_tid] == te); + + td->tcb_history[te->te_tid] = NULL; + free_tcb_histent(te); + rw_wunlock(&td->tcb_history_lock); +} + +static inline struct tcb_histent * +lookup_tcb_histent(struct adapter *sc, u_int tid, bool addrem) +{ + struct tcb_histent *te; + struct tom_data *td = sc->tom_softc; + + MPASS(tid < sc->tids.ntids); + + if (addrem) + rw_wlock(&td->tcb_history_lock); + else + rw_rlock(&td->tcb_history_lock); + te = td->tcb_history[tid]; + if (te != NULL) { + mtx_lock(&te->te_lock); + return (te); /* with both locks held */ + } + if (addrem) + rw_wunlock(&td->tcb_history_lock); + else + rw_runlock(&td->tcb_history_lock); + + return (te); +} + +static inline void +release_tcb_histent(struct tcb_histent *te) +{ + struct adapter *sc = te->te_adapter; + struct tom_data *td = sc->tom_softc; + + mtx_assert(&te->te_lock, MA_OWNED); + mtx_unlock(&te->te_lock); + rw_assert(&td->tcb_history_lock, RA_RLOCKED); + rw_runlock(&td->tcb_history_lock); +} + +static void +request_tcb(void *arg) +{ + struct tcb_histent *te = arg; + + mtx_assert(&te->te_lock, MA_OWNED); + + /* Noone else is supposed to update the histent. */ + MPASS(!(te->te_flags & TE_RPL_PENDING)); + if (send_get_tcb(te->te_adapter, te->te_tid) == 0) + te->te_flags |= TE_RPL_PENDING; + else + callout_schedule(&te->te_callout, hz / 100); +} + +static void +update_tcb_histent(struct tcb_histent *te, const uint64_t *tcb) +{ + struct tom_data *td = te->te_adapter->tom_softc; + uint64_t tflags = get_tcb_tflags(tcb); + uint8_t sample = 0; + + if (GET_TCB_FIELD(tcb, SND_MAX_RAW) != GET_TCB_FIELD(tcb, SND_UNA_RAW)) { + if (GET_TCB_FIELD(tcb, T_RXTSHIFT) != 0) + sample |= TS_RTO; + if (GET_TCB_FIELD(tcb, T_DUPACKS) != 0) + sample |= TS_DUPACKS; + if (GET_TCB_FIELD(tcb, T_DUPACKS) >= td->dupack_threshold) + sample |= TS_FASTREXMT; + } + + if (GET_TCB_FIELD(tcb, SND_MAX_RAW) != 0) { + uint32_t snd_wnd; + + sample |= TS_SND_BACKLOGGED; /* for whatever reason. */ + + snd_wnd = GET_TCB_FIELD(tcb, RCV_ADV); + if (tflags & V_TF_RECV_SCALE(1)) + snd_wnd <<= GET_TCB_FIELD(tcb, RCV_SCALE); + if (GET_TCB_FIELD(tcb, SND_CWND) < snd_wnd) + sample |= TS_CWND_LIMITED; /* maybe due to CWND */ + } + + if (tflags & V_TF_CCTRL_ECN(1)) { + + /* + * CE marker on incoming IP hdr, echoing ECE back in the TCP + * hdr. Indicates congestion somewhere on the way from the peer + * to this node. + */ + if (tflags & V_TF_CCTRL_ECE(1)) + sample |= TS_ECN_ECE; + + /* + * ECE seen and CWR sent (or about to be sent). Might indicate + * congestion on the way to the peer. This node is reducing its + * congestion window in response. + */ + if (tflags & (V_TF_CCTRL_CWR(1) | V_TF_CCTRL_RFR(1))) + sample |= TS_ECN_CWR; + } + + te->te_sample[te->te_pidx] = sample; + if (++te->te_pidx == nitems(te->te_sample)) + te->te_pidx = 0; + memcpy(te->te_tcb, tcb, TCB_SIZE); + te->te_flags |= TE_ACTIVE; +} + +static int +do_get_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_get_tcb_rpl *cpl = mtod(m, const void *); + const uint64_t *tcb = (const uint64_t *)(const void *)(cpl + 1); + struct tcb_histent *te; + const u_int tid = GET_TID(cpl); + bool remove; + + remove = GET_TCB_FIELD(tcb, T_STATE) == TCPS_CLOSED; + te = lookup_tcb_histent(sc, tid, remove); + if (te == NULL) { + /* Not in the history. Who issued the GET_TCB for this? */ + device_printf(sc->dev, "tcb %u: flags 0x%016jx, state %u, " + "srtt %u, sscale %u, rscale %u, cookie 0x%x\n", tid, + (uintmax_t)get_tcb_tflags(tcb), GET_TCB_FIELD(tcb, T_STATE), + GET_TCB_FIELD(tcb, T_SRTT), GET_TCB_FIELD(tcb, SND_SCALE), + GET_TCB_FIELD(tcb, RCV_SCALE), cpl->cookie); + goto done; + } + + MPASS(te->te_flags & TE_RPL_PENDING); + te->te_flags &= ~TE_RPL_PENDING; + if (remove) { + remove_tcb_histent(te); + } else { + update_tcb_histent(te, tcb); + callout_reset(&te->te_callout, hz / 10, request_tcb, te); + release_tcb_histent(te); + } +done: + m_freem(m); + return (0); +} + +static void +fill_tcp_info_from_tcb(struct adapter *sc, uint64_t *tcb, struct tcp_info *ti) +{ + uint32_t v; + + ti->tcpi_state = GET_TCB_FIELD(tcb, T_STATE); + + v = GET_TCB_FIELD(tcb, T_SRTT); + ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + + v = GET_TCB_FIELD(tcb, T_RTTVAR); + ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); + + ti->tcpi_snd_ssthresh = GET_TCB_FIELD(tcb, SND_SSTHRESH); + ti->tcpi_snd_cwnd = GET_TCB_FIELD(tcb, SND_CWND); + ti->tcpi_rcv_nxt = GET_TCB_FIELD(tcb, RCV_NXT); + + v = GET_TCB_FIELD(tcb, TX_MAX); + ti->tcpi_snd_nxt = v - GET_TCB_FIELD(tcb, SND_NXT_RAW); + + /* Receive window being advertised by us. */ + ti->tcpi_rcv_wscale = GET_TCB_FIELD(tcb, SND_SCALE); /* Yes, SND. */ + ti->tcpi_rcv_space = GET_TCB_FIELD(tcb, RCV_WND); + + /* Send window */ + ti->tcpi_snd_wscale = GET_TCB_FIELD(tcb, RCV_SCALE); /* Yes, RCV. */ + ti->tcpi_snd_wnd = GET_TCB_FIELD(tcb, RCV_ADV); + if (get_tcb_tflags(tcb) & V_TF_RECV_SCALE(1)) + ti->tcpi_snd_wnd <<= ti->tcpi_snd_wscale; + else + ti->tcpi_snd_wscale = 0; + +} + +static void +fill_tcp_info_from_history(struct adapter *sc, struct tcb_histent *te, + struct tcp_info *ti) +{ + + fill_tcp_info_from_tcb(sc, te->te_tcb, ti); +} + /* - * Called by the kernel to allow the TOE driver to "refine" values filled up in - * the tcp_info for an offloaded connection. + * Reads the TCB for the given tid using a memory window and copies it to 'buf' + * in the same format as CPL_GET_TCB_RPL. */ static void -t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +read_tcb_using_memwin(struct adapter *sc, u_int tid, uint64_t *buf) { int i, j, k, rc; - struct adapter *sc = tod->tod_softc; - struct toepcb *toep = tp->t_toe; - uint32_t addr, v; - uint32_t buf[TCB_SIZE / sizeof(uint32_t)]; + uint32_t addr; u_char *tcb, tmp; - INP_WLOCK_ASSERT(tp->t_inpcb); - MPASS(ti != NULL); + MPASS(tid < sc->tids.ntids); - ti->tcpi_toe_tid = toep->tid; - - addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + toep->tid * TCB_SIZE; - rc = read_via_memwin(sc, 2, addr, &buf[0], TCB_SIZE); + addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + tid * TCB_SIZE; + rc = read_via_memwin(sc, 2, addr, (uint32_t *)buf, TCB_SIZE); if (rc != 0) return; - tcb = (u_char *)&buf[0]; + tcb = (u_char *)buf; for (i = 0, j = TCB_SIZE - 16; i < j; i += 16, j -= 16) { for (k = 0; k < 16; k++) { tmp = tcb[i + k]; @@ -442,28 +739,42 @@ t4_tcp_info(struct toedev *tod, struct tcpcb *tp, stru tcb[j + k] = tmp; } } +} - ti->tcpi_state = get_tcb_bits(tcb, 115, 112); +static void +fill_tcp_info(struct adapter *sc, u_int tid, struct tcp_info *ti) +{ + uint64_t tcb[TCB_SIZE / sizeof(uint64_t)]; + struct tcb_histent *te; - v = get_tcb_bits(tcb, 271, 256); - ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + ti->tcpi_toe_tid = tid; + te = lookup_tcb_histent(sc, tid, false); + if (te != NULL) { + fill_tcp_info_from_history(sc, te, ti); + release_tcb_histent(te); + } else { + if (!(sc->debug_flags & DF_DISABLE_TCB_CACHE)) { + /* XXX: tell firmware to flush TCB cache. */ + } + read_tcb_using_memwin(sc, tid, tcb); + fill_tcp_info_from_tcb(sc, tcb, ti); + } +} - v = get_tcb_bits(tcb, 287, 272); - ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); +/* + * Called by the kernel to allow the TOE driver to "refine" values filled up in + * the tcp_info for an offloaded connection. + */ +static void +t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +{ + struct adapter *sc = tod->tod_softc; + struct toepcb *toep = tp->t_toe; - ti->tcpi_snd_ssthresh = get_tcb_bits(tcb, 487, 460); - ti->tcpi_snd_cwnd = get_tcb_bits(tcb, 459, 432); - ti->tcpi_rcv_nxt = get_tcb_bits(tcb, 553, 522); + INP_WLOCK_ASSERT(tp->t_inpcb); + MPASS(ti != NULL); - ti->tcpi_snd_nxt = get_tcb_bits(tcb, 319, 288) - - get_tcb_bits(tcb, 375, 348); - - /* Receive window being advertised by us. */ - ti->tcpi_rcv_space = get_tcb_bits(tcb, 581, 554); - - /* Send window ceiling. */ - v = get_tcb_bits(tcb, 159, 144) << get_tcb_bits(tcb, 131, 128); - ti->tcpi_snd_wnd = min(v, ti->tcpi_snd_cwnd); + fill_tcp_info(sc, toep->tid, ti); } /* @@ -807,6 +1118,35 @@ failed: return (rc); } +static inline void +alloc_tcb_history(struct adapter *sc, struct tom_data *td) +{ + + if (sc->tids.ntids == 0 || sc->tids.ntids > 1024) + return; + rw_init(&td->tcb_history_lock, "TCB history"); + td->tcb_history = malloc(sc->tids.ntids * sizeof(*td->tcb_history), + M_CXGBE, M_ZERO | M_NOWAIT); + td->dupack_threshold = G_DUPACKTHRESH(t4_read_reg(sc, A_TP_PARA_REG0)); +} + +static inline void +free_tcb_history(struct adapter *sc, struct tom_data *td) +{ +#ifdef INVARIANTS + int i; + + if (td->tcb_history != NULL) { + for (i = 0; i < sc->tids.ntids; i++) { + MPASS(td->tcb_history[i] == NULL); + } + } +#endif + free(td->tcb_history, M_CXGBE); + if (rw_initialized(&td->tcb_history_lock)) + rw_destroy(&td->tcb_history_lock); +} + static void free_tom_data(struct adapter *sc, struct tom_data *td) { @@ -830,6 +1170,7 @@ free_tom_data(struct adapter *sc, struct tom_data *td) if (mtx_initialized(&td->toep_list_lock)) mtx_destroy(&td->toep_list_lock); + free_tcb_history(sc, td); free_tid_tabs(&sc->tids); free(td, M_CXGBE); } @@ -1097,6 +1438,8 @@ t4_tom_activate(struct adapter *sc) t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK, V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask); + alloc_tcb_history(sc, td); + /* toedev ops */ tod = &td->tod; init_toedev(tod); @@ -1214,6 +1557,7 @@ t4_tom_mod_load(void) struct protosw *tcp_protosw, *tcp6_protosw; /* CPL handlers */ + t4_register_cpl_handler(CPL_GET_TCB_RPL, do_get_tcb_rpl); t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl2, CPL_COOKIE_TOM); t4_init_connect_cpl_handlers(); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Mon Apr 22 17:29:26 2019 (r346569) +++ head/sys/dev/cxgbe/tom/t4_tom.h Mon Apr 22 17:48:10 2019 (r346570) @@ -33,6 +33,7 @@ #ifndef __T4_TOM_H__ #define __T4_TOM_H__ #include +#include "common/t4_hw.h" #include "tom/t4_tls.h" #define LISTEN_HASH_SIZE 32 @@ -254,6 +255,31 @@ struct listen_ctx { struct clip_entry *ce; }; +/* tcb_histent flags */ +#define TE_RPL_PENDING 1 +#define TE_ACTIVE 2 + +/* bits in one 8b tcb_histent sample. */ +#define TS_RTO (1 << 0) +#define TS_DUPACKS (1 << 1) +#define TS_FASTREXMT (1 << 2) +#define TS_SND_BACKLOGGED (1 << 3) +#define TS_CWND_LIMITED (1 << 4) +#define TS_ECN_ECE (1 << 5) +#define TS_ECN_CWR (1 << 6) +#define TS_RESERVED (1 << 7) /* Unused. */ + +struct tcb_histent { + struct mtx te_lock; + struct callout te_callout; + uint64_t te_tcb[TCB_SIZE / sizeof(uint64_t)]; + struct adapter *te_adapter; + u_int te_flags; + u_int te_tid; + uint8_t te_pidx; + uint8_t te_sample[100]; +}; + struct tom_data { struct toedev tod; @@ -268,6 +294,10 @@ struct tom_data { struct ppod_region pr; + struct rwlock tcb_history_lock __aligned(CACHE_LINE_SIZE); + struct tcb_histent **tcb_history; + int dupack_threshold; + /* WRs that will not be sent to the chip because L2 resolution failed */ struct mtx unsent_wr_lock; STAILQ_HEAD(, wrqe) unsent_wr_list; @@ -326,6 +356,7 @@ int select_ulp_mode(struct socket *, struct adapter *, struct offload_settings *); void set_ulp_mode(struct toepcb *, int); int negative_advice(int); +int add_tid_to_history(struct adapter *, u_int); /* t4_connect.c */ void t4_init_connect_cpl_handlers(void); From owner-svn-src-head@freebsd.org Mon Apr 22 17:52:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B3115A056E; Mon, 22 Apr 2019 17:52:49 +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 03F586F3D5; Mon, 22 Apr 2019 17:52:49 +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 E692818790; Mon, 22 Apr 2019 17:52:48 +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 x3MHqm73053208; Mon, 22 Apr 2019 17:52:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MHqk8b053194; Mon, 22 Apr 2019 17:52:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221752.x3MHqk8b053194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 17:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/tests usr.sbin/sysrc X-SVN-Commit-Revision: 346571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03F586F3D5 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 17:52:49 -0000 Author: ngie Date: Mon Apr 22 17:52:46 2019 New Revision: 346571 URL: https://svnweb.freebsd.org/changeset/base/346571 Log: Update the spelling of my name Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". MFC after: 1 week Modified: head/share/examples/tests/tests/tap/cp_test.sh head/share/man/man4/cfiscsi.4 head/share/man/man5/cd9660.5 head/share/zoneinfo/tests/backward_test.sh head/share/zoneinfo/tests/zoneinfo_common.sh head/usr.bin/calendar/calendars/calendar.freebsd head/usr.bin/du/tests/du_test.sh head/usr.bin/getconf/tests/arch_type.c head/usr.bin/procstat/tests/procstat_test.sh head/usr.bin/procstat/tests/while1.c head/usr.sbin/sysrc/sysrc.8 Modified: head/share/examples/tests/tests/tap/cp_test.sh ============================================================================== --- head/share/examples/tests/tests/tap/cp_test.sh Mon Apr 22 17:48:10 2019 (r346570) +++ head/share/examples/tests/tests/tap/cp_test.sh Mon Apr 22 17:52:46 2019 (r346571) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/share/man/man4/cfiscsi.4 ============================================================================== --- head/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 (r346570) +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 (r346571) @@ -1,7 +1,6 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -109,4 +108,4 @@ subsystem was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: head/share/man/man5/cd9660.5 ============================================================================== --- head/share/man/man5/cd9660.5 Mon Apr 22 17:48:10 2019 (r346570) +++ head/share/man/man5/cd9660.5 Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ .\" -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -79,4 +78,4 @@ and .An Atsushi Murai Aq Mt amurai@spec.co.jp . .Pp This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: head/share/zoneinfo/tests/backward_test.sh ============================================================================== --- head/share/zoneinfo/tests/backward_test.sh Mon Apr 22 17:48:10 2019 (r346570) +++ head/share/zoneinfo/tests/backward_test.sh Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/share/zoneinfo/tests/zoneinfo_common.sh ============================================================================== --- head/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 22 17:48:10 2019 (r346570) +++ head/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 22 17:52:46 2019 (r346571) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 22 17:52:46 2019 (r346571) @@ -46,7 +46,7 @@ 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 01/27 Alexandre C. Guimaraes born in Rio de Janeiro, Rio de Janeiro, Brazil, 1982 -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: head/usr.bin/du/tests/du_test.sh ============================================================================== --- head/usr.bin/du/tests/du_test.sh Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.bin/du/tests/du_test.sh Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.bin/getconf/tests/arch_type.c ============================================================================== --- head/usr.bin/getconf/tests/arch_type.c Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.bin/getconf/tests/arch_type.c Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- head/usr.bin/procstat/tests/procstat_test.sh Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.bin/procstat/tests/procstat_test.sh Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.bin/procstat/tests/while1.c ============================================================================== --- head/usr.bin/procstat/tests/while1.c Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.bin/procstat/tests/while1.c Mon Apr 22 17:52:46 2019 (r346571) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Mon Apr 22 17:48:10 2019 (r346570) +++ head/usr.sbin/sysrc/sysrc.8 Mon Apr 22 17:52:46 2019 (r346571) @@ -481,6 +481,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-head@freebsd.org Mon Apr 22 18:05:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16FE415A0850; Mon, 22 Apr 2019 18:05:36 +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 B16B86FA60; Mon, 22 Apr 2019 18:05:35 +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 87E7418946; Mon, 22 Apr 2019 18:05:35 +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 x3MI5ZXS058828; Mon, 22 Apr 2019 18:05:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MI5XfT058818; Mon, 22 Apr 2019 18:05:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221805.x3MI5XfT058818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 18:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346572 - in head/lib: libcam/tests libkvm/tests libsbuf/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/lib: libcam/tests libkvm/tests libsbuf/tests X-SVN-Commit-Revision: 346572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B16B86FA60 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 18:05:36 -0000 Author: ngie Date: Mon Apr 22 18:05:33 2019 New Revision: 346572 URL: https://svnweb.freebsd.org/changeset/base/346572 Log: Update the spelling of my name (continuation of r346571) Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". MFC after: 1 week Modified: head/lib/libcam/tests/libcam_test.c head/lib/libkvm/tests/kvm_close_test.c head/lib/libkvm/tests/kvm_geterr_test.c head/lib/libkvm/tests/kvm_open2_test.c head/lib/libkvm/tests/kvm_open_test.c head/lib/libkvm/tests/kvm_test_common.c head/lib/libkvm/tests/kvm_test_common.h head/lib/libsbuf/tests/sbuf_core_test.c head/lib/libsbuf/tests/sbuf_stdio_test.c head/lib/libsbuf/tests/sbuf_string_test.c head/lib/libsbuf/tests/sbuf_test_common.h Modified: head/lib/libcam/tests/libcam_test.c ============================================================================== --- head/lib/libcam/tests/libcam_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libcam/tests/libcam_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_close_test.c ============================================================================== --- head/lib/libkvm/tests/kvm_close_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_close_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_geterr_test.c ============================================================================== --- head/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_open2_test.c ============================================================================== --- head/lib/libkvm/tests/kvm_open2_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_open2_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_open_test.c ============================================================================== --- head/lib/libkvm/tests/kvm_open_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_open_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_test_common.c ============================================================================== --- head/lib/libkvm/tests/kvm_test_common.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_test_common.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libkvm/tests/kvm_test_common.h ============================================================================== --- head/lib/libkvm/tests/kvm_test_common.h Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libkvm/tests/kvm_test_common.h Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- head/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- head/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- head/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libsbuf/tests/sbuf_test_common.h ============================================================================== --- head/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 22 17:52:46 2019 (r346571) +++ head/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 22 18:05:33 2019 (r346572) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Mon Apr 22 18:33:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42BC115A13F8; Mon, 22 Apr 2019 18:33:33 +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 DD7AC70B61; Mon, 22 Apr 2019 18:33:32 +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 9FDCF18E8D; Mon, 22 Apr 2019 18:33:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MIXWSj074251; Mon, 22 Apr 2019 18:33:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MIXWRb074250; Mon, 22 Apr 2019 18:33:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904221833.x3MIXWRb074250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Apr 2019 18:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346573 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD7AC70B61 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 18:33:33 -0000 Author: imp Date: Mon Apr 22 18:33:32 2019 New Revision: 346573 URL: https://svnweb.freebsd.org/changeset/base/346573 Log: Move setting of console earlier in boot. There's no reason we can't setup the console first thing after the arch flags are setup. We set it undconditionally to efi. This is a good default, and will get us error messages to at least the efi console no matter what. This will also prime the pump so that as other variables are set, they will take effect and the console will be correct as soon as those env vars are set. Also remove the redundant setting of the console to efi when we know the console is efi. Differential Revision: https://reviews.freebsd.org/D20014 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 22 18:05:33 2019 (r346572) +++ head/stand/efi/loader/main.c Mon Apr 22 18:33:32 2019 (r346573) @@ -765,6 +765,17 @@ main(int argc, CHAR16 *argv[]) /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); + /* + * 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. So, we set it to the efi console, then call console init. This + * gets us printf early, but also primes the pump for all future console + * changes to take effect, regardless of where they come from. + */ + setenv("console", "efi", 1); + cons_probe(); + /* Tell ZFS probe code where we booted from, if zfs configured */ efizfs_set_preferred(img->DeviceHandle); @@ -774,15 +785,6 @@ main(int argc, CHAR16 *argv[]) 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. - */ - setenv("console", "efi", 1); - cons_probe(); - - /* * Initialise the block cache. Set the upper limit. */ bcache_init(32768, 512); @@ -806,17 +808,15 @@ main(int argc, CHAR16 *argv[]) 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); + /* Do nothing */ } else { /* * We detected some kind of serial in the override, but ConOut From owner-svn-src-head@freebsd.org Mon Apr 22 18:38:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F05E15A1556; Mon, 22 Apr 2019 18:38:57 +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 5D7B570DD9; Mon, 22 Apr 2019 18:38:56 +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 336FB18E93; Mon, 22 Apr 2019 18:38:56 +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 x3MIcuRc074543; Mon, 22 Apr 2019 18:38:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MIcshZ074537; Mon, 22 Apr 2019 18:38:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221838.x3MIcshZ074537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 18:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346574 - in head: lib/libc++ lib/libc++experimental lib/libc++fs lib/libcxxrt lib/libgcc_eh lib/ofed/libibnetdisc usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/libc++ lib/libc++experimental lib/libc++fs lib/libcxxrt lib/libgcc_eh lib/ofed/libibnetdisc usr.bin/dtc X-SVN-Commit-Revision: 346574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D7B570DD9 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 18:38:57 -0000 Author: ngie Date: Mon Apr 22 18:38:54 2019 New Revision: 346574 URL: https://svnweb.freebsd.org/changeset/base/346574 Log: Rework CXXSTD setting via r345708 This change allows the user to once again override the C++ standard, restoring high-level pre-r345708 behavior. This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11 capable compiler, e.g., g++ 4.2.1, as the library supported being built with older C++ standards. MFC after: 2 weeks MFC with: r345708 Reviewed by: emaste Reported by: jbeich Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change) Modified: head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/ofed/libibnetdisc/Makefile head/usr.bin/dtc/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/libc++/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -76,7 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD= c++11 +CXXSTD?= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/libc++experimental/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -20,6 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +CXXSTD?= c++14 .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/libc++fs/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -22,6 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +CXXSTD?= c++14 .include Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/libcxxrt/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -22,7 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD= c++11 +CXXSTD?= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/libgcc_eh/Makefile.inc Mon Apr 22 18:38:54 2019 (r346574) @@ -28,7 +28,7 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY CXXFLAGS+= -fno-rtti -CXXSTD= c++11 +CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/lib/ofed/libibnetdisc/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -31,6 +31,9 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband +.if ${COMPILER_FEATURES:Mc++11} +CXXSTD= c++11 +.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Mon Apr 22 18:33:32 2019 (r346573) +++ head/usr.bin/dtc/Makefile Mon Apr 22 18:38:54 2019 (r346574) @@ -8,6 +8,8 @@ WARNS?= 3 CXXFLAGS+= -fno-rtti -fno-exceptions +CXXSTD= c++11 + NO_SHARED?=NO .include From owner-svn-src-head@freebsd.org Mon Apr 22 18:40:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5133215A1643; Mon, 22 Apr 2019 18:40:26 +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 EB27670F58; Mon, 22 Apr 2019 18:40:25 +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 C3D7B18E9B; Mon, 22 Apr 2019 18:40:25 +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 x3MIePIC074681; Mon, 22 Apr 2019 18:40:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MIePbI074677; Mon, 22 Apr 2019 18:40:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904221840.x3MIePbI074677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Apr 2019 18:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346575 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 346575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB27670F58 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 18:40:26 -0000 Author: imp Date: Mon Apr 22 18:40:24 2019 New Revision: 346575 URL: https://svnweb.freebsd.org/changeset/base/346575 Log: Create boot_img as a global variable Get the information from the image that we're booting and store it in a global variable. Prefer using this to passing it around. Remove the special case for zfs that set the preferred boot handle by having it uses this global variable diretly. Reviewed by: kevans@ Differential Revision: https://reviews.freebsd.org/D20015 Modified: head/stand/efi/include/efi.h head/stand/efi/include/efizfs.h head/stand/efi/libefi/efizfs.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efi.h ============================================================================== --- head/stand/efi/include/efi.h Mon Apr 22 18:38:54 2019 (r346574) +++ head/stand/efi/include/efi.h Mon Apr 22 18:40:24 2019 (r346575) @@ -62,6 +62,11 @@ Revision History #include "efiuga.h" /* + * Global variables + */ +extern EFI_LOADED_IMAGE *boot_img; + +/* * FreeBSD UUID */ #define FREEBSD_BOOT_VAR_GUID \ Modified: head/stand/efi/include/efizfs.h ============================================================================== --- head/stand/efi/include/efizfs.h Mon Apr 22 18:38:54 2019 (r346574) +++ head/stand/efi/include/efizfs.h Mon Apr 22 18:40:24 2019 (r346575) @@ -50,10 +50,8 @@ 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); #else -#define efizfs_set_preferred(x) #define efi_zfs_probe NULL #endif Modified: head/stand/efi/libefi/efizfs.c ============================================================================== --- head/stand/efi/libefi/efizfs.c Mon Apr 22 18:38:54 2019 (r346574) +++ head/stand/efi/libefi/efizfs.c Mon Apr 22 18:40:24 2019 (r346575) @@ -45,14 +45,6 @@ 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) { @@ -122,7 +114,7 @@ efi_zfs_probe(void) efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); if (zfs_probe_dev(devname, &guid) == 0) { insert_zfs(pd->pd_handle, guid); - if (pd->pd_handle == preferred) + if (pd->pd_handle == boot_img->DeviceHandle) pool_guid = guid; } Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 22 18:38:54 2019 (r346574) +++ head/stand/efi/loader/main.c Mon Apr 22 18:40:24 2019 (r346575) @@ -88,6 +88,11 @@ static int fail_timeout = 5; */ UINT16 boot_current; +/* + * Image that we booted from. + */ +EFI_LOADED_IMAGE *boot_img; + static bool has_keyboard(void) { @@ -300,7 +305,7 @@ fix_dosisms(char *p) enum { BOOT_INFO_OK = 0, BAD_CHOICE = 1, NOT_SPECIFIC = 2 }; static int -match_boot_info(EFI_LOADED_IMAGE *img __unused, char *boot_info, size_t bisz) +match_boot_info(char *boot_info, size_t bisz) { uint32_t attr; uint16_t fplen; @@ -448,7 +453,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, char * * a drop to the OK boot loader prompt is possible. */ static int -find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, bool is_last, +find_currdev(bool do_bootmgr, bool is_last, char *boot_info, size_t boot_info_sz) { pdinfo_t *dp, *pp; @@ -481,7 +486,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b * loader.conf. */ if (do_bootmgr) { - rv = match_boot_info(img, boot_info, boot_info_sz); + rv = match_boot_info(boot_info, boot_info_sz); switch (rv) { case BOOT_INFO_OK: /* We found it */ return (0); @@ -514,7 +519,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b * boot protocol to do so. We fail and let UEFI go on to * the next candidate. */ - dp = efiblk_get_pdinfo_by_handle(img->DeviceHandle); + dp = efiblk_get_pdinfo_by_handle(boot_img->DeviceHandle); if (dp != NULL) { text = efi_devpath_name(dp->pd_devpath); if (text != NULL) { @@ -553,7 +558,7 @@ find_currdev(EFI_LOADED_IMAGE *img, bool do_bootmgr, b * any of the nodes in that path match one of the enumerated * handles. Currently, this handle list is only for netboot. */ - if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &extra) == 0) { + if (efi_handle_lookup(boot_img->DeviceHandle, &dev, &unit, &extra) == 0) { set_currdev_devsw(dev, unit); if (sanity_check_currdev()) return (0); @@ -751,7 +756,6 @@ main(int argc, CHAR16 *argv[]) size_t sz, bosz = 0, bisz = 0; UINT16 boot_order[100]; char boot_info[4096]; - EFI_LOADED_IMAGE *img; char buf[32]; bool uefi_boot_mgr; @@ -763,7 +767,7 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&img); + BS->HandleProtocol(IH, &imgid, (VOID**)&boot_img); /* * Chicken-and-egg problem; we want to have console output early, but @@ -776,9 +780,6 @@ main(int argc, CHAR16 *argv[]) setenv("console", "efi", 1); cons_probe(); - /* Tell ZFS probe code where we booted from, if zfs configured */ - efizfs_set_preferred(img->DeviceHandle); - /* Init the time source */ efi_time_init(); @@ -880,14 +881,14 @@ main(int argc, CHAR16 *argv[]) /* Determine the devpath of our image so we can prefer it. */ - text = efi_devpath_name(img->FilePath); + text = efi_devpath_name(boot_img->FilePath); if (text != NULL) { printf(" Load Path: %S\n", text); efi_setenv_freebsd_wcs("LoaderPath", text); efi_free_devpath_name(text); } - rv = BS->HandleProtocol(img->DeviceHandle, &devid, (void **)&imgpath); + rv = BS->HandleProtocol(boot_img->DeviceHandle, &devid, (void **)&imgpath); if (rv == EFI_SUCCESS) { text = efi_devpath_name(imgpath); if (text != NULL) { @@ -974,7 +975,7 @@ main(int argc, CHAR16 *argv[]) * the boot protocol and also allow an escape hatch for users wishing * to try something different. */ - if (find_currdev(img, uefi_boot_mgr, is_last, boot_info, bisz) != 0) + if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0) if (!interactive_interrupt("Failed to find bootable partition")) return (EFI_NOT_FOUND); From owner-svn-src-head@freebsd.org Mon Apr 22 18:40:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E5715A166F; Mon, 22 Apr 2019 18:40:48 +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 AF7A5711BE; Mon, 22 Apr 2019 18:40:47 +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 84CB718EAD; Mon, 22 Apr 2019 18:40:47 +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 x3MIeluK075252; Mon, 22 Apr 2019 18:40:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MIelCv074928; Mon, 22 Apr 2019 18:40:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221840.x3MIelCv074928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 18:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346576 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 346576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF7A5711BE 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 18:40:48 -0000 Author: ngie Date: Mon Apr 22 18:40:46 2019 New Revision: 346576 URL: https://svnweb.freebsd.org/changeset/base/346576 Log: Fix up CXXSTD support originally added in r345708 r345708 worked for the base system, but unfortunately, caused a lot of disruption for third-party packages that relied on C++, since bsd.sys.mk is used by applications outside the base system. The defaults picked didn't match the compiler's defaults and broke some builds that didn't specify a standard, as well as some that overrode the value by setting `-std=gnu++14` (for example) manually. This change takes a more relaxed approach to appending `-std=${CXXSTD}` to CXXFLAGS, by only doing so when the value is specified, as opposed to overriding the standard set by an end-user. This avoids the need for having to bake NOP default into bsd.sys.mk for supported compiler-toolchain versions. In order to make this change possible, add CXXSTD to Makefile snippets which relied on the default value (c++11) added in r345708. MFC after: 2 weeks MFC with: r345708, r346574 Reviewed by: emaste Reported by: jbeich Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change) Modified: head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Apr 22 18:40:24 2019 (r346575) +++ head/share/mk/bsd.sys.mk Mon Apr 22 18:40:46 2019 (r346576) @@ -25,17 +25,9 @@ CFLAGS+= -std=iso9899:1999 CFLAGS+= -std=${CSTD} .endif # CSTD -.if ${COMPILER_FEATURES:Mc++11} -CXXSTD?= c++11 -.elif ${COMPILER_TYPE} == "gcc" -# Prior versions of g++ support C++98 with GNU extensions by default. -CXXSTD?= gnu++98 -.else -# Assume that the compiler supports at least C++98. -CXXSTD?= c++98 -.endif +.if !empty(CXXSTD) CXXFLAGS+= -std=${CXXSTD} -# CXXSTD +.endif # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Mon Apr 22 18:40:24 2019 (r346575) +++ head/share/mk/googletest.test.inc.mk Mon Apr 22 18:40:46 2019 (r346576) @@ -9,4 +9,6 @@ GTESTS_CXXFLAGS+= -frtti # libgmock's, etc, headers. CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private +CXXSTD?= c++11 + NO_WTHREAD_SAFETY= From owner-svn-src-head@freebsd.org Mon Apr 22 19:01:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB2B15A1C38; Mon, 22 Apr 2019 19:01:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72BCA71D23; Mon, 22 Apr 2019 19:01:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3MJ1Usp033403; Mon, 22 Apr 2019 12:01:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3MJ1UgK033402; Mon, 22 Apr 2019 12:01:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904221901.x3MJ1UgK033402@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... In-Reply-To: <201904221752.x3MHqk8b053194@repo.freebsd.org> To: Enji Cooper Date: Mon, 22 Apr 2019 12:01:30 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 72BCA71D23 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.947,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:01:36 -0000 > Author: ngie > Date: Mon Apr 22 17:52:46 2019 > New Revision: 346571 > URL: https://svnweb.freebsd.org/changeset/base/346571 > > Log: > Update the spelling of my name > > Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji > instead for clarity. > > While here, remove "All Rights Reserved" from copyrights I "own". > > MFC after: 1 week > > Modified: > head/share/examples/tests/tests/tap/cp_test.sh > head/share/man/man4/cfiscsi.4 > head/share/man/man5/cd9660.5 > head/share/zoneinfo/tests/backward_test.sh > head/share/zoneinfo/tests/zoneinfo_common.sh > head/usr.bin/calendar/calendars/calendar.freebsd > head/usr.bin/du/tests/du_test.sh > head/usr.bin/getconf/tests/arch_type.c > head/usr.bin/procstat/tests/procstat_test.sh > head/usr.bin/procstat/tests/while1.c > head/usr.sbin/sysrc/sysrc.8 > > Modified: head/share/examples/tests/tests/tap/cp_test.sh > ============================================================================== > --- head/share/examples/tests/tests/tap/cp_test.sh Mon Apr 22 17:48:10 2019 (r346570) > +++ head/share/examples/tests/tests/tap/cp_test.sh Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,7 +1,6 @@ > #!/bin/sh > # > -# Copyright (c) 2017 Ngie Cooper > -# All rights reserved. > +# Copyright (c) 2017 Enji Cooper > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > > Modified: head/share/man/man4/cfiscsi.4 > ============================================================================== > --- head/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 (r346570) > +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,7 +1,6 @@ > .\" Copyright (c) 2013 Edward Tomasz Napierala > .\" Copyright (c) 2015-2017 Alexander Motin > -.\" Copyright (c) 2017 Ngie Cooper > -.\" All rights reserved. > +.\" Copyright (c) 2017 Enji Cooper We should investiage the history of this All rights reserved, I suspect it actually originally belongs to traz and possibly mav, and not explicity you due to prior habbits. If you have already done that investigation (ie, you added the line) ignore my comment. If however you simply added a copyright between the line and some other copyright please restore this line to its prior state. Thanks, Rod > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -109,4 +108,4 @@ subsystem was developed by > .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org > under sponsorship from the FreeBSD Foundation. > This manual page was written by > -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . > +.An Enji Cooper Aq Mt ngie@FreeBSD.org . > > Modified: head/share/man/man5/cd9660.5 > ============================================================================== > --- head/share/man/man5/cd9660.5 Mon Apr 22 17:48:10 2019 (r346570) > +++ head/share/man/man5/cd9660.5 Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > .\" > -.\" Copyright (c) 2017 Ngie Cooper > -.\" All rights reserved. > +.\" Copyright (c) 2017 Enji Cooper > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -79,4 +78,4 @@ and > .An Atsushi Murai Aq Mt amurai@spec.co.jp . > .Pp > This manual page was written by > -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . > +.An Enji Cooper Aq Mt ngie@FreeBSD.org . > > Modified: head/share/zoneinfo/tests/backward_test.sh > ============================================================================== > --- head/share/zoneinfo/tests/backward_test.sh Mon Apr 22 17:48:10 2019 (r346570) > +++ head/share/zoneinfo/tests/backward_test.sh Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > # > -# Copyright (c) 2017 Ngie Cooper > -# All rights reserved. > +# Copyright (c) 2017 Enji Cooper > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > > Modified: head/share/zoneinfo/tests/zoneinfo_common.sh > ============================================================================== > --- head/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 22 17:48:10 2019 (r346570) > +++ head/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,7 +1,6 @@ > #!/bin/sh > # > -# Copyright (c) 2017 Ngie Cooper > -# All rights reserved. > +# Copyright (c) 2017 Enji Cooper > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > > Modified: head/usr.bin/calendar/calendars/calendar.freebsd > ============================================================================== > --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 22 17:52:46 2019 (r346571) > @@ -46,7 +46,7 @@ > 01/27 Nick Sayer born in San Diego, California, United States, 1968 > 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 > 01/27 Alexandre C. Guimaraes born in Rio de Janeiro, Rio de Janeiro, Brazil, 1982 > -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 > +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 > 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 > 02/01 Doug Rabson born in London, England, 1966 > 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 > > Modified: head/usr.bin/du/tests/du_test.sh > ============================================================================== > --- head/usr.bin/du/tests/du_test.sh Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.bin/du/tests/du_test.sh Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > # > -# Copyright (c) 2017 Ngie Cooper > -# All rights reserved. > +# Copyright (c) 2017 Enji Cooper > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > > Modified: head/usr.bin/getconf/tests/arch_type.c > ============================================================================== > --- head/usr.bin/getconf/tests/arch_type.c Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.bin/getconf/tests/arch_type.c Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > /* > - * Copyright (c) 2017 Ngie Cooper > - * All rights reserved. > + * Copyright (c) 2017 Enji Cooper > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/usr.bin/procstat/tests/procstat_test.sh > ============================================================================== > --- head/usr.bin/procstat/tests/procstat_test.sh Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.bin/procstat/tests/procstat_test.sh Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > # > -# Copyright (c) 2017 Ngie Cooper > -# All rights reserved. > +# Copyright (c) 2017 Enji Cooper > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > > Modified: head/usr.bin/procstat/tests/while1.c > ============================================================================== > --- head/usr.bin/procstat/tests/while1.c Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.bin/procstat/tests/while1.c Mon Apr 22 17:52:46 2019 (r346571) > @@ -1,6 +1,5 @@ > /* > - * Copyright (c) 2017 Ngie Cooper > - * All rights reserved. > + * Copyright (c) 2017 Enji Cooper > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/usr.sbin/sysrc/sysrc.8 > ============================================================================== > --- head/usr.sbin/sysrc/sysrc.8 Mon Apr 22 17:48:10 2019 (r346570) > +++ head/usr.sbin/sysrc/sysrc.8 Mon Apr 22 17:52:46 2019 (r346571) > @@ -481,6 +481,6 @@ utility first appeared in > .Sh AUTHORS > .An Devin Teske Aq Mt dteske@FreeBSD.org > .Sh THANKS TO > -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, > +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, > Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, > Allan Jude, and Lars Engels for suggestions, help, and testing. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Apr 22 19:19:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3223F1580025; Mon, 22 Apr 2019 19:19:40 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B21E872395; Mon, 22 Apr 2019 19:19:39 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id t20so1128952otl.5; Mon, 22 Apr 2019 12:19:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1VHFSjVxm8QRAOBxoBWSldvxJKQAn1G8dRNh1dGnifY=; b=gvcZzIlSkKBzkkRDTgZCj2Q91tD1pZDY3KzjzTe1jKtMrR1NIAQWjmbay6eWLn2AXN 8lAC+SWEkw53VdSQNHH/fdKssK5D++0dlGFZKKs/SjML0DRO+mcJEyI7N6aGzpoKA+S9 BG1u+g1bba6TmTVRB0OZuO21E+y/+eHpNbCFsnPgXM4wtRIgFVFY1SYT0L2c47oRpz0c cHxX1kqY3pTpUGaAvcHqJk9trGqHn5ozGdhSjv2v2SHNARD6bJYieTyIyEm3RkgyCyk6 U31gNGuARPZOpiwZDd/w+Q6PuTViGLOx8ZxIT6+5xuFkDkotwHaX2pmpu7HGVlXQVlBJ CEuw== X-Gm-Message-State: APjAAAU2g+o679Y9n0KJn62oBK7GoH4LZ5dfw2ZO69Um5EV4GDT+30uQ C07BpbMaRZ77c7Va+DcV5IbWQMy6y/QvamVVBVPQdA== X-Google-Smtp-Source: APXvYqwWf7Q+/9BO1OGigx6gqd+SZIhvbJiTzwVYx+gUBxX6q17DyX0G0PGu9LfQfPuWIe5Xy/OjC/pcPvBC7WZTKXg= X-Received: by 2002:a05:6830:13cd:: with SMTP id e13mr13330067otq.139.1555960773409; Mon, 22 Apr 2019 12:19:33 -0700 (PDT) MIME-Version: 1.0 References: <201904221752.x3MHqk8b053194@repo.freebsd.org> <201904221901.x3MJ1UgK033402@gndrsh.dnsmgr.net> In-Reply-To: <201904221901.x3MJ1UgK033402@gndrsh.dnsmgr.net> From: Edward Napierala Date: Mon, 22 Apr 2019 20:19:22 +0100 Message-ID: Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... To: rgrimes@freebsd.org Cc: Enji Cooper , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B21E872395 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:19:40 -0000 On Mon, 22 Apr 2019 at 20:01, Rodney W. Grimes wrote: > > > Author: ngie > > Date: Mon Apr 22 17:52:46 2019 > > New Revision: 346571 > > URL: https://svnweb.freebsd.org/changeset/base/346571 > > > > Log: > > Update the spelling of my name > > > > Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji > > instead for clarity. > > > > While here, remove "All Rights Reserved" from copyrights I "own". [..] > > Modified: head/share/man/man4/cfiscsi.4 > > ============================================================================== > > --- head/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 (r346570) > > +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 (r346571) > > @@ -1,7 +1,6 @@ > > .\" Copyright (c) 2013 Edward Tomasz Napierala > > .\" Copyright (c) 2015-2017 Alexander Motin > > -.\" Copyright (c) 2017 Ngie Cooper > > -.\" All rights reserved. > > +.\" Copyright (c) 2017 Enji Cooper > > We should investiage the history of this All rights reserved, > I suspect it actually originally belongs to traz and possibly > mav, and not explicity you due to prior habbits. If you have > already done that investigation (ie, you added the line) ignore > my comment. If however you simply added a copyright between > the line and some other copyright please restore this line > to its prior state. FWIW, I'm perfectly fine with this. From owner-svn-src-head@freebsd.org Mon Apr 22 19:21:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FD3158013A; Mon, 22 Apr 2019 19:21:36 +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 A1471727C4; Mon, 22 Apr 2019 19:21:35 +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 6F626196C7; Mon, 22 Apr 2019 19:21:35 +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 x3MJLZ8g099772; Mon, 22 Apr 2019 19:21:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MJLZrD099771; Mon, 22 Apr 2019 19:21:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904221921.x3MJLZrD099771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 22 Apr 2019 19:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346578 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 346578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A1471727C4 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:21:36 -0000 Author: ngie Date: Mon Apr 22 19:21:35 2019 New Revision: 346578 URL: https://svnweb.freebsd.org/changeset/base/346578 Log: Build libclang_rt/profile on all clang-supported architectures There's no reason why a special case needs to be added specifically for amd64, arm, and i386, as the code is written in machine architecture agnostic C/C++. This will make it possible for all supporting clang architectures to produce runtime coverage with `--coverage`. MFC after: 2 weeks Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D20003 Modified: head/lib/libclang_rt/Makefile Modified: head/lib/libclang_rt/Makefile ============================================================================== --- head/lib/libclang_rt/Makefile Mon Apr 22 18:43:43 2019 (r346577) +++ head/lib/libclang_rt/Makefile Mon Apr 22 19:21:35 2019 (r346578) @@ -22,9 +22,6 @@ SUBDIR+= ubsan_standalone SUBDIR+= ubsan_standalone_cxx .endif -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" SUBDIR+= profile -.endif .include From owner-svn-src-head@freebsd.org Mon Apr 22 19:24:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766801580760; Mon, 22 Apr 2019 19:24:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D08272C37; Mon, 22 Apr 2019 19:24:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1C5119724; Mon, 22 Apr 2019 19:24:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3MJOMqP000973; Mon, 22 Apr 2019 19:24:22 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MJOLOA000964; Mon, 22 Apr 2019 19:24:21 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201904221924.x3MJOLOA000964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 22 Apr 2019 19:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346579 - in head: share/man/man9 sys/dev/cxgbe sys/dev/mlx5/mlx5_en sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head: share/man/man9 sys/dev/cxgbe sys/dev/mlx5/mlx5_en sys/net X-SVN-Commit-Revision: 346579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D08272C37 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:24:23 -0000 Author: gallatin Date: Mon Apr 22 19:24:21 2019 New Revision: 346579 URL: https://svnweb.freebsd.org/changeset/base/346579 Log: Track device's NUMA domain in ifnet & alloc ifnet from NUMA local memory This commit adds new if_alloc_domain() and if_alloc_dev() methods to allocate ifnets. When called with a domain on a NUMA machine, ifalloc_domain() will record the NUMA domain in the ifnet, and it will allocate the ifnet struct from memory which is local to that NUMA node. Similarly, if_alloc_dev() is a wrapper for if_alloc_domain which uses a driver supplied device_t to call ifalloc_domain() with the appropriate domain. Note that the new if_numa_domain field fits in an alignment pad in struct ifnet, and so does not alter the size of the structure. Reviewed by: glebius, kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19930 Modified: head/share/man/man9/Makefile head/share/man/man9/ifnet.9 head/sys/dev/cxgbe/t4_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/net/if.c head/sys/net/if_var.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Apr 22 19:21:35 2019 (r346578) +++ head/share/man/man9/Makefile Mon Apr 22 19:24:21 2019 (r346579) @@ -1175,6 +1175,8 @@ MLINKS+=iflibtxrx.9 isc_rxd_available.9 \ iflibtxrx.9 isc_txd_flush.9 MLINKS+=ifnet.9 if_addmulti.9 \ ifnet.9 if_alloc.9 \ + ifnet.9 if_alloc_dev.9 \ + ifnet.9 if_alloc_domain.9 \ ifnet.9 if_allmulti.9 \ ifnet.9 if_attach.9 \ ifnet.9 if_data.9 \ Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Mon Apr 22 19:21:35 2019 (r346578) +++ head/share/man/man9/ifnet.9 Mon Apr 22 19:24:21 2019 (r346579) @@ -48,6 +48,10 @@ .Ss "Interface Manipulation Functions" .Ft "struct ifnet *" .Fn if_alloc "u_char type" +.Ft "struct ifnet *" +.Fn if_alloc_dev "u_char type" "device_t dev" +.Ft "struct ifnet *" +.Fn if_alloc_domain "u_char type" "int numa_domain" .Ft void .Fn if_attach "struct ifnet *ifp" .Ft void @@ -440,6 +444,15 @@ It is used to cache the type passed to but unlike .Va if_type , it would not be changed by drivers. +.It Va if_numa_domain +.Pq Vt uint8_t +The NUMA domain of the hardware device associated with the interface. +This is filled in with a wildcard value unless the kernel is NUMA +aware, the system is a NUMA system, and the ifnet is allocated +using +.Fn if_alloc_dev +or +.Fn if_alloc_domain . .El .Pp References to @@ -1151,6 +1164,24 @@ include the allocation of a .Fa type specific structure in .Va if_l2com . +.It Fn if_alloc_dev +Allocate and initialize +.Vt "struct ifnet" +as +.Fn if_alloc +does, with the addition that the ifnet can be tagged with the +appropriate NUMA domain derived from the +.Fa dev +argument passed by the caller. +.It Fn if_alloc_domain +Allocate and initialize +.Vt "struct ifnet" +as +.Fn if_alloc +does, with the addition that the ifnet will be tagged with the NUMA +domain via the +.Fa numa_domain +argument passed by the caller. .It Fn if_attach Link the specified interface .Fa ifp @@ -1168,7 +1199,10 @@ function.) The .Fa ifp must have been allocated by -.Fn if_alloc . +.Fn if_alloc , +.Fn if_alloc_dev +or +.Fn if_alloc_domain . .It Fn if_detach Shut down and unlink the specified .Fa ifp Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Apr 22 19:21:35 2019 (r346578) +++ head/sys/dev/cxgbe/t4_main.c Mon Apr 22 19:24:21 2019 (r346579) @@ -1636,7 +1636,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) callout_init(&vi->tick, 1); /* Allocate an ifnet and set it up */ - ifp = if_alloc(IFT_ETHER); + ifp = if_alloc_dev(IFT_ETHER, dev); if (ifp == NULL) { device_printf(dev, "Cannot allocate ifnet\n"); return (ENOMEM); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Apr 22 19:21:35 2019 (r346578) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Apr 22 19:24:21 2019 (r346579) @@ -3682,7 +3682,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) M_MLX5EN, M_WAITOK | M_ZERO); mlx5e_priv_mtx_init(priv); - ifp = priv->ifp = if_alloc(IFT_ETHER); + ifp = priv->ifp = if_alloc_dev(IFT_ETHER, mdev->pdev->dev.bsddev); if (ifp == NULL) { mlx5_core_err(mdev, "if_alloc() failed\n"); goto err_free_priv; Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Apr 22 19:21:35 2019 (r346578) +++ head/sys/net/if.c Mon Apr 22 19:24:21 2019 (r346579) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -526,13 +527,19 @@ if_grow(void) * registered for the passed type. */ struct ifnet * -if_alloc(u_char type) +if_alloc_domain(u_char type, int numa_domain) { struct ifnet *ifp; u_short idx; void *old; - ifp = malloc(sizeof(struct ifnet), M_IFNET, M_WAITOK|M_ZERO); + KASSERT(numa_domain <= IF_NODOM, ("numa_domain too large")); + if (numa_domain == IF_NODOM) + ifp = malloc(sizeof(struct ifnet), M_IFNET, + M_WAITOK | M_ZERO); + else + ifp = malloc_domainset(sizeof(struct ifnet), M_IFNET, + DOMAINSET_PREF(numa_domain), M_WAITOK | M_ZERO); restart: IFNET_WLOCK(); idx = ifindex_alloc(&old); @@ -547,6 +554,7 @@ if_alloc(u_char type) ifp->if_index = idx; ifp->if_type = type; ifp->if_alloctype = type; + ifp->if_numa_domain = numa_domain; #ifdef VIMAGE ifp->if_vnet = curvnet; #endif @@ -580,6 +588,22 @@ if_alloc(u_char type) return (ifp); } +struct ifnet * +if_alloc_dev(u_char type, device_t dev) +{ + int numa_domain; + + if (dev == NULL || bus_get_domain(dev, &numa_domain) != 0) + return (if_alloc_domain(type, IF_NODOM)); + return (if_alloc_domain(type, numa_domain)); +} + +struct ifnet * +if_alloc(u_char type) +{ + + return (if_alloc_domain(type, IF_NODOM)); +} /* * Do the actual work of freeing a struct ifnet, and layer 2 common * structure. This call is made when the last reference to an @@ -608,7 +632,10 @@ if_free_internal(struct ifnet *ifp) free(ifp->if_description, M_IFDESCR); free(ifp->if_hw_addr, M_IFADDR); - free(ifp, M_IFNET); + if (ifp->if_numa_domain == IF_NODOM) + free(ifp, M_IFNET); + else + free_domain(ifp, M_IFNET); } static void Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Apr 22 19:21:35 2019 (r346578) +++ head/sys/net/if_var.h Mon Apr 22 19:24:21 2019 (r346579) @@ -244,7 +244,7 @@ struct ifnet { CK_STAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if (CK_) */ /* protected by if_addr_lock */ u_char if_alloctype; /* if_type at time of allocation */ - + uint8_t if_numa_domain; /* NUMA domain of device */ /* Driver and protocol specific information that remains stable. */ void *if_softc; /* pointer to driver state */ void *if_llsoftc; /* link layer softc */ @@ -394,6 +394,7 @@ struct ifnet { /* for compatibility with other BSDs */ #define if_name(ifp) ((ifp)->if_xname) +#define IF_NODOM 255 /* * Locks for address lists on the network interface. */ @@ -622,6 +623,8 @@ int if_delgroup(struct ifnet *, const char *); int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); int if_allmulti(struct ifnet *, int); struct ifnet* if_alloc(u_char); +struct ifnet* if_alloc_dev(u_char, device_t dev); +struct ifnet* if_alloc_domain(u_char, int numa_domain); void if_attach(struct ifnet *); void if_dead(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); From owner-svn-src-head@freebsd.org Mon Apr 22 19:27:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71E311580815; Mon, 22 Apr 2019 19:27:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E839372DF2; Mon, 22 Apr 2019 19:27:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x644.google.com with SMTP id x15so1897724pln.9; Mon, 22 Apr 2019 12:27:10 -0700 (PDT) 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=Gg+wF2RIGPDuUPvhHnN9/RiUqaGwzn8+T0Ytf1lqy7w=; b=SsMTU6OGPdNLtXs8TBD1cRS0b1+6wALS7bJ9brtW8dSN5osoMpG57hi4A7qL+emgSP z6xnX1MHIidfDYgw6xyZPLPu3hHrgmLm9RIvTH1dK02i1zPb0XXh0B1tRyJu2XrVhWtn GBHLjIIKSwvztPslVVu+pS7Ji41Y11FvrinN8OP/H699q3LN7b9aFywkxq7agY9tPsju SVtac6dh3R8QO78x+A6nnFuoR2J+ZJxi1Sm6MOyA3kk++nAmPlw61D2RjbS+iiM/xLyk 6MA1EthO0i5M3XfW7AitQvuVzuB2krabSuoMw/CfJIF6QNE2YtupEay2OWeyA4/lg5w7 DuXg== 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=Gg+wF2RIGPDuUPvhHnN9/RiUqaGwzn8+T0Ytf1lqy7w=; b=hWEQa+vU1y2ywZjXaV8shWgumhaOI3/wYdGFLZAkae/UPw3jtXH/Q1g8V/yMxn4OKx fblWcZMCUGaiXON7glUqPIrhVgHAYajLFPZaEBphxY6HTemQanpnw70GFp6fnjsK5e5C h040PbSQNOVI0rKjrKTWOvIqwmDhXrbGPccsCayMqzC2LMIG7Sdzmts4smAxHWTsXN7d 5/D9NCZ3Xglgu/puIwbARHw1HMxmesf1Bzed7KQ2mCNagoH9QNj8S6f+V6PEy5o03gQN J6N7tueQCSjN/fWslWKJzqv46Qmf1QfiXDBEbnW+Q9YO59WFIEzbWdVqqE4AnTb/rafh W5EA== X-Gm-Message-State: APjAAAUy/yIAqQedAB1/HikMlkxwv6G8DdO+y0TMMEo6AAQQm1lQyWvH heBbJjE0KxbLTQTw5gq4PS34lTTy7lY= X-Google-Smtp-Source: APXvYqxHW3DK7U2wlq5EYIyvemZI2xzu1HHQK0/z8J8xIwn0arfsFjvDLDlviNgt/sjmsXQ08j4slw== X-Received: by 2002:a17:902:20c6:: with SMTP id v6mr20874203plg.276.1555961229278; Mon, 22 Apr 2019 12:27:09 -0700 (PDT) Received: from [192.168.20.21] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p17sm18159829pfn.157.2019.04.22.12.27.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 12:27:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... From: "Enji Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 22 Apr 2019 12:27:07 -0700 Cc: rgrimes@freebsd.org, Enji Cooper , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <08421426-0370-442C-BEC2-0FEDF65CF088@gmail.com> References: <201904221752.x3MHqk8b053194@repo.freebsd.org> <201904221901.x3MJ1UgK033402@gndrsh.dnsmgr.net> To: Edward Napierala X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: E839372DF2 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:27:11 -0000 > On Apr 22, 2019, at 12:19, Edward Napierala wrote: >=20 > On Mon, 22 Apr 2019 at 20:01, Rodney W. Grimes > wrote: >>=20 >>> Author: ngie >>> Date: Mon Apr 22 17:52:46 2019 >>> New Revision: 346571 >>> URL: https://svnweb.freebsd.org/changeset/base/346571 >>>=20 >>> Log: >>> Update the spelling of my name >>>=20 >>> Previous spellings of my name (NGie, Ngie) weren't my legal = spelling. Use Enji >>> instead for clarity. >>>=20 >>> While here, remove "All Rights Reserved" from copyrights I "own". >=20 > [..] >=20 >>> Modified: head/share/man/man4/cfiscsi.4 >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 = (r346570) >>> +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 = (r346571) >>> @@ -1,7 +1,6 @@ >>> .\" Copyright (c) 2013 Edward Tomasz Napierala >>> .\" Copyright (c) 2015-2017 Alexander Motin >>> -.\" Copyright (c) 2017 Ngie Cooper >>> -.\" All rights reserved. >>> +.\" Copyright (c) 2017 Enji Cooper >>=20 >> We should investiage the history of this All rights reserved, >> I suspect it actually originally belongs to traz and possibly >> mav, and not explicity you due to prior habbits. If you have >> already done that investigation (ie, you added the line) ignore >> my comment. If however you simply added a copyright between >> the line and some other copyright please restore this line >> to its prior state. >=20 > FWIW, I'm perfectly fine with this. The lineage is complicated: trasz@ was the original person that = put =E2=80=9CAll rights reserved=E2=80=9D in the iscsi.4 copyright, and = I based manpage on the iscsi.4 manpage, so I thought it was appropriate = for me to remove the copyright. trasz@ signing off on this resolves the = only potential gray area with this change. Thank you though for following up. -Enji= From owner-svn-src-head@freebsd.org Mon Apr 22 19:30:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6427A15808BA; Mon, 22 Apr 2019 19:30:54 +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 E4AE072FDF; Mon, 22 Apr 2019 19:30:53 +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 879BA26046D; Mon, 22 Apr 2019 21:30:51 +0200 (CEST) Subject: Re: Panic with r346530 [Re: svn commit: r346530 - in head/sys: netinet netinet6] To: Kristof Provost , Enji Cooper Cc: src-committers , svn-src-all , svn-src-head , FreeBSD CURRENT References: <201904220727.x3M7ROpR009729@repo.freebsd.org> <2F3D6B17-AF4F-4B0F-B20E-5EF41DE851F9@gmail.com> <87917500-0381-79d8-a34b-819848abed32@selasky.org> <8EAC0CFE-E22F-478F-813F-A07E68C0518D@gmail.com> <1342BBD2-EE0F-4457-8752-659EA7F01725@FreeBSD.org> From: Hans Petter Selasky Message-ID: <89bdecf9-970e-f571-a94d-b4ceaea18368@selasky.org> Date: Mon, 22 Apr 2019 21:30:24 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1342BBD2-EE0F-4457-8752-659EA7F01725@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4AE072FDF 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:30:54 -0000 On 4/22/19 3:28 PM, Kristof Provost wrote: > On 22 Apr 2019, at 12:25, Enji Cooper wrote: >> Either the sys/netinet/ or sys/netipsec/ tests triggered the panic. >> Not sure which right now. >> > That looks to be happening during a vnet jail teardown, so it’s likely > the sys/netipsec or sys/netpfil/pf tests. > > I’ve done a quick test with the pf tests, and they provoke this panic: > >     panic: mtx_lock() of destroyed mutex @ > /usr/src/sys/netinet/ip_reass.c:628 >     cpuid = 0 >     time = 1555939645 >     KDB: stack backtrace: >     db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe0091d68530 >     vpanic() at vpanic+0x19d/frame 0xfffffe0091d68580 >     panic() at panic+0x43/frame 0xfffffe0091d685e0 >     __mtx_lock_flags() at __mtx_lock_flags+0x12e/frame 0xfffffe0091d68630 >     ipreass_cleanup() at ipreass_cleanup+0x86/frame 0xfffffe0091d68670 >     if_detach_internal() at if_detach_internal+0x786/frame > 0xfffffe0091d686f0 >     if_detach() at if_detach+0x3d/frame 0xfffffe0091d68710 >     lo_clone_destroy() at lo_clone_destroy+0x16/frame 0xfffffe0091d68730 >     if_clone_destroyif() at if_clone_destroyif+0x21f/frame > 0xfffffe0091d68780 >     if_clone_detach() at if_clone_detach+0xb8/frame 0xfffffe0091d687b0 >     vnet_loif_uninit() at vnet_loif_uninit+0x26/frame 0xfffffe0091d687d0 >     vnet_destroy() at vnet_destroy+0x124/frame 0xfffffe0091d68800 >     prison_deref() at prison_deref+0x29d/frame 0xfffffe0091d68840 >     sys_jail_remove() at sys_jail_remove+0x28f/frame 0xfffffe0091d68890 >     amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe0091d689b0 >     fast_syscall_common() at fast_syscall_common+0x101/frame > 0xfffffe0091d689b0 >     --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = > 0x80031e12a, rsp = 0x7fffffffe848, rbp = 0x7fffffffe8d0 --- >     KDB: enter: panic >     [ thread pid 1223 tid 100501 ] >     Stopped at      kdb_enter+0x3b: movq    $0,kdb_why >     db> > > To reproduce: > >     kldload pfsync >     cd /usr/tests/sys/netpfil/pf >     sudo kyua test > I'll revert r346530 until further testing has taken place. Thank you! --HPS From owner-svn-src-head@freebsd.org Mon Apr 22 19:31:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DB6E158090C; Mon, 22 Apr 2019 19:31:18 +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 B604173168; Mon, 22 Apr 2019 19:31:17 +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 909F819883; Mon, 22 Apr 2019 19:31:17 +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 x3MJVH4X001321; Mon, 22 Apr 2019 19:31:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MJVGo6001317; Mon, 22 Apr 2019 19:31:16 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904221931.x3MJVGo6001317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 22 Apr 2019 19:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346580 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B604173168 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:31:18 -0000 Author: bde Date: Mon Apr 22 19:31:16 2019 New Revision: 346580 URL: https://svnweb.freebsd.org/changeset/base/346580 Log: Fix mouse cursor coloring in depths > 8 (previously, a hack that only worked right for white interiors and black borders was used). Advertise this by changing the default colors to a red interior and a white border (the same as the kernel default). Add undocumented env variables for changing these colors. Also change to the larger and better-shaped 16x10 cursor sometimes used in the kernel. The kernel choice is fancier, but libvgl is closer to supporting the larger cursors needed in newer modes. The (n)and-or logic for the cursor doesn't work right for more than 2 colors. The (n)and part only masks out all color bits for the pixel under the cursor when all bits are set in the And mask. With more complicated logic, the non-masked bits could be used to implement translucent cursors, but they actually just gave strange colors (especially in packed and planar modes where the bits are indirect through 1 or 2 palettes so it is hard to predict the final color). They also gave a bug for writing pixels under the cursor. The non-masked bits under the cursor were not combined in this case. Drop support for combining with bits under the cursor by making any nonzero value in the And mask mean all bits set. Convert the Or mask (which is represented as a half-initialized 256-color bitmap) to a fully initialized bitmap with the correct number of colors. The 256-color representation must be as in 3:3:2 direct mode iff the final bitmap has more than 256 colors. The conversion of colors is not very efficient, so convert at initialization time. Modified: head/lib/libvgl/bitmap.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Mon Apr 22 19:24:21 2019 (r346579) +++ head/lib/libvgl/bitmap.c Mon Apr 22 19:31:16 2019 (r346580) @@ -274,3 +274,27 @@ VGLBitmapAllocateBits(VGLBitmap *object) return -1; return 0; } + +void +VGLBitmapCvt(VGLBitmap *src, VGLBitmap *dst) +{ + u_long color; + int dstpos, i, pb, size, srcpb, srcpos; + + size = src->VXsize * src->VYsize; + srcpb = src->PixelBytes; + if (srcpb <= 0) + srcpb = 1; + pb = dst->PixelBytes; + if (pb == srcpb) { + bcopy(src->Bitmap, dst->Bitmap, size * pb); + return; + } + if (srcpb != 1) + return; /* not supported */ + for (srcpos = dstpos = 0; srcpos < size; srcpos++) { + color = VGLrgb332ToNative(src->Bitmap[srcpos]); + for (i = 0; i < pb; i++, color >>= 8) + dst->Bitmap[dstpos++] = color; + } +} Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Mon Apr 22 19:24:21 2019 (r346579) +++ head/lib/libvgl/mouse.c Mon Apr 22 19:31:16 2019 (r346580) @@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" -#define X 0xff +#define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ +#define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ +#define X 0xff /* any nonzero in And mask means part of cursor */ +#define B BORDER +#define I INTERIOR static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -49,34 +53,36 @@ static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - 0,0,0,X,X,X,X,0,0,0,0,0,0,0,0,0, - 0,0,0,X,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,0,X,X,X,X,0,0,0,0,0,0,0,0, + X,X,0,0,X,X,X,X,0,0,0,0,0,0,0,0, + 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, + 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, + 0,0,0,0,0,0,X,X,0,0,0,0,0,0,0,0, }; static byte StdOrMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, - 0,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, - 0,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, - 0,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - 0,X,X,0,X,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,X,X,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,X,X,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,I,I,B,B,B,B,0,0,0,0,0,0, + B,I,I,B,I,I,B,0,0,0,0,0,0,0,0,0, + B,I,B,0,B,I,I,B,0,0,0,0,0,0,0,0, + B,B,0,0,B,I,I,B,0,0,0,0,0,0,0,0, + 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, + 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, + 0,0,0,0,0,0,B,B,0,0,0,0,0,0,0,0, }; #undef X +#undef B +#undef I static VGLBitmap VGLMouseStdAndMask = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask); static VGLBitmap VGLMouseStdOrMask = @@ -103,7 +109,7 @@ VGLMousePointerShow() VGLBitmap buffer = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf); byte crtcidx, crtcval, gdcidx, gdcval; - int i, pos, pos1; + int pos; if (!VGLMouseVisible) { INTOFF(); @@ -118,12 +124,10 @@ VGLMousePointerShow() __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, &buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); for (pos = 0; pos < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; pos++) - for (i = 0; i < VGLDisplay->PixelBytes; i++) { - pos1 = pos * VGLDisplay->PixelBytes + i; - buffer.Bitmap[pos1] = (buffer.Bitmap[pos1] & - ~VGLMouseAndMask->Bitmap[pos]) | - VGLMouseOrMask->Bitmap[pos]; - } + if (VGLMouseAndMask->Bitmap[pos]) + bcopy(&VGLMouseOrMask->Bitmap[pos*VGLDisplay->PixelBytes], + &buffer.Bitmap[pos*VGLDisplay->PixelBytes], + VGLDisplay->PixelBytes); __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { @@ -216,8 +220,17 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask { if (VGLMouseShown == VGL_MOUSESHOW) VGLMousePointerHide(); + VGLMouseAndMask = AndMask; - VGLMouseOrMask = OrMask; + + if (VGLMouseOrMask != NULL) { + free(VGLMouseOrMask->Bitmap); + free(VGLMouseOrMask); + } + VGLMouseOrMask = VGLBitmapCreate(MEMBUF, OrMask->VXsize, OrMask->VYsize, 0); + VGLBitmapAllocateBits(VGLMouseOrMask); + VGLBitmapCvt(OrMask, VGLMouseOrMask); + if (VGLMouseShown == VGL_MOUSESHOW) VGLMousePointerShow(); } @@ -225,34 +238,42 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask void VGLMouseSetStdImage() { - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); - VGLMouseAndMask = &VGLMouseStdAndMask; - VGLMouseOrMask = &VGLMouseStdOrMask; - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); + VGLMouseSetImage(&VGLMouseStdAndMask, &VGLMouseStdOrMask); } int VGLMouseInit(int mode) { struct mouse_info mouseinfo; - int error, i, mask; + int andmask, border, error, i, interior; switch (VGLModeInfo.vi_mem_model) { case V_INFO_MM_PACKED: case V_INFO_MM_PLANAR: - mask = 0x0f; + andmask = 0x0f; + border = 0x0f; + interior = 0x04; break; case V_INFO_MM_VGAX: - mask = 0x3f; + andmask = 0x3f; + border = 0x3f; + interior = 0x24; break; default: - mask = 0xff; + andmask = 0xff; + border = BORDER; + interior = INTERIOR; break; } - for (i = 0; i < 256; i++) - VGLMouseStdOrMask.Bitmap[i] &= mask; + if (VGLModeInfo.vi_mode == M_BG640x480) + border = 0; /* XXX (palette makes 0x04 look like 0x0f) */ + if (getenv("VGLMOUSEBORDERCOLOR") != NULL) + border = strtoul(getenv("VGLMOUSEBORDERCOLOR"), NULL, 0); + if (getenv("VGLMOUSEINTERIORCOLOR") != NULL) + interior = strtoul(getenv("VGLMOUSEINTERIORCOLOR"), NULL, 0); + for (i = 0; i < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; i++) + VGLMouseStdOrMask.Bitmap[i] = VGLMouseStdOrMask.Bitmap[i] == BORDER ? + border : VGLMouseStdOrMask.Bitmap[i] == INTERIOR ? interior : 0; VGLMouseSetStdImage(); mouseinfo.operation = MOUSE_MODE; mouseinfo.u.mode.signal = SIGUSR2; Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Apr 22 19:24:21 2019 (r346579) +++ head/lib/libvgl/simple.c Mon Apr 22 19:31:16 2019 (r346580) @@ -513,6 +513,31 @@ VGLClear(VGLBitmap *object, u_long color) VGLMouseUnFreeze(); } +static inline u_long +VGLrgbToNative(uint16_t r, uint16_t g, uint16_t b) +{ + int nr, ng, nb; + + nr = VGLModeInfo.vi_pixel_fsizes[2]; + ng = VGLModeInfo.vi_pixel_fsizes[1]; + nb = VGLModeInfo.vi_pixel_fsizes[0]; + return (r >> (16 - nr) << (ng + nb)) | (g >> (16 - ng) << nb) | + (b >> (16 - nb) << 0); +} + +u_long +VGLrgb332ToNative(byte c) +{ + uint16_t r, g, b; + + /* 3:3:2 to 16:16:16 */ + r = ((c & 0xe0) >> 5) * 0xffff / 7; + g = ((c & 0x1c) >> 2) * 0xffff / 7; + b = ((c & 0x03) >> 0) * 0xffff / 3; + + return VGLrgbToNative(r, g, b); +} + void VGLRestorePalette() { Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Mon Apr 22 19:24:21 2019 (r346579) +++ head/lib/libvgl/vgl.h Mon Apr 22 19:31:16 2019 (r346580) @@ -112,6 +112,7 @@ int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *VGLBitmapCreate(int type, int xsize, int ysize, byte *bits); void VGLBitmapDestroy(VGLBitmap *object); int VGLBitmapAllocateBits(VGLBitmap *object); +void VGLBitmapCvt(VGLBitmap *src, VGLBitmap *dst); /* keyboard.c */ int VGLKeyboardInit(int mode); void VGLKeyboardEnd(void); @@ -144,6 +145,7 @@ void VGLFilledBox(VGLBitmap *object, int x1, int y1, i void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); void VGLClear(VGLBitmap *object, u_long color); +u_long VGLrgb332ToNative(byte c); void VGLRestoreBlank(void); void VGLRestoreBorder(void); void VGLRestorePalette(void); From owner-svn-src-head@freebsd.org Mon Apr 22 19:36:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BEC11580C82; Mon, 22 Apr 2019 19:36:21 +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 B593F736A1; Mon, 22 Apr 2019 19:36:20 +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 91204198E5; Mon, 22 Apr 2019 19:36:20 +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 x3MJaK1Z006452; Mon, 22 Apr 2019 19:36:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MJaKPC006451; Mon, 22 Apr 2019 19:36:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904221936.x3MJaKPC006451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Apr 2019 19:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346581 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 346581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B593F736A1 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:36:21 -0000 Author: hselasky Date: Mon Apr 22 19:36:19 2019 New Revision: 346581 URL: https://svnweb.freebsd.org/changeset/base/346581 Log: Revert r346530 until further. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet/ip_reass.c head/sys/netinet6/frag6.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Mon Apr 22 19:31:16 2019 (r346580) +++ head/sys/netinet/ip_reass.c Mon Apr 22 19:36:19 2019 (r346581) @@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include #include @@ -609,37 +606,6 @@ ipreass_drain(void) IPQ_UNLOCK(i); } } - -/* - * Drain off all datagram fragments belonging to - * the given network interface. - */ -static void -ipreass_cleanup(void *arg __unused, struct ifnet *ifp) -{ - struct ipq *fp, *temp; - struct mbuf *m; - int i; - - KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); - - CURVNET_SET_QUIET(ifp->if_vnet); - for (i = 0; i < IPREASS_NHASH; i++) { - IPQ_LOCK(i); - /* Scan fragment list. */ - TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) { - for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) { - if (m->m_pkthdr.rcvif == ifp) { - ipq_drop(&V_ipq[i], fp); - break; - } - } - } - IPQ_UNLOCK(i); - } - CURVNET_RESTORE(); -} -EVENTHANDLER_DEFINE(ifnet_departure_event, ipreass_cleanup, NULL, 0); #ifdef VIMAGE /* Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Apr 22 19:31:16 2019 (r346580) +++ head/sys/netinet6/frag6.c Mon Apr 22 19:36:19 2019 (r346581) @@ -82,7 +82,7 @@ static void frag6_deq(struct ip6asfrag *, uint32_t buc static void frag6_insque_head(struct ip6q *, struct ip6q *, uint32_t bucket); static void frag6_remque(struct ip6q *, uint32_t bucket); -static void frag6_freef(struct ip6q *, uint32_t bucket, bool send_icmp); +static void frag6_freef(struct ip6q *, uint32_t bucket); struct ip6qbucket { struct ip6q ip6q; @@ -595,7 +595,7 @@ insert: if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash, true); + frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); return IPPROTO_DONE; @@ -605,7 +605,7 @@ insert: if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash, true); + frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); return IPPROTO_DONE; @@ -732,7 +732,7 @@ insert: * associated datagrams. */ static void -frag6_freef(struct ip6q *q6, uint32_t bucket, bool send_icmp) +frag6_freef(struct ip6q *q6, uint32_t bucket) { struct ip6asfrag *af6, *down6; @@ -749,7 +749,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket, bool sen * Return ICMP time exceeded error for the 1st fragment. * Just free other fragments. */ - if (af6->ip6af_off == 0 && send_icmp != false) { + if (af6->ip6af_off == 0) { struct ip6_hdr *ip6; /* adjust pointer */ @@ -865,7 +865,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragtimeout, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev, i, true); + frag6_freef(q6->ip6q_prev, i); } } /* @@ -884,7 +884,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i, true); + frag6_freef(head->ip6q_prev, i); } IP6Q_UNLOCK(i); } @@ -902,7 +902,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i, true); + frag6_freef(head->ip6q_prev, i); } IP6Q_UNLOCK(i); i = (i + 1) % IP6REASS_NHASH; @@ -932,7 +932,7 @@ frag6_drain(void) while (head->ip6q_next != head) { IP6STAT_INC(ip6s_fragdropped); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_next, i, true); + frag6_freef(head->ip6q_next, i); } IP6Q_UNLOCK(i); } @@ -940,45 +940,6 @@ frag6_drain(void) } VNET_LIST_RUNLOCK_NOSLEEP(); } - -/* - * Drain off all datagram fragments belonging to - * the given network interface. - */ -static void -frag6_cleanup(void *arg __unused, struct ifnet *ifp) -{ - struct ip6q *q6, *q6n, *head; - struct ip6asfrag *af6; - struct mbuf *m; - int i; - - KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); - - CURVNET_SET_QUIET(ifp->if_vnet); - for (i = 0; i < IP6REASS_NHASH; i++) { - IP6Q_LOCK(i); - head = IP6Q_HEAD(i); - /* Scan fragment list. */ - for (q6 = head->ip6q_next; q6 != head; q6 = q6n) { - q6n = q6->ip6q_next; - - for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; - af6 = af6->ip6af_down) { - m = IP6_REASS_MBUF(af6); - - if (m->m_pkthdr.rcvif == ifp) { - IP6STAT_INC(ip6s_fragdropped); - frag6_freef(q6, i, false); - break; - } - } - } - IP6Q_UNLOCK(i); - } - CURVNET_RESTORE(); -} -EVENTHANDLER_DEFINE(ifnet_departure_event, frag6_cleanup, NULL, 0); int ip6_deletefraghdr(struct mbuf *m, int offset, int wait) From owner-svn-src-head@freebsd.org Mon Apr 22 19:55:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37E9D15812AA; Mon, 22 Apr 2019 19:55:49 +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 A3A9B74804; Mon, 22 Apr 2019 19:55:48 +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 7940A19C8B; Mon, 22 Apr 2019 19:55:48 +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 x3MJtmL0016886; Mon, 22 Apr 2019 19:55:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3MJtmAm016884; Mon, 22 Apr 2019 19:55:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904221955.x3MJtmAm016884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Apr 2019 19:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346582 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 346582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3A9B74804 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 19:55:49 -0000 Author: emaste Date: Mon Apr 22 19:55:47 2019 New Revision: 346582 URL: https://svnweb.freebsd.org/changeset/base/346582 Log: ar: shuffle symbol offsets during conversion for 32-bit ar archives During processing we maintain symbol offsets in the 64-bit s_so array, and when writing the archive convert to 32-bit if no offsets are greater than 4GB. However, this was somewhat inefficient as we looped over the array twice: first, converting to big endian and second, writing each 32-bit value one at a time (and incorrectly so on big-endian platforms). Instead, when writing a 32-bit archive shuffle convert symbol data to big endian (as required by the ar format) and shuffle to the beginning of the allocation at the same time. Also correct emission of the symbol count on big endian platforms. Further changes are planned, but this should fix powerpc64. Reported by: jhibbits, mlinimon Reviewed by: jhibbits, Gerald Aryeetey (earlier) Tested by: jhibbits MFC after: 10 days MFC with: r346079 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20007 Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Mon Apr 22 19:36:19 2019 (r346581) +++ head/usr.bin/ar/write.c Mon Apr 22 19:55:47 2019 (r346582) @@ -616,6 +616,7 @@ write_objs(struct bsdar *bsdar) size_t pm_sz; /* size of pseudo members */ size_t w_sz; /* size of words in symbol table */ uint64_t nr; + uint32_t nr32; int i; if (elf_version(EV_CURRENT) == EV_NONE) @@ -669,15 +670,18 @@ write_objs(struct bsdar *bsdar) s_sz = (bsdar->s_cnt + 1) * sizeof(uint64_t) + bsdar->s_sn_sz; pm_sz += s_sz; - } - - for (i = 0; (size_t)i < bsdar->s_cnt; i++) { - if (w_sz == sizeof(uint32_t)) + /* Convert to big-endian. */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) bsdar->s_so[i] = - htobe32(bsdar->s_so[i] + pm_sz); - else - bsdar->s_so[i] = htobe64(bsdar->s_so[i] + pm_sz); + } else { + /* + * Convert to big-endian and shuffle in-place to + * the front of the allocation. XXX UB + */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + ((uint32_t *)(bsdar->s_so))[i] = + htobe32(bsdar->s_so[i] + pm_sz); } } @@ -708,19 +712,14 @@ write_objs(struct bsdar *bsdar) archive_entry_set_size(entry, (bsdar->s_cnt + 1) * w_sz + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); - if (w_sz == sizeof(uint32_t)) - nr = (uint64_t)htobe32((uint32_t)bsdar->s_cnt); - else + if (w_sz == sizeof(uint64_t)) { nr = htobe64(bsdar->s_cnt); - write_data(bsdar, a, &nr, w_sz); - if (w_sz == sizeof(uint64_t)) - write_data(bsdar, a, bsdar->s_so, sizeof(uint64_t) * - bsdar->s_cnt); - else - for (i = 0; (size_t)i < bsdar->s_cnt; i++) - write_data(bsdar, a, - (uint32_t *)&bsdar->s_so[i], - sizeof(uint32_t)); + write_data(bsdar, a, &nr, sizeof(nr)); + } else { + nr32 = htobe32((uint32_t)bsdar->s_cnt); + write_data(bsdar, a, &nr32, sizeof(nr32)); + } + write_data(bsdar, a, bsdar->s_so, w_sz * bsdar->s_cnt); write_data(bsdar, a, bsdar->s_sn, bsdar->s_sn_sz); archive_entry_free(entry); } From owner-svn-src-head@freebsd.org Mon Apr 22 20:31:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A3C1581E89; Mon, 22 Apr 2019 20:31:05 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4128075C72; Mon, 22 Apr 2019 20:31:04 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3MKV1dH033833; Mon, 22 Apr 2019 13:31:01 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3MKV1ZZ033832; Mon, 22 Apr 2019 13:31:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904222031.x3MKV1ZZ033832@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... In-Reply-To: To: Edward Napierala Date: Mon, 22 Apr 2019 13:31:01 -0700 (PDT) CC: rgrimes@freebsd.org, Enji Cooper , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4128075C72 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 20:31:05 -0000 > On Mon, 22 Apr 2019 at 20:01, Rodney W. Grimes > wrote: > > > > > Author: ngie > > > Date: Mon Apr 22 17:52:46 2019 > > > New Revision: 346571 > > > URL: https://svnweb.freebsd.org/changeset/base/346571 > > > > > > Log: > > > Update the spelling of my name > > > > > > Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji > > > instead for clarity. > > > > > > While here, remove "All Rights Reserved" from copyrights I "own". > > [..] > > > > Modified: head/share/man/man4/cfiscsi.4 > > > ============================================================================== > > > --- head/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 (r346570) > > > +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 (r346571) > > > @@ -1,7 +1,6 @@ > > > .\" Copyright (c) 2013 Edward Tomasz Napierala > > > .\" Copyright (c) 2015-2017 Alexander Motin > > > -.\" Copyright (c) 2017 Ngie Cooper > > > -.\" All rights reserved. > > > +.\" Copyright (c) 2017 Enji Cooper > > > > We should investiage the history of this All rights reserved, > > I suspect it actually originally belongs to traz and possibly > > mav, and not explicity you due to prior habbits. If you have > > already done that investigation (ie, you added the line) ignore > > my comment. If however you simply added a copyright between > > the line and some other copyright please restore this line > > to its prior state. > > FWIW, I'm perfectly fine with this. Ok, thanks, then another step forward would be to get mav's approval and then make a null commit noting that all parties agree to the removal of All rights reserved. This is too important of a detail to leave to an email thread, imho. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Apr 22 20:50:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4F63158297F; Mon, 22 Apr 2019 20:50:24 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1220E771AA; Mon, 22 Apr 2019 20:50:23 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3MKoMfj033909; Mon, 22 Apr 2019 13:50:22 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3MKoMdI033908; Mon, 22 Apr 2019 13:50:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904222050.x3MKoMdI033908@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... In-Reply-To: <08421426-0370-442C-BEC2-0FEDF65CF088@gmail.com> To: "Enji Cooper (yaneurabeya)" Date: Mon, 22 Apr 2019 13:50:22 -0700 (PDT) CC: Edward Napierala , rgrimes@freebsd.org, Enji Cooper , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 1220E771AA 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 20:50:25 -0000 > > On Apr 22, 2019, at 12:19, Edward Napierala wrote: > > > > On Mon, 22 Apr 2019 at 20:01, Rodney W. Grimes > > wrote: > >> > >>> Author: ngie > >>> Date: Mon Apr 22 17:52:46 2019 > >>> New Revision: 346571 > >>> URL: https://svnweb.freebsd.org/changeset/base/346571 > >>> > >>> Log: > >>> Update the spelling of my name > >>> > >>> Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji > >>> instead for clarity. > >>> > >>> While here, remove "All Rights Reserved" from copyrights I "own". > > > > [..] > > > >>> Modified: head/share/man/man4/cfiscsi.4 > >>> ============================================================================== > >>> --- head/share/man/man4/cfiscsi.4 Mon Apr 22 17:48:10 2019 (r346570) > >>> +++ head/share/man/man4/cfiscsi.4 Mon Apr 22 17:52:46 2019 (r346571) > >>> @@ -1,7 +1,6 @@ > >>> .\" Copyright (c) 2013 Edward Tomasz Napierala > >>> .\" Copyright (c) 2015-2017 Alexander Motin > >>> -.\" Copyright (c) 2017 Ngie Cooper > >>> -.\" All rights reserved. > >>> +.\" Copyright (c) 2017 Enji Cooper > >> > >> We should investiage the history of this All rights reserved, > >> I suspect it actually originally belongs to traz and possibly > >> mav, and not explicity you due to prior habbits. If you have > >> already done that investigation (ie, you added the line) ignore > >> my comment. If however you simply added a copyright between > >> the line and some other copyright please restore this line > >> to its prior state. > > > > FWIW, I'm perfectly fine with this. > > The lineage is complicated: trasz@ was the original person that put ?All rights reserved? in the iscsi.4 copyright, and I based manpage on the iscsi.4 manpage, so I thought it was appropriate for me to remove the copyright. trasz@ signing off on this resolves the only potential gray area with this change. > Thank you though for following up. It still does not dis-associate mav's copyright with the All rights reserved clause, as it appears as if he did an insert of copyright bewteen the 2, thus giving grey assertion by him of that clause. Again, please get mav@ to signoff and I am all happy! Though I would like it documented in a commit. > -Enji -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Apr 22 20:58:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F881582C25; Mon, 22 Apr 2019 20:58:18 +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.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E79FB77782; Mon, 22 Apr 2019 20:58:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x529.google.com with SMTP id d31so6407775pgl.7; Mon, 22 Apr 2019 13:58:17 -0700 (PDT) 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=/CcgcIEhvS7xAPkEMCzHhnl4g9Z6QWEXOGt7EmErCio=; b=P1BcoyIBV3NMgnXSNQqagRbSpMeqnk6a5RvZCwupBx9IzeddkyXG2onHkha3VgR6KL vUyXTrBi1bWBgFV8cPcpn36KrtKA9culAikwprrihosIBwlN9mykTXEToCWvZi+cV7ry vdADpzllAdV4bNPxQea5cG7L9Vlb+nYSrX+dzTElVjan0dsjjcQ5szsR6SMeXttIMxVd Dvl+C5GPk5cWBdAihWHpg59TngIiJ1kBTM0CuzJ5k3JdNXj4Tjff044SMVWBaQEzdgSr YCJAoLy+dqkl1HpgxFGWnpiSAFqXDnFtF+LiV1PGFGemgFpvk0hzb4jUnMGbiKWwWcAt ycQw== 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=/CcgcIEhvS7xAPkEMCzHhnl4g9Z6QWEXOGt7EmErCio=; b=EuEUjpfMPUQgrwdq6m6SzenFIpH/wJFp4RgmbKLH6rFhnD32wdANrpRNL0bfLOs8N2 R1TpW6H4LvR4/S84vp6WkemPI/X5PoY8WOOGq5MVhz5vRK5975Is9crbTfxBYzi7o5uj 46IvcsapFF7Dd7ZyPsMj75ENA7x5ct6dkRCZtoVPkIRL9z7vCS8JG/Wj81od48139ljR AzUB4QzO320w3vR3m1499YyZKFKn0VZWAYCHqQpTyARkaadnStUXAeprNM7uxAHxQ2Nh luJxs0enTtdG4j1NrvcOX6i23KSAJH9aDOUj7USxZq1KOETpjnihw04T0r2PhSYKyyS4 fS0A== X-Gm-Message-State: APjAAAW9ki/gC6OZeGmcJy378EGoKktuf621Snt+/SIzZx/jVaXF7Ch8 gPpn7zKPtVVzMSTauIVoHjcZqNl6eMY= X-Google-Smtp-Source: APXvYqyfdQzbnLnFLyszBNz9bRHRdrmTlXSSxEjPVgJEuy5zuFCNe5jzx2WofTZ8N+k07YsynoRixA== X-Received: by 2002:a65:558a:: with SMTP id j10mr20774957pgs.85.1555966695908; Mon, 22 Apr 2019 13:58:15 -0700 (PDT) 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 g11sm4601734pgf.1.2019.04.22.13.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 13:58:15 -0700 (PDT) From: Enji Cooper Message-Id: <8B292C8B-B3F5-4236-89C8-9D26EFC1C80F@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346571 - in head: share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/getconf/tests usr.bin/procstat/t... Date: Mon, 22 Apr 2019 13:58:14 -0700 In-Reply-To: <201904222050.x3MKoMdI033908@gndrsh.dnsmgr.net> Cc: Edward Napierala , Enji Cooper , src-committers , svn-src-all , svn-src-head , "Rodney W. Grimes" To: Alexander Motin References: <201904222050.x3MKoMdI033908@gndrsh.dnsmgr.net> X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: E79FB77782 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2019 20:58:18 -0000 > On Apr 22, 2019, at 1:50 PM, Rodney W. Grimes = wrote: =E2=80=A6 > It still does not dis-associate mav's copyright with the All rights = reserved clause, > as it appears as if he did an insert of copyright bewteen the 2, thus = giving > grey assertion by him of that clause. >=20 > Again, please get mav@ to signoff and I am all happy! Though I would > like it documented in a commit. Hi Alexander, Are you ok with my removing =E2=80=9CAll rights reserved=E2=80=9D = from share/man/man4/cfiscsi.4 in r346571? Thank you! -Enji= From owner-svn-src-head@freebsd.org Tue Apr 23 02:53:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83993158AEF9; Tue, 23 Apr 2019 02:53:54 +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 286488A774; Tue, 23 Apr 2019 02:53:54 +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 0285C1E483; Tue, 23 Apr 2019 02:53:54 +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 x3N2rrdf041289; Tue, 23 Apr 2019 02:53:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N2rrrh041288; Tue, 23 Apr 2019 02:53:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904230253.x3N2rrrh041288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Apr 2019 02:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346588 - head/lib/libc/powerpc64/string X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libc/powerpc64/string X-SVN-Commit-Revision: 346588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 286488A774 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 02:53:54 -0000 Author: jhibbits Date: Tue Apr 23 02:53:53 2019 New Revision: 346588 URL: https://svnweb.freebsd.org/changeset/base/346588 Log: powerpc64: Rewrite strcmp in asm to take advantage of word size Summary: Optimize strcmp for powerpc64. Data is loaded by double words and cmpb intruction is used to find '\0'. Some performance gain rates between the current and the optimized solution: String size (bytes) Gain rate <=8 0.59% <=16 1.92% 32 3.02% 64 5.60% 128 10.16% 256 18.05% 512 30.18% 1024 42.82% Submitted by: alexandre.yamashita_eldorado.org.br, leonardo.bianconi_eldorado.org.br Differential Revision: https://reviews.freebsd.org/D15220 Added: head/lib/libc/powerpc64/string/ head/lib/libc/powerpc64/string/Makefile.inc (contents, props changed) head/lib/libc/powerpc64/string/strcmp.S (contents, props changed) Added: head/lib/libc/powerpc64/string/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/string/Makefile.inc Tue Apr 23 02:53:53 2019 (r346588) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +MDSRCS+= \ + strcmp.S Added: head/lib/libc/powerpc64/string/strcmp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/string/strcmp.S Tue Apr 23 02:53:53 2019 (r346588) @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 2018 Instituto de Pesquisas Eldorado + * 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$"); + +#if 0 + RCSID("$NetBSD: strcmp.S,v 1.0 2018/05/10 12:33:02 alexandre Exp $") +#endif + +/* Alignment mask. */ +#define STRCMP_MULTI_ALIGNMENT_BYTES 8 +#define STRCMP_MULTI_ALIGNMENT_MASK (STRCMP_MULTI_ALIGNMENT_BYTES - 1) + +ENTRY(strcmp) + /* Starting alignment even if aligned, avoiding performance + * degradation for short strings. + */ + lbz %r5,0(%r3) /* Load chars. */ + lbz %r6,0(%r4) + cmpd %r5,%r6 /* Check if chars are different. */ + bne .Lstrcmp_end + cmpdi %r5,0 /* Check if char is zero. */ + beq .Lstrcmp_end + + /* Checking if addresses can be aligned, otherwise copy by byte */ + xor %r7,%r3,%r4 + andi. %r7,%r7,STRCMP_MULTI_ALIGNMENT_MASK + bne .Lstrcmp_compare_by_byte_loop + +.Lstrcmp_param1_align_loop: + lbzu %r5,1(%r3) /* Load chars. */ + lbzu %r6,1(%r4) + cmpd %r5,%r6 /* Check if chars are different. */ + bne .Lstrcmp_end + cmpdi %r5,0 /* Check if char is zero. */ + beq .Lstrcmp_end + andi. %r7,%r3,STRCMP_MULTI_ALIGNMENT_MASK /* Check alignment. */ + bne .Lstrcmp_param1_align_loop + +.Lstrcmp_param1_aligned: + /* If parameter 2 is aligned compare by qword/word, + * else compare by byte. */ + andi. %r7,%r4,STRCMP_MULTI_ALIGNMENT_MASK + beq .Lstrcmp_compare_by_word + lbz %r5,0(%r3) /* Load chars. */ + lbz %r6,0(%r4) + cmpd %r5,%r6 /* Check if chars are different. */ + bne+ .Lstrcmp_end + cmpdi %r5,0 /* Check if char is zero. */ + beq+ .Lstrcmp_end + +.Lstrcmp_compare_by_byte_loop: + lbzu %r5,1(%r3) + lbzu %r6,1(%r4) + cmpdi %r5,0 + beq .Lstrcmp_end + cmpd %r5,%r6 + beq .Lstrcmp_compare_by_byte_loop + +.Lstrcmp_end: + sub %r3,%r5,%r6 + blr + +.Lstrcmp_compare_by_word: + ld %r5,0(%r3) /* Load double words. */ + ld %r6,0(%r4) + xor %r8,%r8,%r8 /* %r8 <- Zero. */ + xor %r0,%r5,%r6 /* Check if double words are different. */ + cmpb %r7,%r5,%r8 /* Check if double words contain zero. */ + + /* + * If double words are different or contain zero, + * find what byte is different or contains zero, + * else load next double words. + */ + or. %r9,%r7,%r0 + bne .Lstrcmp_check_zeros_differences + +.Lstrcmp_compare_by_word_loop: + ldu %r5,8(%r3) /* Load double words. */ + ldu %r6,8(%r4) + xor %r0,%r5,%r6 /* Check if double words are different. */ + cmpb %r7,%r5,%r8 /* Check if double words contain zero. */ + + /* + * If double words are different or contain zero, + * find what byte is different or contains zero, + * else load next double words. + */ + or. %r9,%r7,%r0 + beq .Lstrcmp_compare_by_word_loop + +.Lstrcmp_check_zeros_differences: + /* Find what byte is different or contains zero. */ + + /* Check 1st byte. */ + rldicr. %r0,%r9,0,7 + bne .Lstrcmp_found_zero_difference_in_1 + + /* Check 2nd byte. */ + rldicr. %r0,%r9,8,7 + bne .Lstrcmp_found_zero_difference_in_2 + + /* Check 3rd byte. */ + rldicr. %r0,%r9,16,7 + bne .Lstrcmp_found_zero_difference_in_3 + + /* Check 4th byte. */ + rldicr. %r0,%r9,24,7 + bne .Lstrcmp_found_zero_difference_in_4 + + /* Check 5th byte. */ + andis. %r0,%r9,0xff00 + bne .Lstrcmp_found_zero_difference_in_5 + + /* Check 6th byte. */ + andis. %r0,%r9,0xff + bne .Lstrcmp_found_zero_difference_in_6 + + /* Check 7th byte. */ + andi. %r0,%r9,0xff00 + bne .Lstrcmp_found_zero_difference_in_7 + +.Lstrcmp_found_zero_difference_in_8: + /* 8th byte is different or contains zero. */ + andi. %r5,%r5,0xff + andi. %r6,%r6,0xff + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_1: + /* 1st byte is different or contains zero. */ + lbz %r5,0(%r3) + lbz %r6,0(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_2: + /* 2nd byte is different or contains zero. */ + lbz %r5,1(%r3) + lbz %r6,1(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_3: + /* 3rd byte is different or contains zero. */ + lbz %r5,2(%r3) + lbz %r6,2(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_4: + /* 4th byte is different or contains zero. */ + lbz %r5,3(%r3) + lbz %r6,3(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_5: + /* 5th byte is different or contains zero. */ + lbz %r5,4(%r3) + lbz %r6,4(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_6: + /* 6th byte is different or contains zero. */ + lbz %r5,5(%r3) + lbz %r6,5(%r4) + sub %r3,%r5,%r6 + blr + +.Lstrcmp_found_zero_difference_in_7: + /* 7th byte is different or contains zero. */ + lbz %r5,6(%r3) + lbz %r6,6(%r4) + sub %r3,%r5,%r6 + blr + +END(strcmp) + + .section .note.GNU-stack,"",%progbits + From owner-svn-src-head@freebsd.org Tue Apr 23 03:05:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A927F158BB93; Tue, 23 Apr 2019 03:05:27 +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 4F4098BAA4; Tue, 23 Apr 2019 03:05:27 +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 27FE71E6D0; Tue, 23 Apr 2019 03:05:27 +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 x3N35RTh048292; Tue, 23 Apr 2019 03:05:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N35Ri5048291; Tue, 23 Apr 2019 03:05:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904230305.x3N35Ri5048291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Apr 2019 03:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346589 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 346589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F4098BAA4 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 03:05:28 -0000 Author: jhibbits Date: Tue Apr 23 03:05:26 2019 New Revision: 346589 URL: https://svnweb.freebsd.org/changeset/base/346589 Log: powerpc64/pseries: Fix hypervisor call with extra arguments Some hypervisor calls, such as H_SEND_LOGICAL_LAN, take more arguments than are traditionally passed in registers. The HCALL ABI will accept these arguments in r11 and r12. With ELFv2 ABI, these arguments are 2 double-words lower than ELFv1 ABI, as two double-words in the stack frame are no longer used, and therefore removed from the frame. Fix the offsets for loading the registers for the HCALL. This fixes the phyp_llan driver with ELFv2 kernel. Submitted by: alfredo.junior_eldorado.org.br Differential Revision: https://reviews.freebsd.org/D20008 Modified: head/sys/powerpc/pseries/phyp-hvcall.S Modified: head/sys/powerpc/pseries/phyp-hvcall.S ============================================================================== --- head/sys/powerpc/pseries/phyp-hvcall.S Tue Apr 23 02:53:53 2019 (r346588) +++ head/sys/powerpc/pseries/phyp-hvcall.S Tue Apr 23 03:05:26 2019 (r346589) @@ -36,8 +36,13 @@ ASENTRY(phyp_hcall) mflr %r0 std %r0,16(%r1) +#if defined(_CALL_ELF) && _CALL_ELF == 2 + ld %r11,96(%r1) /* Last couple args into volatile regs*/ + ld %r12,104(%r1) +#else ld %r11,112(%r1) /* Last couple args into volatile regs*/ ld %r12,120(%r1) +#endif hc /* invoke the hypervisor */ ld %r0,16(%r1) mtlr %r0 From owner-svn-src-head@freebsd.org Tue Apr 23 03:19:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD397158C1C8; Tue, 23 Apr 2019 03:19:04 +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 4F2A78C37D; Tue, 23 Apr 2019 03:19:04 +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 27B1C1E8AE; Tue, 23 Apr 2019 03:19:04 +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 x3N3J4wG053771; Tue, 23 Apr 2019 03:19:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N3J4bA053770; Tue, 23 Apr 2019 03:19:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904230319.x3N3J4bA053770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Apr 2019 03:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346590 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 346590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F2A78C37D 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 03:19:04 -0000 Author: jhibbits Date: Tue Apr 23 03:19:03 2019 New Revision: 346590 URL: https://svnweb.freebsd.org/changeset/base/346590 Log: [PowerPC64] pseries-llan: increment packet output counters on error and success Summary: when using pseries-llan driver, Opkts and Oerrs counters (netstat -i) are always zero. This patch adds an small error handling to increment these counters. Submitted by: alfredo.junior_eldorado.org.br Differential Revision: https://reviews.freebsd.org/D20009 Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Tue Apr 23 03:05:26 2019 (r346589) +++ head/sys/powerpc/pseries/phyp_llan.c Tue Apr 23 03:19:03 2019 (r346590) @@ -425,7 +425,7 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, i { struct llan_softc *sc = xsc; uint64_t bufdescs[6]; - int i; + int i, err; bzero(bufdescs, sizeof(bufdescs)); @@ -435,7 +435,7 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, i bufdescs[i] |= segs[i].ds_addr; } - phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], + err = phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], bufdescs[1], bufdescs[2], bufdescs[3], bufdescs[4], bufdescs[5], 0); /* * The hypercall returning implies completion -- or that the call will @@ -443,6 +443,10 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, i * H_BUSY based on the continuation token in R4. For now, just drop * the packet in such cases. */ + if (err == H_SUCCESS) + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); + else + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } static void From owner-svn-src-head@freebsd.org Tue Apr 23 03:52:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CBAC158CC30; Tue, 23 Apr 2019 03:52:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B3B38D32D; Tue, 23 Apr 2019 03:52:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05CFA1EF73; Tue, 23 Apr 2019 03:52:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3N3qkMR074099; Tue, 23 Apr 2019 03:52:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N3qi4l074089; Tue, 23 Apr 2019 03:52:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904230352.x3N3qi4l074089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 23 Apr 2019 03:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346591 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_c... X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_common contrib/wpa/src/eap... X-SVN-Commit-Revision: 346591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B3B38D32D 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 03:52:46 -0000 Author: cy Date: Tue Apr 23 03:52:43 2019 New Revision: 346591 URL: https://svnweb.freebsd.org/changeset/base/346591 Log: MFV r346563: Update wpa_supplicant/hostapd 2.7 --> 2.8 Upstream documents the following advisories: - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\ with-unexpected-fragment.txt Relnotes: yes MFC after: 1 week (or less) Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496, CVE-2019-9497, CVE-2019-9498, CVE-2019-9499 Added: head/contrib/wpa/hostapd/README-MULTI-AP - copied unchanged from r346563, vendor/wpa/dist/hostapd/README-MULTI-AP head/contrib/wpa/src/common/ocv.c - copied unchanged from r346563, vendor/wpa/dist/src/common/ocv.c head/contrib/wpa/src/common/ocv.h - copied unchanged from r346563, vendor/wpa/dist/src/common/ocv.h head/contrib/wpa/src/crypto/sha512.c - copied unchanged from r346563, vendor/wpa/dist/src/crypto/sha512.c head/contrib/wpa/src/utils/const_time.h - copied unchanged from r346563, vendor/wpa/dist/src/utils/const_time.h head/contrib/wpa/wpa_supplicant/README-DPP - copied unchanged from r346563, vendor/wpa/dist/wpa_supplicant/README-DPP Deleted: head/contrib/wpa/wpa_supplicant/dbus/dbus_old.c head/contrib/wpa/wpa_supplicant/dbus/dbus_old.h head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c head/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in head/contrib/wpa/wpa_supplicant/examples/wpas-test.py Modified: head/contrib/wpa/CONTRIBUTIONS head/contrib/wpa/COPYING head/contrib/wpa/README head/contrib/wpa/hostapd/ChangeLog head/contrib/wpa/hostapd/README head/contrib/wpa/hostapd/config_file.c head/contrib/wpa/hostapd/ctrl_iface.c head/contrib/wpa/hostapd/defconfig head/contrib/wpa/hostapd/hostapd.conf head/contrib/wpa/hostapd/hostapd.wpa_psk head/contrib/wpa/hostapd/hostapd_cli.c head/contrib/wpa/hostapd/main.c head/contrib/wpa/hostapd/wps-ap-nfc.py head/contrib/wpa/hs20/client/Makefile head/contrib/wpa/hs20/client/est.c head/contrib/wpa/hs20/client/osu_client.c head/contrib/wpa/src/ap/acs.c head/contrib/wpa/src/ap/ap_config.c head/contrib/wpa/src/ap/ap_config.h head/contrib/wpa/src/ap/ap_drv_ops.h head/contrib/wpa/src/ap/authsrv.c head/contrib/wpa/src/ap/beacon.c head/contrib/wpa/src/ap/ctrl_iface_ap.c head/contrib/wpa/src/ap/dfs.c head/contrib/wpa/src/ap/dhcp_snoop.c head/contrib/wpa/src/ap/dpp_hostapd.c head/contrib/wpa/src/ap/dpp_hostapd.h head/contrib/wpa/src/ap/drv_callbacks.c head/contrib/wpa/src/ap/eap_user_db.c head/contrib/wpa/src/ap/fils_hlp.c head/contrib/wpa/src/ap/hostapd.c head/contrib/wpa/src/ap/hostapd.h head/contrib/wpa/src/ap/hs20.c head/contrib/wpa/src/ap/hw_features.c head/contrib/wpa/src/ap/ieee802_11.c head/contrib/wpa/src/ap/ieee802_11.h head/contrib/wpa/src/ap/ieee802_11_auth.c head/contrib/wpa/src/ap/ieee802_11_he.c head/contrib/wpa/src/ap/ieee802_11_shared.c head/contrib/wpa/src/ap/ieee802_11_vht.c head/contrib/wpa/src/ap/ieee802_1x.c head/contrib/wpa/src/ap/neighbor_db.c head/contrib/wpa/src/ap/neighbor_db.h head/contrib/wpa/src/ap/rrm.c head/contrib/wpa/src/ap/sta_info.c head/contrib/wpa/src/ap/sta_info.h head/contrib/wpa/src/ap/vlan_full.c head/contrib/wpa/src/ap/vlan_init.c head/contrib/wpa/src/ap/wnm_ap.c head/contrib/wpa/src/ap/wpa_auth.c head/contrib/wpa/src/ap/wpa_auth.h head/contrib/wpa/src/ap/wpa_auth_ft.c head/contrib/wpa/src/ap/wpa_auth_glue.c head/contrib/wpa/src/ap/wpa_auth_i.h head/contrib/wpa/src/ap/wpa_auth_ie.c head/contrib/wpa/src/ap/wpa_auth_ie.h head/contrib/wpa/src/ap/wps_hostapd.c head/contrib/wpa/src/common/common_module_tests.c head/contrib/wpa/src/common/defs.h head/contrib/wpa/src/common/dpp.c head/contrib/wpa/src/common/dpp.h head/contrib/wpa/src/common/hw_features_common.c head/contrib/wpa/src/common/hw_features_common.h head/contrib/wpa/src/common/ieee802_11_common.c head/contrib/wpa/src/common/ieee802_11_common.h head/contrib/wpa/src/common/ieee802_11_defs.h head/contrib/wpa/src/common/qca-vendor.h head/contrib/wpa/src/common/sae.c head/contrib/wpa/src/common/sae.h head/contrib/wpa/src/common/version.h head/contrib/wpa/src/common/wpa_common.c head/contrib/wpa/src/common/wpa_common.h head/contrib/wpa/src/common/wpa_ctrl.c head/contrib/wpa/src/crypto/aes-internal-enc.c head/contrib/wpa/src/crypto/crypto.h head/contrib/wpa/src/crypto/crypto_gnutls.c head/contrib/wpa/src/crypto/crypto_internal-modexp.c head/contrib/wpa/src/crypto/crypto_internal.c head/contrib/wpa/src/crypto/crypto_libtomcrypt.c head/contrib/wpa/src/crypto/crypto_linux.c head/contrib/wpa/src/crypto/crypto_nettle.c head/contrib/wpa/src/crypto/crypto_openssl.c head/contrib/wpa/src/crypto/crypto_wolfssl.c head/contrib/wpa/src/crypto/dh_groups.c head/contrib/wpa/src/crypto/md4-internal.c head/contrib/wpa/src/crypto/random.c head/contrib/wpa/src/crypto/sha1-tlsprf.c head/contrib/wpa/src/crypto/sha512-internal.c head/contrib/wpa/src/crypto/tls.h head/contrib/wpa/src/crypto/tls_gnutls.c head/contrib/wpa/src/crypto/tls_internal.c head/contrib/wpa/src/crypto/tls_none.c head/contrib/wpa/src/crypto/tls_openssl.c head/contrib/wpa/src/crypto/tls_wolfssl.c head/contrib/wpa/src/drivers/driver.h head/contrib/wpa/src/drivers/driver_bsd.c head/contrib/wpa/src/drivers/driver_common.c head/contrib/wpa/src/drivers/driver_macsec_linux.c head/contrib/wpa/src/drivers/driver_nl80211.h head/contrib/wpa/src/drivers/driver_nl80211_capa.c head/contrib/wpa/src/drivers/driver_nl80211_event.c head/contrib/wpa/src/drivers/driver_nl80211_scan.c head/contrib/wpa/src/drivers/driver_openbsd.c head/contrib/wpa/src/eap_common/eap_eke_common.c head/contrib/wpa/src/eap_common/eap_pwd_common.c head/contrib/wpa/src/eap_common/eap_pwd_common.h head/contrib/wpa/src/eap_common/eap_sake_common.c head/contrib/wpa/src/eap_common/eap_sake_common.h head/contrib/wpa/src/eap_peer/eap_config.h head/contrib/wpa/src/eap_peer/eap_fast.c head/contrib/wpa/src/eap_peer/eap_mschapv2.c head/contrib/wpa/src/eap_peer/eap_peap.c head/contrib/wpa/src/eap_peer/eap_pwd.c head/contrib/wpa/src/eap_peer/eap_sake.c head/contrib/wpa/src/eap_peer/eap_tls.c head/contrib/wpa/src/eap_peer/eap_tls_common.c head/contrib/wpa/src/eap_peer/eap_tls_common.h head/contrib/wpa/src/eap_peer/eap_ttls.c head/contrib/wpa/src/eap_peer/eap_wsc.c head/contrib/wpa/src/eap_server/eap.h head/contrib/wpa/src/eap_server/eap_i.h head/contrib/wpa/src/eap_server/eap_server.c head/contrib/wpa/src/eap_server/eap_server_aka.c head/contrib/wpa/src/eap_server/eap_server_gpsk.c head/contrib/wpa/src/eap_server/eap_server_mschapv2.c head/contrib/wpa/src/eap_server/eap_server_pax.c head/contrib/wpa/src/eap_server/eap_server_peap.c head/contrib/wpa/src/eap_server/eap_server_pwd.c head/contrib/wpa/src/eap_server/eap_server_sake.c head/contrib/wpa/src/eap_server/eap_server_sim.c head/contrib/wpa/src/eap_server/eap_server_tls.c head/contrib/wpa/src/eap_server/eap_server_tls_common.c head/contrib/wpa/src/eap_server/eap_server_ttls.c head/contrib/wpa/src/eap_server/eap_tls_common.h head/contrib/wpa/src/eapol_supp/eapol_supp_sm.c head/contrib/wpa/src/fst/fst.h head/contrib/wpa/src/p2p/p2p.c head/contrib/wpa/src/p2p/p2p.h head/contrib/wpa/src/p2p/p2p_build.c head/contrib/wpa/src/p2p/p2p_group.c head/contrib/wpa/src/p2p/p2p_i.h head/contrib/wpa/src/p2p/p2p_invitation.c head/contrib/wpa/src/p2p/p2p_utils.c head/contrib/wpa/src/pae/ieee802_1x_cp.c head/contrib/wpa/src/pae/ieee802_1x_cp.h head/contrib/wpa/src/pae/ieee802_1x_kay.c head/contrib/wpa/src/pae/ieee802_1x_kay.h head/contrib/wpa/src/pae/ieee802_1x_kay_i.h head/contrib/wpa/src/pae/ieee802_1x_key.c head/contrib/wpa/src/pae/ieee802_1x_key.h head/contrib/wpa/src/pae/ieee802_1x_secy_ops.c head/contrib/wpa/src/pae/ieee802_1x_secy_ops.h head/contrib/wpa/src/radius/radius_client.c head/contrib/wpa/src/radius/radius_server.c head/contrib/wpa/src/radius/radius_server.h head/contrib/wpa/src/rsn_supp/pmksa_cache.c head/contrib/wpa/src/rsn_supp/tdls.c head/contrib/wpa/src/rsn_supp/wpa.c head/contrib/wpa/src/rsn_supp/wpa.h head/contrib/wpa/src/rsn_supp/wpa_ft.c head/contrib/wpa/src/rsn_supp/wpa_i.h head/contrib/wpa/src/rsn_supp/wpa_ie.c head/contrib/wpa/src/rsn_supp/wpa_ie.h head/contrib/wpa/src/tls/asn1.c head/contrib/wpa/src/tls/bignum.c head/contrib/wpa/src/tls/tlsv1_client.c head/contrib/wpa/src/tls/tlsv1_client.h head/contrib/wpa/src/tls/tlsv1_client_read.c head/contrib/wpa/src/tls/tlsv1_client_write.c head/contrib/wpa/src/tls/tlsv1_server.c head/contrib/wpa/src/tls/tlsv1_server.h head/contrib/wpa/src/tls/tlsv1_server_i.h head/contrib/wpa/src/tls/tlsv1_server_read.c head/contrib/wpa/src/tls/tlsv1_server_write.c head/contrib/wpa/src/tls/x509v3.c head/contrib/wpa/src/utils/base64.c head/contrib/wpa/src/utils/browser.c head/contrib/wpa/src/utils/common.c head/contrib/wpa/src/utils/common.h head/contrib/wpa/src/utils/eloop.c head/contrib/wpa/src/utils/http_curl.c head/contrib/wpa/src/utils/json.c head/contrib/wpa/src/utils/list.h head/contrib/wpa/src/utils/os_internal.c head/contrib/wpa/src/utils/os_none.c head/contrib/wpa/src/utils/os_unix.c head/contrib/wpa/src/utils/utils_module_tests.c head/contrib/wpa/src/utils/wpa_debug.c head/contrib/wpa/src/wps/wps.c head/contrib/wpa/src/wps/wps.h head/contrib/wpa/src/wps/wps_attr_build.c head/contrib/wpa/src/wps/wps_attr_parse.c head/contrib/wpa/src/wps/wps_attr_parse.h head/contrib/wpa/src/wps/wps_common.c head/contrib/wpa/src/wps/wps_defs.h head/contrib/wpa/src/wps/wps_dev_attr.c head/contrib/wpa/src/wps/wps_dev_attr.h head/contrib/wpa/src/wps/wps_enrollee.c head/contrib/wpa/src/wps/wps_er.c head/contrib/wpa/src/wps/wps_i.h head/contrib/wpa/src/wps/wps_registrar.c head/contrib/wpa/src/wps/wps_upnp.c head/contrib/wpa/src/wps/wps_validate.c head/contrib/wpa/wpa_supplicant/Android.mk head/contrib/wpa/wpa_supplicant/ChangeLog head/contrib/wpa/wpa_supplicant/README head/contrib/wpa/wpa_supplicant/README-P2P head/contrib/wpa/wpa_supplicant/android.config head/contrib/wpa/wpa_supplicant/ap.c head/contrib/wpa/wpa_supplicant/bss.c head/contrib/wpa/wpa_supplicant/bss.h head/contrib/wpa/wpa_supplicant/config.c head/contrib/wpa/wpa_supplicant/config.h head/contrib/wpa/wpa_supplicant/config_file.c head/contrib/wpa/wpa_supplicant/config_ssid.h head/contrib/wpa/wpa_supplicant/ctrl_iface.c head/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c head/contrib/wpa/wpa_supplicant/dbus/Makefile head/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf head/contrib/wpa/wpa_supplicant/dbus/dbus_common.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new.h head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c head/contrib/wpa/wpa_supplicant/defconfig head/contrib/wpa/wpa_supplicant/dpp_supplicant.c head/contrib/wpa/wpa_supplicant/dpp_supplicant.h head/contrib/wpa/wpa_supplicant/driver_i.h head/contrib/wpa/wpa_supplicant/eapol_test.c head/contrib/wpa/wpa_supplicant/eapol_test.py head/contrib/wpa/wpa_supplicant/events.c head/contrib/wpa/wpa_supplicant/examples/dbus-listen-preq.py head/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py head/contrib/wpa/wpa_supplicant/examples/p2p-nfc.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_connect.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_disconnect.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_find.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_flush.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_group_add.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_invite.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_listen.py head/contrib/wpa/wpa_supplicant/examples/p2p/p2p_stop_find.py head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py head/contrib/wpa/wpa_supplicant/examples/wps-nfc.py head/contrib/wpa/wpa_supplicant/gas_query.c head/contrib/wpa/wpa_supplicant/gas_query.h head/contrib/wpa/wpa_supplicant/hs20_supplicant.c head/contrib/wpa/wpa_supplicant/hs20_supplicant.h head/contrib/wpa/wpa_supplicant/ibss_rsn.c head/contrib/wpa/wpa_supplicant/interworking.c head/contrib/wpa/wpa_supplicant/main.c head/contrib/wpa/wpa_supplicant/mbo.c head/contrib/wpa/wpa_supplicant/mesh.c head/contrib/wpa/wpa_supplicant/mesh_mpm.c head/contrib/wpa/wpa_supplicant/mesh_rsn.c head/contrib/wpa/wpa_supplicant/notify.c head/contrib/wpa/wpa_supplicant/notify.h head/contrib/wpa/wpa_supplicant/op_classes.c head/contrib/wpa/wpa_supplicant/p2p_supplicant.c head/contrib/wpa/wpa_supplicant/p2p_supplicant.h head/contrib/wpa/wpa_supplicant/rrm.c head/contrib/wpa/wpa_supplicant/scan.c head/contrib/wpa/wpa_supplicant/sme.c head/contrib/wpa/wpa_supplicant/sme.h head/contrib/wpa/wpa_supplicant/systemd/wpa_supplicant.service.in head/contrib/wpa/wpa_supplicant/utils/log2pcap.py head/contrib/wpa/wpa_supplicant/wmm_ac.c head/contrib/wpa/wpa_supplicant/wnm_sta.c head/contrib/wpa/wpa_supplicant/wpa_cli.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h head/contrib/wpa/wpa_supplicant/wpas_glue.c head/contrib/wpa/wpa_supplicant/wpas_kay.c head/contrib/wpa/wpa_supplicant/wps_supplicant.c head/contrib/wpa/wpa_supplicant/wps_supplicant.h head/usr.sbin/wpa/Makefile.crypto Directory Properties: head/contrib/wpa/ (props changed) Modified: head/contrib/wpa/CONTRIBUTIONS ============================================================================== --- head/contrib/wpa/CONTRIBUTIONS Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/CONTRIBUTIONS Tue Apr 23 03:52:43 2019 (r346591) @@ -140,7 +140,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2018, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without Modified: head/contrib/wpa/COPYING ============================================================================== --- head/contrib/wpa/COPYING Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/COPYING Tue Apr 23 03:52:43 2019 (r346591) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2018, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Modified: head/contrib/wpa/README ============================================================================== --- head/contrib/wpa/README Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/README Tue Apr 23 03:52:43 2019 (r346591) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2018, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: head/contrib/wpa/hostapd/ChangeLog ============================================================================== --- head/contrib/wpa/hostapd/ChangeLog Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/ChangeLog Tue Apr 23 03:52:43 2019 (r346591) @@ -1,5 +1,60 @@ ChangeLog for hostapd +2019-04-21 - v2.8 + * SAE changes + - added support for SAE Password Identifier + - changed default configuration to enable only group 19 + (i.e., disable groups 20, 21, 25, 26 from default configuration) and + disable all unsuitable groups completely based on REVmd changes + - improved anti-clogging token mechanism and SAE authentication + frame processing during heavy CPU load; this mitigates some issues + with potential DoS attacks trying to flood an AP with large number + of SAE messages + - added Finite Cyclic Group field in status code 77 responses + - reject use of unsuitable groups based on new implementation guidance + in REVmd (allow only FFC groups with prime >= 3072 bits and ECC + groups with prime >= 256) + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-1/] (CVE-2019-9494) + - fixed confirm message validation in error cases + [https://w1.fi/security/2019-3/] (CVE-2019-9496) + * EAP-pwd changes + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-2/] (CVE-2019-9495) + - verify peer scalar/element + [https://w1.fi/security/2019-4/] (CVE-2019-9497 and CVE-2019-9498) + - fix message reassembly issue with unexpected fragment + [https://w1.fi/security/2019-5/] + - enforce rand,mask generation rules more strictly + - fix a memory leak in PWE derivation + - disallow ECC groups with a prime under 256 bits (groups 25, 26, and + 27) + * Hotspot 2.0 changes + - added support for release number 3 + - reject release 2 or newer association without PMF + * added support for RSN operating channel validation + (CONFIG_OCV=y and configuration parameter ocv=1) + * added Multi-AP protocol support + * added FTM responder configuration + * fixed build with LibreSSL + * added FT/RRB workaround for short Ethernet frame padding + * fixed KEK2 derivation for FILS+FT + * added RSSI-based association rejection from OCE + * extended beacon reporting functionality + * VLAN changes + - allow local VLAN management with remote RADIUS authentication + - add WPA/WPA2 passphrase/PSK -based VLAN assignment + * OpenSSL: allow systemwide policies to be overridden + * extended PEAP to derive EMSK to enable use with ERP/FILS + * extended WPS to allow SAE configuration to be added automatically + for PSK (wps_cred_add_sae=1) + * fixed FT and SA Query Action frame with AP-MLME-in-driver cases + * OWE: allow Diffie-Hellman Parameter element to be included with DPP + in preparation for DPP protocol extension + * RADIUS server: started to accept ERP keyName-NAI as user identity + automatically without matching EAP database entry + * fixed PTK rekeying with FILS and FT + 2018-12-02 - v2.7 * fixed WPA packet number reuse with replayed messages and key reinstallation Modified: head/contrib/wpa/hostapd/README ============================================================================== --- head/contrib/wpa/hostapd/README Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/README Tue Apr 23 03:52:43 2019 (r346591) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WP Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2018, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with Copied: head/contrib/wpa/hostapd/README-MULTI-AP (from r346563, vendor/wpa/dist/hostapd/README-MULTI-AP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/wpa/hostapd/README-MULTI-AP Tue Apr 23 03:52:43 2019 (r346591, copy of r346563, vendor/wpa/dist/hostapd/README-MULTI-AP) @@ -0,0 +1,160 @@ +hostapd, wpa_supplicant and the Multi-AP Specification +====================================================== + +This document describes how hostapd and wpa_supplicant can be configured to +support the Multi-AP Specification. + +Introduction to Multi-AP +------------------------ + +The Wi-Fi Alliance Multi-AP Specification is the technical specification for +Wi-Fi CERTIFIED EasyMesh(TM) [1], the Wi-Fi Alliance® certification program for +Multi-AP. It defines control protocols between Wi-Fi® access points (APs) to +join them into a network with centralized control and operation. It is targeted +only at routers (repeaters, gateways, ...), not at clients. Clients are not +involved at all in the protocols. + +Most of the Multi-AP specification falls outside of the scope of +hostapd/wpa_supplicant. hostapd/wpa_supplicant is only involved for the items +summarized below. The rest of the protocol must be implemented by a separate +daemon, e.g., prplMesh [2]. That daemon also needs to communicate with hostapd, +e.g., to get a list of associated clients, but this can be done using the normal +hostapd interfaces. + +hostapd/wpa_supplicant needs to be configured specifically to support: +- the WPS onboarding process; +- configuring backhaul links. + +The text below refers to "Multi-AP Specification v1.0" [3]. + + +Fronthaul and backhaul links +---------------------------- + +In a Multi-AP network, the central controller can configure the BSSs on the +devices that are joined into the network. These are called fronthaul BSSs. +From the point of view of hostapd, there is nothing special about these +fronthaul BSSs. + +In addition to fronthaul BSSs, the controller can also configure backhaul +links. A backhaul link is a link between two access point devices, giving +internet access to access point devices that don't have a wired link. The +Multi-AP specification doesn't dictate this, but typically the backhaul link +will be bridged into a LAN together with (one of) the fronthaul BSS(s) and the +wired Ethernet ports. + +A backhaul link must be treated specially by hostapd and wpa_supplicant. One +side of the backhaul link is configured through the Multi-AP protocol as the +"backhaul STA", i.e., the client side of the link. A backhaul STA is like any +station and is handled appropriately by wpa_supplicant, but two additional +features are required. It must send an additional information element in each +(Re)Association Request frame ([3], section 5.2, paragraph 4). In addition, it +must use 4-address mode for all frames sent over this link ([3], section 14). +Therefore, wpa_supplicant must be configured explicitly as the backhaul STA +role, by setting 'multi_ap_backhaul_sta=1' in the network configuration block +or when configuring the network profile through the control interface. When +'multi_ap_backhaul_sta=1', wpa_supplicant includes the Multi-AP IE in +(Re)Association Request frame and verifies that it is included in the +(Re)Association Response frame. If it is not, association fails. If it is, +wpa_supplicant sets 4-address mode for this interface through a driver +callback. + +The AP side of the backhaul link is called a "backhaul BSS". Such a BSS must +be handled specially by hostapd, because it must add an additional information +element in each (Re)Association Response frame, but only to stations that have +identified themselves as backhaul stations ([3], section 5.2, paragraph 5-6). +This is important because it is possible to use the same BSS and SSID for +fronthaul and backhaul at the same time. The additional information element must +only be used for frames sent to a backhaul STA, not to a normal STA. Also, +frames sent to a backhaul STA must use 4-address mode, while frames sent to a +normal STA (fronthaul, when it's a fronthaul and backhaul BSS) must use +3-address mode. + +A BSS is configured in Multi-AP mode in hostapd by setting the 'multi_ap' +configuration option to 1 (backhaul BSS), 2 (fronthaul BSS), or 3 +(simultaneous backhaul and fronthaul BSS). If this option is set, hostapd +parses the Multi-AP information element in the Association Request frame. If the +station is a backhaul STA and the BSS is configured as a backhaul BSS, +hostapd sets up 4-address mode. Since there may be multiple stations connected +simultaneously, and each of them has a different RA (receiver address), a VLAN +is created for each backhaul STA and it is automatically added to a bridge. +This is the same behavior as for WDS, and the relevant option ('bridge' or +'wds_bridge') applies here as well. + +If 'multi_ap' is 1 (backhaul BSS only), any station that tries to associate +without the Multi-AP information element will be denied. + +If 'multi_ap' is 2 (fronthaul BSS only), any station that tries to associate +with the Multi-AP information element will be denied. That is also the only +difference with 'multi_ap' set to 0: in the latter case, the Multi-AP +information element is simply ignored. + +In summary, this is the end-to-end behavior for a backhaul BSS (i.e., +multi_ap_backhaul_sta=1 in wpa_supplicant on STA, and multi_ap=1 or 3 in +hostapd on AP). Note that point 1 means that hostapd must not be configured +with WPS support on the backhaul BSS (multi_ap=1). hostapd does not check for +that. + +1. Backhaul BSS beacons do not advertise WPS support (other than that, nothing + Multi-AP specific). +2. STA sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. STA sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. STA and AP both use 4-address mode for Data frames. + + +WPS support +----------- + +WPS requires more special handling. WPS must only be advertised on fronthaul +BSSs, not on backhaul BSSs, so WPS should not be enabled on a backhaul-only +BSS in hostapd.conf. The WPS configuration purely works on the fronthaul BSS. +When a WPS M1 message has an additional subelement that indicates a request for +a Multi-AP backhaul link, hostapd must not respond with the normal fronthaul +BSS credentials; instead, it should respond with the (potentially different) +backhaul BSS credentials. + +To support this, hostapd has the 'multi_ap_backhaul_ssid', +'multi_ap_backhaul_wpa_psk' and 'multi_ap_backhaul_wpa_passphrase' options. +When these are set on an BSS with WPS, they are used instead of the normal +credentials when hostapd receives a WPS M1 message with the Multi-AP IE. Only +WPA2-Personal is supported in the Multi-AP specification, so there is no need +to specify authentication or encryption options. For the backhaul credentials, +per-device PSK is not supported. + +If the BSS is a simultaneous backhaul and fronthaul BSS, there is no need to +specify the backhaul credentials, since the backhaul and fronthaul credentials +are identical. + +To enable the Multi-AP backhaul STA feature when it performs WPS, a new +parameter has been introduced to the WPS_PBC control interface call. When this +"multi_ap=1" option is set, it adds the Multi-AP backhaul subelement to the +Association Request frame and the M1 message. It then configures the new network +profile with 'multi_ap_backhaul_sta=1'. Note that this means that if the AP does +not follow the Multi-AP specification, wpa_supplicant will fail to associate. + +In summary, this is the end-to-end behavior for WPS of a backhaul link (i.e., +multi_ap=1 option is given in the wps_pbc call on the STA side, and multi_ap=2 +and multi_ap_backhaul_ssid and either multi_ap_backhaul_wpa_psk or +multi_ap_backhaul_wpa_passphrase are set to the credentials of a backhaul BSS +in hostapd on Registrar AP). + +1. Fronthaul BSS Beacon frames advertise WPS support (nothing Multi-AP + specific). +2. Enrollee sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. Enrollee sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. Enrollee sends M1 with additional Multi-AP subelement. +7. AP sends M8 with backhaul instead of fronthaul credentials. +8. Enrollee sends Deauthentication frame. + + +References +---------- + +[1] https://www.wi-fi.org/discover-wi-fi/wi-fi-easymesh +[2] https://github.com/prplfoundation/prplMesh +[3] https://www.wi-fi.org/file/multi-ap-specification-v10 + (requires registration) Modified: head/contrib/wpa/hostapd/config_file.c ============================================================================== --- head/contrib/wpa/hostapd/config_file.c Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/config_file.c Tue Apr 23 03:52:43 2019 (r346591) @@ -37,7 +37,7 @@ static int hostapd_config_read_vlan_file(struct hostap const char *fname) { FILE *f; - char buf[128], *pos, *pos2; + char buf[128], *pos, *pos2, *pos3; int line = 0, vlan_id; struct hostapd_vlan *vlan; @@ -82,7 +82,10 @@ static int hostapd_config_read_vlan_file(struct hostap pos2 = pos; while (*pos2 != ' ' && *pos2 != '\t' && *pos2 != '\0') pos2++; - *pos2 = '\0'; + + if (*pos2 != '\0') + *(pos2++) = '\0'; + if (*pos == '\0' || os_strlen(pos) > IFNAMSIZ) { wpa_printf(MSG_ERROR, "Invalid VLAN ifname at line %d " "in '%s'", line, fname); @@ -90,6 +93,13 @@ static int hostapd_config_read_vlan_file(struct hostap return -1; } + while (*pos2 == ' ' || *pos2 == '\t') + pos2++; + pos3 = pos2; + while (*pos3 != ' ' && *pos3 != '\t' && *pos3 != '\0') + pos3++; + *pos3 = '\0'; + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " @@ -102,6 +112,7 @@ static int hostapd_config_read_vlan_file(struct hostap vlan->vlan_desc.untagged = vlan_id; vlan->vlan_desc.notempty = !!vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); + os_strlcpy(vlan->bridge, pos2, sizeof(vlan->bridge)); vlan->next = bss->vlan; bss->vlan = vlan; } @@ -1368,6 +1379,30 @@ static int hostapd_config_vht_capab(struct hostapd_con #endif /* CONFIG_IEEE80211AC */ +#ifdef CONFIG_IEEE80211AX + +static u8 find_bit_offset(u8 val) +{ + u8 res = 0; + + for (; val; val >>= 1) { + if (val & 1) + break; + res++; + } + + return res; +} + + +static u8 set_he_cap(int val, u8 mask) +{ + return (u8) (mask & (val << find_bit_offset(mask))); +} + +#endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_INTERWORKING static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, int line) @@ -2254,10 +2289,16 @@ static unsigned int parse_tls_flags(const char *val) flags |= TLS_CONN_DISABLE_TIME_CHECKS; if (os_strstr(val, "[DISABLE-TLSv1.0]")) flags |= TLS_CONN_DISABLE_TLSv1_0; + if (os_strstr(val, "[ENABLE-TLSv1.0]")) + flags |= TLS_CONN_ENABLE_TLSv1_0; if (os_strstr(val, "[DISABLE-TLSv1.1]")) flags |= TLS_CONN_DISABLE_TLSv1_1; + if (os_strstr(val, "[ENABLE-TLSv1.1]")) + flags |= TLS_CONN_ENABLE_TLSv1_1; if (os_strstr(val, "[DISABLE-TLSv1.2]")) flags |= TLS_CONN_DISABLE_TLSv1_2; + if (os_strstr(val, "[ENABLE-TLSv1.2]")) + flags |= TLS_CONN_ENABLE_TLSv1_2; if (os_strstr(val, "[DISABLE-TLSv1.3]")) flags |= TLS_CONN_DISABLE_TLSv1_3; if (os_strstr(val, "[ENABLE-TLSv1.3]")) @@ -2292,6 +2333,14 @@ static int parse_sae_password(struct hostapd_bss_confi pos = pos2 + ETH_ALEN * 3 - 1; } + pos2 = os_strstr(pos, "|vlanid="); + if (pos2) { + if (!end) + end = pos2; + pos2 += 8; + pw->vlan_id = atoi(pos2); + } + pos2 = os_strstr(pos, "|id="); if (pos2) { if (!end) @@ -2476,8 +2525,22 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "private_key_passwd") == 0) { os_free(bss->private_key_passwd); bss->private_key_passwd = os_strdup(pos); + } else if (os_strcmp(buf, "check_cert_subject") == 0) { + if (!pos[0]) { + wpa_printf(MSG_ERROR, "Line %d: unknown check_cert_subject '%s'", + line, pos); + return 1; + } + os_free(bss->check_cert_subject); + bss->check_cert_subject = os_strdup(pos); + if (!bss->check_cert_subject) + return 1; } else if (os_strcmp(buf, "check_crl") == 0) { bss->check_crl = atoi(pos); + } else if (os_strcmp(buf, "check_crl_strict") == 0) { + bss->check_crl_strict = atoi(pos); + } else if (os_strcmp(buf, "crl_reload_interval") == 0) { + bss->crl_reload_interval = atoi(pos); } else if (os_strcmp(buf, "tls_session_lifetime") == 0) { bss->tls_session_lifetime = atoi(pos); } else if (os_strcmp(buf, "tls_flags") == 0) { @@ -2494,6 +2557,9 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "openssl_ciphers") == 0) { os_free(bss->openssl_ciphers); bss->openssl_ciphers = os_strdup(pos); + } else if (os_strcmp(buf, "openssl_ecdh_curves") == 0) { + os_free(bss->openssl_ecdh_curves); + bss->openssl_ecdh_curves = os_strdup(pos); } else if (os_strcmp(buf, "fragment_size") == 0) { bss->fragment_size = atoi(pos); #ifdef EAP_SERVER_FAST @@ -3070,9 +3136,10 @@ static int hostapd_config_fill(struct hostapd_config * * cause problems with the current implementation. * Since it is unlikely that this small numbers are * useful in real life scenarios, do not allow beacon - * period to be set below 15 TU. */ - if (val < 15 || val > 65535) { - wpa_printf(MSG_ERROR, "Line %d: invalid beacon_int %d (expected 15..65535)", + * period to be set below 10 TU. */ + if (val < 10 || val > 65535) { + wpa_printf(MSG_ERROR, + "Line %d: invalid beacon_int %d (expected 10..65535)", line, val); return 1; } @@ -3148,7 +3215,7 @@ static int hostapd_config_fill(struct hostapd_config * line, val); return 1; } - conf->send_probe_response = val; + bss->send_probe_response = val; } else if (os_strcmp(buf, "supported_rates") == 0) { if (hostapd_parse_intlist(&conf->supported_rates, pos)) { wpa_printf(MSG_ERROR, "Line %d: invalid rate list", @@ -3316,6 +3383,12 @@ static int hostapd_config_fill(struct hostapd_config * return 1; } #endif /* CONFIG_IEEE80211W */ +#ifdef CONFIG_OCV + } else if (os_strcmp(buf, "ocv") == 0) { + bss->ocv = atoi(pos); + if (bss->ocv && !bss->ieee80211w) + bss->ieee80211w = 1; +#endif /* CONFIG_OCV */ #ifdef CONFIG_IEEE80211N } else if (os_strcmp(buf, "ieee80211n") == 0) { conf->ieee80211n = atoi(pos); @@ -3369,6 +3442,90 @@ static int hostapd_config_fill(struct hostapd_config * conf->he_op.he_twt_required = atoi(pos); } else if (os_strcmp(buf, "he_rts_threshold") == 0) { conf->he_op.he_rts_threshold = atoi(pos); + } else if (os_strcmp(buf, "he_mu_edca_qos_info_param_count") == 0) { + conf->he_mu_edca.he_qos_info |= + set_he_cap(atoi(pos), HE_QOS_INFO_EDCA_PARAM_SET_COUNT); + } else if (os_strcmp(buf, "he_mu_edca_qos_info_q_ack") == 0) { + conf->he_mu_edca.he_qos_info |= + set_he_cap(atoi(pos), HE_QOS_INFO_Q_ACK); + } else if (os_strcmp(buf, "he_mu_edca_qos_info_queue_request") == 0) { + conf->he_mu_edca.he_qos_info |= + set_he_cap(atoi(pos), HE_QOS_INFO_QUEUE_REQUEST); + } else if (os_strcmp(buf, "he_mu_edca_qos_info_txop_request") == 0) { + conf->he_mu_edca.he_qos_info |= + set_he_cap(atoi(pos), HE_QOS_INFO_TXOP_REQUEST); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_aifsn") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_AIFSN); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_acm") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACM); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_aci") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACI); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_ecwmin") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMIN); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_ecwmax") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMAX); + } else if (os_strcmp(buf, "he_mu_edca_ac_be_timer") == 0) { + conf->he_mu_edca.he_mu_ac_be_param[HE_MU_AC_PARAM_TIMER_IDX] = + atoi(pos) & 0xff; + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_aifsn") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_AIFSN); + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_acm") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACM); + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_aci") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACI); + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_ecwmin") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMIN); + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_ecwmax") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMAX); + } else if (os_strcmp(buf, "he_mu_edca_ac_bk_timer") == 0) { + conf->he_mu_edca.he_mu_ac_bk_param[HE_MU_AC_PARAM_TIMER_IDX] = + atoi(pos) & 0xff; + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_aifsn") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_AIFSN); + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_acm") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACM); + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_aci") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACI); + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_ecwmin") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMIN); + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_ecwmax") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMAX); + } else if (os_strcmp(buf, "he_mu_edca_ac_vi_timer") == 0) { + conf->he_mu_edca.he_mu_ac_vi_param[HE_MU_AC_PARAM_TIMER_IDX] = + atoi(pos) & 0xff; + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_aifsn") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_AIFSN); + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_acm") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACM); + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_aci") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_ACI_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ACI); + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_ecwmin") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMIN); + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_ecwmax") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_ECW_IDX] |= + set_he_cap(atoi(pos), HE_MU_AC_PARAM_ECWMAX); + } else if (os_strcmp(buf, "he_mu_edca_ac_vo_timer") == 0) { + conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_TIMER_IDX] = + atoi(pos) & 0xff; #endif /* CONFIG_IEEE80211AX */ } else if (os_strcmp(buf, "max_listen_interval") == 0) { bss->max_listen_interval = atoi(pos); @@ -3466,6 +3623,8 @@ static int hostapd_config_fill(struct hostapd_config * } } else if (os_strcmp(buf, "wps_cred_processing") == 0) { bss->wps_cred_processing = atoi(pos); + } else if (os_strcmp(buf, "wps_cred_add_sae") == 0) { + bss->wps_cred_add_sae = atoi(pos); } else if (os_strcmp(buf, "ap_settings") == 0) { os_free(bss->ap_settings); bss->ap_settings = @@ -3475,6 +3634,56 @@ static int hostapd_config_fill(struct hostapd_config * line, pos); return 1; } + } else if (os_strcmp(buf, "multi_ap_backhaul_ssid") == 0) { + size_t slen; + char *str = wpa_config_parse_string(pos, &slen); + + if (!str || slen < 1 || slen > SSID_MAX_LEN) { + wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'", + line, pos); + os_free(str); + return 1; + } + os_memcpy(bss->multi_ap_backhaul_ssid.ssid, str, slen); + bss->multi_ap_backhaul_ssid.ssid_len = slen; + bss->multi_ap_backhaul_ssid.ssid_set = 1; + os_free(str); + } else if (os_strcmp(buf, "multi_ap_backhaul_wpa_passphrase") == 0) { + int len = os_strlen(pos); + + if (len < 8 || len > 63) { + wpa_printf(MSG_ERROR, + "Line %d: invalid WPA passphrase length %d (expected 8..63)", + line, len); + return 1; + } + os_free(bss->multi_ap_backhaul_ssid.wpa_passphrase); + bss->multi_ap_backhaul_ssid.wpa_passphrase = os_strdup(pos); + if (bss->multi_ap_backhaul_ssid.wpa_passphrase) { + hostapd_config_clear_wpa_psk( + &bss->multi_ap_backhaul_ssid.wpa_psk); + bss->multi_ap_backhaul_ssid.wpa_passphrase_set = 1; + } + } else if (os_strcmp(buf, "multi_ap_backhaul_wpa_psk") == 0) { + hostapd_config_clear_wpa_psk( + &bss->multi_ap_backhaul_ssid.wpa_psk); + bss->multi_ap_backhaul_ssid.wpa_psk = + os_zalloc(sizeof(struct hostapd_wpa_psk)); + if (!bss->multi_ap_backhaul_ssid.wpa_psk) + return 1; + if (hexstr2bin(pos, bss->multi_ap_backhaul_ssid.wpa_psk->psk, + PMK_LEN) || + pos[PMK_LEN * 2] != '\0') { + wpa_printf(MSG_ERROR, "Line %d: Invalid PSK '%s'.", + line, pos); + hostapd_config_clear_wpa_psk( + &bss->multi_ap_backhaul_ssid.wpa_psk); + return 1; + } + bss->multi_ap_backhaul_ssid.wpa_psk->group = 1; + os_free(bss->multi_ap_backhaul_ssid.wpa_passphrase); + bss->multi_ap_backhaul_ssid.wpa_passphrase = NULL; + bss->multi_ap_backhaul_ssid.wpa_psk_set = 1; } else if (os_strcmp(buf, "upnp_iface") == 0) { os_free(bss->upnp_iface); bss->upnp_iface = os_strdup(pos); @@ -3717,6 +3926,16 @@ static int hostapd_config_fill(struct hostapd_config * #ifdef CONFIG_HS20 } else if (os_strcmp(buf, "hs20") == 0) { bss->hs20 = atoi(pos); + } else if (os_strcmp(buf, "hs20_release") == 0) { + int val = atoi(pos); + + if (val < 1 || val > (HS20_VERSION >> 4) + 1) { + wpa_printf(MSG_ERROR, + "Line %d: Unsupported hs20_release: %s", + line, pos); + return 1; + } + bss->hs20_release = val; } else if (os_strcmp(buf, "disable_dgaf") == 0) { bss->disable_dgaf = atoi(pos); } else if (os_strcmp(buf, "na_mcast_to_ucast") == 0) { @@ -3807,6 +4026,9 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "hs20_t_c_server_url") == 0) { os_free(bss->t_c_server_url); bss->t_c_server_url = os_strdup(pos); + } else if (os_strcmp(buf, "hs20_sim_provisioning_url") == 0) { + os_free(bss->hs20_sim_provisioning_url); + bss->hs20_sim_provisioning_url = os_strdup(pos); #endif /* CONFIG_HS20 */ #ifdef CONFIG_MBO } else if (os_strcmp(buf, "mbo") == 0) { @@ -4111,6 +4333,22 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "coloc_intf_reporting") == 0) { bss->coloc_intf_reporting = atoi(pos); #endif /* CONFIG_OWE */ + } else if (os_strcmp(buf, "multi_ap") == 0) { + int val = atoi(pos); + + if (val < 0 || val > 3) { + wpa_printf(MSG_ERROR, "Line %d: Invalid multi_ap '%s'", + line, buf); + return -1; + } + + bss->multi_ap = val; + } else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) { + conf->rssi_reject_assoc_rssi = atoi(pos); + } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) { + conf->rssi_reject_assoc_timeout = atoi(pos); + } else if (os_strcmp(buf, "pbss") == 0) { + bss->pbss = atoi(pos); } else { wpa_printf(MSG_ERROR, "Line %d: unknown configuration item '%s'", Modified: head/contrib/wpa/hostapd/ctrl_iface.c ============================================================================== --- head/contrib/wpa/hostapd/ctrl_iface.c Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/ctrl_iface.c Tue Apr 23 03:52:43 2019 (r346591) @@ -883,7 +883,7 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostap /* TODO: TSF configurable/learnable */ bss_term_dur[0] = 4; /* Subelement ID */ bss_term_dur[1] = 10; /* Length */ - os_memset(bss_term_dur, 2, 8); + os_memset(&bss_term_dur[2], 0, 8); end = os_strchr(pos, ','); if (end == NULL) { wpa_printf(MSG_DEBUG, "Invalid bss_term data"); @@ -1488,6 +1488,63 @@ static int hostapd_ctrl_iface_disable(struct hostapd_i } +static int +hostapd_ctrl_iface_kick_mismatch_psk_sta_iter(struct hostapd_data *hapd, + struct sta_info *sta, void *ctx) +{ + struct hostapd_wpa_psk *psk; + const u8 *pmk; + int pmk_len; + int pmk_match; + int sta_match; + int bss_match; + int reason; + + pmk = wpa_auth_get_pmk(sta->wpa_sm, &pmk_len); + + for (psk = hapd->conf->ssid.wpa_psk; pmk && psk; psk = psk->next) { + pmk_match = PMK_LEN == pmk_len && + os_memcmp(psk->psk, pmk, pmk_len) == 0; + sta_match = psk->group == 0 && + os_memcmp(sta->addr, psk->addr, ETH_ALEN) == 0; + bss_match = psk->group == 1; + + if (pmk_match && (sta_match || bss_match)) + return 0; + } + + wpa_printf(MSG_INFO, "STA " MACSTR + " PSK/passphrase no longer valid - disconnect", + MAC2STR(sta->addr)); + reason = WLAN_REASON_PREV_AUTH_NOT_VALID; + hostapd_drv_sta_deauth(hapd, sta->addr, reason); + ap_sta_deauthenticate(hapd, sta, reason); + + return 0; +} + + +static int hostapd_ctrl_iface_reload_wpa_psk(struct hostapd_data *hapd) +{ + struct hostapd_bss_config *conf = hapd->conf; + int err; + + hostapd_config_clear_wpa_psk(&conf->ssid.wpa_psk); + + err = hostapd_setup_wpa_psk(conf); + if (err < 0) { + wpa_printf(MSG_ERROR, "Reloading WPA-PSK passwords failed: %d", + err); + return -1; + } + + ap_for_each_sta(hapd, hostapd_ctrl_iface_kick_mismatch_psk_sta_iter, + NULL); + + return 0; +} + + #ifdef CONFIG_TESTING_OPTIONS static int hostapd_ctrl_iface_radar(struct hostapd_data *hapd, char *cmd) @@ -2826,6 +2883,34 @@ static int hostapd_ctrl_iface_acl_add_mac(struct mac_a } +static int hostapd_ctrl_iface_get_capability(struct hostapd_data *hapd, + const char *field, char *buf, + size_t buflen) +{ + wpa_printf(MSG_DEBUG, "CTRL_IFACE: GET_CAPABILITY '%s'", field); + +#ifdef CONFIG_DPP + if (os_strcmp(field, "dpp") == 0) { + int res; + +#ifdef CONFIG_DPP2 + res = os_snprintf(buf, buflen, "DPP=2"); +#else /* CONFIG_DPP2 */ + res = os_snprintf(buf, buflen, "DPP=1"); +#endif /* CONFIG_DPP2 */ + if (os_snprintf_error(buflen, res)) + return -1; + return res; + } +#endif /* CONFIG_DPP */ + + wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'", + field); + + return -1; +} + + static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, char *buf, char *reply, int reply_size, @@ -3013,6 +3098,9 @@ static int hostapd_ctrl_iface_receive_process(struct h } else if (os_strncmp(buf, "ENABLE", 6) == 0) { if (hostapd_ctrl_iface_enable(hapd->iface)) reply_len = -1; + } else if (os_strcmp(buf, "RELOAD_WPA_PSK") == 0) { + if (hostapd_ctrl_iface_reload_wpa_psk(hapd)) + reply_len = -1; } else if (os_strncmp(buf, "RELOAD", 6) == 0) { if (hostapd_ctrl_iface_reload(hapd->iface)) reply_len = -1; @@ -3182,7 +3270,7 @@ static int hostapd_ctrl_iface_receive_process(struct h reply_len = -1; } } else if (os_strncmp(buf, "DPP_BOOTSTRAP_GEN ", 18) == 0) { - res = hostapd_dpp_bootstrap_gen(hapd, buf + 18); + res = dpp_bootstrap_gen(hapd->iface->interfaces->dpp, buf + 18); if (res < 0) { reply_len = -1; } else { @@ -3191,12 +3279,14 @@ static int hostapd_ctrl_iface_receive_process(struct h reply_len = -1; } } else if (os_strncmp(buf, "DPP_BOOTSTRAP_REMOVE ", 21) == 0) { - if (hostapd_dpp_bootstrap_remove(hapd, buf + 21) < 0) + if (dpp_bootstrap_remove(hapd->iface->interfaces->dpp, + buf + 21) < 0) reply_len = -1; } else if (os_strncmp(buf, "DPP_BOOTSTRAP_GET_URI ", 22) == 0) { const char *uri; - uri = hostapd_dpp_bootstrap_get_uri(hapd, atoi(buf + 22)); + uri = dpp_bootstrap_get_uri(hapd->iface->interfaces->dpp, + atoi(buf + 22)); if (!uri) { reply_len = -1; } else { @@ -3205,8 +3295,9 @@ static int hostapd_ctrl_iface_receive_process(struct h reply_len = -1; } } else if (os_strncmp(buf, "DPP_BOOTSTRAP_INFO ", 19) == 0) { - reply_len = hostapd_dpp_bootstrap_info(hapd, atoi(buf + 19), - reply, reply_size); + reply_len = dpp_bootstrap_info(hapd->iface->interfaces->dpp, + atoi(buf + 19), + reply, reply_size); } else if (os_strncmp(buf, "DPP_AUTH_INIT ", 14) == 0) { if (hostapd_dpp_auth_init(hapd, buf + 13) < 0) reply_len = -1; @@ -3217,7 +3308,8 @@ static int hostapd_ctrl_iface_receive_process(struct h hostapd_dpp_stop(hapd); hostapd_dpp_listen_stop(hapd); } else if (os_strncmp(buf, "DPP_CONFIGURATOR_ADD", 20) == 0) { - res = hostapd_dpp_configurator_add(hapd, buf + 20); + res = dpp_configurator_add(hapd->iface->interfaces->dpp, + buf + 20); if (res < 0) { reply_len = -1; } else { @@ -3226,15 +3318,17 @@ static int hostapd_ctrl_iface_receive_process(struct h reply_len = -1; } } else if (os_strncmp(buf, "DPP_CONFIGURATOR_REMOVE ", 24) == 0) { - if (hostapd_dpp_configurator_remove(hapd, buf + 24) < 0) + if (dpp_configurator_remove(hapd->iface->interfaces->dpp, + buf + 24) < 0) reply_len = -1; } else if (os_strncmp(buf, "DPP_CONFIGURATOR_SIGN ", 22) == 0) { - if (hostapd_dpp_configurator_sign(hapd, buf + 22) < 0) + if (hostapd_dpp_configurator_sign(hapd, buf + 21) < 0) reply_len = -1; } else if (os_strncmp(buf, "DPP_CONFIGURATOR_GET_KEY ", 25) == 0) { - reply_len = hostapd_dpp_configurator_get_key(hapd, - atoi(buf + 25), - reply, reply_size); + reply_len = dpp_configurator_get_key_id( + hapd->iface->interfaces->dpp, + atoi(buf + 25), + reply, reply_size); } else if (os_strncmp(buf, "DPP_PKEX_ADD ", 13) == 0) { res = hostapd_dpp_pkex_add(hapd, buf + 12); if (res < 0) { @@ -3253,6 +3347,9 @@ static int hostapd_ctrl_iface_receive_process(struct h if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) reply_len = -1; #endif /* RADIUS_SERVER */ + } else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) { + reply_len = hostapd_ctrl_iface_get_capability( + hapd, buf + 15, reply, reply_size); } else { os_memcpy(reply, "UNKNOWN COMMAND\n", 16); reply_len = 16; @@ -3506,18 +3603,18 @@ fail: } if (hapd->conf->ctrl_interface_gid_set && - chown(hapd->conf->ctrl_interface, -1, - hapd->conf->ctrl_interface_gid) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface]: %s", + lchown(hapd->conf->ctrl_interface, -1, + hapd->conf->ctrl_interface_gid) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface]: %s", strerror(errno)); return -1; } if (!hapd->conf->ctrl_interface_gid_set && hapd->iface->interfaces->ctrl_iface_group && - chown(hapd->conf->ctrl_interface, -1, - hapd->iface->interfaces->ctrl_iface_group) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface]: %s", + lchown(hapd->conf->ctrl_interface, -1, + hapd->iface->interfaces->ctrl_iface_group) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface]: %s", strerror(errno)); return -1; } @@ -3590,16 +3687,16 @@ fail: } if (hapd->conf->ctrl_interface_gid_set && - chown(fname, -1, hapd->conf->ctrl_interface_gid) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface/ifname]: %s", + lchown(fname, -1, hapd->conf->ctrl_interface_gid) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface/ifname]: %s", strerror(errno)); goto fail; } if (!hapd->conf->ctrl_interface_gid_set && hapd->iface->interfaces->ctrl_iface_group && - chown(fname, -1, hapd->iface->interfaces->ctrl_iface_group) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface/ifname]: %s", + lchown(fname, -1, hapd->iface->interfaces->ctrl_iface_group) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface/ifname]: %s", strerror(errno)); goto fail; } @@ -3733,7 +3830,7 @@ static void hostapd_ctrl_iface_flush(struct hapd_inter #endif /* CONFIG_TESTING_OPTIONS */ #ifdef CONFIG_DPP - hostapd_dpp_deinit_global(interfaces); + dpp_global_clear(interfaces->dpp); #endif /* CONFIG_DPP */ } @@ -4273,9 +4370,9 @@ fail: goto fail; } } else if (interface->ctrl_iface_group && - chown(interface->global_iface_path, -1, - interface->ctrl_iface_group) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface]: %s", + lchown(interface->global_iface_path, -1, + interface->ctrl_iface_group) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface]: %s", strerror(errno)); goto fail; } @@ -4332,8 +4429,8 @@ fail: } if (interface->ctrl_iface_group && - chown(fname, -1, interface->ctrl_iface_group) < 0) { - wpa_printf(MSG_ERROR, "chown[ctrl_interface]: %s", + lchown(fname, -1, interface->ctrl_iface_group) < 0) { + wpa_printf(MSG_ERROR, "lchown[ctrl_interface]: %s", strerror(errno)); goto fail; } Modified: head/contrib/wpa/hostapd/defconfig ============================================================================== --- head/contrib/wpa/hostapd/defconfig Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/defconfig Tue Apr 23 03:52:43 2019 (r346591) @@ -53,6 +53,9 @@ CONFIG_RSN_PREAUTH=y # IEEE 802.11w (management frame protection) CONFIG_IEEE80211W=y +# Support Operating Channel Validation +#CONFIG_OCV=y + # Integrated EAP server CONFIG_EAP=y @@ -249,6 +252,11 @@ CONFIG_IPV6=y # requirements described above. #CONFIG_NO_RANDOM_POOL=y +# Should we attempt to use the getrandom(2) call that provides more reliable +# yet secure randomness source than /dev/random on Linux 3.17 and newer. +# Requires glibc 2.25 to build, falls back to /dev/random if unavailable. +#CONFIG_GETRANDOM=y + # Should we use poll instead of select? Select is used by default. #CONFIG_ELOOP_POLL=y @@ -356,8 +364,6 @@ CONFIG_IPV6=y #CONFIG_TAXONOMY=y # Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. #CONFIG_FILS=y # FILS shared key authentication with PFS #CONFIG_FILS_SK_PFS=y Modified: head/contrib/wpa/hostapd/hostapd.conf ============================================================================== --- head/contrib/wpa/hostapd/hostapd.conf Tue Apr 23 03:19:03 2019 (r346590) +++ head/contrib/wpa/hostapd/hostapd.conf Tue Apr 23 03:52:43 2019 (r346591) @@ -438,6 +438,13 @@ wmm_ac_vo_txop_limit=47 wmm_ac_vo_acm=0 # Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102 +# Enable Multi-AP functionality +# 0 = disabled (default) +# 1 = AP support backhaul BSS +# 2 = AP support fronthaul BSS +# 3 = AP supports both backhaul BSS and fronthaul BSS +#multi_ap=0 + # Static WEP key configuration # # The key number to use when transmitting. @@ -794,6 +801,30 @@ wmm_ac_vo_acm=0 # unsigned integer = duration in units of 16 us #he_rts_threshold=0 +#he_mu_edca_qos_info_param_count +#he_mu_edca_qos_info_q_ack +#he_mu_edca_qos_info_queue_request=1 +#he_mu_edca_qos_info_txop_request +#he_mu_edca_ac_be_aifsn=0 +#he_mu_edca_ac_be_ecwmin=15 +#he_mu_edca_ac_be_ecwmax=15 +#he_mu_edca_ac_be_timer=255 +#he_mu_edca_ac_bk_aifsn=0 +#he_mu_edca_ac_bk_aci=1 +#he_mu_edca_ac_bk_ecwmin=15 +#he_mu_edca_ac_bk_ecwmax=15 +#he_mu_edca_ac_bk_timer=255 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Apr 23 04:07:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E73A158D0C2; Tue, 23 Apr 2019 04:07:15 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id DCEA28D983; Tue, 23 Apr 2019 04:07:10 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id 9E3013F49F; Tue, 23 Apr 2019 13:06:57 +0900 (JST) Date: Tue, 23 Apr 2019 00:06:25 -0400 From: Yoshihiro Ota To: Ed Maste Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs Message-Id: <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> In-Reply-To: <201904171602.x3HG2wQq054372@repo.freebsd.org> References: <201904171602.x3HG2wQq054372@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DCEA28D983 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.15 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [-0.75 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-0.96)[-0.960,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[email.ne.jp]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; IP_SCORE(0.12)[asn: 4685(0.67), country: JP(-0.06)]; NEURAL_SPAM_SHORT(0.82)[0.819,0]; MX_GOOD(-0.01)[sbmx.asahi-net.or.jp]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[15.55.224.202.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 04:07:15 -0000 It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to fail as the following with HEAD checked out under "/usr/obj/freebsd": cc -O2 -pipe -DWITH_CASPER -I/usr/obj/freebsd/contrib/elftoolchain/libelftc - I/usr/obj/freebsd/contrib/elftoolchain/common -g -MD -MF.depend.strings.o -MTstrings.o -std=gnu99 -Qunused-arguments -c /usr/obj/freebsd/contrib/elftoolchain/strings/strings.c -o strings.o /usr/obj/freebsd/contrib/elftoolchain/strings/strings.c:198:55: error: use of undeclared identifier 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); ^ 1 error generated. *** [strings.o] Error code 1 It looks #include cannot pick up header files from "lib/libcasper/services/cap_fileargs" Hiro Ed Maste wrote: > Author: emaste > Date: Wed Apr 17 16:02:57 2019 > New Revision: 346315 > URL: https://svnweb.freebsd.org/changeset/base/346315 > > Log: > cap_fileargs: add fileargs_lstat service > > Add fileargs_lstat function to cap_fileargs casper service to be able to > lstat files while in capability mode. It can only lstat files given in > fileargs_init. > > Submitted by: Bora $B".(Bzarslan > Reviewed by: oshogbo, cem (partial) > MFC after: 3 weeks > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D19548 > > Modified: > head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 > head/lib/libcasper/services/cap_fileargs/cap_fileargs.c > head/lib/libcasper/services/cap_fileargs/cap_fileargs.h > > Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 > ============================================================================== > --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 16:00:33 > 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr > 17 16:02:57 2019 (r346315) @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 12, 2018 > +.Dd April 17, 2019 > .Dt CAP_FILEARGS 3 > .Os > .Sh NAME > @@ -33,6 +33,7 @@ > .Nm fileargs_init , > .Nm fileargs_initnv , > .Nm fileargs_free , > +.Nm fileargs_lstat , > .Nm fileargs_open , > .Nm fileargs_fopen > .Nd "library for handling files in capability mode" > @@ -43,9 +44,9 @@ > .In libcasper.h > .In casper/cap_fileargs.h > .Ft "fileargs_t *" > -.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" > +.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" > "int operations" .Ft "fileargs_t *" > -.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int flags" "mode_t mode" > "cap_rights_t *rightsp" +.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int > flags" "mode_t mode" "cap_rights_t *rightsp" "int operations" .Ft "fileargs_t *" > .Fn fileargs_cinitnv "cap_channel_t *cas" "nvlist_t *limits" > .Ft "fileargs_t *" > @@ -53,6 +54,8 @@ > .Ft "void" > .Fn fileargs_free "fileargs_t *fa" > .Ft "int" > +.Fn fileargs_lstat "fileargs_t *fa" "const char *path" "struct stat *sb" > +.Ft "int" > .Fn fileargs_open "fileargs_t *fa" "const char *name" > .Ft "FILE *" > .Fn fileargs_fopen "fileargs_t *fa" "const char *name" "const char *mode" > @@ -97,6 +100,22 @@ The > argument contains a list of the capability rights which file should be limited to. > For more details of the capability rights see > .Xr cap_rights_init 3 . > +The > +.Fa operations > +argument limits the operations that are available using > +.Nm system.fileargs . > +.Fa operations > +is a combination of: > +.Bl -ohang -offset indent > +.It FA_OPEN > +Allow > +.Fn fileargs_open > +and > +.Fn fileargs_fopen . > +.It FA_LSTAT > +Allow > +.Fn fileargs_lstat . > +.El > .Pp > The function > .Fn fileargs_cinit > @@ -126,6 +145,11 @@ The function handle > .Dv NULL > argument. > .Pp > +The function > +.Fn fileargs_lstat > +is equivalent to > +.Xr lstat 2 . > +.Pp > The functions > .Fn fileargs_open > and > @@ -165,6 +189,15 @@ must contain the > The > .Va mode > argument tells which what mode file should be created. > +.It operations (NV_TYPE_NUMBER) > +The > +.Va operations > +limits the usable operations for > +.Fa system.fileargs . > +The possible values are explained as > +.Va operations > +argument with > +.Fn fileargs_init . > .El > .Pp > The > @@ -201,7 +234,7 @@ argv += optind; > > /* Create capability to the system.fileargs service. */ > fa = fileargs_init(argc, argv, O_RDONLY, 0, > - cap_rights_init(&rights, CAP_READ)); > + cap_rights_init(&rights, CAP_READ), FA_OPEN); > if (fa == NULL) > err(1, "unable to open system.fileargs service"); > > @@ -222,6 +255,7 @@ fileargs_free(fa); > .Ed > .Sh SEE ALSO > .Xr cap_enter 2 , > +.Xr lstat 2 , > .Xr open 2 , > .Xr cap_rights_init 3 , > .Xr err 3 , > > Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c > ============================================================================== > --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:00:33 > 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr > 17 16:02:57 2019 (r346315) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > @@ -59,8 +60,37 @@ struct fileargs { > }; > > static int > -fileargs_get_cache(fileargs_t *fa, const char *name) > +fileargs_get_lstat_cache(fileargs_t *fa, const char *name, struct stat *sb) > { > + const nvlist_t *nvl; > + size_t size; > + const void *buf; > + > + assert(fa != NULL); > + assert(fa->fa_magic == FILEARGS_MAGIC); > + assert(name != NULL); > + > + if (fa->fa_cache == NULL) > + return (-1); > + > + nvl = dnvlist_get_nvlist(fa->fa_cache, name, NULL); > + if (nvl == NULL) > + return (-1); > + > + if (!nvlist_exists_binary(nvl, "stat")) { > + return (-1); > + } > + > + buf = nvlist_get_binary(nvl, "stat", &size); > + assert(size == sizeof(*sb)); > + memcpy(sb, buf, size); > + > + return (0); > +} > + > +static int > +fileargs_get_fd_cache(fileargs_t *fa, const char *name) > +{ > int fd; > const nvlist_t *nvl; > nvlist_t *tnvl; > @@ -80,6 +110,12 @@ fileargs_get_cache(fileargs_t *fa, const char *name) > return (-1); > > tnvl = nvlist_take_nvlist(fa->fa_cache, name); > + > + if (!nvlist_exists_descriptor(tnvl, "fd")) { > + nvlist_destroy(tnvl); > + return (-1); > + } > + > fd = nvlist_take_descriptor(tnvl, "fd"); > nvlist_destroy(tnvl); > > @@ -102,7 +138,7 @@ fileargs_set_cache(fileargs_t *fa, nvlist_t *nvl) > } > > static nvlist_t* > -fileargs_fetch(fileargs_t *fa, const char *name) > +fileargs_fetch(fileargs_t *fa, const char *name, const char *cmd) > { > nvlist_t *nvl; > int serrno; > @@ -111,7 +147,7 @@ fileargs_fetch(fileargs_t *fa, const char *name) > assert(name != NULL); > > nvl = nvlist_create(NV_FLAG_NO_UNIQUE); > - nvlist_add_string(nvl, "cmd", "open"); > + nvlist_add_string(nvl, "cmd", cmd); > nvlist_add_string(nvl, "name", name); > > nvl = cap_xfer_nvlist(fa->fa_chann, nvl); > @@ -130,7 +166,7 @@ fileargs_fetch(fileargs_t *fa, const char *name) > > static nvlist_t * > fileargs_create_limit(int argc, const char * const *argv, int flags, > - mode_t mode, cap_rights_t *rightsp) > + mode_t mode, cap_rights_t *rightsp, int operations) > { > nvlist_t *limits; > int i; > @@ -140,6 +176,7 @@ fileargs_create_limit(int argc, const char * const *ar > return (NULL); > > nvlist_add_number(limits, "flags", flags); > + nvlist_add_number(limits, "operations", operations); > if (rightsp != NULL) { > nvlist_add_binary(limits, "cap_rights", rightsp, > sizeof(*rightsp)); > @@ -172,7 +209,7 @@ fileargs_create(cap_channel_t *chan, int fdflags) > > fileargs_t * > fileargs_init(int argc, char *argv[], int flags, mode_t mode, > - cap_rights_t *rightsp) > + cap_rights_t *rightsp, int operations) > { > nvlist_t *limits; > > @@ -181,7 +218,7 @@ fileargs_init(int argc, char *argv[], int flags, mode_ > } > > limits = fileargs_create_limit(argc, (const char * const *)argv, flags, > - mode, rightsp); > + mode, rightsp, operations); > if (limits == NULL) > return (NULL); > > @@ -190,7 +227,7 @@ fileargs_init(int argc, char *argv[], int flags, mode_ > > fileargs_t * > fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], int flags, > - mode_t mode, cap_rights_t *rightsp) > + mode_t mode, cap_rights_t *rightsp, int operations) > { > nvlist_t *limits; > > @@ -199,7 +236,7 @@ fileargs_cinit(cap_channel_t *cas, int argc, char *arg > } > > limits = fileargs_create_limit(argc, (const char * const *)argv, flags, > - mode, rightsp); > + mode, rightsp, operations); > if (limits == NULL) > return (NULL); > > @@ -234,7 +271,7 @@ fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits) > cap_channel_t *chann; > fileargs_t *fa; > int serrno, ret; > - int flags; > + int flags, operations; > > assert(cas != NULL); > > @@ -252,6 +289,7 @@ fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits) > } > > flags = nvlist_get_number(limits, "flags"); > + operations = nvlist_get_number(limits, "operations"); > > /* Limits are consumed no need to free them. */ > ret = cap_limit_set(chann, limits); > @@ -291,11 +329,11 @@ fileargs_open(fileargs_t *fa, const char *name) > return (-1); > } > > - fd = fileargs_get_cache(fa, name); > + fd = fileargs_get_fd_cache(fa, name); > if (fd != -1) > return (fd); > > - nvl = fileargs_fetch(fa, name); > + nvl = fileargs_fetch(fa, name, "open"); > if (nvl == NULL) > return (-1); > > @@ -322,6 +360,53 @@ fileargs_fopen(fileargs_t *fa, const char *name, const > return (fdopen(fd, mode)); > } > > +int > +fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb) > +{ > + nvlist_t *nvl; > + const void *buf; > + size_t size; > + char *cmd; > + > + assert(fa != NULL); > + assert(fa->fa_magic == FILEARGS_MAGIC); > + > + if (name == NULL) { > + errno = EINVAL; > + return (-1); > + } > + > + if (sb == NULL) { > + errno = EFAULT; > + return (-1); > + } > + > + if (fa->fa_chann == NULL) { > + errno = ENOTCAPABLE; > + return (-1); > + } > + > + if (fileargs_get_lstat_cache(fa, name, sb) != -1) > + return (0); > + > + nvl = fileargs_fetch(fa, name, "lstat"); > + if (nvl == NULL) > + return (-1); > + > + buf = nvlist_get_binary(nvl, "stat", &size); > + assert(size == sizeof(*sb)); > + memcpy(sb, buf, size); > + > + cmd = nvlist_take_string(nvl, "cmd"); > + if (strcmp(cmd, "cache") == 0) > + fileargs_set_cache(fa, nvl); > + else > + nvlist_destroy(nvl); > + free(cmd); > + > + return (0); > +} > + > void > fileargs_free(fileargs_t *fa) > { > @@ -348,6 +433,7 @@ static void *cacheposition; > static bool allcached; > static const cap_rights_t *caprightsp; > static int capflags; > +static int allowed_operations; > static mode_t capmode; > > static int > @@ -382,6 +468,7 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l > void *cookie; > nvlist_t *new; > const char *fname; > + struct stat sb; > > if ((capflags & O_CREAT) != 0) { > allcached = true; > @@ -409,14 +496,25 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l > continue; > } > > - fd = open_file(fname); > - if (fd < 0) { > - i--; > - continue; > + new = nvlist_create(NV_FLAG_NO_UNIQUE); > + if ((allowed_operations & FA_OPEN) != 0) { > + fd = open_file(fname); > + if (fd < 0) { > + i--; > + nvlist_destroy(new); > + continue; > + } > + nvlist_move_descriptor(new, "fd", fd); > } > + if ((allowed_operations & FA_LSTAT) != 0) { > + if (lstat(fname, &sb) < 0) { > + i--; > + nvlist_destroy(new); > + continue; > + } > + nvlist_add_binary(new, "stat", &sb, sizeof(sb)); > + } > > - new = nvlist_create(NV_FLAG_NO_UNIQUE); > - nvlist_move_descriptor(new, "fd", fd); > nvlist_add_nvlist(nvlout, fname, new); > } > cacheposition = cookie; > @@ -424,10 +522,13 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l > } > > static bool > -fileargs_allowed(const nvlist_t *limits, const nvlist_t *request) > +fileargs_allowed(const nvlist_t *limits, const nvlist_t *request, int operation) > { > const char *name; > > + if ((allowed_operations & operation) == 0) > + return (false); > + > name = dnvlist_get_string(request, "name", NULL); > if (name == NULL) > return (false); > @@ -450,6 +551,7 @@ fileargs_limit(const nvlist_t *oldlimits, const nvlist > return (ENOTCAPABLE); > > capflags = (int)dnvlist_get_number(newlimits, "flags", 0); > + allowed_operations = (int)dnvlist_get_number(newlimits, "operations", 0); > if ((capflags & O_CREAT) != 0) > capmode = (mode_t)nvlist_get_number(newlimits, "mode"); > else > @@ -461,6 +563,37 @@ fileargs_limit(const nvlist_t *oldlimits, const nvlist > } > > static int > +fileargs_command_lstat(const nvlist_t *limits, nvlist_t *nvlin, > + nvlist_t *nvlout) > +{ > + int stat; > + const char *name; > + struct stat sb; > + > + if (limits == NULL) > + return (ENOTCAPABLE); > + > + if (!fileargs_allowed(limits, nvlin, FA_LSTAT)) > + return (ENOTCAPABLE); > + > + name = nvlist_get_string(nvlin, "name"); > + > + stat = lstat(name, &sb); > + if (stat < 0) > + return (errno); > + > + if (!allcached && (lastname == NULL || > + strcmp(name, lastname) == 0)) { > + nvlist_add_string(nvlout, "cmd", "cache"); > + fileargs_add_cache(nvlout, limits, name); > + } else { > + nvlist_add_string(nvlout, "cmd", "lstat"); > + } > + nvlist_add_binary(nvlout, "stat", &sb, sizeof(sb)); > + return (0); > +} > + > +static int > fileargs_command_open(const nvlist_t *limits, nvlist_t *nvlin, > nvlist_t *nvlout) > { > @@ -470,7 +603,7 @@ fileargs_command_open(const nvlist_t *limits, nvlist_t > if (limits == NULL) > return (ENOTCAPABLE); > > - if (!fileargs_allowed(limits, nvlin)) > + if (!fileargs_allowed(limits, nvlin, FA_OPEN)) > return (ENOTCAPABLE); > > name = nvlist_get_string(nvlin, "name"); > @@ -497,6 +630,9 @@ fileargs_command(const char *cmd, const nvlist_t *limi > > if (strcmp(cmd, "open") == 0) > return (fileargs_command_open(limits, nvlin, nvlout)); > + > + if (strcmp(cmd, "lstat") == 0) > + return (fileargs_command_lstat(limits, nvlin, nvlout)); > > return (EINVAL); > } > > Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h > ============================================================================== > --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 16:00:33 > 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr > 17 16:02:57 2019 (r346315) @@ -36,16 +36,21 @@ > > #include > > +#define FA_OPEN 1 > +#define FA_LSTAT 2 > + > #ifdef WITH_CASPER > struct fileargs; > typedef struct fileargs fileargs_t; > +struct stat; > > fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, > - cap_rights_t *rightsp); > + cap_rights_t *rightsp, int operations); > fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], > - int flags, mode_t mode, cap_rights_t *rightsp); > + int flags, mode_t mode, cap_rights_t *rightsp, int operations); > fileargs_t *fileargs_initnv(nvlist_t *limits); > fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); > +int fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb); > int fileargs_open(fileargs_t *fa, const char *name); > void fileargs_free(fileargs_t *fa); > FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); > @@ -57,7 +62,7 @@ typedef struct fileargs { > > static inline fileargs_t * > fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, > - cap_rights_t *rightsp __unused) { > + cap_rights_t *rightsp __unused, int operations __unused) { > fileargs_t *fa; > > fa = malloc(sizeof(*fa)); > @@ -71,10 +76,10 @@ fileargs_init(int argc __unused, char *argv[] __unused > > static inline fileargs_t * > fileargs_cinit(cap_channel_t *cas __unused, int argc, char *argv[], int flags, > - mode_t mode, cap_rights_t *rightsp) > + mode_t mode, cap_rights_t *rightsp, int operations) > { > > - return (fileargs_init(argc, argv, flags, mode, rightsp)); > + return (fileargs_init(argc, argv, flags, mode, rightsp, operations)); > } > > static inline fileargs_t * > @@ -85,7 +90,8 @@ fileargs_initnv(nvlist_t *limits) > fa = fileargs_init(0, NULL, > nvlist_get_number(limits, "flags"), > dnvlist_get_number(limits, "mode", 0), > - NULL); > + NULL, > + nvlist_get_number(limits, "operations")); > nvlist_destroy(limits); > > return (fa); > @@ -98,6 +104,8 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t > return (fileargs_initnv(limits)); > } > > +#define fileargs_lstat(fa, name, sb) \ > + lstat(name, sb) > #define fileargs_open(fa, name) \ > open(name, fa->fa_flags, fa->fa_mode) > #define fileargs_fopen(fa, name, mode) \ > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Apr 23 06:36:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B6E159011B; Tue, 23 Apr 2019 06:36:33 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54AE691C1F; Tue, 23 Apr 2019 06:36:33 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2910420A97; Tue, 23 Apr 2019 06:36:33 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3N6aWxE057864; Tue, 23 Apr 2019 06:36:32 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N6aWQK057863; Tue, 23 Apr 2019 06:36:32 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201904230636.x3N6aWQK057863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Tue, 23 Apr 2019 06:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346593 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 346593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54AE691C1F 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 06:36:33 -0000 Author: wma Date: Tue Apr 23 06:36:32 2019 New Revision: 346593 URL: https://svnweb.freebsd.org/changeset/base/346593 Log: This patch offers a workaround to buf_ring reordering visible on armv7 and armv8. Similar issue to rS302292. Obtained from: Semihalf Authored by: Michal Krawczyk Approved by: wma Differential Revision: https://reviews.freebsd.org/D19932 Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Tue Apr 23 04:06:26 2019 (r346592) +++ head/sys/sys/buf_ring.h Tue Apr 23 06:36:32 2019 (r346593) @@ -310,14 +310,23 @@ buf_ring_peek_clear_sc(struct buf_ring *br) if (!mtx_owned(br->br_lock)) panic("lock not held on single consumer dequeue"); #endif - /* - * I believe it is safe to not have a memory barrier - * here because we control cons and tail is worst case - * a lagging indicator so we worst case we might - * return NULL immediately after a buffer has been enqueued - */ + if (br->br_cons_head == br->br_prod_tail) return (NULL); + +#if defined(__arm__) || defined(__aarch64__) + /* + * The barrier is required there on ARM and ARM64 to ensure, that + * br->br_ring[br->br_cons_head] will not be fetched before the above + * condition is checked. + * Without the barrier, it is possible, that buffer will be fetched + * before the enqueue will put mbuf into br, then, in the meantime, the + * enqueue will update the array and the br_prod_tail, and the + * conditional check will be true, so we will return previously fetched + * (and invalid) buffer. + */ + atomic_thread_fence_acq(); +#endif #ifdef DEBUG_BUFRING /* From owner-svn-src-head@freebsd.org Tue Apr 23 07:46:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C757F15916D3; Tue, 23 Apr 2019 07:46:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69C1D93912; Tue, 23 Apr 2019 07:46:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE9892167C; Tue, 23 Apr 2019 07:46:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3N7kc6H094157; Tue, 23 Apr 2019 07:46:38 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3N7kciW094155; Tue, 23 Apr 2019 07:46:38 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201904230746.x3N7kciW094155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 23 Apr 2019 07:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346594 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: smh X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 346594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 69C1D93912 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 07:46:40 -0000 Author: smh Date: Tue Apr 23 07:46:38 2019 New Revision: 346594 URL: https://svnweb.freebsd.org/changeset/base/346594 Log: Add ATA power mode support to camcontrol Add the ability to report ATA device power mode with the cmmand 'powermode' to compliment the existing ability to set it using idle, standby and sleep commands. MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Tue Apr 23 06:36:32 2019 (r346593) +++ head/sbin/camcontrol/camcontrol.8 Tue Apr 23 07:46:38 2019 (r346594) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2019 +.Dd April 22, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -243,6 +243,10 @@ .Op device id .Op generic args .Nm +.Ic powermode +.Op device id +.Op generic args +.Nm .Ic apm .Op device id .Op generic args @@ -1388,6 +1392,8 @@ Value 0 disables timer. Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic powermode +Report ATA device power mode. .It Ic apm It optional parameter .Pq Fl l Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Apr 23 06:36:32 2019 (r346593) +++ head/sbin/camcontrol/camcontrol.c Tue Apr 23 07:46:38 2019 (r346594) @@ -109,7 +109,8 @@ typedef enum { CAM_CMD_ZONE = 0x00000026, CAM_CMD_EPC = 0x00000027, CAM_CMD_TIMESTAMP = 0x00000028, - CAM_CMD_MMCSD_CMD = 0x00000029 + CAM_CMD_MMCSD_CMD = 0x00000029, + CAM_CMD_POWER_MODE = 0x0000002a, } cam_cmdmask; typedef enum { @@ -236,6 +237,7 @@ static struct camcontrol_opts option_table[] = { {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"powermode", CAM_CMD_POWER_MODE, CAM_ARG_NONE, ""}, {"apm", CAM_CMD_APM, CAM_ARG_NONE, "l:"}, {"aam", CAM_CMD_AAM, CAM_ARG_NONE, "l:"}, {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, @@ -8885,6 +8887,61 @@ bailout: } static int +atapm_proc_resp(struct cam_device *device, union ccb *ccb) +{ + struct ata_res *res; + + res = &ccb->ataio.res; + if (res->status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + printf("error = 0x%02x, sector_count = 0x%04x, " + "device = 0x%02x, status = 0x%02x\n", + res->error, res->sector_count, + res->device, res->status); + } + + return (1); + } + + if (arglist & CAM_ARG_VERBOSE) { + fprintf(stdout, "%s%d: Raw native check power data:\n", + device->device_name, device->dev_unit_num); + /* res is 4 byte aligned */ + dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + + printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " + "status = 0x%02x\n", res->error, res->sector_count, + res->device, res->status); + } + + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (res->sector_count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", res->sector_count); + break; + } + + return (0); +} + +static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -8892,6 +8949,7 @@ atapm(struct cam_device *device, int argc, char **argv int retval = 0; int t = -1; int c; + u_int8_t ata_flags = 0; u_char cmd, sc; ccb = cam_getccb(device); @@ -8920,6 +8978,10 @@ atapm(struct cam_device *device, int argc, char **argv cmd = ATA_STANDBY_IMMEDIATE; else cmd = ATA_STANDBY_CMD; + } else if (strcmp(argv[1], "powermode") == 0) { + cmd = ATA_CHECK_POWER_MODE; + ata_flags = AP_FLAG_CHK_COND; + t = -1; } else { cmd = ATA_SLEEP; t = -1; @@ -8937,11 +8999,12 @@ atapm(struct cam_device *device, int argc, char **argv else sc = 253; - retval = ata_do_28bit_cmd(device, + retval = ata_do_cmd(device, ccb, /*retries*/retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/ata_flags, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/0, @@ -8953,7 +9016,11 @@ atapm(struct cam_device *device, int argc, char **argv /*quiet*/1); cam_freeccb(ccb); - return (retval); + + if (retval || cmd != ATA_CHECK_POWER_MODE) + return (retval); + + return (atapm_proc_resp(device, ccb)); } static int @@ -9566,6 +9633,7 @@ usage(int printlong) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol powermode [dev_id][generic args]\n" " camcontrol apm [dev_id][generic args][-l level]\n" " camcontrol aam [dev_id][generic args][-l level]\n" " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-q]\n" @@ -9629,6 +9697,7 @@ usage(int printlong) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" +"powermode send the ATA CHECK POWER MODE command to the named device\n" "fwdownload program firmware of the named device with the given image\n" "security report or send ATA security commands to the named device\n" "persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" @@ -10199,6 +10268,7 @@ main(int argc, char **argv) case CAM_CMD_IDLE: case CAM_CMD_STANDBY: case CAM_CMD_SLEEP: + case CAM_CMD_POWER_MODE: error = atapm(cam_dev, argc, argv, combinedopt, retry_count, timeout); break; From owner-svn-src-head@freebsd.org Tue Apr 23 10:12:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2621F159540E; Tue, 23 Apr 2019 10:12:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08F66A9B2; Tue, 23 Apr 2019 10:12:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A94C230A9; Tue, 23 Apr 2019 10:12:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3NACYhn075437; Tue, 23 Apr 2019 10:12:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NACYWI075436; Tue, 23 Apr 2019 10:12:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201904231012.x3NACYWI075436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Apr 2019 10:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346595 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C08F66A9B2 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 10:12:35 -0000 Author: bz Date: Tue Apr 23 10:12:33 2019 New Revision: 346595 URL: https://svnweb.freebsd.org/changeset/base/346595 Log: iFix udp_output() lock inconsistency. In r297225 the initial INP_RLOCK() was replaced by an early acquisition of an r- or w-lock depending on input variables possibly extending the write locked area for reasons not entirely clear but possibly to avoid a later case of unlock and relock leading to a possible race condition and possibly in order to allow the route cache to work for connected sockets. Unfortunately the conditions were not 1:1 replicated (probably because of the route cache needs). While this would not be a problem the legacy IP code compared to IPv6 has an extra case when dealing with IP_SENDSRCADDR. In a particular case we were holding an exclusive inp lock and acquired the shared udbinfo lock (now epoch). When then running into an error case, the locking assertions on release fired as the udpinfo and inp lock levels did not match. Break up the special case and in that particular case acquire and udpinfo lock depending on the exclusitivity of the inp lock. MFC After: 9 days Reported-by: syzbot+1f5c6800e4f99bdb1a48@syzkaller.appspotmail.com Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D19594 Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Apr 23 07:46:38 2019 (r346594) +++ head/sys/netinet/udp_usrreq.c Tue Apr 23 10:12:33 2019 (r346595) @@ -1258,20 +1258,22 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s } /* - * Depending on whether or not the application has bound or connected - * the socket, we may have to do varying levels of work. The optimal - * case is for a connected UDP socket, as a global lock isn't - * required at all. - * - * In order to decide which we need, we require stability of the - * inpcb binding, which we ensure by acquiring a read lock on the - * inpcb. This doesn't strictly follow the lock order, so we play - * the trylock and retry game; note that we may end up with more - * conservative locks than required the second time around, so later - * assertions have to accept that. Further analysis of the number of - * misses under contention is required. - * - * XXXRW: Check that hash locking update here is correct. + * In the old days, depending on whether or not the application had + * bound or connected the socket, we had to do varying levels of work. + * The optimal case was for a connected UDP socket, as a global lock + * wasn't required at all. + * In order to decide which we need, we required stability of the + * inpcb binding, which we ensured by acquiring a read lock on the + * inpcb. This didn't strictly follow the lock order, so we played + * the trylock and retry game. + * With the re-introduction of the route-cache in some cases, we started + * to acquire an early inp wlock and a possible race during re-lock + * went away. With the introduction of epoch(9) some read locking + * became epoch(9) and the lock-order issues also went away. + * Due to route-cache we may now hold more conservative locks than + * otherwise required and have split up the 2nd case in case 2 and 3 + * in order to keep the udpinfo lock level in sync with the inp one + * for the IP_SENDSRCADDR case below. */ pr = inp->inp_socket->so_proto->pr_protocol; pcbinfo = udp_get_inpcbinfo(pr); @@ -1279,14 +1281,21 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; - } else if ((sin != NULL && - (sin->sin_addr.s_addr == INADDR_ANY || - sin->sin_addr.s_addr == INADDR_BROADCAST || - inp->inp_laddr.s_addr == INADDR_ANY || - inp->inp_lport == 0)) || - src.sin_family == AF_INET) { + } else if (sin != NULL && + (sin->sin_addr.s_addr == INADDR_ANY || + sin->sin_addr.s_addr == INADDR_BROADCAST || + inp->inp_laddr.s_addr == INADDR_ANY || + inp->inp_lport == 0)) { INP_HASH_RLOCK_ET(pcbinfo, et); unlock_udbinfo = UH_RLOCKED; + } else if (src.sin_family == AF_INET) { + if (unlock_inp == UH_WLOCKED) { + INP_HASH_WLOCK(pcbinfo); + unlock_udbinfo = UH_WLOCKED; + } else { + INP_HASH_RLOCK_ET(pcbinfo, et); + unlock_udbinfo = UH_RLOCKED; + } } else unlock_udbinfo = UH_UNLOCKED; From owner-svn-src-head@freebsd.org Tue Apr 23 10:24:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F8CB159581A; Tue, 23 Apr 2019 10:24:43 +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 A7A1B6B03E; Tue, 23 Apr 2019 10:24:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 7F35B1B3F; Tue, 23 Apr 2019 10:24:42 +0000 (UTC) Date: Tue, 23 Apr 2019 10:24:42 +0000 From: Alexey Dokuchaev To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346588 - head/lib/libc/powerpc64/string Message-ID: <20190423102442.GA86961@FreeBSD.org> References: <201904230253.x3N2rrrh041288@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904230253.x3N2rrrh041288@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: A7A1B6B03E 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.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 10:24:43 -0000 On Tue, Apr 23, 2019 at 02:53:53AM +0000, Justin Hibbits wrote: > New Revision: 346588 > URL: https://svnweb.freebsd.org/changeset/base/346588 > > Log: > powerpc64: Rewrite strcmp in asm to take advantage of word size > ... > Some performance gain rates between the current and the optimized > solution: > > String size (bytes) Gain rate > <=8 0.59% > <=16 1.92% > 32 3.02% > 64 5.60% > 128 10.16% > 256 18.05% > 512 30.18% > 1024 42.82% Nice! This should help to speed up buildworld quite a bit. Would it be feasible to patch ppc32 in a similar fashion? Thanks, ./danfe From owner-svn-src-head@freebsd.org Tue Apr 23 12:23:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F1BA1599371; Tue, 23 Apr 2019 12:23:46 +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 722536FB8A; Tue, 23 Apr 2019 12:23: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 634782473F; Tue, 23 Apr 2019 12:23: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 x3NCNjPt045052; Tue, 23 Apr 2019 12:23:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NCNjd9045051; Tue, 23 Apr 2019 12:23:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904231223.x3NCNjd9045051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Apr 2019 12:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346596 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 346596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 722536FB8A 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 12:23:46 -0000 Author: kib Date: Tue Apr 23 12:23:44 2019 New Revision: 346596 URL: https://svnweb.freebsd.org/changeset/base/346596 Log: poib: assign link-local address according to RFC RFC 4391 specifies that the IB interface GID should be re-used as IPv6 link-local address. Since the code in in6_get_hw_ifid() ignored IFT_INFINIBAND case, ibX interfaces ended up with the local address borrowed from some other interface, which is non-compliant. Use lowest eight bytes from GID for filling the link-local address, same as Linux. Reviewed by: bz (previous version), ae, hselasky, slavash, Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20006 Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Tue Apr 23 10:12:33 2019 (r346595) +++ head/sys/netinet6/in6_ifattach.c Tue Apr 23 12:23:44 2019 (r346596) @@ -328,6 +328,14 @@ found: NET_EPOCH_EXIT(et); return -1; + case IFT_INFINIBAND: + if (addrlen != 20) { + NET_EPOCH_EXIT(et); + return -1; + } + bcopy(addr + 12, &in6->s6_addr[8], 8); + break; + default: NET_EPOCH_EXIT(et); return -1; From owner-svn-src-head@freebsd.org Tue Apr 23 13:49:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C19159B1BA; Tue, 23 Apr 2019 13:49:21 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B55B87290B; Tue, 23 Apr 2019 13:49:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id e8so325318ioe.12; Tue, 23 Apr 2019 06:49:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pNdxLoucJ8M1gSzgt/VGEfzNWG4w70fxaiy7aGalSBE=; b=A4GhYeRHndYp7btXpt7Hd4rYSkLwIYWYSMUkb876lL71JuZrD9R3a09sCM9QtdgwAs 9DRqnRjx8YKfkMjL55wyx29WWNcB9tB8M95isoRequ2ZgYC4ahL62iFr2D1GeDL5KpJQ EBil7trscA7DD3BvBco8nOPTyN/o+UwwFI0cnUjJbfPa0nivMyXaRExQIFoiLVjBnRop moE7HznKV1lvnDKZ1UZYY8tQWXm3Zy71CEDbogLqJxj2vpIhVmgUWkzIH/BPrsLOfK8L 2ThiiIHpoTvyvnJljWPWUU0Gh08R6odzhza0O55sBa8pNvuAuwssMMZiYcuiO8Rppabs iJOg== X-Gm-Message-State: APjAAAViMrC2SV1YQnlPL36vTjJKMlSCZ6rsl6uC0boFH92XZlhgugQI Nvz7pWH9vzvO3bpbIUMq9yNRDeyBY893F3UnR80= X-Google-Smtp-Source: APXvYqyAA5puUw++pf/M9EyLJkHte+FlsHCbmB6t3xuu97I54HbsZO1ruKZj8gO7n3eoGsoNFcpslk4qG654SL6XOx8= X-Received: by 2002:a6b:7f09:: with SMTP id l9mr5806627ioq.66.1556027353606; Tue, 23 Apr 2019 06:49:13 -0700 (PDT) MIME-Version: 1.0 References: <201904171602.x3HG2wQq054372@repo.freebsd.org> <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> In-Reply-To: <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> From: Ed Maste Date: Tue, 23 Apr 2019 09:49:00 -0400 Message-ID: Subject: Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs To: Yoshihiro Ota Cc: svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B55B87290B 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.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 13:49:21 -0000 On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota wrote: > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to fail as the following with HEAD checked out under "/usr/obj/freebsd": Hello Hiro-san, sorry about that. I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but it failed on the install as DESTDIR wasn't set and I ran as non-root). Just `make xdev-build` was successful though. What version were you trying to build? There were (several) followup commits to address issues with the initial commit of cap_fileargs lstat support. From owner-svn-src-head@freebsd.org Tue Apr 23 15:11:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4F41159CCC4; Tue, 23 Apr 2019 15:11:01 +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 7B41575A41; Tue, 23 Apr 2019 15:11:01 +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 6D723262CA; Tue, 23 Apr 2019 15:11:01 +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 x3NFB1l2032939; Tue, 23 Apr 2019 15:11:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NFB1tR032938; Tue, 23 Apr 2019 15:11:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904231511.x3NFB1tR032938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Apr 2019 15:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346598 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 346598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B41575A41 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 15:11:02 -0000 Author: emaste Date: Tue Apr 23 15:11:01 2019 New Revision: 346598 URL: https://svnweb.freebsd.org/changeset/base/346598 Log: Enable Mellanox drivers (modules) on AArch64 Tested by Greg V with mlx5en on an Ampere eMAG instance at Packet.com on c2.large.arm (with some additional uncommitted PCIe WIP). PR: 237055 Submitted by: Greg V Reviewed by: hselasky MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19983 Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Apr 23 12:29:19 2019 (r346597) +++ head/sys/modules/Makefile Tue Apr 23 15:11:01 2019 (r346598) @@ -483,7 +483,24 @@ SUBDIR+= fdt SUBDIR+= linprocfs SUBDIR+= linsysfs _ena= ena +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ibcore= ibcore +_ipoib= ipoib +_iser= iser .endif +_mlx4= mlx4 +_mlx5= mlx5 +.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ + defined(ALL_MODULES) +_mlx4en= mlx4en +_mlx5en= mlx5en +.endif +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_mthca= mthca +_mlx4ib= mlx4ib +_mlx5ib= mlx5ib +.endif +.endif .if ${MK_NAND} != "no" || defined(ALL_MODULES) _nandfs= nandfs @@ -592,15 +609,8 @@ _ep= ep _et= et _exca= exca _fe= fe -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ibcore= ibcore -.endif _if_ndis= if_ndis _io= io -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ipoib= ipoib -_iser= iser -.endif _ix= ix _ixv= ixv _linux= linux @@ -672,18 +682,6 @@ _ipwfw= ipwfw _iwifw= iwifw _iwmfw= iwmfw _iwnfw= iwnfw -.endif -_mlx4= mlx4 -_mlx5= mlx5 -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_mlx4en= mlx4en -_mlx5en= mlx5en -.endif -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_mthca= mthca -_mlx4ib= mlx4ib -_mlx5ib= mlx5ib .endif _mly= mly _nfe= nfe From owner-svn-src-head@freebsd.org Tue Apr 23 17:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEAA3159FC1E; Tue, 23 Apr 2019 17:05: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 83F5B8211F; Tue, 23 Apr 2019 17:05: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 5113F277BB; Tue, 23 Apr 2019 17:05: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 x3NH5wE5094399; Tue, 23 Apr 2019 17:05:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NH5wdK094398; Tue, 23 Apr 2019 17:05:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904231705.x3NH5wdK094398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 23 Apr 2019 17:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346599 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 346599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83F5B8211F 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 17:05:59 -0000 Author: cem Date: Tue Apr 23 17:05:57 2019 New Revision: 346599 URL: https://svnweb.freebsd.org/changeset/base/346599 Log: netdump: Fix !COMPAT_FREEBSD11 unused variable warning Reported by: Ralf Wenk Sponsored by: Dell EMC Isilon Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Tue Apr 23 15:11:01 2019 (r346598) +++ head/sys/netinet/netdump/netdump_client.c Tue Apr 23 17:05:57 2019 (r346599) @@ -1140,7 +1140,9 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c struct netdump_conf *conf; uint8_t *encryptedkey; int error; +#ifdef COMPAT_FREEBSD11 u_int u; +#endif error = 0; switch (cmd) { From owner-svn-src-head@freebsd.org Tue Apr 23 17:11:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 261CB159FFB0; Tue, 23 Apr 2019 17:11:46 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C117382790; Tue, 23 Apr 2019 17:11:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9339A2795F; Tue, 23 Apr 2019 17:11:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3NHBjTh096418; Tue, 23 Apr 2019 17:11:45 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NHBjtL096417; Tue, 23 Apr 2019 17:11:45 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201904231711.x3NHBjtL096417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Tue, 23 Apr 2019 17:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346600 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 346600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C117382790 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 17:11:46 -0000 Author: luporl Date: Tue Apr 23 17:11:45 2019 New Revision: 346600 URL: https://svnweb.freebsd.org/changeset/base/346600 Log: [PPC64] Fix wrong KASSERT in mphyp_pte_insert() As mphyp_pte_unset() can also remove PTE entries, and as this can happen in parallel with PTEs evicted by mphyp_pte_insert(), there is a (rare) chance the PTE being evicted gets removed before mphyp_pte_insert() is able to do so. Thus, the KASSERT should check wether the result is H_SUCCESS or H_NOT_FOUND, to avoid panics if the situation described above occurs. More details about this issue can be found in PR 237470. PR: 237470 Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20012 Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Tue Apr 23 17:05:57 2019 (r346599) +++ head/sys/powerpc/pseries/mmu_phyp.c Tue Apr 23 17:11:45 2019 (r346600) @@ -453,7 +453,7 @@ mphyp_pte_insert(mmu_t mmu, struct pvo_entry *pvo) evicted.pte_hi & LPTE_AVPN_MASK, 0, &junk, &lastptelo, &junk); moea64_pte_overflow++; - KASSERT(result == H_SUCCESS, + KASSERT(result == H_SUCCESS || result == H_NOT_FOUND, ("Error evicting page: %d", (int)result)); } From owner-svn-src-head@freebsd.org Tue Apr 23 17:18:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A29815A02EE; Tue, 23 Apr 2019 17:18:22 +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 3740982B1B; Tue, 23 Apr 2019 17:18:22 +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 089D8279AC; Tue, 23 Apr 2019 17:18:21 +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 x3NHIKmv099949; Tue, 23 Apr 2019 17:18:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NHIKgS099948; Tue, 23 Apr 2019 17:18:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904231718.x3NHIKgS099948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 23 Apr 2019 17:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346601 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 346601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3740982B1B 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 17:18:22 -0000 Author: cem Date: Tue Apr 23 17:18:20 2019 New Revision: 346601 URL: https://svnweb.freebsd.org/changeset/base/346601 Log: ip6_randomflowlabel: Avoid blocking if random(4) is not available If kern.random.initial_seeding.bypass_before_seeding is disabled, random(4) and arc4random(9) will block indefinitely until enough entropy is available to initially seed Fortuna. It seems that zero flowids are perfectly valid, so avoid blocking on random until initial seeding takes place. Discussed with: bz (earlier revision) Reviewed by: thj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20011 Modified: head/sys/netinet6/ip6_id.c Modified: head/sys/netinet6/ip6_id.c ============================================================================== --- head/sys/netinet6/ip6_id.c Tue Apr 23 17:11:45 2019 (r346600) +++ head/sys/netinet6/ip6_id.c Tue Apr 23 17:18:20 2019 (r346601) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -257,6 +258,16 @@ ip6_randomid(void) u_int32_t ip6_randomflowlabel(void) { + + /* + * It's ok to emit zero flow labels early, before random is available + * (seeded). RFC 6437: + * + * "A Flow Label of zero is used to indicate packets that have not been + * labeled." + */ + if (__predict_false(!is_random_seeded())) + return (0); return randomid(&randomtab_20) & 0xfffff; } From owner-svn-src-head@freebsd.org Tue Apr 23 17:26:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0887B15A0682; Tue, 23 Apr 2019 17:26:03 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F178831B1; Tue, 23 Apr 2019 17:26:01 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3NHPq2v038791; Tue, 23 Apr 2019 10:25:52 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3NHPqCt038790; Tue, 23 Apr 2019 10:25:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346598 - head/sys/modules In-Reply-To: <201904231511.x3NFB1tR032938@repo.freebsd.org> To: Ed Maste Date: Tue, 23 Apr 2019 10:25:52 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, greg@unrelenting.technology 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: 5F178831B1 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.954,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 17:26:03 -0000 > Author: emaste > Date: Tue Apr 23 15:11:01 2019 > New Revision: 346598 > URL: https://svnweb.freebsd.org/changeset/base/346598 > > Log: > Enable Mellanox drivers (modules) on AArch64 > > Tested by Greg V with mlx5en on an Ampere eMAG instance at Packet.com on > c2.large.arm (with some additional uncommitted PCIe WIP). > > PR: 237055 > Submitted by: Greg V > Reviewed by: hselasky > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D19983 Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) This does make some of the newer RockPro64 type boards an interesting thing to experiment with. I am hopeing some of that PCIe WIP might include some of the bits needed or do we already have PCIe slot on RockPro64 code that works? Thanks for this work Greg! > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Tue Apr 23 12:29:19 2019 (r346597) > +++ head/sys/modules/Makefile Tue Apr 23 15:11:01 2019 (r346598) > @@ -483,7 +483,24 @@ SUBDIR+= fdt > SUBDIR+= linprocfs > SUBDIR+= linsysfs > _ena= ena > +.if ${MK_OFED} != "no" || defined(ALL_MODULES) > +_ibcore= ibcore > +_ipoib= ipoib > +_iser= iser > .endif > +_mlx4= mlx4 > +_mlx5= mlx5 > +.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ > + defined(ALL_MODULES) > +_mlx4en= mlx4en > +_mlx5en= mlx5en > +.endif > +.if ${MK_OFED} != "no" || defined(ALL_MODULES) > +_mthca= mthca > +_mlx4ib= mlx4ib > +_mlx5ib= mlx5ib > +.endif > +.endif > > .if ${MK_NAND} != "no" || defined(ALL_MODULES) > _nandfs= nandfs > @@ -592,15 +609,8 @@ _ep= ep > _et= et > _exca= exca > _fe= fe > -.if ${MK_OFED} != "no" || defined(ALL_MODULES) > -_ibcore= ibcore > -.endif > _if_ndis= if_ndis > _io= io > -.if ${MK_OFED} != "no" || defined(ALL_MODULES) > -_ipoib= ipoib > -_iser= iser > -.endif > _ix= ix > _ixv= ixv > _linux= linux > @@ -672,18 +682,6 @@ _ipwfw= ipwfw > _iwifw= iwifw > _iwmfw= iwmfw > _iwnfw= iwnfw > -.endif > -_mlx4= mlx4 > -_mlx5= mlx5 > -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ > - defined(ALL_MODULES) > -_mlx4en= mlx4en > -_mlx5en= mlx5en > -.endif > -.if ${MK_OFED} != "no" || defined(ALL_MODULES) > -_mthca= mthca > -_mlx4ib= mlx4ib > -_mlx5ib= mlx5ib > .endif > _mly= mly > _nfe= nfe > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Apr 23 17:28:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CADD15A07E0; Tue, 23 Apr 2019 17:28: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 12865833FF; Tue, 23 Apr 2019 17:28: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 DAB5927B80; Tue, 23 Apr 2019 17:28: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 x3NHSS8r005099; Tue, 23 Apr 2019 17:28:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NHSSqw005098; Tue, 23 Apr 2019 17:28:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904231728.x3NHSSqw005098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 23 Apr 2019 17:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346602 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12865833FF 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 17:28:29 -0000 Author: kevans Date: Tue Apr 23 17:28:28 2019 New Revision: 346602 URL: https://svnweb.freebsd.org/changeset/base/346602 Log: tun(4): Defer clearing TUN_OPEN until much later tun destruction will not continue until TUN_OPEN is cleared. There are brief moments in tunclose where the mutex is dropped and we've already cleared TUN_OPEN, so tun_destroy would be able to proceed while we're in the middle of cleaning up the tun still. tun_destroy should be blocked until these parts (address/route purges, mostly) are complete. PR: 233955 MFC after: 2 weeks Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Tue Apr 23 17:18:20 2019 (r346601) +++ head/sys/net/if_tun.c Tue Apr 23 17:28:28 2019 (r346602) @@ -500,8 +500,6 @@ tunclose(struct cdev *dev, int foo, int bar, struct th ifp = TUN2IFP(tp); mtx_lock(&tp->tun_mtx); - tp->tun_flags &= ~TUN_OPEN; - tp->tun_pid = 0; /* * junk all pending output @@ -540,6 +538,8 @@ tunclose(struct cdev *dev, int foo, int bar, struct th selwakeuppri(&tp->tun_rsel, PZERO + 1); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + tp->tun_flags &= ~TUN_OPEN; + tp->tun_pid = 0; cv_broadcast(&tp->tun_cv); mtx_unlock(&tp->tun_mtx); From owner-svn-src-head@freebsd.org Tue Apr 23 18:10:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E057015A194E; Tue, 23 Apr 2019 18:10:47 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F96855CB; Tue, 23 Apr 2019 18:10:47 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB7F301; Tue, 23 Apr 2019 18:10:47 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3NIAlGq028034; Tue, 23 Apr 2019 18:10:47 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NIAlf2028032; Tue, 23 Apr 2019 18:10:47 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904231810.x3NIAlf2028032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 23 Apr 2019 18:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346603 - in head/sys: amd64/linux32 i386/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: amd64/linux32 i386/linux X-SVN-Commit-Revision: 346603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83F96855CB 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)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 18:10:48 -0000 Author: dchagin Date: Tue Apr 23 18:10:46 2019 New Revision: 346603 URL: https://svnweb.freebsd.org/changeset/base/346603 Log: Since r339624 HEAD does not need for backslashes in syscalls.master, however to make a merge r345471 to the stable add backslashes to the syscalls.master. MFC after: 3 days Modified: head/sys/amd64/linux32/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Tue Apr 23 17:28:28 2019 (r346602) +++ head/sys/amd64/linux32/syscalls.master Tue Apr 23 18:10:46 2019 (r346603) @@ -690,7 +690,7 @@ 383 AUE_NULL STD { int linux_statx(l_int dirfd, \ const char *pathname, l_uint flags, \ l_uint mask, void *statxbuf); } -384 AUE_NULL STD { int linux_arch_prctl(l_int option, +384 AUE_NULL STD { int linux_arch_prctl(l_int option, \ l_ulong arg2); } ; Linux 4.18: 385 AUE_NULL STD { int linux_io_pgetevents(void); } Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Tue Apr 23 17:28:28 2019 (r346602) +++ head/sys/i386/linux/syscalls.master Tue Apr 23 18:10:46 2019 (r346603) @@ -698,7 +698,7 @@ 383 AUE_NULL STD { int linux_statx(l_int dirfd, \ const char *pathname, l_uint flags, \ l_uint mask, void *statxbuf); } -384 AUE_PRCTL STD { int linux_arch_prctl(l_int option, +384 AUE_PRCTL STD { int linux_arch_prctl(l_int option, \ l_ulong arg2); } ; Linux 4.18: 385 AUE_NULL STD { int linux_io_pgetevents(void); } From owner-svn-src-head@freebsd.org Tue Apr 23 20:25:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D517315816F1; Tue, 23 Apr 2019 20:25:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3A389905; Tue, 23 Apr 2019 20:25:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367071AED; Tue, 23 Apr 2019 20:25:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3NKPQhH001938; Tue, 23 Apr 2019 20:25:26 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NKPPaR001935; Tue, 23 Apr 2019 20:25:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201904232025.x3NKPPaR001935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 23 Apr 2019 20:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346604 - in head/lib/libsecureboot: . h X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/lib/libsecureboot: . h X-SVN-Commit-Revision: 346604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A3A389905 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 20:25:27 -0000 Author: sjg Date: Tue Apr 23 20:25:25 2019 New Revision: 346604 URL: https://svnweb.freebsd.org/changeset/base/346604 Log: Allow no_hash to appear in manifest. sbin/veriexec will ignore entries that have no hash anyway, but loader needs to be explicitly told that such files are ok to ignore (not verify). We will report as Unverified depending on verbose level, but with no reason - because we are not rejecting the file. Reviewed by: imp, mindal_semihalf Sponsored by: Juniper Networks MFC After: 1 week Differential Revision: https://reviews.freebsd.org//D20018 Modified: head/lib/libsecureboot/h/libsecureboot.h head/lib/libsecureboot/vectx.c head/lib/libsecureboot/veopen.c head/lib/libsecureboot/verify_file.c Modified: head/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- head/lib/libsecureboot/h/libsecureboot.h Tue Apr 23 18:10:46 2019 (r346603) +++ head/lib/libsecureboot/h/libsecureboot.h Tue Apr 23 20:25:25 2019 (r346604) @@ -86,6 +86,7 @@ ssize_t ve_pcr_get(unsigned char *, size_t); #define VEF_VERBOSE 1 #define VE_FINGERPRINT_OK 1 +#define VE_FINGERPRINT_IGNORE 2 /* errors from verify_fd */ #define VE_FINGERPRINT_NONE -2 #define VE_FINGERPRINT_WRONG -3 Modified: head/lib/libsecureboot/vectx.c ============================================================================== --- head/lib/libsecureboot/vectx.c Tue Apr 23 18:10:46 2019 (r346603) +++ head/lib/libsecureboot/vectx.c Tue Apr 23 20:25:25 2019 (r346604) @@ -120,7 +120,10 @@ vectx_open(int fd, const char *path, off_t off, struct ctx->vec_status = VE_FINGERPRINT_NONE; ve_error_set("%s: no entry", path); } else { - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + ctx->vec_status = VE_FINGERPRINT_IGNORE; + hashsz = 0; + } else if (strncmp(cp, "sha256=", 7) == 0) { ctx->vec_md = &br_sha256_vtable; hashsz = br_sha256_SIZE; cp += 7; @@ -150,11 +153,13 @@ vectx_open(int fd, const char *path, off_t off, struct *error = ctx->vec_status; ctx->vec_hashsz = hashsz; ctx->vec_want = cp; - ctx->vec_md->init(&ctx->vec_ctx.vtable); + if (hashsz > 0) { + ctx->vec_md->init(&ctx->vec_ctx.vtable); - if (hashsz > 0 && off > 0) { - lseek(fd, 0, SEEK_SET); - vectx_lseek(ctx, off, SEEK_SET); + if (off > 0) { + lseek(fd, 0, SEEK_SET); + vectx_lseek(ctx, off, SEEK_SET); + } } return (ctx); Modified: head/lib/libsecureboot/veopen.c ============================================================================== --- head/lib/libsecureboot/veopen.c Tue Apr 23 18:10:46 2019 (r346603) +++ head/lib/libsecureboot/veopen.c Tue Apr 23 20:25:25 2019 (r346604) @@ -345,7 +345,9 @@ verify_fingerprint(int fd, const char *path, const cha size_t hlen; int n; - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + return (VE_FINGERPRINT_IGNORE); + } else if (strncmp(cp, "sha256=", 7) == 0) { md = &br_sha256_vtable; hlen = br_sha256_SIZE; cp += 7; @@ -423,6 +425,7 @@ verify_fd(int fd, const char *path, off_t off, struct rc = verify_fingerprint(fd, path, cp, off); switch (rc) { case VE_FINGERPRINT_OK: + case VE_FINGERPRINT_IGNORE: case VE_FINGERPRINT_UNKNOWN: return (rc); default: Modified: head/lib/libsecureboot/verify_file.c ============================================================================== --- head/lib/libsecureboot/verify_file.c Tue Apr 23 18:10:46 2019 (r346603) +++ head/lib/libsecureboot/verify_file.c Tue Apr 23 20:25:25 2019 (r346604) @@ -343,10 +343,14 @@ verify_file(int fd, const char *filename, off_t off, i if ((rc = verify_fd(fd, filename, off, &st)) >= 0) { if (verbose || severity > VE_WANT) { #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0 - printf("Verified %s %llu,%llu\n", filename, + printf("%serified %s %llu,%llu\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename, (long long)st.st_dev, (long long)st.st_ino); #else - printf("Verified %s\n", filename); + printf("%serified %s\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename); #endif } if (severity < VE_MUST) { /* not a kernel or module */ From owner-svn-src-head@freebsd.org Tue Apr 23 21:07:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60DF21582ADD; Tue, 23 Apr 2019 21:07:48 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063C28B2B6; Tue, 23 Apr 2019 21:07:48 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE1F21CD; Tue, 23 Apr 2019 21:07:47 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3NL7lx5023646; Tue, 23 Apr 2019 21:07:47 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3NL7lKD023645; Tue, 23 Apr 2019 21:07:47 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201904232107.x3NL7lKD023645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 23 Apr 2019 21:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346605 - head/tests/sys/geom/class/mirror X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/tests/sys/geom/class/mirror X-SVN-Commit-Revision: 346605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 063C28B2B6 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 21:07:48 -0000 Author: olivier (ports committer) Date: Tue Apr 23 21:07:47 2019 New Revision: 346605 URL: https://svnweb.freebsd.org/changeset/base/346605 Log: Skip test component_selection:run_latest_genid if gmirror/gnop GEOM classes aren't available PR: 237051 Reviewed by: asomers, imp, ngie, emaste (IRC) Approved by: ngie MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19958 Modified: head/tests/sys/geom/class/mirror/component_selection.sh Modified: head/tests/sys/geom/class/mirror/component_selection.sh ============================================================================== --- head/tests/sys/geom/class/mirror/component_selection.sh Tue Apr 23 20:25:25 2019 (r346604) +++ head/tests/sys/geom/class/mirror/component_selection.sh Tue Apr 23 21:07:47 2019 (r346605) @@ -1,5 +1,9 @@ # $FreeBSD$ +ATF_TEST=true +class=mirror +. $(atf_get_srcdir)/conf.sh + atf_test_case run_latest_genid cleanup run_latest_genid_head() { @@ -9,7 +13,10 @@ run_latest_genid_head() } run_latest_genid_body() { - . $(atf_get_srcdir)/conf.sh + geom_atf_test_setup + if ! error_message=$(geom_load_class_if_needed nop); then + atf_skip "$error_message" + fi f1=$(mktemp ${base}.XXXXXX) f2=$(mktemp ${base}.XXXXXX) From owner-svn-src-head@freebsd.org Wed Apr 24 00:10:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 578EF1586C9E; Wed, 24 Apr 2019 00:10:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBBC16A3E0; Wed, 24 Apr 2019 00:10:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99B29435D; Wed, 24 Apr 2019 00:10:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3O0ALbI019372; Wed, 24 Apr 2019 00:10:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O0ALqJ019371; Wed, 24 Apr 2019 00:10:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904240010.x3O0ALqJ019371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 00:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346614 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBBC16A3E0 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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 00:10:22 -0000 Author: jhb Date: Wed Apr 24 00:10:21 2019 New Revision: 346614 URL: https://svnweb.freebsd.org/changeset/base/346614 Log: Skip tests with missing test vectors instead of failing. This copes more gracefully when older version of the nist-kat package are intalled that don't have newer test vectors such as CCM or plain SHA. If the nist-kat package is not installed at all, this still fails with an error. Reviewed by: cem MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20034 Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Tue Apr 23 22:43:47 2019 (r346613) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:10:21 2019 (r346614) @@ -42,7 +42,9 @@ from glob import iglob katdir = '/usr/local/share/nist-kat' def katg(base, glob): - assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'" + assert os.path.exists(katdir), "Please 'pkg install nist-kat'" + if not os.path.exists(os.path.join(katdir, base)): + raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] From owner-svn-src-head@freebsd.org Wed Apr 24 00:14:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 922E815870CF; Wed, 24 Apr 2019 00:14:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 356816A9C2; Wed, 24 Apr 2019 00:14:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F24C4505; Wed, 24 Apr 2019 00:14:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3O0EbRq024375; Wed, 24 Apr 2019 00:14:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O0EbJl024374; Wed, 24 Apr 2019 00:14:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904240014.x3O0EbJl024374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 00:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346615 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 356816A9C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 00:14:38 -0000 Author: jhb Date: Wed Apr 24 00:14:37 2019 New Revision: 346615 URL: https://svnweb.freebsd.org/changeset/base/346615 Log: Use more descriptive algorithm names in skip messages. Reviewed by: cem, ngie MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D19977 Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:10:21 2019 (r346614) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:14:37 2019 (r346615) @@ -61,17 +61,17 @@ def GenTestCase(cname): ############### ##### AES ##### ############### - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-XTS on %s' % (cname)) def test_xts(self): for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'): self.runXTS(i, cryptodev.CRYPTO_AES_XTS) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-CBC on %s' % (cname)) def test_cbc(self): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) - @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname)) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-GCM on %s' % (cname)) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): self.runGCM(i, 'ENCRYPT') @@ -265,7 +265,7 @@ def GenTestCase(cname): #for i in iglob('SHA1*'): # self.runSHA(i) - @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) + @unittest.skipIf(cname not in shamodules, 'skipping SHA-HMAC on %s' % str(cname)) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): self.runSHA1HMAC(i) From owner-svn-src-head@freebsd.org Wed Apr 24 00:16:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB871587169; Wed, 24 Apr 2019 00:16:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8FB16AB6D; Wed, 24 Apr 2019 00:16:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD2F5450B; Wed, 24 Apr 2019 00:16:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3O0GdiP024522; Wed, 24 Apr 2019 00:16:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O0GdlS024521; Wed, 24 Apr 2019 00:16:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904240016.x3O0GdlS024521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 00:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346616 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8FB16AB6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 00:16:40 -0000 Author: jhb Date: Wed Apr 24 00:16:39 2019 New Revision: 346616 URL: https://svnweb.freebsd.org/changeset/base/346616 Log: Run the plain SHA digest tests from NIST. Pass in an explicit digest length to the Crypto constructor since it was assuming only sessions with a MAC key would have a MAC. Passing an explicit size allows us to test the full digest in HMAC tests as well. Reviewed by: cem MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D19884 Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 00:14:37 2019 (r346615) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 00:16:39 2019 (r346616) @@ -151,8 +151,9 @@ class Crypto: return _findop(crid, '')[1] def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE): + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): self._ses = None + self._maclen = maclen ses = SessionOp2() ses.cipher = cipher ses.mac = mac @@ -168,9 +169,6 @@ class Crypto: ses.mackeylen = len(mackey) mk = array.array('B', mackey) ses.mackey = mk.buffer_info()[0] - self._maclen = 16 # parameterize? - else: - self._maclen = None if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:14:37 2019 (r346615) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:16:39 2019 (r346616) @@ -114,7 +114,8 @@ def GenTestCase(cname): c = Crypto(cryptodev.CRYPTO_AES_NIST_GCM_16, cipherkey, mac=self._gmacsizes[len(cipherkey)], - mackey=cipherkey, crid=crid) + mackey=cipherkey, crid=crid, + maclen=16) except EnvironmentError, e: # Can't test algorithms the driver does not support. if e.errno != errno.EOPNOTSUPP: @@ -260,11 +261,55 @@ def GenTestCase(cname): ############### @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % str(cname)) def test_sha(self): - # SHA not available in software - pass - #for i in iglob('SHA1*'): - # self.runSHA(i) + for i in katg('shabytetestvectors', 'SHA*Msg.rsp'): + self.runSHA(i) + def runSHA(self, fname): + # Skip SHA512_(224|256) tests + if fname.find('SHA512_') != -1: + return + + for hashlength, lines in cryptodev.KATParser(fname, + [ 'Len', 'Msg', 'MD' ]): + # E.g., hashlength will be "L=20" (bytes) + hashlen = int(hashlength.split("=")[1]) + + if hashlen == 20: + alg = cryptodev.CRYPTO_SHA1 + elif hashlen == 28: + alg = cryptodev.CRYPTO_SHA2_224 + elif hashlen == 32: + alg = cryptodev.CRYPTO_SHA2_256 + elif hashlen == 48: + alg = cryptodev.CRYPTO_SHA2_384 + elif hashlen == 64: + alg = cryptodev.CRYPTO_SHA2_512 + else: + # Skip unsupported hashes + # Slurp remaining input in section + for data in lines: + continue + continue + + for data in lines: + msg = data['Msg'].decode('hex') + msg = msg[:int(data['Len'])] + md = data['MD'].decode('hex') + + try: + c = Crypto(mac=alg, crid=crid, + maclen=hashlen) + except EnvironmentError, e: + # Can't test hashes the driver does not support. + if e.errno != errno.EOPNOTSUPP: + raise + continue + + _, r = c.encrypt(msg, iv="") + + self.assertEqual(r, md, "Actual: " + \ + repr(r.encode("hex")) + " Expected: " + repr(data) + " on " + cname) + @unittest.skipIf(cname not in shamodules, 'skipping SHA-HMAC on %s' % str(cname)) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): @@ -310,7 +355,7 @@ def GenTestCase(cname): try: c = Crypto(mac=alg, mackey=key, - crid=crid) + crid=crid, maclen=hashlen) except EnvironmentError, e: # Can't test hashes the driver does not support. if e.errno != errno.EOPNOTSUPP: @@ -319,13 +364,8 @@ def GenTestCase(cname): _, r = c.encrypt(msg, iv="") - # A limitation in cryptodev.py means we - # can only store MACs up to 16 bytes. - # That's good enough to validate the - # correct behavior, more or less. - maclen = min(tlen, 16) - self.assertEqual(r[:maclen], mac[:maclen], "Actual: " + \ - repr(r[:maclen].encode("hex")) + " Expected: " + repr(data)) + self.assertEqual(r[:tlen], mac, "Actual: " + \ + repr(r.encode("hex")) + " Expected: " + repr(data)) return GendCryptoTestCase From owner-svn-src-head@freebsd.org Wed Apr 24 00:23:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA62815873CE; Wed, 24 Apr 2019 00:23:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5AD6AFFC; Wed, 24 Apr 2019 00:23:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 717E546CD; Wed, 24 Apr 2019 00:23:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3O0N7so029393; Wed, 24 Apr 2019 00:23:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O0N7VT029391; Wed, 24 Apr 2019 00:23:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904240023.x3O0N7VT029391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 00:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346617 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F5AD6AFFC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 00:23:08 -0000 Author: jhb Date: Wed Apr 24 00:23:06 2019 New Revision: 346617 URL: https://svnweb.freebsd.org/changeset/base/346617 Log: Test the AES-CCM test vectors from the NIST Known Answer Tests. The CCM test vectors use a slightly different file format in that there are global key-value pairs as well as section key-value pairs that need to be used in each test. In addition, the sections can set multiple key-value pairs in the section name. The CCM KAT parser class is an iterator that returns a dictionary once per test where the dictionary contains all of the relevant key-value pairs for a given test (global, section name, section, test-specific). Note that all of the CCM decrypt tests use nonce and tag lengths that are not supported by OCF (OCF only supports a 12 byte nonce and 16 byte tag), so none of the decryption vectors are actually tested. Reviewed by: ngie MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D19978 Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 00:16:39 2019 (r346616) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 00:23:06 2019 (r346617) @@ -381,6 +381,112 @@ class KATParser: yield values +# The CCM files use a bit of a different syntax that doesn't quite fit +# the generic KATParser. In particular, some keys are set globally at +# the start of the file, and some are set globally at the start of a +# section. +class KATCCMParser: + def __init__(self, fname): + self.fp = open(fname) + self._pending = None + self.read_globals() + + def read_globals(self): + self.global_values = {} + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return + + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + + v = v.strip() + + if f in self.global_values: + raise ValueError('already present: %r' % repr(f)) + self.global_values[f] = v + + def read_section_values(self, kwpairs): + self.section_values = self.global_values.copy() + for pair in kwpairs.split(', '): + f, v = pair.split(' = ') + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v + + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return + + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + + if f == 'Count': + self._pending = line + return + + v = v.strip() + + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v + + def __iter__(self): + while True: + if self._pending: + line = self._pending + self._pending = None + else: + line = self.fp.readline() + if not line: + return + + if (line and line[0] == '#') or not line.strip(): + continue + + if line[0] == '[': + section = line[1:].split(']', 1)[0] + self.read_section_values(section) + continue + + values = self.section_values.copy() + + while True: + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + v = v.strip() + + if f in values: + raise ValueError('already present: %r' % repr(f)) + values[f] = v + line = self.fp.readline().strip() + if not line: + break + + yield values + + def _spdechex(s): return ''.join(s.split()).decode('hex') Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:16:39 2019 (r346616) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 00:23:06 2019 (r346617) @@ -71,6 +71,14 @@ def GenTestCase(cname): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-CCM on %s' % (cname)) + def test_ccm(self): + for i in katg('ccmtestvectors', 'V*.rsp'): + self.runCCMEncrypt(i) + + for i in katg('ccmtestvectors', 'D*.rsp'): + self.runCCMDecrypt(i) + @unittest.skipIf(cname not in aesmodules, 'skipping AES-GCM on %s' % (cname)) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): @@ -219,6 +227,93 @@ def GenTestCase(cname): raise continue self.assertEqual(r, ct) + + def runCCMEncrypt(self, fname): + for data in cryptodev.KATCCMParser(fname): + Nlen = int(data['Nlen']) + if Nlen != 12: + # OCF only supports 12 byte IVs + continue + key = data['Key'].decode('hex') + nonce = data['Nonce'].decode('hex') + Alen = int(data['Alen']) + if Alen != 0: + aad = data['Adata'].decode('hex') + else: + aad = None + payload = data['Payload'].decode('hex') + ct = data['CT'].decode('hex') + + try: + c = Crypto(crid=crid, + cipher=cryptodev.CRYPTO_AES_CCM_16, + key=key, + mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, + mackey=key, maclen=16) + r, tag = Crypto.encrypt(c, payload, + nonce, aad) + except EnvironmentError, e: + if e.errno != errno.EOPNOTSUPP: + raise + continue + + out = r + tag + self.assertEqual(out, ct, + "Count " + data['Count'] + " Actual: " + \ + repr(out.encode("hex")) + " Expected: " + \ + repr(data) + " on " + cname) + + def runCCMDecrypt(self, fname): + # XXX: Note that all of the current CCM + # decryption test vectors use IV and tag sizes + # that aren't supported by OCF none of the + # tests are actually ran. + for data in cryptodev.KATCCMParser(fname): + Nlen = int(data['Nlen']) + if Nlen != 12: + # OCF only supports 12 byte IVs + continue + Tlen = int(data['Tlen']) + if Tlen != 16: + # OCF only supports 16 byte tags + continue + key = data['Key'].decode('hex') + nonce = data['Nonce'].decode('hex') + Alen = int(data['Alen']) + if Alen != 0: + aad = data['Adata'].decode('hex') + else: + aad = None + ct = data['CT'].decode('hex') + tag = ct[-16:] + ct = ct[:-16] + + try: + c = Crypto(crid=crid, + cipher=cryptodev.CRYPTO_AES_CCM_16, + key=key, + mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, + mackey=key, maclen=16) + except EnvironmentError, e: + if e.errno != errno.EOPNOTSUPP: + raise + continue + + if data['Result'] == 'Fail': + self.assertRaises(IOError, + c.decrypt, payload, nonce, aad, tag) + else: + r = Crypto.decrypt(c, payload, nonce, + aad, tag) + + payload = data['Payload'].decode('hex') + Plen = int(data('Plen')) + payload = payload[:plen] + self.assertEqual(r, payload, + "Count " + data['Count'] + \ + " Actual: " + repr(r.encode("hex")) + \ + " Expected: " + repr(data) + \ + " on " + cname) ############### ##### DES ##### From owner-svn-src-head@freebsd.org Wed Apr 24 01:11:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6643C158827F; Wed, 24 Apr 2019 01:11: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 09C396C335; Wed, 24 Apr 2019 01:11: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 D14964EEC; Wed, 24 Apr 2019 01:11: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 x3O1BoMA054916; Wed, 24 Apr 2019 01:11:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O1BoRc054914; Wed, 24 Apr 2019 01:11:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904240111.x3O1BoRc054914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 24 Apr 2019 01:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346618 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 346618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09C396C335 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 01:11:51 -0000 Author: kevans Date: Wed Apr 24 01:11:50 2019 New Revision: 346618 URL: https://svnweb.freebsd.org/changeset/base/346618 Log: fdt: stop installing FDT_DTS_FILE r346307 inadvertently started installing FDT_DTS_FILE along with the kernel. While this isn't necessarily bad, it was not intended or discussed and it actively breaks some current setups that don't anticipate any .dtb being installed when it's using static fdt. This change could be reconsidered down the line, but it needs to be done with prior discussion. Fix it by pushing FDT_DTS_FILE build down into the raw dtb.build.mk bits. This technically allows modules building DTS to accidentally specify an FDT_DTS_FILE that gets built but isn't otherwise useful (since it's not installed), but I suspect this isn't a big deal and would get caught with any kind of testing -- and perhaps this might end up useful in some other way, for example by some module wanting to embed fdt in some other way than our current/normal mechanism. Reported by: Mori Hiroki MFC after: 3 days X-MFC-With: r346307 Modified: head/sys/conf/dtb.build.mk head/sys/conf/kern.post.mk Modified: head/sys/conf/dtb.build.mk ============================================================================== --- head/sys/conf/dtb.build.mk Wed Apr 24 00:23:06 2019 (r346617) +++ head/sys/conf/dtb.build.mk Wed Apr 24 01:11:50 2019 (r346618) @@ -43,7 +43,7 @@ DTBO=${DTSO:T:R:S/$/.dtbo/} # Add dependencies on the source file so that out-of-tree things can be included # without any .PATH additions. -.for _dts in ${DTS} +.for _dts in ${DTS} ${FDT_DTS_FILE} ${_dts:R:T}.dtb: ${_dts} .endfor Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Apr 24 00:23:06 2019 (r346617) +++ head/sys/conf/kern.post.mk Wed Apr 24 01:11:50 2019 (r346618) @@ -8,10 +8,7 @@ # should be defined in the kern.pre.mk so that port makefiles can # override or augment them. -.if !empty(FDT_DTS_FILE) -DTS+= ${FDT_DTS_FILE} -.endif -.if defined(DTS) || defined(DTSO) +.if defined(DTS) || defined(DTSO) || defined(FDT_DTS_FILE) .include "dtb.build.mk" KERNEL_EXTRA+= ${DTB} ${DTBO} From owner-svn-src-head@freebsd.org Wed Apr 24 02:51:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DAB2158A041; Wed, 24 Apr 2019 02:51:59 +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 DE3406F1B4; Wed, 24 Apr 2019 02:51:58 +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 A9F225FDE; Wed, 24 Apr 2019 02:51:58 +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 x3O2pwvn008363; Wed, 24 Apr 2019 02:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O2pwd0008362; Wed, 24 Apr 2019 02:51:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904240251.x3O2pwd0008362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 24 Apr 2019 02:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346619 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 346619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE3406F1B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 02:51:59 -0000 Author: jhibbits Date: Wed Apr 24 02:51:58 2019 New Revision: 346619 URL: https://svnweb.freebsd.org/changeset/base/346619 Log: powerpc: Add a couple missing isyncs mtmsr and mtsr require context synchronizing instructions to follow. Without a CSI, there's a chance for a machine check exception. This reportedly does occur on a MPC750 (PowerMac G3). Reported by: Mark Millard Modified: head/sys/powerpc/aim/trap_subr32.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Wed Apr 24 01:11:50 2019 (r346618) +++ head/sys/powerpc/aim/trap_subr32.S Wed Apr 24 02:51:58 2019 (r346619) @@ -68,7 +68,7 @@ lwzu sr,PM_SR(pmap); \ RESTORE_SRS(pmap,sr) \ /* Restore SR 12 */ \ - lwz sr,12*4(pmap); mtsr 12,sr + lwz sr,12*4(pmap); mtsr 12,sr; isync /* * Kernel SRs are loaded directly from kernel_pmap_ @@ -799,6 +799,7 @@ CNAME(trapexit): mfmsr %r3 andi. %r3,%r3,~PSL_EE@l mtmsr %r3 + isync /* Test AST pending: */ lwz %r5,FRAME_SRR1+8(%r1) mtcr %r5 From owner-svn-src-head@freebsd.org Wed Apr 24 03:37:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFF79158AB96; Wed, 24 Apr 2019 03:37:26 +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.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26221706C0; Wed, 24 Apr 2019 03:37:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x529.google.com with SMTP id j26so8651412pgl.5; Tue, 23 Apr 2019 20:37:26 -0700 (PDT) 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=IGILeDbtIfHPS5wd5h3BzNRtFlUbOROCmgyDdMcwShM=; b=jCEDtOfV2PjaCF+TSdDbDQNdpg0aHZfGchBNx0C6m+h7V93HcU7gtYWVM2LKV+LcEN REaAfxyNxLQ0kR5+UhWTeyC6nFfhSocw7Ni4VnJ/g3SmPpXlem6VzJdGORyON1BvDKKy k9YQpIAGEc5VdnFAhN44UDawmhRSSkLT+Im2fO9wSL0V6GvJVh2q3vY7+HNp93h2sZC0 txGmDuP2UdePeD6+X6w/VAsBr3kMcn1S2eT6nlQSDg2w22+JiS94EL/QdDg9CkhahbZ8 K+yrE9H98dgsfsOiPkUXTh/AJK1ImvxCZ09tMKcTvlwkrh5gprxfHjHGmlXKxcyZphS9 /Dxw== 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=IGILeDbtIfHPS5wd5h3BzNRtFlUbOROCmgyDdMcwShM=; b=tVasGsDhybXXtj7I84kKtgDaA7tfFFhFrFHoM3Xh3gCF/Z1KO+VlxhRLSZuFuzL0mj q35gq3rTWXn1wuMOZkETxnbsydkkiHB2rOtimrveKNSmP9utMQrjw00bYLtj0kJM1p9T xaMatSEh/CeZMJwpCJyN9hBb4rq7uZX8SAFggDews/JR8KmJTPq3gyXQaaLFj/v+Wig+ /xWqDqAQDrxleazfk7f8dRH/L5TFcEzw/AdCvie9/szdoY7fMHyL+J59AsRidT1lFH6z DJE/CPqcQovrm7G0nwQRMIjEFaALJ2tjPph3ZPSFt2O51emRPNkUxMY2V/PQASHbPPwH 5NvQ== X-Gm-Message-State: APjAAAX5nHZ/y8c9KiQhl3iku/mzsKQ+28siB4fSnTeNBgReIox30rR7 hcmFr04Gw6HSQ0jjkLiZeaDxuGKC X-Google-Smtp-Source: APXvYqwI4VHSDAx4CNCWc+RLv+2Spnui5WTqjsuvA+zRvH5r2fWP8pf1Whx2KQYugvZHlu6bGFp2OA== X-Received: by 2002:a63:f448:: with SMTP id p8mr28526627pgk.50.1556077043765; Tue, 23 Apr 2019 20:37:23 -0700 (PDT) Received: from ?IPv6:2607:fb90:82a8:498d:b9d5:a157:187d:53f5? ([2607:fb90:82a8:498d:b9d5:a157:187d:53f5]) by smtp.gmail.com with ESMTPSA id c22sm25246776pfn.136.2019.04.23.20.37.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 20:37:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r346619 - head/sys/powerpc/aim From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201904240251.x3O2pwd0008362@repo.freebsd.org> Date: Tue, 23 Apr 2019 20:37:21 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201904240251.x3O2pwd0008362@repo.freebsd.org> To: Justin Hibbits X-Rspamd-Queue-Id: 26221706C0 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.941,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 03:37:26 -0000 > On Apr 23, 2019, at 19:51, Justin Hibbits wrote: >=20 > Author: jhibbits > Date: Wed Apr 24 02:51:58 2019 > New Revision: 346619 > URL: https://svnweb.freebsd.org/changeset/base/346619 >=20 > Log: > powerpc: Add a couple missing isyncs >=20 > mtmsr and mtsr require context synchronizing instructions to follow. Wit= hout > a CSI, there's a chance for a machine check exception. This reportedly d= oes > occur on a MPC750 (PowerMac G3). G3?! Wow... the oldest I=E2=80=99ve used is the G4, back a decade and a half= ago :0... -Enji= From owner-svn-src-head@freebsd.org Wed Apr 24 04:25:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E38D6158B57B; Wed, 24 Apr 2019 04:25:20 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail02.asahi-net.or.jp (mail02.asahi-net.or.jp [202.224.55.14]) by mx1.freebsd.org (Postfix) with ESMTP id 5ABF5718D6; Wed, 24 Apr 2019 04:25:19 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail02.asahi-net.or.jp (Postfix) with ESMTPSA id BDC3A3CAA1; Wed, 24 Apr 2019 13:25:06 +0900 (JST) Date: Wed, 24 Apr 2019 00:24:34 -0400 From: Yoshihiro Ota To: Ed Maste Cc: ota@j.email.ne.jp, svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs Message-Id: <20190424002434.06aad79f1135a3f2e7248da6@j.email.ne.jp> In-Reply-To: References: <201904171602.x3HG2wQq054372@repo.freebsd.org> <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__24_Apr_2019_00_24_34_-0400_KhD+WnN_igxQI/iG" X-Rspamd-Queue-Id: 5ABF5718D6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.889,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 04:25:21 -0000 This is a multi-part message in MIME format. --Multipart=_Wed__24_Apr_2019_00_24_34_-0400_KhD+WnN_igxQI/iG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Ed and thank you for taking a look. my svn info says 346593 which is after few other fixes were commited. I'm on i386 arch. I haven't done installworld yet after picking up libcasper changes. 'make buildworld' works fine. 'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and TARGET_ARCH. Both fail same way. Please check your /usr/include/casper/ca_fileargs.h and I suspect that's where you pick up FA_OPEN. I attached a log file this time. Regards, Hiro On Tue, 23 Apr 2019 09:49:00 -0400 Ed Maste wrote: > On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota wrote: > > > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to fail as the > > following with HEAD checked out under "/usr/obj/freebsd": > > Hello Hiro-san, sorry about that. > > I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but > it failed on the install as DESTDIR wasn't set and I ran as non-root). > Just `make xdev-build` was successful though. > > What version were you trying to build? There were (several) followup > commits to address issues with the initial commit of cap_fileargs > lstat support. --Multipart=_Wed__24_Apr_2019_00_24_34_-0400_KhD+WnN_igxQI/iG Content-Type: text/plain; name="xdev-build.txt" Content-Disposition: attachment; filename="xdev-build.txt" Content-Transfer-Encoding: 7bit % svn info Path: . Working Copy Root Path: /usr/src URL: https://svn0.us-east.freebsd.org/base/head Relative URL: ^/head Repository Root: https://svn0.us-east.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 346593 Node Kind: directory Schedule: normal Last Changed Author: wma Last Changed Rev: 346593 Last Changed Date: 2019-04-23 02:36:32 -0400 (Tue, 23 Apr 2019) % make xdev-build TARGET=mips TARGET_ARCH=mips mkdir -p /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr mtree -deUW -f /usr/src/etc/mtree/BSD.usr.dist -p /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr >/dev/null ===> lib/clang/libllvmminimal (obj,all,install) ===> usr.bin/clang/llvm-tblgen (obj,all,install) sh /usr/src/tools/install.sh -s -o root -g wheel -m 555 llvm-tblgen /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/llvm-tblgen sh /usr/src/tools/install.sh -o root -g wheel -m 444 llvm-tblgen.debug /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/llvm-tblgen.debug ===> usr.bin/clang/clang-tblgen (obj,all,install) sh /usr/src/tools/install.sh -s -o root -g wheel -m 555 clang-tblgen /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/clang-tblgen sh /usr/src/tools/install.sh -o root -g wheel -m 444 clang-tblgen.debug /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/clang-tblgen.debug ===> gnu/usr.bin/gperf (obj,all,install) sh /usr/src/tools/install.sh -s -o root -g wheel -m 555 gperf /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/gperf sh /usr/src/tools/install.sh -o root -g wheel -m 444 gperf.debug /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/gperf.debug ===> lib/liby (obj,all,install) sh /usr/src/tools/install.sh -C -o root -g wheel -m 444 liby.a /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/ ===> usr.bin/yacc (obj,all,install) sh /usr/src/tools/install.sh -s -o root -g wheel -m 555 yacc /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc sh /usr/src/tools/install.sh -o root -g wheel -m 444 yacc.debug /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/lib/debug/usr/bin/yacc.debug sh /usr/src/tools/install.sh -l h -o root -g wheel -m 555 /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/yacc /usr/obj/usr/src/mips.mips/mips-freebsd/tmp/usr/bin/byacc ===> bin/csh (obj,build-tools) ===> bin/sh (obj,build-tools) ===> lib/ncurses/ncurses (obj,build-tools) ===> lib/ncurses/ncursesw (obj,build-tools) ===> share/syscons/scrnmaps (obj,build-tools) ===> usr.bin/awk (obj,build-tools) ===> lib/libmagic (obj,build-tools) ===> usr.bin/mkesdb_static (obj,build-tools) ===> usr.bin/mkcsmapper_static (obj,build-tools) ===> usr.bin/vi/catalog (obj,build-tools) ===> gnu/usr.bin/cc/cc_tools (obj,build-tools) ===> xdev gnu/usr.bin/binutils (obj,all) ===> gnu/usr.bin/binutils/libiberty (all) ===> gnu/usr.bin/binutils/libbfd (all) ===> gnu/usr.bin/binutils/libopcodes (all) ===> gnu/usr.bin/binutils/doc (all) ===> gnu/usr.bin/binutils/libbinutils (all) ===> gnu/usr.bin/binutils/as (all) ===> gnu/usr.bin/binutils/objdump (all) ===> gnu/usr.bin/binutils/ld (all) ===> xdev lib/libelftc (obj,all) ===> xdev lib/libpe (obj,all) ===> xdev usr.bin/objcopy (obj,all) ===> xdev usr.bin/nm (obj,all) ===> xdev usr.bin/size (obj,all) ===> xdev usr.bin/strings (obj,all) cc -O2 -pipe -DWITH_CASPER -I/usr/src/contrib/elftoolchain/libelftc -I/usr/src/contrib/elftoolchain/common -g -MD -MF.depend.strings.o -MTstrings.o -std=gnu99 -Qunused-arguments -c /usr/src/contrib/elftoolchain/strings/strings.c -o strings.o /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of undeclared identifier 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); ^ 1 error generated. *** Error code 1 Stop. make[2]: stopped in /usr/src/usr.bin/strings *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src --Multipart=_Wed__24_Apr_2019_00_24_34_-0400_KhD+WnN_igxQI/iG-- From owner-svn-src-head@freebsd.org Wed Apr 24 04:40:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F654158BDC7; Wed, 24 Apr 2019 04:40:25 +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 C554471FCA; Wed, 24 Apr 2019 04:40:24 +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 9B08D716B; Wed, 24 Apr 2019 04:40:24 +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 x3O4eOXJ061980; Wed, 24 Apr 2019 04:40:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O4eOHA061977; Wed, 24 Apr 2019 04:40:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904240440.x3O4eOHA061977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 24 Apr 2019 04:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346620 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C554471FCA 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)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 04:40:25 -0000 Author: ngie Date: Wed Apr 24 04:40:24 2019 New Revision: 346620 URL: https://svnweb.freebsd.org/changeset/base/346620 Log: Reapply whitespace style changes from r346443 after recent changes to tests/sys/opencrypto From r346443: """ Replace hard tabs with four-character indentations, per PEP8. This is being done to separate stylistic changes from the tests from functional ones, as I accidentally introduced a bug to the tests when I used four-space indentation locally. No functional change. """ MFC after: 2 months Discussed with: jhb Modified: head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 02:51:58 2019 (r346619) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 04:40:24 2019 (r346620) @@ -35,73 +35,79 @@ import array import dpkt from fcntl import ioctl import os +import random import signal from struct import pack as _pack +import time from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] class FindOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('crid', 'i', 0), - ('name', '32s', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('crid', 'i', 0), + ('name', '32s', 0), + ) class SessionOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ) class SessionOp2(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ('crid', 'i', 0), - ('pad0', 'i', 0), - ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ('crid', 'i', 0), + ('pad0', 'i', 0), + ('pad1', 'i', 0), + ('pad2', 'i', 0), + ('pad3', 'i', 0), + ) class CryptOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('mac', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('mac', 'P', 0), + ('iv', 'P', 0), + ) class CryptAEAD(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('aadlen', 'I', 0), - ('ivlen', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('aad', 'P', 0), - ('tag', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('aadlen', 'I', 0), + ('ivlen', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('aad', 'P', 0), + ('tag', 'P', 0), + ('iv', 'P', 0), + ) # h2py.py can't handle multiarg macros CRIOGET = 3221513060 @@ -116,549 +122,546 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - fd = os.open('/dev/crypto', os.O_RDWR) - buf = array.array('I', [0]) - ioctl(fd, CRIOGET, buf, 1) - os.close(fd) + fd = os.open('/dev/crypto', os.O_RDWR) + buf = array.array('I', [0]) + ioctl(fd, CRIOGET, buf, 1) + os.close(fd) - return buf[0] + return buf[0] _cryptodev = _getdev() def _findop(crid, name): - fop = FindOp() - fop.crid = crid - fop.name = name - s = array.array('B', fop.pack_hdr()) - ioctl(_cryptodev, CIOCFINDDEV, s, 1) - fop.unpack(s) + fop = FindOp() + fop.crid = crid + fop.name = name + s = array.array('B', fop.pack_hdr()) + ioctl(_cryptodev, CIOCFINDDEV, s, 1) + fop.unpack(s) - try: - idx = fop.name.index('\x00') - name = fop.name[:idx] - except ValueError: - name = fop.name + try: + idx = fop.name.index('\x00') + name = fop.name[:idx] + except ValueError: + name = fop.name - return fop.crid, name + return fop.crid, name class Crypto: - @staticmethod - def findcrid(name): - return _findop(-1, name)[0] + @staticmethod + def findcrid(name): + return _findop(-1, name)[0] - @staticmethod - def getcridname(crid): - return _findop(crid, '')[1] + @staticmethod + def getcridname(crid): + return _findop(crid, '')[1] - def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): - self._ses = None - self._maclen = maclen - ses = SessionOp2() - ses.cipher = cipher - ses.mac = mac + def __init__(self, cipher=0, key=None, mac=0, mackey=None, + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): + self._ses = None + self._maclen = maclen + ses = SessionOp2() + ses.cipher = cipher + ses.mac = mac - if key is not None: - ses.keylen = len(key) - k = array.array('B', key) - ses.key = k.buffer_info()[0] - else: - self.key = None + if key is not None: + ses.keylen = len(key) + k = array.array('B', key) + ses.key = k.buffer_info()[0] + else: + self.key = None - if mackey is not None: - ses.mackeylen = len(mackey) - mk = array.array('B', mackey) - ses.mackey = mk.buffer_info()[0] + if mackey is not None: + ses.mackeylen = len(mackey) + mk = array.array('B', mackey) + ses.mackey = mk.buffer_info()[0] - if not cipher and not mac: - raise ValueError('one of cipher or mac MUST be specified.') - ses.crid = crid - #print(ses) - s = array.array('B', ses.pack_hdr()) - #print(s) - ioctl(_cryptodev, CIOCGSESSION2, s, 1) - ses.unpack(s) + if not cipher and not mac: + raise ValueError('one of cipher or mac MUST be specified.') + ses.crid = crid + #print(ses) + s = array.array('B', ses.pack_hdr()) + #print(s) + ioctl(_cryptodev, CIOCGSESSION2, s, 1) + ses.unpack(s) - self._ses = ses.ses + self._ses = ses.ses - def __del__(self): - if self._ses is None: - return + def __del__(self): + if self._ses is None: + return - try: - ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) - except TypeError: - pass - self._ses = None + try: + ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) + except TypeError: + pass + self._ses = None - def _doop(self, op, src, iv): - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(src) - s = array.array('B', src) - cop.src = cop.dst = s.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', iv) - cop.iv = ivbuf.buffer_info()[0] + def _doop(self, op, src, iv): + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(src) + s = array.array('B', src) + cop.src = cop.dst = s.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', iv) + cop.iv = ivbuf.buffer_info()[0] - #print('cop:', cop) - ioctl(_cryptodev, CIOCCRYPT, str(cop)) + #print('cop:', cop) + ioctl(_cryptodev, CIOCCRYPT, str(cop)) - s = s.tostring() - if self._maclen is not None: - return s, m.tostring() + s = s.tostring() + if self._maclen is not None: + return s, m.tostring() - return s + return s - def _doaead(self, op, src, aad, iv, tag=None): - caead = CryptAEAD() - caead.ses = self._ses - caead.op = op - caead.flags = CRD_F_IV_EXPLICIT - caead.flags = 0 - caead.len = len(src) - s = array.array('B', src) - caead.src = caead.dst = s.buffer_info()[0] - caead.aadlen = len(aad) - saad = array.array('B', aad) - caead.aad = saad.buffer_info()[0] + def _doaead(self, op, src, aad, iv, tag=None): + caead = CryptAEAD() + caead.ses = self._ses + caead.op = op + caead.flags = CRD_F_IV_EXPLICIT + caead.flags = 0 + caead.len = len(src) + s = array.array('B', src) + caead.src = caead.dst = s.buffer_info()[0] + caead.aadlen = len(aad) + saad = array.array('B', aad) + caead.aad = saad.buffer_info()[0] - if self._maclen is None: - raise ValueError('must have a tag length') + if self._maclen is None: + raise ValueError('must have a tag length') - if tag is None: - tag = array.array('B', [0] * self._maclen) - else: - assert len(tag) == self._maclen, \ + if tag is None: + tag = array.array('B', [0] * self._maclen) + else: + assert len(tag) == self._maclen, \ '%d != %d' % (len(tag), self._maclen) - tag = array.array('B', tag) + tag = array.array('B', tag) - caead.tag = tag.buffer_info()[0] + caead.tag = tag.buffer_info()[0] - ivbuf = array.array('B', iv) - caead.ivlen = len(iv) - caead.iv = ivbuf.buffer_info()[0] + ivbuf = array.array('B', iv) + caead.ivlen = len(iv) + caead.iv = ivbuf.buffer_info()[0] - ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) + ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) - s = s.tostring() + s = s.tostring() - return s, tag.tostring() + return s, tag.tostring() - def perftest(self, op, size, timeo=3): - import random - import time + def perftest(self, op, size, timeo=3): + inp = array.array('B', (random.randint(0, 255) for x in xrange(size))) + out = array.array('B', inp) - inp = array.array('B', (random.randint(0, 255) for x in xrange(size))) - out = array.array('B', inp) + # prep ioctl + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(inp) + s = array.array('B', inp) + cop.src = s.buffer_info()[0] + cop.dst = out.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16))) + cop.iv = ivbuf.buffer_info()[0] - # prep ioctl - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(inp) - s = array.array('B', inp) - cop.src = s.buffer_info()[0] - cop.dst = out.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16))) - cop.iv = ivbuf.buffer_info()[0] + exit = [ False ] + def alarmhandle(a, b, exit=exit): + exit[0] = True - exit = [ False ] - def alarmhandle(a, b, exit=exit): - exit[0] = True + oldalarm = signal.signal(signal.SIGALRM, alarmhandle) + signal.alarm(timeo) - oldalarm = signal.signal(signal.SIGALRM, alarmhandle) - signal.alarm(timeo) + start = time.time() + reps = 0 + while not exit[0]: + ioctl(_cryptodev, CIOCCRYPT, str(cop)) + reps += 1 - start = time.time() - reps = 0 - while not exit[0]: - ioctl(_cryptodev, CIOCCRYPT, str(cop)) - reps += 1 + end = time.time() - end = time.time() + signal.signal(signal.SIGALRM, oldalarm) - signal.signal(signal.SIGALRM, oldalarm) + print('time:', end - start) + print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) - print('time:', end - start) - print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) + def encrypt(self, data, iv, aad=None): + if aad is None: + return self._doop(COP_ENCRYPT, data, iv) + else: + return self._doaead(COP_ENCRYPT, data, aad, + iv) - def encrypt(self, data, iv, aad=None): - if aad is None: - return self._doop(COP_ENCRYPT, data, iv) - else: - return self._doaead(COP_ENCRYPT, data, aad, - iv) + def decrypt(self, data, iv, aad=None, tag=None): + if aad is None: + return self._doop(COP_DECRYPT, data, iv) + else: + return self._doaead(COP_DECRYPT, data, aad, + iv, tag=tag) - def decrypt(self, data, iv, aad=None, tag=None): - if aad is None: - return self._doop(COP_DECRYPT, data, iv) - else: - return self._doaead(COP_DECRYPT, data, aad, - iv, tag=tag) - class MismatchError(Exception): - pass + pass class KATParser: - def __init__(self, fname, fields): - self.fp = open(fname) - self.fields = set(fields) - self._pending = None + def __init__(self, fname, fields): + self.fp = open(fname) + self.fields = set(fields) + self._pending = None - def __iter__(self): - while True: - didread = False - if self._pending is not None: - i = self._pending - self._pending = None - else: - i = self.fp.readline() - didread = True + def __iter__(self): + while True: + didread = False + if self._pending is not None: + i = self._pending + self._pending = None + else: + i = self.fp.readline() + didread = True - if didread and not i: - return + if didread and not i: + return - if (i and i[0] == '#') or not i.strip(): - continue - if i[0] == '[': - yield i[1:].split(']', 1)[0], self.fielditer() - else: - raise ValueError('unknown line: %r' % repr(i)) + if (i and i[0] == '#') or not i.strip(): + continue + if i[0] == '[': + yield i[1:].split(']', 1)[0], self.fielditer() + else: + raise ValueError('unknown line: %r' % repr(i)) - def eatblanks(self): - while True: - line = self.fp.readline() - if line == '': - break + def eatblanks(self): + while True: + line = self.fp.readline() + if line == '': + break - line = line.strip() - if line: - break + line = line.strip() + if line: + break - return line + return line - def fielditer(self): - while True: - values = {} + def fielditer(self): + while True: + values = {} - line = self.eatblanks() - if not line or line[0] == '[': - self._pending = line - return + line = self.eatblanks() + if not line or line[0] == '[': + self._pending = line + return - while True: - try: - f, v = line.split(' =') - except: - if line == 'FAIL': - f, v = 'FAIL', '' - else: - print('line:', repr(line)) - raise - v = v.strip() + while True: + try: + f, v = line.split(' =') + except: + if line == 'FAIL': + f, v = 'FAIL', '' + else: + print('line:', repr(line)) + raise + v = v.strip() - if f in values: - raise ValueError('already present: %r' % repr(f)) - values[f] = v - line = self.fp.readline().strip() - if not line: - break + if f in values: + raise ValueError('already present: %r' % repr(f)) + values[f] = v + line = self.fp.readline().strip() + if not line: + break - # we should have everything - remain = self.fields.copy() - set(values.keys()) - # XXX - special case GCM decrypt - if remain and not ('FAIL' in values and 'PT' in remain): - raise ValueError('not all fields found: %r' % repr(remain)) + # we should have everything + remain = self.fields.copy() - set(values.keys()) + # XXX - special case GCM decrypt + if remain and not ('FAIL' in values and 'PT' in remain): + raise ValueError('not all fields found: %r' % repr(remain)) - yield values + yield values # The CCM files use a bit of a different syntax that doesn't quite fit # the generic KATParser. In particular, some keys are set globally at # the start of the file, and some are set globally at the start of a # section. class KATCCMParser: - def __init__(self, fname): - self.fp = open(fname) - self._pending = None - self.read_globals() + def __init__(self, fname): + self.fp = open(fname) + self._pending = None + self.read_globals() - def read_globals(self): - self.global_values = {} - while True: - line = self.fp.readline() - if not line: - return - if line[0] == '#' or not line.strip(): - continue - if line[0] == '[': - self._pending = line - return + def read_globals(self): + self.global_values = {} + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return - try: - f, v = line.split(' =') - except: - print('line:', repr(line)) - raise + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise - v = v.strip() + v = v.strip() - if f in self.global_values: - raise ValueError('already present: %r' % repr(f)) - self.global_values[f] = v + if f in self.global_values: + raise ValueError('already present: %r' % repr(f)) + self.global_values[f] = v - def read_section_values(self, kwpairs): - self.section_values = self.global_values.copy() - for pair in kwpairs.split(', '): - f, v = pair.split(' = ') - if f in self.section_values: - raise ValueError('already present: %r' % repr(f)) - self.section_values[f] = v + def read_section_values(self, kwpairs): + self.section_values = self.global_values.copy() + for pair in kwpairs.split(', '): + f, v = pair.split(' = ') + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v - while True: - line = self.fp.readline() - if not line: - return - if line[0] == '#' or not line.strip(): - continue - if line[0] == '[': - self._pending = line - return + while True: + line = self.fp.readline() + if not line: + return + if line[0] == '#' or not line.strip(): + continue + if line[0] == '[': + self._pending = line + return - try: - f, v = line.split(' =') - except: - print('line:', repr(line)) - raise + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise - if f == 'Count': - self._pending = line - return + if f == 'Count': + self._pending = line + return - v = v.strip() + v = v.strip() - if f in self.section_values: - raise ValueError('already present: %r' % repr(f)) - self.section_values[f] = v + if f in self.section_values: + raise ValueError('already present: %r' % repr(f)) + self.section_values[f] = v - def __iter__(self): - while True: - if self._pending: - line = self._pending - self._pending = None - else: - line = self.fp.readline() - if not line: - return + def __iter__(self): + while True: + if self._pending: + line = self._pending + self._pending = None + else: + line = self.fp.readline() + if not line: + return - if (line and line[0] == '#') or not line.strip(): - continue + if (line and line[0] == '#') or not line.strip(): + continue - if line[0] == '[': - section = line[1:].split(']', 1)[0] - self.read_section_values(section) - continue + if line[0] == '[': + section = line[1:].split(']', 1)[0] + self.read_section_values(section) + continue - values = self.section_values.copy() + values = self.section_values.copy() - while True: - try: - f, v = line.split(' =') - except: - print('line:', repr(line)) - raise - v = v.strip() + while True: + try: + f, v = line.split(' =') + except: + print('line:', repr(line)) + raise + v = v.strip() - if f in values: - raise ValueError('already present: %r' % repr(f)) - values[f] = v - line = self.fp.readline().strip() - if not line: - break + if f in values: + raise ValueError('already present: %r' % repr(f)) + values[f] = v + line = self.fp.readline().strip() + if not line: + break - yield values + yield values def _spdechex(s): - return ''.join(s.split()).decode('hex') + return ''.join(s.split()).decode('hex') if __name__ == '__main__': - if True: - try: - crid = Crypto.findcrid('aesni0') - print('aesni:', crid) - except IOError: - print('aesni0 not found') + if True: + try: + crid = Crypto.findcrid('aesni0') + print('aesni:', crid) + except IOError: + print('aesni0 not found') - for i in xrange(10): - try: - name = Crypto.getcridname(i) - print('%2d: %r' % (i, repr(name))) - except IOError: - pass - elif False: - kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ]) - for mode, ni in kp: - print(i, ni) - for j in ni: - print(j) - elif False: - key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') - iv = _spdechex('00000000000000000000000000000001') - pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e') - #pt = _spdechex('00000000000000000000000000000000') - ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef') + for i in xrange(10): + try: + name = Crypto.getcridname(i) + print('%2d: %r' % (i, repr(name))) + except IOError: + pass + elif False: + kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ]) + for mode, ni in kp: + print(i, ni) + for j in ni: + print(j) + elif False: + key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = _spdechex('00000000000000000000000000000001') + pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e') + #pt = _spdechex('00000000000000000000000000000000') + ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef') - c = Crypto(CRYPTO_AES_ICM, key) - enc = c.encrypt(pt, iv) + c = Crypto(CRYPTO_AES_ICM, key) + enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) - assert ct == enc + assert ct == enc - dec = c.decrypt(ct, iv) + dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) - assert pt == dec - elif False: - key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') - iv = _spdechex('00000000000000000000000000000001') - pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f') - #pt = _spdechex('00000000000000000000000000000000') - ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768') + assert pt == dec + elif False: + key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = _spdechex('00000000000000000000000000000001') + pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f') + #pt = _spdechex('00000000000000000000000000000000') + ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768') - c = Crypto(CRYPTO_AES_ICM, key) - enc = c.encrypt(pt, iv) + c = Crypto(CRYPTO_AES_ICM, key) + enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) - assert ct == enc + assert ct == enc - dec = c.decrypt(ct, iv) + dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) - assert pt == dec - elif False: - key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') - iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc') - pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f') - ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427') - c = Crypto(CRYPTO_AES_CBC, key) + assert pt == dec + elif False: + key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc') + pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f') + ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427') + c = Crypto(CRYPTO_AES_CBC, key) - enc = c.encrypt(pt, iv) + enc = c.encrypt(pt, iv) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) - assert ct == enc + assert ct == enc - dec = c.decrypt(ct, iv) + dec = c.decrypt(ct, iv) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) - assert pt == dec - elif False: - key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') - iv = _spdechex('b3d8cc017cbb89b39e0f67e2') - pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030') - aad = _spdechex('24825602bd12a984e0092d3e448eda5f') - ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354') - ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73') - tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd') - tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea') + assert pt == dec + elif False: + key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = _spdechex('b3d8cc017cbb89b39e0f67e2') + pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030') + aad = _spdechex('24825602bd12a984e0092d3e448eda5f') + ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354') + ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73') + tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd') + tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea') - c = Crypto(CRYPTO_AES_NIST_GCM_16, key, - mac=CRYPTO_AES_128_NIST_GMAC, mackey=key) + c = Crypto(CRYPTO_AES_NIST_GCM_16, key, + mac=CRYPTO_AES_128_NIST_GMAC, mackey=key) - enc, enctag = c.encrypt(pt, iv, aad=aad) + enc, enctag = c.encrypt(pt, iv, aad=aad) - print('enc:', enc.encode('hex')) - print(' ct:', ct.encode('hex')) + print('enc:', enc.encode('hex')) + print(' ct:', ct.encode('hex')) - assert enc == ct + assert enc == ct - print('etg:', enctag.encode('hex')) - print('tag:', tag.encode('hex')) - assert enctag == tag + print('etg:', enctag.encode('hex')) + print('tag:', tag.encode('hex')) + assert enctag == tag - # Make sure we get EBADMSG - #enctag = enctag[:-1] + 'a' - dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag) + # Make sure we get EBADMSG + #enctag = enctag[:-1] + 'a' + dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag) - print('dec:', dec.encode('hex')) - print(' pt:', pt.encode('hex')) + print('dec:', dec.encode('hex')) + print(' pt:', pt.encode('hex')) - assert dec == pt + assert dec == pt *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 24 04:50:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52635158C0DD; Wed, 24 Apr 2019 04:50:04 +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 E892E725C6; Wed, 24 Apr 2019 04:50:03 +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 BF5E37313; Wed, 24 Apr 2019 04:50:03 +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 x3O4o3cH067301; Wed, 24 Apr 2019 04:50:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O4o35q067300; Wed, 24 Apr 2019 04:50:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904240450.x3O4o35q067300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 24 Apr 2019 04:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346623 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E892E725C6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 04:50:04 -0000 Author: ngie Date: Wed Apr 24 04:50:03 2019 New Revision: 346623 URL: https://svnweb.freebsd.org/changeset/base/346623 Log: Chase PEP-3110 Replace `except Environment, e:` with `except Environment as e` for compatibility between python 2.x and python 3.x. While here, fix a bad indentation change from r346620 by reindenting the code properly. MFC after: 2 months Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 04:45:00 2019 (r346622) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 04:50:03 2019 (r346623) @@ -124,7 +124,7 @@ def GenTestCase(cname): mac=self._gmacsizes[len(cipherkey)], mackey=cipherkey, crid=crid, maclen=16) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test algorithms the driver does not support. if e.errno != errno.EOPNOTSUPP: raise @@ -133,7 +133,7 @@ def GenTestCase(cname): if mode == 'ENCRYPT': try: rct, rtag = c.encrypt(pt, iv, aad) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test inputs the driver does not support. if e.errno != errno.EINVAL: raise @@ -153,7 +153,7 @@ def GenTestCase(cname): else: try: rpt, rtag = c.decrypt(*args) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test inputs the driver does not support. if e.errno != errno.EINVAL: raise @@ -221,7 +221,7 @@ def GenTestCase(cname): try: c = Crypto(meth, cipherkey, crid=crid) r = curfun(c, pt, iv) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test hashes the driver does not support. if e.errno != errno.EOPNOTSUPP: raise @@ -252,7 +252,7 @@ def GenTestCase(cname): mackey=key, maclen=16) r, tag = Crypto.encrypt(c, payload, nonce, aad) - except EnvironmentError, e: + except EnvironmentError as e: if e.errno != errno.EOPNOTSUPP: raise continue @@ -294,7 +294,7 @@ def GenTestCase(cname): key=key, mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, mackey=key, maclen=16) - except EnvironmentError, e: + except EnvironmentError as e: if e.errno != errno.EOPNOTSUPP: raise continue @@ -388,13 +388,13 @@ def GenTestCase(cname): for data in lines: msg = data['Msg'].decode('hex') - msg = msg[:int(data['Len'])] + msg = msg[:int(data['Len'])] md = data['MD'].decode('hex') try: c = Crypto(mac=alg, crid=crid, maclen=hashlen) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test hashes the driver does not support. if e.errno != errno.EOPNOTSUPP: raise @@ -451,7 +451,7 @@ def GenTestCase(cname): try: c = Crypto(mac=alg, mackey=key, crid=crid, maclen=hashlen) - except EnvironmentError, e: + except EnvironmentError as e: # Can't test hashes the driver does not support. if e.errno != errno.EOPNOTSUPP: raise From owner-svn-src-head@freebsd.org Wed Apr 24 05:24:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48E71158CA83; Wed, 24 Apr 2019 05:24:11 +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 E44E773468; Wed, 24 Apr 2019 05:24:10 +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 C059B79B9; Wed, 24 Apr 2019 05:24: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 x3O5OAiR087739; Wed, 24 Apr 2019 05:24:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O5OA1X087737; Wed, 24 Apr 2019 05:24:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904240524.x3O5OA1X087737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 24 Apr 2019 05:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346624 - head/bin/date X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/bin/date X-SVN-Commit-Revision: 346624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E44E773468 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.967,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 05:24:11 -0000 Author: imp Date: Wed Apr 24 05:24:10 2019 New Revision: 346624 URL: https://svnweb.freebsd.org/changeset/base/346624 Log: Restore the -n flag parsing, but ignore it. Since D19668 was done, new users of the -n flag have surfaced. Parse and ignore it on the command line until they can be updated. Suggested by: rgrimes (in D19668). Modified: head/bin/date/date.1 head/bin/date/date.c Modified: head/bin/date/date.1 ============================================================================== --- head/bin/date/date.1 Wed Apr 24 04:50:03 2019 (r346623) +++ head/bin/date/date.1 Wed Apr 24 05:24:10 2019 (r346624) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd March 20, 2019 +.Dd April 23, 2019 .Dt DATE 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd display or set date and time .Sh SYNOPSIS .Nm -.Op Fl jRu +.Op Fl jnRu .Op Fl r Ar seconds | Ar filename .Oo .Fl v @@ -142,6 +142,8 @@ This allows you to use the flag in addition to the .Cm + option to convert one date format to another. +.It Fl n +Obsolete flag, accepted and ignored for compatibility. .It Fl R Use RFC 2822 date and time output format. This is equivalent to using Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Wed Apr 24 04:50:03 2019 (r346623) +++ head/bin/date/date.c Wed Apr 24 05:24:10 2019 (r346624) @@ -108,7 +108,7 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); rflag = 0; Iflag = jflag = Rflag = 0; - while ((ch = getopt(argc, argv, "f:I::jRr:uv:")) != -1) + while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1) switch((char)ch) { case 'f': fmt = optarg; @@ -131,6 +131,8 @@ main(int argc, char *argv[]) break; case 'j': jflag = 1; /* don't set time */ + break; + case 'n': break; case 'R': /* RFC 2822 datetime format */ if (Iflag) From owner-svn-src-head@freebsd.org Wed Apr 24 05:47:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A55158D34F; Wed, 24 Apr 2019 05:47:10 +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 2C9F9745D8; Wed, 24 Apr 2019 05:47:10 +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 1996C7D03; Wed, 24 Apr 2019 05:47:10 +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 x3O5l9hu098749; Wed, 24 Apr 2019 05:47:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O5l9jn098748; Wed, 24 Apr 2019 05:47:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904240547.x3O5l9jn098748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 24 Apr 2019 05:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346625 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C9F9745D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 05:47:10 -0000 Author: ngie Date: Wed Apr 24 05:47:09 2019 New Revision: 346625 URL: https://svnweb.freebsd.org/changeset/base/346625 Log: Don't leak `fd` when manipulating the device via `_getdev()` Close the file descriptor when done calling ioctl with a try-finally block so it doesn't get leaked. MFC after: 2 months Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 05:24:10 2019 (r346624) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 05:47:09 2019 (r346625) @@ -122,10 +122,12 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - fd = os.open('/dev/crypto', os.O_RDWR) buf = array.array('I', [0]) - ioctl(fd, CRIOGET, buf, 1) - os.close(fd) + fd = os.open('/dev/crypto', os.O_RDWR) + try: + ioctl(fd, CRIOGET, buf, 1) + finally: + os.close(fd) return buf[0] From owner-svn-src-head@freebsd.org Wed Apr 24 05:49:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05B44158D41D; Wed, 24 Apr 2019 05:49:49 +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 9E37B7475D; Wed, 24 Apr 2019 05:49:48 +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 8D67D7D06; Wed, 24 Apr 2019 05:49:48 +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 x3O5nmh8098914; Wed, 24 Apr 2019 05:49:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O5nmYb098913; Wed, 24 Apr 2019 05:49:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904240549.x3O5nmYb098913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 24 Apr 2019 05:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346626 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E37B7475D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 05:49:49 -0000 Author: ngie Date: Wed Apr 24 05:49:48 2019 New Revision: 346626 URL: https://svnweb.freebsd.org/changeset/base/346626 Log: Fix typo: `Plen` should be `plen` MFC after: 1 month MFC with: r346617 Reported by: pylint -E Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 05:47:09 2019 (r346625) +++ head/tests/sys/opencrypto/cryptotest.py Wed Apr 24 05:49:48 2019 (r346626) @@ -307,7 +307,7 @@ def GenTestCase(cname): aad, tag) payload = data['Payload'].decode('hex') - Plen = int(data('Plen')) + plen = int(data('Plen')) payload = payload[:plen] self.assertEqual(r, payload, "Count " + data['Count'] + \ From owner-svn-src-head@freebsd.org Wed Apr 24 05:52:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14792158D632; Wed, 24 Apr 2019 05:52:25 +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 AE61F74B35; Wed, 24 Apr 2019 05:52:24 +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 A22A47EB1; Wed, 24 Apr 2019 05:52:24 +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 x3O5qOL7003935; Wed, 24 Apr 2019 05:52:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O5qO4P003934; Wed, 24 Apr 2019 05:52:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904240552.x3O5qO4P003934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 24 Apr 2019 05:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346627 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 346627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE61F74B35 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.967,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 05:52:25 -0000 Author: ngie Date: Wed Apr 24 05:52:24 2019 New Revision: 346627 URL: https://svnweb.freebsd.org/changeset/base/346627 Log: Use `range` instead of `xrange` `xrange` is a pre-python 2.x compatible idiom. Use `range` instead. The values being iterated over are sufficiently small that using range on python 2.x won't be a noticeable issue. MFC after: 2 months Modified: head/tests/sys/opencrypto/cryptodev.py Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 05:49:48 2019 (r346626) +++ head/tests/sys/opencrypto/cryptodev.py Wed Apr 24 05:52:24 2019 (r346627) @@ -258,7 +258,7 @@ class Crypto: return s, tag.tostring() def perftest(self, op, size, timeo=3): - inp = array.array('B', (random.randint(0, 255) for x in xrange(size))) + inp = array.array('B', (random.randint(0, 255) for x in range(size))) out = array.array('B', inp) # prep ioctl @@ -273,7 +273,7 @@ class Crypto: if self._maclen is not None: m = array.array('B', [0] * self._maclen) cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16))) + ivbuf = array.array('B', (random.randint(0, 255) for x in range(16))) cop.iv = ivbuf.buffer_info()[0] exit = [ False ] @@ -503,7 +503,7 @@ if __name__ == '__main__': except IOError: print('aesni0 not found') - for i in xrange(10): + for i in range(10): try: name = Crypto.getcridname(i) print('%2d: %r' % (i, repr(name))) @@ -637,7 +637,7 @@ if __name__ == '__main__': print('tag:', tag.encode('hex')) assert enctag == tag elif False: - for i in xrange(100000): + for i in range(100000): c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')) data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex') ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex') From owner-svn-src-head@freebsd.org Wed Apr 24 06:25:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AB6158E202; Wed, 24 Apr 2019 06:25:22 +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 3AA8175E34; Wed, 24 Apr 2019 06:25:22 +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 10E8383D6; Wed, 24 Apr 2019 06:25:22 +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 x3O6PLBs020499; Wed, 24 Apr 2019 06:25:21 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O6PLSK020496; Wed, 24 Apr 2019 06:25:21 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201904240625.x3O6PLSK020496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 24 Apr 2019 06:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346628 - head/usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/usr.sbin/pkg X-SVN-Commit-Revision: 346628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AA8175E34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 06:25:22 -0000 Author: cperciva Date: Wed Apr 24 06:25:21 2019 New Revision: 346628 URL: https://svnweb.freebsd.org/changeset/base/346628 Log: Keep two versions of the FreeBSD.conf pkg configuration file; one which points at the "latest" branch and one which points at the "quarterly" branch. Install the "latest" version unless overridden via the newly added PKGCONFBRANCH variable. This does not change user-visible behaviour (assuming said vairable is not set) but will make it easier to change the defaults in the future -- on stable branches we will want "latest" on x86 but "quarterly" elsewhere. Discussed with: gjb MFC after: 3 days X-MFC: After MFCing this I'll make a direct commit to stable/* to switch non-x86 architectures to "quarterly". Added: head/usr.sbin/pkg/FreeBSD.conf.latest - copied unchanged from r346627, head/usr.sbin/pkg/FreeBSD.conf head/usr.sbin/pkg/FreeBSD.conf.quarterly - copied, changed from r346627, head/usr.sbin/pkg/FreeBSD.conf Deleted: head/usr.sbin/pkg/FreeBSD.conf Modified: head/usr.sbin/pkg/Makefile Copied: head/usr.sbin/pkg/FreeBSD.conf.latest (from r346627, head/usr.sbin/pkg/FreeBSD.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pkg/FreeBSD.conf.latest Wed Apr 24 06:25:21 2019 (r346628, copy of r346627, head/usr.sbin/pkg/FreeBSD.conf) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +# To disable this repository, instead of modifying or removing this file, +# create a /usr/local/etc/pkg/repos/FreeBSD.conf file: +# +# mkdir -p /usr/local/etc/pkg/repos +# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf +# + +FreeBSD: { + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} Copied and modified: head/usr.sbin/pkg/FreeBSD.conf.quarterly (from r346627, head/usr.sbin/pkg/FreeBSD.conf) ============================================================================== --- head/usr.sbin/pkg/FreeBSD.conf Wed Apr 24 05:52:24 2019 (r346627, copy source) +++ head/usr.sbin/pkg/FreeBSD.conf.quarterly Wed Apr 24 06:25:21 2019 (r346628) @@ -8,7 +8,7 @@ # FreeBSD: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Wed Apr 24 05:52:24 2019 (r346627) +++ head/usr.sbin/pkg/Makefile Wed Apr 24 06:25:21 2019 (r346628) @@ -1,6 +1,8 @@ # $FreeBSD$ -CONFS= FreeBSD.conf +PKGCONFBRANCH?= latest +CONFS= FreeBSD.conf.${PKGCONFBRANCH} +CONFSNAME= FreeBSD.conf CONFSDIR= /etc/pkg CONFSMODE= 644 PROG= pkg From owner-svn-src-head@freebsd.org Wed Apr 24 09:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C531592238; Wed, 24 Apr 2019 09:05:47 +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 7FC268354F; Wed, 24 Apr 2019 09:05:47 +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 5330E9F53; Wed, 24 Apr 2019 09:05:47 +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 x3O95l5v004752; Wed, 24 Apr 2019 09:05:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3O95jno004742; Wed, 24 Apr 2019 09:05:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904240905.x3O95jno004742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 24 Apr 2019 09:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346630 - in head: sbin/ifconfig share/man/man4 sys/modules/if_gre sys/net sys/netinet sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man4 sys/modules/if_gre sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 346630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FC268354F 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 09:05:48 -0000 Author: ae Date: Wed Apr 24 09:05:45 2019 New Revision: 346630 URL: https://svnweb.freebsd.org/changeset/base/346630 Log: Add GRE-in-UDP encapsulation support as defined in RFC8086. This GRE-in-UDP encapsulation allows the UDP source port field to be used as an entropy field for load-balancing of GRE traffic in transit networks. Also most of multiqueue network cards are able distribute incoming UDP datagrams to different NIC queues, while very little are able do this for GRE packets. When an administrator enables UDP encapsulation with command `ifconfig gre0 udpencap`, the driver creates kernel socket, that binds to tunnel source address and after udp_set_kernel_tunneling() starts receiving of all UDP packets destined to 4754 port. Each kernel socket maintains list of tunnels with different destination addresses. Thus when several tunnels use the same source address, they all handled by single socket. The IP[V6]_BINDANY socket option is used to be able bind socket to source address even if it is not yet available in the system. This may happen on system boot, when gre(4) interface is created before source address become available. The encapsulation and sending of packets is done directly from gre(4) into ip[6]_output() without using sockets. Reviewed by: eugen MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19921 Modified: head/sbin/ifconfig/ifgre.c head/share/man/man4/gre.4 head/sys/modules/if_gre/Makefile head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/ip_gre.c head/sys/netinet6/ip6_gre.c Modified: head/sbin/ifconfig/ifgre.c ============================================================================== --- head/sbin/ifconfig/ifgre.c Wed Apr 24 06:41:52 2019 (r346629) +++ head/sbin/ifconfig/ifgre.c Wed Apr 24 09:05:45 2019 (r346630) @@ -44,15 +44,16 @@ __FBSDID("$FreeBSD$"); #include "ifconfig.h" -#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ" +#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ\03UDPENCAP" static void gre_status(int s); static void gre_status(int s) { - uint32_t opts = 0; + uint32_t opts, port; + opts = 0; ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GREGKEY, &ifr) == 0) if (opts != 0) @@ -60,6 +61,11 @@ gre_status(int s) opts = 0; if (ioctl(s, GREGOPTS, &ifr) != 0 || opts == 0) return; + + port = 0; + ifr.ifr_data = (caddr_t)&port; + if (ioctl(s, GREGPORT, &ifr) == 0 && port != 0) + printf("\tudpport: %u\n", port); printb("\toptions", opts, GREBITS); putchar('\n'); } @@ -77,6 +83,18 @@ setifgrekey(const char *val, int dummy __unused, int s } static void +setifgreport(const char *val, int dummy __unused, int s, + const struct afswtch *afp) +{ + uint32_t udpport = strtol(val, NULL, 0); + + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + ifr.ifr_data = (caddr_t)&udpport; + if (ioctl(s, GRESPORT, (caddr_t)&ifr) < 0) + warn("ioctl (set udpport)"); +} + +static void setifgreopts(const char *val, int d, int s, const struct afswtch *afp) { uint32_t opts; @@ -101,10 +119,13 @@ setifgreopts(const char *val, int d, int s, const stru static struct cmd gre_cmds[] = { DEF_CMD_ARG("grekey", setifgrekey), + DEF_CMD_ARG("udpport", setifgreport), DEF_CMD("enable_csum", GRE_ENABLE_CSUM, setifgreopts), DEF_CMD("-enable_csum",-GRE_ENABLE_CSUM,setifgreopts), DEF_CMD("enable_seq", GRE_ENABLE_SEQ, setifgreopts), DEF_CMD("-enable_seq",-GRE_ENABLE_SEQ, setifgreopts), + DEF_CMD("udpencap", GRE_UDPENCAP, setifgreopts), + DEF_CMD("-udpencap",-GRE_UDPENCAP, setifgreopts), }; static struct afswtch af_gre = { .af_name = "af_gre", Modified: head/share/man/man4/gre.4 ============================================================================== --- head/share/man/man4/gre.4 Wed Apr 24 06:41:52 2019 (r346629) +++ head/share/man/man4/gre.4 Wed Apr 24 09:05:45 2019 (r346630) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2015 +.Dd April 24, 2019 .Dt GRE 4 .Os .Sh NAME @@ -89,7 +89,45 @@ A value of 0 disables the key option. Enables checksum calculation for outgoing packets. .It Ar enable_seq Enables use of sequence number field in the GRE header for outgoing packets. +.It Ar udpencap +Enables UDP-in-GRE encapsulation (see the +.Sx GRE-IN-UDP ENCAPSULATION +Section below for details). +.It Ar udpport +Set the source UDP port for outgoing packets. +A value of 0 disables the persistence of source UDP port for outgoing packets. +See the +.Sx GRE-IN-UDP ENCAPSULATION +Section below for details. .El +.Sh GRE-IN-UDP ENCAPSULATION +The +.Nm +supports GRE in UDP encapsulation as defined in RFC 8086. +A GRE in UDP tunnel offers the possibility of better performance for +load-balancing GRE traffic in transit networks. +Encapsulating GRE in UDP enables use of the UDP source port to provide +entropy to ECMP hashing. +.Pp +The GRE in UDP tunnel uses single value 4754 as UDP destination port. +The UDP source port contains a 14-bit entropy value that is generated +by the encapsulator to identify a flow for the encapsulated packet. +The +.Ar udpport +option can be used to disable this behaviour and use single source UDP +port value. +The value of +.Ar udpport +should be within the ephemeral port range, i.e., 49152 to 65535 by default. +.Pp +Note that a GRE in UDP tunnel is unidirectional; the tunnel traffic is not +expected to be returned back to the UDP source port values used to generate +entropy. +This may impact NAPT (Network Address Port Translator) middleboxes. +If such tunnels are expected to be used on a path with a middlebox, +the tunnel can be configured either to disable use of the UDP source port +for entropy or to enable middleboxes to pass packets with UDP source port +entropy. .Sh EXAMPLES .Bd -literal 192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.* Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Wed Apr 24 06:41:52 2019 (r346629) +++ head/sys/modules/if_gre/Makefile Wed Apr 24 09:05:45 2019 (r346630) @@ -5,7 +5,7 @@ SYSDIR?=${SRCTOP}/sys .include "${SYSDIR}/conf/kern.opts.mk" KMOD= if_gre -SRCS= if_gre.c opt_inet.h opt_inet6.h +SRCS= if_gre.c opt_inet.h opt_inet6.h opt_rss.h SRCS.INET= ip_gre.c SRCS.INET6= ip6_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Wed Apr 24 06:41:52 2019 (r346629) +++ head/sys/net/if_gre.c Wed Apr 24 09:05:45 2019 (r346630) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #include #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,19 +67,27 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef INET #include #include #include +#ifdef RSS +#include #endif +#endif #ifdef INET6 #include #include #include +#ifdef RSS +#include #endif +#endif #include +#include #include #include @@ -151,6 +161,7 @@ vnet_gre_uninit(const void *unused __unused) #ifdef INET6 in6_gre_uninit(); #endif + /* XXX: epoch_call drain */ } VNET_SYSUNINIT(vnet_gre_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_gre_uninit, NULL); @@ -266,6 +277,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GRESKEY: case GRESOPTS: + case GRESPORT: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; if ((error = copyin(ifr_data_get_ptr(ifr), &opt, @@ -281,23 +293,45 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (sc->gre_options == opt) break; + } else if (cmd == GRESPORT) { + if (opt != 0 && (opt < V_ipport_hifirstauto || + opt > V_ipport_hilastauto)) { + error = EINVAL; + break; + } + if (sc->gre_port == opt) + break; + if ((sc->gre_options & GRE_UDPENCAP) == 0) { + /* + * UDP encapsulation is not enabled, thus + * there is no need to reattach softc. + */ + sc->gre_port = opt; + break; + } } switch (sc->gre_family) { #ifdef INET case AF_INET: - in_gre_setopts(sc, cmd, opt); + error = in_gre_setopts(sc, cmd, opt); break; #endif #ifdef INET6 case AF_INET6: - in6_gre_setopts(sc, cmd, opt); + error = in6_gre_setopts(sc, cmd, opt); break; #endif default: + /* + * Tunnel is not yet configured. + * We can just change any parameters. + */ if (cmd == GRESKEY) sc->gre_key = opt; - else + if (cmd == GRESOPTS) sc->gre_options = opt; + if (cmd == GRESPORT) + sc->gre_port = opt; break; } /* @@ -313,6 +347,10 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr), sizeof(sc->gre_options)); break; + case GREGPORT: + error = copyout(&sc->gre_port, ifr_data_get_ptr(ifr), + sizeof(sc->gre_port)); + break; default: error = EINVAL; break; @@ -337,6 +375,7 @@ end: static void gre_delete_tunnel(struct gre_softc *sc) { + struct gre_socket *gs; sx_assert(&gre_ioctl_sx, SA_XLOCKED); if (sc->gre_family != 0) { @@ -346,6 +385,16 @@ gre_delete_tunnel(struct gre_softc *sc) free(sc->gre_hdr, M_GRE); sc->gre_family = 0; } + /* + * If this Tunnel was the last one that could use UDP socket, + * we should unlink socket from hash table and close it. + */ + if ((gs = sc->gre_so) != NULL && CK_LIST_EMPTY(&gs->list)) { + CK_LIST_REMOVE(gs, chain); + soclose(gs->so); + epoch_call(net_epoch_preempt, &gs->epoch_ctx, gre_sofree); + sc->gre_so = NULL; + } GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN); } @@ -372,8 +421,39 @@ gre_hashdestroy(struct gre_list *hash) } void -gre_updatehdr(struct gre_softc *sc, struct grehdr *gh) +gre_sofree(epoch_context_t ctx) { + struct gre_socket *gs; + + gs = __containerof(ctx, struct gre_socket, epoch_ctx); + free(gs, M_GRE); +} + +static __inline uint16_t +gre_cksum_add(uint16_t sum, uint16_t a) +{ + uint16_t res; + + res = sum + a; + return (res + (res < a)); +} + +void +gre_update_udphdr(struct gre_softc *sc, struct udphdr *udp, uint16_t csum) +{ + + sx_assert(&gre_ioctl_sx, SA_XLOCKED); + MPASS(sc->gre_options & GRE_UDPENCAP); + + udp->uh_dport = htons(GRE_UDPPORT); + udp->uh_sport = htons(sc->gre_port); + udp->uh_sum = csum; + udp->uh_ulen = 0; +} + +void +gre_update_hdr(struct gre_softc *sc, struct grehdr *gh) +{ uint32_t *opts; uint16_t flags; @@ -539,6 +619,52 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) *opts = htonl(seq); } +static uint32_t +gre_flowid(struct gre_softc *sc, struct mbuf *m, uint32_t af) +{ + uint32_t flowid; + + if ((sc->gre_options & GRE_UDPENCAP) == 0 || sc->gre_port != 0) + return (0); +#ifndef RSS + switch (af) { +#ifdef INET + case AF_INET: + flowid = mtod(m, struct ip *)->ip_src.s_addr ^ + mtod(m, struct ip *)->ip_dst.s_addr; + break; +#endif +#ifdef INET6 + case AF_INET6: + flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ + mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; + break; +#endif + default: + flowid = 0; + } +#else /* RSS */ + switch (af) { +#ifdef INET + case AF_INET: + flowid = rss_hash_ip4_2tuple(mtod(m, struct ip *)->ip_src, + mtod(m, struct ip *)->ip_dst); + break; +#endif +#ifdef INET6 + case AF_INET6: + flowid = rss_hash_ip6_2tuple( + &mtod(m, struct ip6_hdr *)->ip6_src, + &mtod(m, struct ip6_hdr *)->ip6_dst); + break; +#endif + default: + flowid = 0; + } +#endif + return (flowid); +} + #define MTAG_GRE 1307983903 static int gre_transmit(struct ifnet *ifp, struct mbuf *m) @@ -546,7 +672,8 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; - uint32_t af; + struct udphdr *uh; + uint32_t af, flowid; int error, len; uint16_t proto; @@ -573,6 +700,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) af = m->m_pkthdr.csum_data; BPF_MTAP2(ifp, &af, sizeof(af), m); m->m_flags &= ~(M_BCAST|M_MCAST); + flowid = gre_flowid(sc, m, af); M_SETFIB(m, sc->gre_fibnum); M_PREPEND(m, sc->gre_hlen, M_NOWAIT); if (m == NULL) { @@ -614,6 +742,19 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) error = ENETDOWN; goto drop; } + if (sc->gre_options & GRE_UDPENCAP) { + uh = (struct udphdr *)mtodo(m, len); + uh->uh_sport |= htons(V_ipport_hifirstauto) | + (flowid >> 16) | (flowid & 0xFFFF); + uh->uh_sport = htons(ntohs(uh->uh_sport) % + V_ipport_hilastauto); + uh->uh_ulen = htons(m->m_pkthdr.len - len); + uh->uh_sum = gre_cksum_add(uh->uh_sum, + htons(m->m_pkthdr.len - len + IPPROTO_UDP)); + m->m_pkthdr.csum_flags = sc->gre_csumflags; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + len += sizeof(struct udphdr); + } gh = (struct grehdr *)mtodo(m, len); gh->gre_proto = proto; if (sc->gre_options & GRE_ENABLE_SEQ) @@ -631,7 +772,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) #endif #ifdef INET6 case AF_INET6: - error = in6_gre_output(m, af, sc->gre_hlen); + error = in6_gre_output(m, af, sc->gre_hlen, flowid); break; #endif default: Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Wed Apr 24 06:41:52 2019 (r346629) +++ head/sys/net/if_gre.h Wed Apr 24 09:05:45 2019 (r346630) @@ -53,15 +53,36 @@ struct greip { struct ip gi_ip; struct grehdr gi_gre; } __packed; -#endif +struct greudp { + struct ip gi_ip; + struct udphdr gi_udp; + struct grehdr gi_gre; +} __packed; +#endif /* INET */ + #ifdef INET6 struct greip6 { struct ip6_hdr gi6_ip6; struct grehdr gi6_gre; } __packed; -#endif +struct greudp6 { + struct ip6_hdr gi6_ip6; + struct udphdr gi6_udp; + struct grehdr gi6_gre; +} __packed; +#endif /* INET6 */ + +CK_LIST_HEAD(gre_list, gre_softc); +CK_LIST_HEAD(gre_sockets, gre_socket); +struct gre_socket { + struct socket *so; + struct gre_list list; + CK_LIST_ENTRY(gre_socket) chain; + struct epoch_context epoch_ctx; +}; + struct gre_softc { struct ifnet *gre_ifp; int gre_family; /* AF of delivery header */ @@ -69,22 +90,26 @@ struct gre_softc { uint32_t gre_oseq; uint32_t gre_key; uint32_t gre_options; + uint32_t gre_csumflags; + uint32_t gre_port; u_int gre_fibnum; u_int gre_hlen; /* header size */ union { void *hdr; #ifdef INET - struct greip *gihdr; + struct greip *iphdr; + struct greudp *udphdr; #endif #ifdef INET6 - struct greip6 *gi6hdr; + struct greip6 *ip6hdr; + struct greudp6 *udp6hdr; #endif } gre_uhdr; + struct gre_socket *gre_so; CK_LIST_ENTRY(gre_softc) chain; CK_LIST_ENTRY(gre_softc) srchash; }; -CK_LIST_HEAD(gre_list, gre_softc); MALLOC_DECLARE(M_GRE); #ifndef GRE_HASH_SIZE @@ -98,28 +123,35 @@ MALLOC_DECLARE(M_GRE); #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) #define gre_hdr gre_uhdr.hdr -#define gre_gihdr gre_uhdr.gihdr -#define gre_gi6hdr gre_uhdr.gi6hdr -#define gre_oip gre_gihdr->gi_ip -#define gre_oip6 gre_gi6hdr->gi6_ip6 +#define gre_iphdr gre_uhdr.iphdr +#define gre_ip6hdr gre_uhdr.ip6hdr +#define gre_udphdr gre_uhdr.udphdr +#define gre_udp6hdr gre_uhdr.udp6hdr +#define gre_oip gre_iphdr->gi_ip +#define gre_udp gre_udphdr->gi_udp +#define gre_oip6 gre_ip6hdr->gi6_ip6 +#define gre_udp6 gre_udp6hdr->gi6_udp + struct gre_list *gre_hashinit(void); void gre_hashdestroy(struct gre_list *); int gre_input(struct mbuf *, int, int, void *); -void gre_updatehdr(struct gre_softc *, struct grehdr *); +void gre_update_hdr(struct gre_softc *, struct grehdr *); +void gre_update_udphdr(struct gre_softc *, struct udphdr *, uint16_t); +void gre_sofree(epoch_context_t); void in_gre_init(void); void in_gre_uninit(void); -void in_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in_gre_setopts(struct gre_softc *, u_long, uint32_t); int in_gre_ioctl(struct gre_softc *, u_long, caddr_t); int in_gre_output(struct mbuf *, int, int); void in6_gre_init(void); void in6_gre_uninit(void); -void in6_gre_setopts(struct gre_softc *, u_long, uint32_t); +int in6_gre_setopts(struct gre_softc *, u_long, uint32_t); int in6_gre_ioctl(struct gre_softc *, u_long, caddr_t); -int in6_gre_output(struct mbuf *, int, int); +int in6_gre_output(struct mbuf *, int, int, uint32_t); /* * CISCO uses special type for GRE tunnel created as part of WCCP * connection, while in fact those packets are just IPv4 encapsulated @@ -139,9 +171,15 @@ int in6_gre_output(struct mbuf *, int, int); #define GRESKEY _IOW('i', 108, struct ifreq) #define GREGOPTS _IOWR('i', 109, struct ifreq) #define GRESOPTS _IOW('i', 110, struct ifreq) +#define GREGPORT _IOWR('i', 111, struct ifreq) +#define GRESPORT _IOW('i', 112, struct ifreq) +/* GRE-in-UDP encapsulation destination port as defined in RFC8086 */ +#define GRE_UDPPORT 4754 + #define GRE_ENABLE_CSUM 0x0001 #define GRE_ENABLE_SEQ 0x0002 -#define GRE_OPTMASK (GRE_ENABLE_CSUM|GRE_ENABLE_SEQ) +#define GRE_UDPENCAP 0x0004 +#define GRE_OPTMASK (GRE_ENABLE_CSUM|GRE_ENABLE_SEQ|GRE_UDPENCAP) #endif /* _NET_IF_GRE_H_ */ Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Wed Apr 24 06:41:52 2019 (r346629) +++ head/sys/netinet/ip_gre.c Wed Apr 24 09:05:45 2019 (r346630) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,15 +59,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include +#include #ifdef INET6 #include #endif #include +#include #define GRE_TTL 30 VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; @@ -74,14 +79,22 @@ VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); +struct in_gre_socket { + struct gre_socket base; + in_addr_t addr; +}; +VNET_DEFINE_STATIC(struct gre_sockets *, ipv4_sockets) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv4_srchashtbl) = NULL; +#define V_ipv4_sockets VNET(ipv4_sockets) #define V_ipv4_hashtbl VNET(ipv4_hashtbl) #define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) #define GRE_SRCHASH(src) (V_ipv4_srchashtbl[\ fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) +#define GRE_SOCKHASH(src) (V_ipv4_sockets[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ (sc)->gre_oip.ip_dst.s_addr) @@ -94,17 +107,43 @@ in_gre_hashval(in_addr_t src, in_addr_t dst) return (fnv_32_buf(&dst, sizeof(dst), ret)); } +static struct gre_socket* +in_gre_lookup_socket(in_addr_t addr) +{ + struct gre_socket *gs; + struct in_gre_socket *s; + + CK_LIST_FOREACH(gs, &GRE_SOCKHASH(addr), chain) { + s = __containerof(gs, struct in_gre_socket, base); + if (s->addr == addr) + break; + } + return (gs); +} + static int -in_gre_checkdup(const struct gre_softc *sc, in_addr_t src, in_addr_t dst) +in_gre_checkdup(const struct gre_softc *sc, in_addr_t src, in_addr_t dst, + uint32_t opts) { + struct gre_list *head; struct gre_softc *tmp; + struct gre_socket *gs; if (sc->gre_family == AF_INET && sc->gre_oip.ip_src.s_addr == src && - sc->gre_oip.ip_dst.s_addr == dst) + sc->gre_oip.ip_dst.s_addr == dst && + (sc->gre_options & GRE_UDPENCAP) == (opts & GRE_UDPENCAP)) return (EEXIST); - CK_LIST_FOREACH(tmp, &GRE_HASH(src, dst), chain) { + if (opts & GRE_UDPENCAP) { + gs = in_gre_lookup_socket(src); + if (gs == NULL) + return (0); + head = &gs->list; + } else + head = &GRE_HASH(src, dst); + + CK_LIST_FOREACH(tmp, head, chain) { if (tmp == sc) continue; if (tmp->gre_oip.ip_src.s_addr == src && @@ -181,35 +220,228 @@ in_gre_srcaddr(void *arg __unused, const struct sockad } static void +in_gre_udp_input(struct mbuf *m, int off, struct inpcb *inp, + const struct sockaddr *sa, void *ctx) +{ + struct epoch_tracker et; + struct gre_socket *gs; + struct gre_softc *sc; + in_addr_t dst; + + NET_EPOCH_ENTER(et); + /* + * udp_append() holds reference to inp, it is safe to check + * inp_flags2 without INP_RLOCK(). + * If socket was closed before we have entered NET_EPOCH section, + * INP_FREED flag should be set. Otherwise it should be safe to + * make access to ctx data, because gre_so will be freed by + * gre_sofree() via epoch_call(). + */ + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + NET_EPOCH_EXIT(et); + m_freem(m); + return; + } + + gs = (struct gre_socket *)ctx; + dst = ((const struct sockaddr_in *)sa)->sin_addr.s_addr; + CK_LIST_FOREACH(sc, &gs->list, chain) { + if (sc->gre_oip.ip_dst.s_addr == dst) + break; + } + if (sc != NULL && (GRE2IFP(sc)->if_flags & IFF_UP) != 0){ + gre_input(m, off + sizeof(struct udphdr), IPPROTO_UDP, sc); + NET_EPOCH_EXIT(et); + return; + } + m_freem(m); + NET_EPOCH_EXIT(et); +} + +static int +in_gre_setup_socket(struct gre_softc *sc) +{ + struct sockopt sopt; + struct sockaddr_in sin; + struct in_gre_socket *s; + struct gre_socket *gs; + in_addr_t addr; + int error, value; + + /* + * NOTE: we are protected with gre_ioctl_sx lock. + * + * First check that socket is already configured. + * If so, check that source addres was not changed. + * If address is different, check that there are no other tunnels + * and close socket. + */ + addr = sc->gre_oip.ip_src.s_addr; + gs = sc->gre_so; + if (gs != NULL) { + s = __containerof(gs, struct in_gre_socket, base); + if (s->addr != addr) { + if (CK_LIST_EMPTY(&gs->list)) { + CK_LIST_REMOVE(gs, chain); + soclose(gs->so); + epoch_call(net_epoch_preempt, &gs->epoch_ctx, + gre_sofree); + } + gs = sc->gre_so = NULL; + } + } + + if (gs == NULL) { + /* + * Check that socket for given address is already + * configured. + */ + gs = in_gre_lookup_socket(addr); + if (gs == NULL) { + s = malloc(sizeof(*s), M_GRE, M_WAITOK | M_ZERO); + s->addr = addr; + gs = &s->base; + + error = socreate(sc->gre_family, &gs->so, + SOCK_DGRAM, IPPROTO_UDP, curthread->td_ucred, + curthread); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot create socket: %d\n", error); + free(s, M_GRE); + return (error); + } + + error = udp_set_kernel_tunneling(gs->so, + in_gre_udp_input, NULL, gs); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot set UDP tunneling: %d\n", error); + goto fail; + } + + memset(&sopt, 0, sizeof(sopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = IPPROTO_IP; + sopt.sopt_name = IP_BINDANY; + sopt.sopt_val = &value; + sopt.sopt_valsize = sizeof(value); + value = 1; + error = sosetopt(gs->so, &sopt); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot set IP_BINDANY opt: %d\n", error); + goto fail; + } + + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = addr; + sin.sin_port = htons(GRE_UDPPORT); + error = sobind(gs->so, (struct sockaddr *)&sin, + curthread); + if (error != 0) { + if_printf(GRE2IFP(sc), + "cannot bind socket: %d\n", error); + goto fail; + } + /* Add socket to the chain */ + CK_LIST_INSERT_HEAD(&GRE_SOCKHASH(addr), gs, chain); + } + } + + /* Add softc to the socket's list */ + CK_LIST_INSERT_HEAD(&gs->list, sc, chain); + sc->gre_so = gs; + return (0); +fail: + soclose(gs->so); + free(s, M_GRE); + return (error); +} + +static int in_gre_attach(struct gre_softc *sc) { + struct grehdr *gh; + int error; - sc->gre_hlen = sizeof(struct greip); + if (sc->gre_options & GRE_UDPENCAP) { + sc->gre_csumflags = CSUM_UDP; + sc->gre_hlen = sizeof(struct greudp); + sc->gre_oip.ip_p = IPPROTO_UDP; + gh = &sc->gre_udphdr->gi_gre; + gre_update_udphdr(sc, &sc->gre_udp, + in_pseudo(sc->gre_oip.ip_src.s_addr, + sc->gre_oip.ip_dst.s_addr, 0)); + } else { + sc->gre_hlen = sizeof(struct greip); + sc->gre_oip.ip_p = IPPROTO_GRE; + gh = &sc->gre_iphdr->gi_gre; + } sc->gre_oip.ip_v = IPVERSION; sc->gre_oip.ip_hl = sizeof(struct ip) >> 2; - sc->gre_oip.ip_p = IPPROTO_GRE; - gre_updatehdr(sc, &sc->gre_gihdr->gi_gre); - CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + gre_update_hdr(sc, gh); + + /* + * If we return error, this means that sc is not linked, + * and caller should reset gre_family and free(sc->gre_hdr). + */ + if (sc->gre_options & GRE_UDPENCAP) { + error = in_gre_setup_socket(sc); + if (error != 0) + return (error); + } else + CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), sc, srchash); + + /* Set IFF_DRV_RUNNING if interface is ready */ + in_gre_set_running(sc); + return (0); } -void +int in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value) { + int error; - MPASS(cmd == GRESKEY || cmd == GRESOPTS); - /* NOTE: we are protected with gre_ioctl_sx lock */ + MPASS(cmd == GRESKEY || cmd == GRESOPTS || cmd == GRESPORT); MPASS(sc->gre_family == AF_INET); + + /* + * If we are going to change encapsulation protocol, do check + * for duplicate tunnels. Return EEXIST here to do not confuse + * user. + */ + if (cmd == GRESOPTS && + (sc->gre_options & GRE_UDPENCAP) != (value & GRE_UDPENCAP) && + in_gre_checkdup(sc, sc->gre_oip.ip_src.s_addr, + sc->gre_oip.ip_dst.s_addr, value) == EADDRNOTAVAIL) + return (EEXIST); + CK_LIST_REMOVE(sc, chain); CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); - if (cmd == GRESKEY) + switch (cmd) { + case GRESKEY: sc->gre_key = value; - else + break; + case GRESOPTS: sc->gre_options = value; - in_gre_attach(sc); + break; + case GRESPORT: + sc->gre_port = value; + break; + } + error = in_gre_attach(sc); + if (error != 0) { + sc->gre_family = 0; + free(sc->gre_hdr, M_GRE); + } + return (error); } int @@ -241,9 +473,10 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gre_hashinit(); V_ipv4_srchashtbl = gre_hashinit(); + V_ipv4_sockets = (struct gre_sockets *)gre_hashinit(); } error = in_gre_checkdup(sc, src->sin_addr.s_addr, - dst->sin_addr.s_addr); + dst->sin_addr.s_addr, sc->gre_options); if (error == EADDRNOTAVAIL) break; if (error == EEXIST) { @@ -251,7 +484,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t error = 0; break; } - ip = malloc(sizeof(struct greip) + 3 * sizeof(uint32_t), + ip = malloc(sizeof(struct greudp) + 3 * sizeof(uint32_t), M_GRE, M_WAITOK | M_ZERO); ip->ip_src.s_addr = src->sin_addr.s_addr; ip->ip_dst.s_addr = dst->sin_addr.s_addr; @@ -267,8 +500,11 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t sc->gre_hdr = ip; sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; - in_gre_attach(sc); - in_gre_set_running(sc); + error = in_gre_attach(sc); + if (error != 0) { + sc->gre_family = 0; + free(sc->gre_hdr, M_GRE); + } break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -354,5 +590,6 @@ in_gre_uninit(void) V_ipv4_hashtbl = NULL; GRE_WAIT(); gre_hashdestroy(V_ipv4_srchashtbl); + gre_hashdestroy((struct gre_list *)V_ipv4_sockets); } } Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Wed Apr 24 06:41:52 2019 (r346629) +++ head/sys/netinet6/ip6_gre.c Wed Apr 24 09:05:45 2019 (r346630) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,8 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include +#include #include +#include +#include #include #include #include @@ -65,14 +70,22 @@ SYSCTL_DECL(_net_inet6_ip6); SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets"); +struct in6_gre_socket { + struct gre_socket base; + struct in6_addr addr; /* scope zone id is embedded */ +}; +VNET_DEFINE_STATIC(struct gre_sockets *, ipv6_sockets) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL; VNET_DEFINE_STATIC(struct gre_list *, ipv6_srchashtbl) = NULL; +#define V_ipv6_sockets VNET(ipv6_sockets) #define V_ipv6_hashtbl VNET(ipv6_hashtbl) #define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define GRE_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) #define GRE_SRCHASH(src) (V_ipv6_srchashtbl[\ fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) +#define GRE_SOCKHASH(src) (V_ipv6_sockets[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH(&(sc)->gre_oip6.ip6_src,\ &(sc)->gre_oip6.ip6_dst) @@ -85,18 +98,43 @@ in6_gre_hashval(const struct in6_addr *src, const stru return (fnv_32_buf(dst, sizeof(*dst), ret)); } +static struct gre_socket* +in6_gre_lookup_socket(const struct in6_addr *addr) +{ + struct gre_socket *gs; + struct in6_gre_socket *s; + + CK_LIST_FOREACH(gs, &GRE_SOCKHASH(addr), chain) { + s = __containerof(gs, struct in6_gre_socket, base); + if (IN6_ARE_ADDR_EQUAL(&s->addr, addr)) + break; + } + return (gs); +} + static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 24 13:15:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4700515988C3; Wed, 24 Apr 2019 13:15:57 +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 DE1048C196; Wed, 24 Apr 2019 13:15:56 +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 B2EE0CB79; Wed, 24 Apr 2019 13:15:56 +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 x3ODFuNI037123; Wed, 24 Apr 2019 13:15:56 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ODFuOr037122; Wed, 24 Apr 2019 13:15:56 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904241315.x3ODFuOr037122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Apr 2019 13:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346631 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE1048C196 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 13:15:57 -0000 Author: bde Date: Wed Apr 24 13:15:56 2019 New Revision: 346631 URL: https://svnweb.freebsd.org/changeset/base/346631 Log: Fix some races and screeen clearing in VGLEnd(). The mouse signal SIGUSR2 was not turned off for normal termination and in some other cases. Thus mouse signals arriving after the frame buffer was unmapped always caused fatal traps. The fatal traps occurred about 1 time in 5 if the mouse was wiggled while vgl is ending. The screen switch signal SIGUSR1 was turned off after clearing the flag that it sets. Unlike the mouse signal, this signal is handled synchronously, but VGLEnd() does screen clearing which does the synchronous handling. This race is harder to lose. I think it can get vgl into deadlocked state (waiting in the screen switch handler with SIGUSR1 to leave that state already turned off). Turn off the mouse cursor before clearing the screen in VGLEnd(). Otherwise, clearing is careful to not clear the mouse cursor. Undrawing an active mouse cursor uses a lot of state, so is dangerous for abnormal termination, but so is clearing. Clearing is slow and is usually not needed, since the kernel also does it (not quite right). Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Wed Apr 24 09:05:45 2019 (r346630) +++ head/lib/libvgl/main.c Wed Apr 24 13:15:56 2019 (r346631) @@ -73,11 +73,11 @@ struct vt_mode smode; if (!VGLInitDone) return; - VGLInitDone = 0; + signal(SIGUSR1, SIG_IGN); + signal(SIGUSR2, SIG_IGN); VGLSwitchPending = 0; VGLAbortPending = 0; - - signal(SIGUSR1, SIG_IGN); + VGLMousePointerHide(); if (VGLMem != MAP_FAILED) { VGLClear(VGLDisplay, 0); From owner-svn-src-head@freebsd.org Wed Apr 24 13:32:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5351598D4F; Wed, 24 Apr 2019 13:32:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 782178C911; Wed, 24 Apr 2019 13:32:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5381ACDA6; Wed, 24 Apr 2019 13:32:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ODW5dq047348; Wed, 24 Apr 2019 13:32:05 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ODW5LJ047347; Wed, 24 Apr 2019 13:32:05 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201904241332.x3ODW5LJ047347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Wed, 24 Apr 2019 13:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346632 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 782178C911 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.967,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 13:32:06 -0000 Author: gallatin Date: Wed Apr 24 13:32:04 2019 New Revision: 346632 URL: https://svnweb.freebsd.org/changeset/base/346632 Log: iflib: Add pfil hooks As with mlx5en, the idea is to drop unwanted traffic as early in receive as possible, before mbufs are allocated and anything is passed up the stack. This can save considerable CPU time when a machine is under a flooding style DOS attack. The major change here is to remove the unneeded abstraction where callers of rxd_frag_to_sd() get back a pointer to the mbuf ring, and are responsible for NULL'ing that mbuf themselves. Now this happens directly in rxd_frag_to_sd(), and it returns an mbuf. This allows us to use the decision (and potentially mbuf) returned by the pfil hooks. The driver can now recycle mbufs to avoid re-allocation when packets are dropped. Reviewed by: marius (shurd and erj also provided feedback) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19645 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Apr 24 13:15:56 2019 (r346631) +++ head/sys/net/iflib.c Wed Apr 24 13:32:04 2019 (r346632) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -432,6 +433,7 @@ struct iflib_rxq { if_ctx_t ifr_ctx; iflib_fl_t ifr_fl; uint64_t ifr_rx_irq; + struct pfil_head *pfil; uint16_t ifr_id; uint8_t ifr_lro_enabled; uint8_t ifr_nfl; @@ -451,7 +453,6 @@ struct iflib_rxq { typedef struct if_rxsd { caddr_t *ifsd_cl; - struct mbuf **ifsd_m; iflib_fl_t ifsd_fl; qidx_t ifsd_cidx; } *if_rxsd_t; @@ -652,7 +653,6 @@ static int iflib_fast_intrs; static int iflib_rx_unavail; static int iflib_rx_ctx_inactive; static int iflib_rx_if_input; -static int iflib_rx_mbuf_null; static int iflib_rxd_flush; static int iflib_verbose_debug; @@ -669,8 +669,6 @@ SYSCTL_INT(_net_iflib, OID_AUTO, rx_ctx_inactive, CTLF &iflib_rx_ctx_inactive, 0, "# times rxeof called with inactive context"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_if_input, CTLFLAG_RD, &iflib_rx_if_input, 0, "# times rxeof called if_input"); -SYSCTL_INT(_net_iflib, OID_AUTO, rx_mbuf_null, CTLFLAG_RD, - &iflib_rx_mbuf_null, 0, "# times rxeof got null mbuf"); SYSCTL_INT(_net_iflib, OID_AUTO, rxd_flush, CTLFLAG_RD, &iflib_rxd_flush, 0, "# times rxd_flush called"); SYSCTL_INT(_net_iflib, OID_AUTO, verbose_debug, CTLFLAG_RW, @@ -689,7 +687,7 @@ iflib_debug_reset(void) iflib_task_fn_rxs = iflib_rx_intr_enables = iflib_fast_intrs = iflib_rx_unavail = iflib_rx_ctx_inactive = iflib_rx_if_input = - iflib_rx_mbuf_null = iflib_rxd_flush = 0; + iflib_rxd_flush = 0; } #else @@ -2002,11 +2000,12 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun bus_dmamap_sync(fl->ifl_buf_tag, sd_map[frag_idx], BUS_DMASYNC_PREREAD); - MPASS(sd_m[frag_idx] == NULL); - if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { - break; + if (sd_m[frag_idx] == NULL) { + if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { + break; + } + sd_m[frag_idx] = m; } - sd_m[frag_idx] = m; bit_set(fl->ifl_rx_bitmap, frag_idx); #if MEMORY_LOGGING fl->ifl_m_enqueued++; @@ -2483,13 +2482,15 @@ prefetch_pkts(iflib_fl_t fl, int cidx) prefetch(fl->ifl_sds.ifsd_cl[(cidx + 4) & (nrxd-1)]); } -static void -rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int unload, if_rxsd_t sd) +static struct mbuf * +rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd, + int *pf_rv, if_rxd_info_t ri) { - int flid, cidx; bus_dmamap_t map; iflib_fl_t fl; - int next; + caddr_t payload; + struct mbuf *m; + int flid, cidx, len, next; map = NULL; flid = irf->irf_flid; @@ -2497,7 +2498,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int fl = &rxq->ifr_fl[flid]; sd->ifsd_fl = fl; sd->ifsd_cidx = cidx; - sd->ifsd_m = &fl->ifl_sds.ifsd_m[cidx]; + m = fl->ifl_sds.ifsd_m[cidx]; sd->ifsd_cl = &fl->ifl_sds.ifsd_cl[cidx]; fl->ifl_credits--; #if MEMORY_LOGGING @@ -2513,39 +2514,89 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int /* not valid assert if bxe really does SGE from non-contiguous elements */ MPASS(fl->ifl_cidx == cidx); bus_dmamap_sync(fl->ifl_buf_tag, map, BUS_DMASYNC_POSTREAD); + + if (rxq->pfil != NULL && PFIL_HOOKED_IN(rxq->pfil) && pf_rv != NULL) { + payload = *sd->ifsd_cl; + payload += ri->iri_pad; + len = ri->iri_len - ri->iri_pad; + *pf_rv = pfil_run_hooks(rxq->pfil, payload, ri->iri_ifp, + len | PFIL_MEMPTR | PFIL_IN, NULL); + switch (*pf_rv) { + case PFIL_DROPPED: + case PFIL_CONSUMED: + /* + * The filter ate it. Everything is recycled. + */ + m = NULL; + unload = 0; + break; + case PFIL_REALLOCED: + /* + * The filter copied it. Everything is recycled. + */ + m = pfil_mem2mbuf(payload); + unload = 0; + break; + case PFIL_PASS: + /* + * Filter said it was OK, so receive like + * normal + */ + fl->ifl_sds.ifsd_m[cidx] = NULL; + break; + default: + MPASS(0); + } + } else { + fl->ifl_sds.ifsd_m[cidx] = NULL; + *pf_rv = PFIL_PASS; + } + if (unload) bus_dmamap_unload(fl->ifl_buf_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); if (__predict_false(fl->ifl_cidx == 0)) fl->ifl_gen = 0; bit_clear(fl->ifl_rx_bitmap, cidx); + return (m); } static struct mbuf * -assemble_segments(iflib_rxq_t rxq, if_rxd_info_t ri, if_rxsd_t sd) +assemble_segments(iflib_rxq_t rxq, if_rxd_info_t ri, if_rxsd_t sd, int *pf_rv) { - int i, padlen , flags; struct mbuf *m, *mh, *mt; caddr_t cl; + int *pf_rv_ptr, flags, i, padlen; + bool consumed; i = 0; mh = NULL; + consumed = false; + *pf_rv = PFIL_PASS; + pf_rv_ptr = pf_rv; do { - rxd_frag_to_sd(rxq, &ri->iri_frags[i], TRUE, sd); + m = rxd_frag_to_sd(rxq, &ri->iri_frags[i], !consumed, sd, + pf_rv_ptr, ri); MPASS(*sd->ifsd_cl != NULL); - MPASS(*sd->ifsd_m != NULL); - /* Don't include zero-length frags */ - if (ri->iri_frags[i].irf_len == 0) { + /* + * Exclude zero-length frags & frags from + * packets the filter has consumed or dropped + */ + if (ri->iri_frags[i].irf_len == 0 || consumed || + *pf_rv == PFIL_CONSUMED || *pf_rv == PFIL_DROPPED) { + if (mh == NULL) { + /* everything saved here */ + consumed = true; + pf_rv_ptr = NULL; + continue; + } /* XXX we can save the cluster here, but not the mbuf */ - m_init(*sd->ifsd_m, M_NOWAIT, MT_DATA, 0); - m_free(*sd->ifsd_m); - *sd->ifsd_m = NULL; + m_init(m, M_NOWAIT, MT_DATA, 0); + m_free(m); continue; } - m = *sd->ifsd_m; - *sd->ifsd_m = NULL; if (mh == NULL) { flags = M_PKTHDR|M_EXT; mh = mt = m; @@ -2582,22 +2633,28 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) { struct if_rxsd sd; struct mbuf *m; + int pf_rv; /* should I merge this back in now that the two paths are basically duplicated? */ if (ri->iri_nfrags == 1 && ri->iri_frags[0].irf_len <= MIN(IFLIB_RX_COPY_THRESH, MHLEN)) { - rxd_frag_to_sd(rxq, &ri->iri_frags[0], FALSE, &sd); - m = *sd.ifsd_m; - *sd.ifsd_m = NULL; - m_init(m, M_NOWAIT, MT_DATA, M_PKTHDR); + m = rxd_frag_to_sd(rxq, &ri->iri_frags[0], false, &sd, + &pf_rv, ri); + if (pf_rv != PFIL_PASS && pf_rv != PFIL_REALLOCED) + return (m); + if (pf_rv == PFIL_PASS) { + m_init(m, M_NOWAIT, MT_DATA, M_PKTHDR); #ifndef __NO_STRICT_ALIGNMENT - if (!IP_ALIGNED(m)) - m->m_data += 2; + if (!IP_ALIGNED(m)) + m->m_data += 2; #endif - memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); - m->m_len = ri->iri_frags[0].irf_len; - } else { - m = assemble_segments(rxq, ri, &sd); + memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); + m->m_len = ri->iri_frags[0].irf_len; + } + } else { + m = assemble_segments(rxq, ri, &sd, &pf_rv); + if (pf_rv != PFIL_PASS && pf_rv != PFIL_REALLOCED) + return (m); } m->m_pkthdr.len = ri->iri_len; m->m_pkthdr.rcvif = ri->iri_ifp; @@ -2694,6 +2751,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) return (false); } + /* pfil needs the vnet to be set */ + CURVNET_SET_QUIET(ifp->if_vnet); for (budget_left = budget; budget_left > 0 && avail > 0;) { if (__predict_false(!CTX_ACTIVE(ctx))) { DBG_COUNTER_INC(rx_ctx_inactive); @@ -2711,6 +2770,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if (err) goto err; + rx_pkts += 1; + rx_bytes += ri.iri_len; if (sctx->isc_flags & IFLIB_HAS_RXCQ) { *cidxp = ri.iri_cidx; /* Update our consumer index */ @@ -2733,10 +2794,9 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if (avail == 0 && budget_left) avail = iflib_rxd_avail(ctx, rxq, *cidxp, budget_left); - if (__predict_false(m == NULL)) { - DBG_COUNTER_INC(rx_mbuf_null); + if (__predict_false(m == NULL)) continue; - } + /* imm_pkt: -- cxgb */ if (mh == NULL) mh = mt = m; @@ -2745,6 +2805,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) mt = m; } } + CURVNET_RESTORE(); /* make sure that we can refill faster than drain */ for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) __iflib_fl_refill_lt(ctx, fl, budget + 8); @@ -4366,6 +4427,40 @@ iflib_reset_qvalues(if_ctx_t ctx) } } +static void +iflib_add_pfil(if_ctx_t ctx) +{ + struct pfil_head *pfil; + struct pfil_head_args pa; + iflib_rxq_t rxq; + int i; + + pa.pa_version = PFIL_VERSION; + pa.pa_flags = PFIL_IN; + pa.pa_type = PFIL_TYPE_ETHERNET; + pa.pa_headname = ctx->ifc_ifp->if_xname; + pfil = pfil_head_register(&pa); + + for (i = 0, rxq = ctx->ifc_rxqs; i < NRXQSETS(ctx); i++, rxq++) { + rxq->pfil = pfil; + } +} + +static void +iflib_rem_pfil(if_ctx_t ctx) +{ + struct pfil_head *pfil; + iflib_rxq_t rxq; + int i; + + rxq = ctx->ifc_rxqs; + pfil = rxq->pfil; + for (i = 0; i < NRXQSETS(ctx); i++, rxq++) { + rxq->pfil = NULL; + } + pfil_head_unregister(pfil); +} + int iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ctxp) { @@ -4569,6 +4664,7 @@ iflib_device_register(device_t dev, void *sc, if_share if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); + iflib_add_pfil(ctx); ctx->ifc_flags |= IFC_INIT_DONE; CTX_UNLOCK(ctx); return (0); @@ -4903,6 +4999,7 @@ iflib_device_deregister(if_ctx_t ctx) iflib_netmap_detach(ifp); ether_ifdetach(ifp); + iflib_rem_pfil(ctx); if (ctx->ifc_led_dev != NULL) led_destroy(ctx->ifc_led_dev); /* XXX drain any dependent tasks */ From owner-svn-src-head@freebsd.org Wed Apr 24 13:41:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A80251598F17; Wed, 24 Apr 2019 13:41:47 +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 4D2798CE51; Wed, 24 Apr 2019 13:41:47 +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 25FDED055; Wed, 24 Apr 2019 13:41:47 +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 x3ODfl0T051826; Wed, 24 Apr 2019 13:41:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ODflaT051825; Wed, 24 Apr 2019 13:41:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201904241341.x3ODflaT051825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 24 Apr 2019 13:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346633 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 346633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D2798CE51 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 13:41:47 -0000 Author: br Date: Wed Apr 24 13:41:46 2019 New Revision: 346633 URL: https://svnweb.freebsd.org/changeset/base/346633 Log: Implement pic_pre_ithread(), pic_post_ithread(). Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19819 Modified: head/sys/riscv/riscv/plic.c Modified: head/sys/riscv/riscv/plic.c ============================================================================== --- head/sys/riscv/riscv/plic.c Wed Apr 24 13:32:04 2019 (r346632) +++ head/sys/riscv/riscv/plic.c Wed Apr 24 13:41:46 2019 (r346633) @@ -249,6 +249,30 @@ plic_attach(device_t dev) return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc, 0)); } +static void +plic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + WR4(sc, PLIC_PRIORITY(src->irq), 0); +} + +static void +plic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct plic_softc *sc; + struct plic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + WR4(sc, PLIC_PRIORITY(src->irq), 1); +} + static device_method_t plic_methods[] = { DEVMETHOD(device_probe, plic_probe), DEVMETHOD(device_attach, plic_attach), @@ -256,6 +280,8 @@ static device_method_t plic_methods[] = { DEVMETHOD(pic_disable_intr, plic_disable_intr), DEVMETHOD(pic_enable_intr, plic_enable_intr), DEVMETHOD(pic_map_intr, plic_map_intr), + DEVMETHOD(pic_pre_ithread, plic_pre_ithread), + DEVMETHOD(pic_post_ithread, plic_post_ithread), DEVMETHOD_END }; From owner-svn-src-head@freebsd.org Wed Apr 24 13:44:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C82159916F; Wed, 24 Apr 2019 13:44:31 +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 880A38D1D7; Wed, 24 Apr 2019 13:44:31 +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 6014CD099; Wed, 24 Apr 2019 13:44:31 +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 x3ODiV9w052821; Wed, 24 Apr 2019 13:44:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ODiVOA052820; Wed, 24 Apr 2019 13:44:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201904241344.x3ODiVOA052820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 24 Apr 2019 13:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346634 - head/sys/dev/cadence X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/cadence X-SVN-Commit-Revision: 346634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 880A38D1D7 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 13:44:32 -0000 Author: br Date: Wed Apr 24 13:44:30 2019 New Revision: 346634 URL: https://svnweb.freebsd.org/changeset/base/346634 Log: Add support for Cadence network controller found in HiFive Unleashed board. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19798 Modified: head/sys/dev/cadence/if_cgem.c Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Wed Apr 24 13:41:46 2019 (r346633) +++ head/sys/dev/cadence/if_cgem.c Wed Apr 24 13:44:30 2019 (r346634) @@ -98,6 +98,12 @@ __FBSDID("$FreeBSD$"); #define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ CSUM_TCP_IPV6 | CSUM_UDP_IPV6) +static struct ofw_compat_data compat_data[] = { + { "cadence,gem", 1 }, + { "cdns,macb", 1 }, + { NULL, 0 }, +}; + struct cgem_softc { if_t ifp; struct mtx sc_mtx; @@ -1635,7 +1641,7 @@ cgem_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "cadence,gem")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Cadence CGEM Gigabit Ethernet Interface"); From owner-svn-src-head@freebsd.org Wed Apr 24 15:35:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6913159BFA9; Wed, 24 Apr 2019 15:35:30 +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 682CF6B4C7; Wed, 24 Apr 2019 15:35:30 +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 4198DE35E; Wed, 24 Apr 2019 15:35:30 +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 x3OFZUBA013801; Wed, 24 Apr 2019 15:35:30 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OFZTWe013796; Wed, 24 Apr 2019 15:35:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904241535.x3OFZTWe013796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Apr 2019 15:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346639 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 682CF6B4C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 15:35:31 -0000 Author: bde Date: Wed Apr 24 15:35:29 2019 New Revision: 346639 URL: https://svnweb.freebsd.org/changeset/base/346639 Log: Refactor mouse freezing and fix some minor bugs. VGLMouseFreeze() now only defers mouse signals and leaves it to higher levels to hide and unhide the mouse cursor if necessary. (It is never necessary, but is done to simplify the implementation. It is slow and flashes the cursor. It is still done for copying bitmaps and clearing.) VGLMouseUnFreeze() now only undoes 1 level of freezing. Its old optimization to reduce mouse redrawing is too hard to do with unhiding in higher levels, and its undoing of multiple levels was a historical mistake. VGLMouseOverlap() determines if a region overlaps the (full) mouse region. VGLMouseFreezeXY() is the freezing and a precise overlap check combined for the special case of writing a single pixel. This is the single-pixel case of the old VGLMouseFreeze() with cleanups. Fixes: - check in more cases that the application didn't pass an invalid VIDBUF - check for errors from copying a bitmap to the shadow buffer - freeze the mouse before writing to the shadow buffer in all cases. This was not done for the case of writing a single pixel (there was a race) - don't spell the #defined values for VGLMouseShown as 0, 1 or boolean. Modified: head/lib/libvgl/bitmap.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Wed Apr 24 15:02:59 2019 (r346638) +++ head/lib/libvgl/bitmap.c Wed Apr 24 15:35:29 2019 (r346639) @@ -214,23 +214,36 @@ int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight) { - int error; + int error, mouseoverlap; if (src == VGLDisplay) src = &VGLVDisplay; if (src->Type != MEMBUF) return -1; /* invalid */ if (dst == VGLDisplay) { - VGLMouseFreeze(dstx, dsty, width, hight, 0); - __VGLBitmapCopy(src, srcx, srcy, &VGLVDisplay, dstx, dsty, width, hight); + VGLMouseFreeze(); + mouseoverlap = VGLMouseOverlap(dstx, dsty, width, hight); + if (mouseoverlap) + VGLMousePointerHide(); + error = __VGLBitmapCopy(src, srcx, srcy, &VGLVDisplay, dstx, dsty, + width, hight); + if (error != 0) { + if (mouseoverlap) + VGLMousePointerShow(); + VGLMouseUnFreeze(); + return error; + } src = &VGLVDisplay; srcx = dstx; srcy = dsty; } else if (dst->Type != MEMBUF) return -1; /* invalid */ error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, hight); - if (dst == VGLDisplay) + if (dst == VGLDisplay) { + if (mouseoverlap) + VGLMousePointerShow(); VGLMouseUnFreeze(); + } return error; } Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Wed Apr 24 15:02:59 2019 (r346638) +++ head/lib/libvgl/mouse.c Wed Apr 24 15:35:29 2019 (r346639) @@ -89,7 +89,7 @@ static VGLBitmap VGLMouseStdOrMask = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; static int VGLMouseVisible = 0; -static int VGLMouseShown = 0; +static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; static int VGLMouseYpos = 0; static int VGLMouseButtons = 0; @@ -316,48 +316,47 @@ VGLMouseStatus(int *x, int *y, char *buttons) return VGLMouseShown; } -int -VGLMouseFreeze(int x, int y, int width, int hight, u_long color) +void +VGLMouseFreeze(void) { - INTOFF(); - if (width > 1 || hight > 1 || (color & 0xc0000000) == 0) { /* bitmap */ - if (VGLMouseShown == 1) { - int overlap; + INTOFF(); +} - if (x > VGLMouseXpos) - overlap = (VGLMouseXpos + MOUSE_IMG_SIZE) - x; - else - overlap = (x + width) - VGLMouseXpos; - if (overlap > 0) { - if (y > VGLMouseYpos) - overlap = (VGLMouseYpos + MOUSE_IMG_SIZE) - y; - else - overlap = (y + hight) - VGLMouseYpos; - if (overlap > 0) - VGLMousePointerHide(); - } - } - } - else { /* bit */ - if (VGLMouseShown && - x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && - y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE) { - if (color & 0x80000000) { /* Set */ - if (VGLMouseAndMask->Bitmap - [(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) { - return 1; - } - } - } - } +int +VGLMouseFreezeXY(int x, int y) +{ + INTOFF(); + if (VGLMouseShown != VGL_MOUSESHOW) + return 0; + if (x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && + y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE && + VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) + return 1; return 0; } +int +VGLMouseOverlap(int x, int y, int width, int hight) +{ + int overlap; + + if (VGLMouseShown != VGL_MOUSESHOW) + return 0; + if (x > VGLMouseXpos) + overlap = (VGLMouseXpos + MOUSE_IMG_SIZE) - x; + else + overlap = (x + width) - VGLMouseXpos; + if (overlap <= 0) + return 0; + if (y > VGLMouseYpos) + overlap = (VGLMouseYpos + MOUSE_IMG_SIZE) - y; + else + overlap = (y + hight) - VGLMouseYpos; + return overlap > 0; +} + void VGLMouseUnFreeze() { - if (VGLMouseShown == VGL_MOUSESHOW && !VGLMouseVisible && !VGLMintpending) - VGLMousePointerShow(); - while (VGLMsuppressint) - INTON(); + INTON(); } Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Wed Apr 24 15:02:59 2019 (r346638) +++ head/lib/libvgl/simple.c Wed Apr 24 15:35:29 2019 (r346639) @@ -51,14 +51,18 @@ static byte VGLSavePaletteBlue[256]; void VGLSetXY(VGLBitmap *object, int x, int y, u_long color) { - int offset; + int offset, undermouse; VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { - if (object == VGLDisplay) + if (object == VGLDisplay) { + undermouse = VGLMouseFreezeXY(x, y); VGLSetXY(&VGLVDisplay, x, y, color); - if (object->Type == MEMBUF || - !VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) { + } else if (object->Type != MEMBUF) + return; /* invalid */ + else + undermouse = 0; + if (!undermouse) { offset = (y * object->VXsize + x) * object->PixelBytes; switch (object->Type) { case VIDBUF8S: @@ -106,7 +110,7 @@ set_planar: object->Bitmap[offset] |= (byte)color; } } - if (object->Type != MEMBUF) + if (object == VGLDisplay) VGLMouseUnFreeze(); } } @@ -143,7 +147,7 @@ VGLGetXY(VGLBitmap *object, int x, int y) return 0; if (object == VGLDisplay) object = &VGLVDisplay; - if (object->Type != MEMBUF) + else if (object->Type != MEMBUF) return 0; /* invalid */ return __VGLGetXY(object, x, y); } @@ -449,13 +453,14 @@ void VGLClear(VGLBitmap *object, u_long color) { VGLBitmap src; - int offset; - int len; - int i; + int i, len, mouseoverlap, offset; VGLCheckSwitch(); if (object == VGLDisplay) { - VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); + VGLMouseFreeze(); + mouseoverlap = VGLMouseOverlap(0, 0, object->Xsize, object->Ysize); + if (mouseoverlap) + VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); } else if (object->Type != MEMBUF) return; /* invalid */ @@ -509,8 +514,11 @@ VGLClear(VGLBitmap *object, u_long color) outb(0x3ce, 0x05); outb(0x3cf, 0x00); break; } - if (object == VGLDisplay) + if (object == VGLDisplay) { + if (mouseoverlap) + VGLMousePointerShow(); VGLMouseUnFreeze(); + } } static inline u_long Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Wed Apr 24 15:02:59 2019 (r346638) +++ head/lib/libvgl/vgl.h Wed Apr 24 15:35:29 2019 (r346639) @@ -134,7 +134,9 @@ void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); void VGLMouseRestore(void); int VGLMouseStatus(int *x, int *y, char *buttons); -int VGLMouseFreeze(int x, int y, int width, int hight, u_long color); +void VGLMouseFreeze(void); +int VGLMouseFreezeXY(int x, int y); +int VGLMouseOverlap(int x, int y, int width, int hight); void VGLMouseUnFreeze(void); /* simple.c */ void VGLSetXY(VGLBitmap *object, int x, int y, u_long color); From owner-svn-src-head@freebsd.org Wed Apr 24 16:03:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA27159C73B; Wed, 24 Apr 2019 16:03:36 +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 0CD636C2A3; Wed, 24 Apr 2019 16:03:36 +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 CEA2BE862; Wed, 24 Apr 2019 16:03: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 x3OG3ZaK029764; Wed, 24 Apr 2019 16:03:35 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OG3ZeG029761; Wed, 24 Apr 2019 16:03:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904241603.x3OG3ZeG029761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Apr 2019 16:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346641 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CD636C2A3 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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 16:03:36 -0000 Author: bde Date: Wed Apr 24 16:03:35 2019 New Revision: 346641 URL: https://svnweb.freebsd.org/changeset/base/346641 Log: Avoid hiding and unhiding the mouse cursor when copying bitmaps to the screen. Instead, copy a merged bitmap 1 line at a time. This fixes flashing of the cursor and is faster in all modes (especially in planar modes). Modified: head/lib/libvgl/bitmap.c head/lib/libvgl/mouse.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Wed Apr 24 15:54:18 2019 (r346640) +++ head/lib/libvgl/bitmap.c Wed Apr 24 16:03:35 2019 (r346641) @@ -167,8 +167,17 @@ int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight) { - int srcline, dstline, yend, yextra, ystep; - + byte *buffer, *p; + int mousemerge, srcline, dstline, yend, yextra, ystep; + + mousemerge = 0; + if (hight < 0) { + hight = -hight; + mousemerge = (dst == VGLDisplay && + VGLMouseOverlap(dstx, dsty, width, hight)); + if (mousemerge) + buffer = alloca(width*src->PixelBytes); + } if (srcx>src->VXsize || srcy>src->VYsize || dstx>dst->VXsize || dsty>dst->VYsize) return -1; @@ -204,8 +213,13 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, } for (srcline = srcy + yextra, dstline = dsty + yextra; srcline != yend; srcline += ystep, dstline += ystep) { - WriteVerticalLine(dst, dstx, dstline, width, - src->Bitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes); + p = src->Bitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes; + if (mousemerge && VGLMouseOverlap(dstx, dstline, width, 1)) { + bcopy(p, buffer, width*src->PixelBytes); + p = buffer; + VGLMouseMerge(dstx, dstline, width, p); + } + WriteVerticalLine(dst, dstx, dstline, width, p); } return 0; } @@ -214,36 +228,29 @@ int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight) { - int error, mouseoverlap; + int error; + if (hight < 0) + return -1; if (src == VGLDisplay) src = &VGLVDisplay; if (src->Type != MEMBUF) return -1; /* invalid */ if (dst == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(dstx, dsty, width, hight); - if (mouseoverlap) - VGLMousePointerHide(); + __VGLBitmapCopy(src, srcx, srcy, &VGLVDisplay, dstx, dsty, width, hight); error = __VGLBitmapCopy(src, srcx, srcy, &VGLVDisplay, dstx, dsty, width, hight); - if (error != 0) { - if (mouseoverlap) - VGLMousePointerShow(); - VGLMouseUnFreeze(); + if (error != 0) return error; - } src = &VGLVDisplay; srcx = dstx; srcy = dsty; } else if (dst->Type != MEMBUF) return -1; /* invalid */ - error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, hight); - if (dst == VGLDisplay) { - if (mouseoverlap) - VGLMousePointerShow(); + error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, -hight); + if (dst == VGLDisplay) VGLMouseUnFreeze(); - } return error; } Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Wed Apr 24 15:54:18 2019 (r346640) +++ head/lib/libvgl/mouse.c Wed Apr 24 16:03:35 2019 (r346641) @@ -356,6 +356,25 @@ VGLMouseOverlap(int x, int y, int width, int hight) } void +VGLMouseMerge(int x, int y, int width, byte *line) +{ + int pos, x1, xend, xstart; + + xstart = x; + if (xstart < VGLMouseXpos) + xstart = VGLMouseXpos; + xend = x + width; + if (xend > VGLMouseXpos + MOUSE_IMG_SIZE) + xend = VGLMouseXpos + MOUSE_IMG_SIZE; + for (x1 = xstart; x1 < xend; x1++) { + pos = (y - VGLMouseYpos) * MOUSE_IMG_SIZE + x1 - VGLMouseXpos; + if (VGLMouseAndMask->Bitmap[pos]) + bcopy(&VGLMouseOrMask->Bitmap[pos * VGLDisplay->PixelBytes], + &line[(x1 - x) * VGLDisplay->PixelBytes], VGLDisplay->PixelBytes); + } +} + +void VGLMouseUnFreeze() { INTON(); Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Wed Apr 24 15:54:18 2019 (r346640) +++ head/lib/libvgl/vgl.h Wed Apr 24 16:03:35 2019 (r346641) @@ -136,6 +136,7 @@ void VGLMouseRestore(void); int VGLMouseStatus(int *x, int *y, char *buttons); void VGLMouseFreeze(void); int VGLMouseFreezeXY(int x, int y); +void VGLMouseMerge(int x, int y, int width, byte *line); int VGLMouseOverlap(int x, int y, int width, int hight); void VGLMouseUnFreeze(void); /* simple.c */ From owner-svn-src-head@freebsd.org Wed Apr 24 17:54:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E69C0159F5A7; Wed, 24 Apr 2019 17:54:48 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 055087222A; Wed, 24 Apr 2019 17:54:47 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-it1-f175.google.com with SMTP id e13so7709185itk.4; Wed, 24 Apr 2019 10:54:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hXZCeQ8Gar9dEYF6qiE4YllXtohog9QSXrifcKmT1Go=; b=QzuFzgU9yc3HwcRlX2cWLfvaEZhz7RV2TK+hB7Tw2UOkzg67HVCAz4td4Fg1BeD6RJ xweH1T+A3VQfk3kpf3vfOf5PUlZzxATmS78qOpAR9CpYR+BWlv4f4moApQBwkGoLHQTX bXuRjq96jeleBxtHNWXfWJfawjeJgUtIztErbKYBXhVYAPd+bZTIeK2hg+I8tFVxeRrQ O2b4A/E20cR/WaLTKYR19xHzskVESLjXBo7lz2os3kkpW+cm/hW0DLH2zDt9XmJpWcdz MEFXqsOhatLm7wREt5so1jrTGtF6J92E5iCWXeicHqcB9LmP754W3TsALlPkaxVVLxwT tn+w== X-Gm-Message-State: APjAAAXKiW4hqwqgE2+n37MueW3UwWNab+xqzVwYcqLWctH+cAOtSUNW blksCdDgxW/io87O3f9R9UNe2R9jyP/I7xIDJ4C+Zw== X-Google-Smtp-Source: APXvYqx5dA/2CrDWqmHIRc2A7Zeflca2AURjC8pvomECFjwyUyDNV+q9ekC148ySJ97J3tLKDk4iQPsNxfzFvEPQaeA= X-Received: by 2002:a02:630d:: with SMTP id j13mr21632777jac.142.1556128480809; Wed, 24 Apr 2019 10:54:40 -0700 (PDT) MIME-Version: 1.0 References: <201904161326.x3GDQV9J003308@repo.freebsd.org> In-Reply-To: <201904161326.x3GDQV9J003308@repo.freebsd.org> From: Dmitry Chagin Date: Wed, 24 Apr 2019 20:54:30 +0300 Message-ID: Subject: Re: svn commit: r346273 - in head/sys: compat/freebsd32 kern To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 055087222A X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of chagindmitry@gmail.com designates 209.85.166.175 as permitted sender) smtp.mailfrom=chagindmitry@gmail.com X-Spamd-Result: default: False [-5.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; 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)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; RCVD_IN_DNSWL_NONE(0.00)[175.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.46)[ip: (-6.10), ipnet: 209.85.128.0/17(-3.88), asn: 15169(-2.26), country: US(-0.06)]; FORGED_SENDER(0.30)[dchagin@freebsd.org,chagindmitry@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,chagindmitry@gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 17:54:49 -0000 =D0=B2=D1=82, 16 =D0=B0=D0=BF=D1=80. 2019 =D0=B3. =D0=B2 16:26, Ed Maste : > Author: emaste > Date: Tue Apr 16 13:26:31 2019 > New Revision: 346273 > URL: https://svnweb.freebsd.org/changeset/base/346273 > > Log: > correct readlinkat(2) return type > > Hi, Ed make sysent? > r176215 corrected readlink(2)'s return type and the type of the last > argument. readlink(2) was introduced in r177788 after being developed > as part of Google Summer of Code 2007; it appears to have inherited the > wrong return type. > > Man pages and header files were already ssize_t; update syscalls.master > to match. > > PR: 197915 > Submitted by: Henning Petersen > MFC after: 2 weeks > > Modified: > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > > Modified: head/sys/compat/freebsd32/syscalls.master > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/compat/freebsd32/syscalls.master Tue Apr 16 12:40:49 2019 > (r346272) > +++ head/sys/compat/freebsd32/syscalls.master Tue Apr 16 13:26:31 2019 > (r346273) > @@ -963,7 +963,7 @@ > uint32_t dev); } > 499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, const char *path, \ > int flag, mode_t mode); } > -500 AUE_READLINKAT NOPROTO { int readlinkat(int fd, const char *path= , > \ > +500 AUE_READLINKAT NOPROTO { ssize_t readlinkat(int fd, const char > *path, \ > char *buf, size_t bufsize); } > 501 AUE_RENAMEAT NOPROTO { int renameat(int oldfd, const char *old= , > \ > int newfd, const char *new); } > > Modified: head/sys/kern/syscalls.master > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/syscalls.master Tue Apr 16 12:40:49 2019 > (r346272) > +++ head/sys/kern/syscalls.master Tue Apr 16 13:26:31 2019 > (r346273) > @@ -2716,7 +2716,7 @@ > ); > } > 500 AUE_READLINKAT STD { > - int readlinkat( > + ssize_t readlinkat( > int fd, > _In_z_ const char *path, > _Out_writes_bytes_(bufsize) char *buf, > > From owner-svn-src-head@freebsd.org Wed Apr 24 18:24:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8694159FEA3; Wed, 24 Apr 2019 18:24:23 +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 8FFE4734E5; Wed, 24 Apr 2019 18:24:23 +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 69D38180CA; Wed, 24 Apr 2019 18:24:23 +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 x3OIONXP007618; Wed, 24 Apr 2019 18:24:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OIONL2007617; Wed, 24 Apr 2019 18:24:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904241824.x3OIONL2007617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 24 Apr 2019 18:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346643 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 346643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8FFE4734E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 18:24:24 -0000 Author: cem Date: Wed Apr 24 18:24:22 2019 New Revision: 346643 URL: https://svnweb.freebsd.org/changeset/base/346643 Log: x86: Halt non-BSP CPUs on panic IPI_STOP We may need the BSP to reboot, but we don't need any AP CPU that isn't the panic thread. Any CPU landing in this routine during panic isn't the panic thread, so we can just detect !BSP && panic and shut down the logical core. The savings can be demonstrated in a bhyve guest with multiple cores; before this change, N guest threads would spin at 100% CPU. After this change, only one or two threads spin (depending on if the panicing CPU was the BSP or not). Konstantin points out that this may break any future patches which allow switching ddb(4) CPUs after panic and examining CPU-local state that cannot be inspected remotely. In the event that such a mechanism is incorporated, this behavior could be made configurable by tunable/sysctl. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20019 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Wed Apr 24 17:30:50 2019 (r346642) +++ head/sys/x86/x86/mp_x86.c Wed Apr 24 18:24:22 2019 (r346643) @@ -1406,8 +1406,17 @@ cpustop_handler(void) CPU_SET_ATOMIC(cpu, &stopped_cpus); /* Wait for restart */ - while (!CPU_ISSET(cpu, &started_cpus)) - ia32_pause(); + while (!CPU_ISSET(cpu, &started_cpus)) { + ia32_pause(); + + /* + * Halt non-BSP CPUs on panic -- we're never going to need them + * again, and might as well save power / release resources + * (e.g., overprovisioned VM infrastructure). + */ + while (__predict_false(!IS_BSP() && panicstr != NULL)) + halt(); + } cpustop_handler_post(cpu); } From owner-svn-src-head@freebsd.org Wed Apr 24 19:56:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7092A15A1D99; Wed, 24 Apr 2019 19:56:03 +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 171C976E9F; Wed, 24 Apr 2019 19:56:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2D781905A; Wed, 24 Apr 2019 19:56:02 +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 x3OJu28B056391; Wed, 24 Apr 2019 19:56:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OJu2al056390; Wed, 24 Apr 2019 19:56:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904241956.x3OJu2al056390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 24 Apr 2019 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346644 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 346644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 171C976E9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 19:56:03 -0000 Author: mav Date: Wed Apr 24 19:56:02 2019 New Revision: 346644 URL: https://svnweb.freebsd.org/changeset/base/346644 Log: Call delist_dev() before destroy_dev_sched_cb(). destroy_dev_sched_cb() is excessively asynchronous, and during media change retaste new provider may appear sooner then device of the previous one get destroyed. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Wed Apr 24 18:24:22 2019 (r346643) +++ head/sys/geom/geom_dev.c Wed Apr 24 19:56:02 2019 (r346644) @@ -863,6 +863,7 @@ g_dev_orphan(struct g_consumer *cp) (void)clear_dumper(curthread); /* Destroy the struct cdev *so we get no more requests */ + delist_dev(dev); destroy_dev_sched_cb(dev, g_dev_callback, cp); } From owner-svn-src-head@freebsd.org Wed Apr 24 20:30:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286921580687; Wed, 24 Apr 2019 20:30:48 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C60E777F8B; Wed, 24 Apr 2019 20:30:47 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F70C19572; Wed, 24 Apr 2019 20:30:47 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3OKUlNk073337; Wed, 24 Apr 2019 20:30:47 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OKUkgN073331; Wed, 24 Apr 2019 20:30:46 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201904242030.x3OKUkgN073331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 24 Apr 2019 20:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 346645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C60E777F8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 20:30:48 -0000 Author: tychon Date: Wed Apr 24 20:30:45 2019 New Revision: 346645 URL: https://svnweb.freebsd.org/changeset/base/346645 Log: LinuxKPI should use bus_dma(9) to be compatible with an IOMMU Reviewed by: hselasky, kib Tested by: greg@unrelenting.technology Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19845 Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/include/linux/scatterlist.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Wed Apr 24 20:30:45 2019 (r346645) @@ -105,7 +105,7 @@ struct device { struct class *class; void (*release)(struct device *dev); struct kobject kobj; - uint64_t *dma_mask; + void *dma_priv; void *driver_data; unsigned int irq; #define LINUX_IRQ_INVALID 65535 Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Wed Apr 24 20:30:45 2019 (r346645) @@ -90,6 +90,16 @@ struct dma_map_ops { #define DMA_BIT_MASK(n) ((2ULL << ((n) - 1)) - 1ULL) +int linux_dma_tag_init(struct device *dev, u64 mask); +void *linux_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag); +dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); +void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); +int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, + int nents, enum dma_data_direction dir, struct dma_attrs *attrs); +void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction dir, struct dma_attrs *attrs); + static inline int dma_supported(struct device *dev, u64 mask) { @@ -102,11 +112,10 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) { - if (!dev->dma_mask || !dma_supported(dev, dma_mask)) + if (!dev->dma_priv || !dma_supported(dev, dma_mask)) return -EIO; - *dev->dma_mask = dma_mask; - return (0); + return (linux_dma_tag_init(dev, dma_mask)); } static inline int @@ -134,24 +143,7 @@ static inline void * dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) { - vm_paddr_t high; - size_t align; - void *mem; - - if (dev != NULL && dev->dma_mask) - high = *dev->dma_mask; - else if (flag & GFP_DMA32) - high = BUS_SPACE_MAXADDR_32BIT; - else - high = BUS_SPACE_MAXADDR; - align = PAGE_SIZE << get_order(size); - mem = (void *)kmem_alloc_contig(size, flag, 0, high, align, 0, - VM_MEMATTR_DEFAULT); - if (mem) - *dma_handle = vtophys(mem); - else - *dma_handle = 0; - return (mem); + return (linux_dma_alloc_coherent(dev, size, dma_handle, flag)); } static inline void * @@ -164,25 +156,27 @@ dma_zalloc_coherent(struct device *dev, size_t size, d static inline void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, - dma_addr_t dma_handle) + dma_addr_t dma_addr) { + linux_dma_unmap(dev, dma_addr, size); kmem_free((vm_offset_t)cpu_addr, size); } -/* XXX This only works with no iommu. */ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) { - return vtophys(ptr); + return (linux_dma_map_phys(dev, vtophys(ptr), size)); } static inline void -dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, size_t size, +dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) { + + linux_dma_unmap(dev, dma_addr, size); } static inline dma_addr_t @@ -190,26 +184,23 @@ dma_map_page_attrs(struct device *dev, struct page *pa size_t size, enum dma_data_direction dir, unsigned long attrs) { - return (VM_PAGE_TO_PHYS(page) + offset); + return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size)); } static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { - struct scatterlist *sg; - int i; - for_each_sg(sgl, sg, nents, i) - sg_dma_address(sg) = sg_phys(sg); - - return (nents); + return (linux_dma_map_sg_attrs(dev, sgl, nents, dir, attrs)); } static inline void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { + + linux_dma_unmap_sg_attrs(dev, sg, nents, dir, attrs); } static inline dma_addr_t @@ -217,13 +208,15 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) { - return VM_PAGE_TO_PHYS(page) + offset; + return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size)); } static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction) { + + linux_dma_unmap(dev, dma_address, size); } static inline void @@ -273,7 +266,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) { - return (0); + return (dma_addr == 0); } static inline unsigned int dma_set_max_seg_size(struct device *dev, Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Wed Apr 24 20:30:45 2019 (r346645) @@ -37,44 +37,44 @@ #include #include +struct dma_pool *linux_dma_pool_create(char *name, struct device *dev, + size_t size, size_t align, size_t boundary); +void linux_dma_pool_destroy(struct dma_pool *pool); +void *linux_dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, + dma_addr_t *handle); +void linux_dma_pool_free(struct dma_pool *pool, void *vaddr, + dma_addr_t dma_addr); + struct dma_pool { + struct pci_dev *pool_pdev; uma_zone_t pool_zone; + struct mtx pool_dma_lock; + bus_dma_tag_t pool_dmat; + size_t pool_entry_size; + struct mtx pool_ptree_lock; + struct pctrie pool_ptree; }; static inline struct dma_pool * dma_pool_create(char *name, struct device *dev, size_t size, size_t align, size_t boundary) { - struct dma_pool *pool; - pool = kmalloc(sizeof(*pool), GFP_KERNEL); - align--; - /* - * XXX Eventually this could use a separate allocf to honor boundary - * and physical address requirements of the device. - */ - pool->pool_zone = uma_zcreate(name, size, NULL, NULL, NULL, NULL, - align, UMA_ZONE_OFFPAGE|UMA_ZONE_HASH); - - return (pool); + return (linux_dma_pool_create(name, dev, size, align, boundary)); } static inline void dma_pool_destroy(struct dma_pool *pool) { - uma_zdestroy(pool->pool_zone); - kfree(pool); + + linux_dma_pool_destroy(pool); } static inline void * dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle) { - void *vaddr; - vaddr = uma_zalloc(pool->pool_zone, mem_flags); - if (vaddr) - *handle = vtophys(vaddr); - return (vaddr); + return (linux_dma_pool_alloc(pool, mem_flags, handle)); } static inline void * @@ -85,9 +85,10 @@ dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags } static inline void -dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr) +dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma_addr) { - uma_zfree(pool->pool_zone, vaddr); + + linux_dma_pool_free(pool, vaddr, dma_addr); } Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Wed Apr 24 20:30:45 2019 (r346645) @@ -219,7 +219,6 @@ struct pci_dev { struct list_head links; struct pci_driver *pdrv; struct pci_bus *bus; - uint64_t dma_mask; uint16_t device; uint16_t vendor; uint16_t subsystem_vendor; Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Wed Apr 24 20:30:45 2019 (r346645) @@ -43,7 +43,8 @@ struct scatterlist { #define SG_PAGE_LINK_MASK 0x3UL unsigned int offset; unsigned int length; - dma_addr_t address; + dma_addr_t dma_address; + unsigned int dma_length; }; CTASSERT((sizeof(struct scatterlist) & SG_PAGE_LINK_MASK) == 0); @@ -77,8 +78,8 @@ struct sg_page_iter { #define sg_chain_ptr(sg) \ ((struct scatterlist *) ((sg)->page_link & ~SG_PAGE_LINK_MASK)) -#define sg_dma_address(sg) (sg)->address -#define sg_dma_len(sg) (sg)->length +#define sg_dma_address(sg) (sg)->dma_address +#define sg_dma_len(sg) (sg)->dma_length #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ @@ -444,7 +445,7 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_ static inline dma_addr_t sg_page_iter_dma_address(struct sg_page_iter *spi) { - return (spi->sg->address + (spi->sg_pgoffset << PAGE_SHIFT)); + return (spi->sg->dma_address + (spi->sg_pgoffset << PAGE_SHIFT)); } static inline struct page * Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 20:30:45 2019 (r346645) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,6 +76,76 @@ static device_method_t pci_methods[] = { DEVMETHOD_END }; +struct linux_dma_priv { + uint64_t dma_mask; + struct mtx dma_lock; + bus_dma_tag_t dmat; + struct mtx ptree_lock; + struct pctrie ptree; +}; + +static int +linux_pdev_dma_init(struct pci_dev *pdev) +{ + struct linux_dma_priv *priv; + + priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); + pdev->dev.dma_priv = priv; + + mtx_init(&priv->dma_lock, "linux_dma", NULL, MTX_DEF); + + mtx_init(&priv->ptree_lock, "linux_dma_ptree", NULL, MTX_DEF); + pctrie_init(&priv->ptree); + + return (0); +} + +static int +linux_pdev_dma_uninit(struct pci_dev *pdev) +{ + struct linux_dma_priv *priv; + + priv = pdev->dev.dma_priv; + if (priv->dmat) + bus_dma_tag_destroy(priv->dmat); + mtx_destroy(&priv->dma_lock); + mtx_destroy(&priv->ptree_lock); + free(priv, M_DEVBUF); + pdev->dev.dma_priv = NULL; + return (0); +} + +int +linux_dma_tag_init(struct device *dev, u64 dma_mask) +{ + struct linux_dma_priv *priv; + int error; + + priv = dev->dma_priv; + + if (priv->dmat) { + if (priv->dma_mask == dma_mask) + return (0); + + bus_dma_tag_destroy(priv->dmat); + } + + priv->dma_mask = dma_mask; + + error = bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), + 1, 0, /* alignment, boundary */ + dma_mask, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + BUS_SPACE_MAXADDR, /* maxsize */ + 1, /* nsegments */ + BUS_SPACE_MAXADDR, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &priv->dmat); + return (-error); +} + static struct pci_driver * linux_pci_find(device_t dev, const struct pci_device_id **idp) { @@ -158,7 +229,6 @@ linux_pci_attach(device_t dev) pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); - pdev->dev.dma_mask = &pdev->dma_mask; pdev->pdrv = pdrv; kobject_init(&pdev->dev.kobj, &linux_dev_ktype); kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); @@ -170,6 +240,9 @@ linux_pci_attach(device_t dev) else pdev->dev.irq = LINUX_IRQ_INVALID; pdev->irq = pdev->dev.irq; + error = linux_pdev_dma_init(pdev); + if (error) + goto out; if (pdev->bus == NULL) { pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -183,6 +256,7 @@ linux_pci_attach(device_t dev) spin_unlock(&pci_lock); error = pdrv->probe(pdev, id); +out: if (error) { spin_lock(&pci_lock); list_del(&pdev->links); @@ -202,6 +276,7 @@ linux_pci_detach(device_t dev) pdev = device_get_softc(dev); pdev->pdrv->remove(pdev); + linux_pdev_dma_uninit(pdev); spin_lock(&pci_lock); list_del(&pdev->links); @@ -329,4 +404,423 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) if (bus != NULL) devclass_delete_driver(bus, &pdrv->bsddriver); mtx_unlock(&Giant); +} + +struct linux_dma_obj { + void *vaddr; + dma_addr_t dma_addr; + bus_dmamap_t dmamap; +}; + +static uma_zone_t linux_dma_trie_zone; +static uma_zone_t linux_dma_obj_zone; + +static void +linux_dma_init(void *arg) +{ + + linux_dma_trie_zone = uma_zcreate("linux_dma_pctrie", + pctrie_node_size(), NULL, NULL, pctrie_zone_init, NULL, + UMA_ALIGN_PTR, 0); + linux_dma_obj_zone = uma_zcreate("linux_dma_object", + sizeof(struct linux_dma_obj), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + +} +SYSINIT(linux_dma, SI_SUB_DRIVERS, SI_ORDER_THIRD, linux_dma_init, NULL); + +static void +linux_dma_uninit(void *arg) +{ + + uma_zdestroy(linux_dma_obj_zone); + uma_zdestroy(linux_dma_trie_zone); +} +SYSUNINIT(linux_dma, SI_SUB_DRIVERS, SI_ORDER_THIRD, linux_dma_uninit, NULL); + +static void * +linux_dma_trie_alloc(struct pctrie *ptree) +{ + + return (uma_zalloc(linux_dma_trie_zone, 0)); +} + +static void +linux_dma_trie_free(struct pctrie *ptree, void *node) +{ + + uma_zfree(linux_dma_trie_zone, node); +} + + +PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, + linux_dma_trie_free); + +void * +linux_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag) +{ + struct linux_dma_priv *priv; + vm_paddr_t high; + size_t align; + void *mem; + + if (dev == NULL || dev->dma_priv == NULL) { + *dma_handle = 0; + return (NULL); + } + priv = dev->dma_priv; + if (priv->dma_mask) + high = priv->dma_mask; + else if (flag & GFP_DMA32) + high = BUS_SPACE_MAXADDR_32BIT; + else + high = BUS_SPACE_MAXADDR; + align = PAGE_SIZE << get_order(size); + mem = (void *)kmem_alloc_contig(size, flag, 0, high, align, 0, + VM_MEMATTR_DEFAULT); + if (mem) + *dma_handle = linux_dma_map_phys(dev, vtophys(mem), size); + else + *dma_handle = 0; + return (mem); +} + +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + int error, nseg; + bus_dma_segment_t seg; + + priv = dev->dma_priv; + + obj = uma_zalloc(linux_dma_obj_zone, 0); + + if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + + nseg = -1; + mtx_lock(&priv->dma_lock); + if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, + BUS_DMA_NOWAIT, &seg, &nseg) != 0) { + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + mtx_unlock(&priv->dma_lock); + + KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); + obj->dma_addr = seg.ds_addr; + + mtx_lock(&priv->ptree_lock); + error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); + mtx_unlock(&priv->ptree_lock); + if (error != 0) { + mtx_lock(&priv->dma_lock); + bus_dmamap_unload(priv->dmat, obj->dmamap); + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + + return (obj->dma_addr); +} + +void +linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +{ + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + + priv = dev->dma_priv; + + mtx_lock(&priv->ptree_lock); + obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, dma_addr); + if (obj == NULL) { + mtx_unlock(&priv->ptree_lock); + return; + } + LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); + mtx_unlock(&priv->ptree_lock); + + mtx_lock(&priv->dma_lock); + bus_dmamap_unload(priv->dmat, obj->dmamap); + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + + uma_zfree(linux_dma_obj_zone, obj); +} + +int +linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, + enum dma_data_direction dir, struct dma_attrs *attrs) +{ + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + struct scatterlist *dma_sg, *sg; + int dma_nents, error, nseg; + size_t seg_len; + vm_paddr_t seg_phys, prev_phys_end; + bus_dma_segment_t seg; + + priv = dev->dma_priv; + + obj = uma_zalloc(linux_dma_obj_zone, 0); + + if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + + sg = sgl; + dma_sg = sg; + dma_nents = 0; + while (nents > 0) { + seg_phys = sg_phys(sg); + seg_len = sg->length; + while (--nents > 0) { + prev_phys_end = sg_phys(sg) + sg->length; + sg = sg_next(sg); + if (prev_phys_end != sg_phys(sg)) + break; + seg_len += sg->length; + } + + nseg = -1; + mtx_lock(&priv->dma_lock); + if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, + seg_phys, seg_len, BUS_DMA_NOWAIT, + &seg, &nseg) != 0) { + bus_dmamap_unload(priv->dmat, obj->dmamap); + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + mtx_unlock(&priv->dma_lock); + KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); + + sg_dma_address(dma_sg) = seg.ds_addr; + sg_dma_len(dma_sg) = seg.ds_len; + + dma_sg = sg_next(dma_sg); + dma_nents++; + } + + obj->dma_addr = sg_dma_address(sgl); + + mtx_lock(&priv->ptree_lock); + error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); + mtx_unlock(&priv->ptree_lock); + if (error != 0) { + mtx_lock(&priv->dma_lock); + bus_dmamap_unload(priv->dmat, obj->dmamap); + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + uma_zfree(linux_dma_obj_zone, obj); + return (0); + } + + return (dma_nents); +} + +void +linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, + int nents, enum dma_data_direction dir, struct dma_attrs *attrs) +{ + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + + priv = dev->dma_priv; + + mtx_lock(&priv->ptree_lock); + obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, sg_dma_address(sgl)); + if (obj == NULL) { + mtx_unlock(&priv->ptree_lock); + return; + } + LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, sg_dma_address(sgl)); + mtx_unlock(&priv->ptree_lock); + + mtx_lock(&priv->dma_lock); + bus_dmamap_unload(priv->dmat, obj->dmamap); + bus_dmamap_destroy(priv->dmat, obj->dmamap); + mtx_unlock(&priv->dma_lock); + + uma_zfree(linux_dma_obj_zone, obj); +} + +static inline int +dma_pool_obj_ctor(void *mem, int size, void *arg, int flags) +{ + struct linux_dma_obj *obj = mem; + struct dma_pool *pool = arg; + int error, nseg; + bus_dma_segment_t seg; + + nseg = -1; + mtx_lock(&pool->pool_dma_lock); + error = _bus_dmamap_load_phys(pool->pool_dmat, obj->dmamap, + vtophys(obj->vaddr), pool->pool_entry_size, BUS_DMA_NOWAIT, + &seg, &nseg); + mtx_unlock(&pool->pool_dma_lock); + if (error != 0) { + return (error); + } + KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); + obj->dma_addr = seg.ds_addr; + + return (0); +} + +static void +dma_pool_obj_dtor(void *mem, int size, void *arg) +{ + struct linux_dma_obj *obj = mem; + struct dma_pool *pool = arg; + + mtx_lock(&pool->pool_dma_lock); + bus_dmamap_unload(pool->pool_dmat, obj->dmamap); + mtx_unlock(&pool->pool_dma_lock); +} + +static int +dma_pool_obj_import(void *arg, void **store, int count, int domain __unused, + int flags) +{ + struct dma_pool *pool = arg; + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + int error, i; + + priv = pool->pool_pdev->dev.dma_priv; + for (i = 0; i < count; i++) { + obj = uma_zalloc(linux_dma_obj_zone, flags); + if (obj == NULL) + break; + + error = bus_dmamem_alloc(pool->pool_dmat, &obj->vaddr, + BUS_DMA_NOWAIT, &obj->dmamap); + if (error!= 0) { + uma_zfree(linux_dma_obj_zone, obj); + break; + } + + store[i] = obj; + } + + return (i); +} + +static void +dma_pool_obj_release(void *arg, void **store, int count) +{ + struct dma_pool *pool = arg; + struct linux_dma_priv *priv; + struct linux_dma_obj *obj; + int i; + + priv = pool->pool_pdev->dev.dma_priv; + for (i = 0; i < count; i++) { + obj = store[i]; + bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap); + uma_zfree(linux_dma_obj_zone, obj); + } +} + +struct dma_pool * +linux_dma_pool_create(char *name, struct device *dev, size_t size, + size_t align, size_t boundary) +{ + struct linux_dma_priv *priv; + struct dma_pool *pool; + + priv = dev->dma_priv; + + pool = kzalloc(sizeof(*pool), GFP_KERNEL); + pool->pool_pdev = to_pci_dev(dev); + pool->pool_entry_size = size; + + if (bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), + align, boundary, /* alignment, boundary */ + priv->dma_mask, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + size, /* maxsize */ + 1, /* nsegments */ + size, /* maxsegsz */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &pool->pool_dmat)) { + kfree(pool); + return (NULL); + } + + pool->pool_zone = uma_zcache_create(name, -1, dma_pool_obj_ctor, + dma_pool_obj_dtor, NULL, NULL, dma_pool_obj_import, + dma_pool_obj_release, pool, 0); + + mtx_init(&pool->pool_dma_lock, "linux_dma_pool", NULL, MTX_DEF); + + mtx_init(&pool->pool_ptree_lock, "linux_dma_pool_ptree", NULL, + MTX_DEF); + pctrie_init(&pool->pool_ptree); + + return (pool); +} + +void +linux_dma_pool_destroy(struct dma_pool *pool) +{ + + uma_zdestroy(pool->pool_zone); + bus_dma_tag_destroy(pool->pool_dmat); + mtx_destroy(&pool->pool_ptree_lock); + mtx_destroy(&pool->pool_dma_lock); + kfree(pool); +} + +void * +linux_dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, + dma_addr_t *handle) +{ + struct linux_dma_obj *obj; + + obj = uma_zalloc_arg(pool->pool_zone, pool, mem_flags); + if (obj == NULL) + return (NULL); + + mtx_lock(&pool->pool_ptree_lock); + if (LINUX_DMA_PCTRIE_INSERT(&pool->pool_ptree, obj) != 0) { + mtx_unlock(&pool->pool_ptree_lock); + uma_zfree_arg(pool->pool_zone, obj, pool); + return (NULL); + } + mtx_unlock(&pool->pool_ptree_lock); + + *handle = obj->dma_addr; + return (obj->vaddr); +} + +void +linux_dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma_addr) +{ + struct linux_dma_obj *obj; + + mtx_lock(&pool->pool_ptree_lock); + obj = LINUX_DMA_PCTRIE_LOOKUP(&pool->pool_ptree, dma_addr); + if (obj == NULL) { + mtx_unlock(&pool->pool_ptree_lock); + return; + } + LINUX_DMA_PCTRIE_REMOVE(&pool->pool_ptree, dma_addr); + mtx_unlock(&pool->pool_ptree_lock); + + uma_zfree_arg(pool->pool_zone, obj, pool); } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Apr 24 19:56:02 2019 (r346644) +++ head/sys/sys/param.h Wed Apr 24 20:30:45 2019 (r346645) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300020 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300021 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Apr 24 22:35:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30CE3158304B; Wed, 24 Apr 2019 22:35:31 +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 CA0F883BE0; Wed, 24 Apr 2019 22:35:30 +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 99D5D1AB7F; Wed, 24 Apr 2019 22:35:30 +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 x3OMZUNg041692; Wed, 24 Apr 2019 22:35:30 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3OMZUx5041690; Wed, 24 Apr 2019 22:35:30 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201904242235.x3OMZUx5041690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Wed, 24 Apr 2019 22:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346646 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA0F883BE0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 22:35:31 -0000 Author: bcran Date: Wed Apr 24 22:35:29 2019 New Revision: 346646 URL: https://svnweb.freebsd.org/changeset/base/346646 Log: Fix install-boot.sh and rootgen.sh UEFI bugs tools/boot/install-boot.sh was assuming that if a device was passed in, it should operate on the current system and run efibootmgr etc. to update the boot manager. However, rootgen.sh passes a md(4) device and not a fixed disk. Add a -u option to install-boot.sh to tell it to update the system in-place and run efibootmgr etc. Also, source install-boot.sh in rootgen.sh to allow it to find and call make_esp_file etc. And pass the loader file to make_esp_file instead of a directory name. Reported by: ian Reviewed by: ian,imp,tsoome Differential Revision: https://reviews.freebsd.org/D19992 Modified: head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Wed Apr 24 20:30:45 2019 (r346645) +++ head/tools/boot/install-boot.sh Wed Apr 24 22:35:29 2019 (r346646) @@ -134,29 +134,37 @@ make_esp_device() { echo "Copying loader to /EFI/freebsd on ESP" cp "${file}" "${mntpt}/EFI/freebsd/loader.efi" - existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/loader.efi") + if [ -n "${updatesystem}" ]; then + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/loader.efi") - if [ -z "$existingbootentryloaderfile" ]; then - # Try again without the double forward-slash in the path - existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/loader.efi") - fi - - if [ -z "$existingbootentryloaderfile" ]; then - echo "Creating UEFI boot entry for FreeBSD" - efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null - if [ $? -ne 0 ]; then - die "Failed to create new boot entry" + if [ -z "$existingbootentryloaderfile" ]; then + # Try again without the double forward-slash in the path + existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/loader.efi") fi - # When creating new entries, efibootmgr doesn't mark them active, so we need to - # do so. It doesn't make it easy to find which entry it just added, so rely on - # the fact that it places the new entry first in BootOrder. - bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) - bootentry=$(echo "${bootorder}" | cut -w -f 3)$(echo "${bootorder}" | cut -w -f 2) - echo "Marking UEFI boot entry ${bootentry} active" - efibootmgr --activate "${bootentry}" > /dev/null + if [ -z "$existingbootentryloaderfile" ]; then + echo "Creating UEFI boot entry for FreeBSD" + efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + if [ $? -ne 0 ]; then + die "Failed to create new boot entry" + fi + + # When creating new entries, efibootmgr doesn't mark them active, so we need to + # do so. It doesn't make it easy to find which entry it just added, so rely on + # the fact that it places the new entry first in BootOrder. + bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) + bootentry=$(echo "${bootorder}" | cut -w -f 3)$(echo "${bootorder}" | cut -w -f 2) + echo "Marking UEFI boot entry ${bootentry} active" + efibootmgr --activate "${bootentry}" > /dev/null + else + echo "Existing UEFI FreeBSD boot entry found: not creating a new one" + fi else - echo "Existing UEFI FreeBSD boot entry found: not creating a new one" + # Configure for booting from removable media + if [ ! -d "${mntpt}/EFI/BOOT" ]; then + mkdir -p "${mntpt}/EFI/BOOT" + fi + cp "${file}" "${mntpt}/EFI/BOOT/${efibootname}.efi" fi umount "${mntpt}" @@ -362,6 +370,8 @@ usage() { printf ' -f fs filesystem type: ufs or zfs\n' printf ' -g geli yes or no\n' printf ' -h this help/usage text\n' + printf ' -u Run commands such as efibootmgr to update the\n' + printf ' currently running system\n' printf ' -o optargs optional arguments\n' printf ' -s scheme mbr or gpt\n' exit 0 @@ -372,7 +382,7 @@ srcroot=/ # Note: we really don't support geli boot in this script yet. geli=nogeli -while getopts "b:d:f:g:ho:s:" opt; do +while getopts "b:d:f:g:ho:s:u" opt; do case "$opt" in b) bios=${OPTARG} @@ -388,6 +398,9 @@ while getopts "b:d:f:g:ho:s:" opt; do [Yy][Ee][Ss]|geli) geli=geli ;; *) geli=nogeli ;; esac + ;; + u) + updatesystem=1 ;; o) opts=${OPTARG} Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Wed Apr 24 20:30:45 2019 (r346645) +++ head/tools/boot/rootgen.sh Wed Apr 24 22:35:29 2019 (r346646) @@ -27,6 +27,8 @@ espsize=33292 # vars should likely be conditionally set to allow better automation. # +. $(dirname $0)/install-boot.sh + cpsys() { src=$1 dst=$2 @@ -56,7 +58,7 @@ mk_nogeli_gpt_ufs_uefi() { cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67271583DDA; Wed, 24 Apr 2019 23:10:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79D4D84EB6; Wed, 24 Apr 2019 23:10:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C27F1B0AD; Wed, 24 Apr 2019 23:10:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ONAK1W057979; Wed, 24 Apr 2019 23:10:20 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONAKwv057978; Wed, 24 Apr 2019 23:10:20 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201904242310.x3ONAKwv057978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 24 Apr 2019 23:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346647 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 346647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79D4D84EB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:10:21 -0000 Author: gonzo Date: Wed Apr 24 23:10:19 2019 New Revision: 346647 URL: https://svnweb.freebsd.org/changeset/base/346647 Log: [acpi_ibm] Add support for newer Thinkpad models Add support for newer Thinkpad models with id LEN0268. Was tested on Thinkpad T480 and ThinkPad X1 Yoga 2nd gen. PR: 229120 Submitted by: Ali Abdallah MFC after: 1 week Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Wed Apr 24 22:35:29 2019 (r346646) +++ head/sys/dev/acpi_support/acpi_ibm.c Wed Apr 24 23:10:19 2019 (r346647) @@ -349,7 +349,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0068", "LEN0068", NULL}; +static char *ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL}; static void ibm_led(void *softc, int onoff) @@ -428,9 +428,14 @@ static int acpi_ibm_attach(device_t dev) { int i; + int hkey; struct acpi_ibm_softc *sc; char *maker, *product; - devclass_t ec_devclass; + ACPI_OBJECT_LIST input; + ACPI_OBJECT params[1]; + ACPI_OBJECT out_obj; + ACPI_BUFFER result; + devclass_t ec_devclass; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -465,15 +470,42 @@ acpi_ibm_attach(device_t dev) "initialmask", CTLFLAG_RD, &sc->events_initialmask, 0, "Initial eventmask"); - /* The availmask is the bitmask of supported events */ - if (ACPI_FAILURE(acpi_GetInteger(sc->handle, - IBM_NAME_EVENTS_AVAILMASK, &sc->events_availmask))) + if (ACPI_SUCCESS (acpi_GetInteger(sc->handle, "MHKV", &hkey))) { + device_printf(dev, "Firmware version is 0x%X\n", hkey); + switch(hkey >> 8) + { + case 1: + /* The availmask is the bitmask of supported events */ + if (ACPI_FAILURE(acpi_GetInteger(sc->handle, + IBM_NAME_EVENTS_AVAILMASK, &sc->events_availmask))) + sc->events_availmask = 0xffffffff; + break; + + case 2: + result.Length = sizeof(out_obj); + result.Pointer = &out_obj; + params[0].Type = ACPI_TYPE_INTEGER; + params[0].Integer.Value = 1; + input.Pointer = params; + input.Count = 1; + + sc->events_availmask = 0xffffffff; + + if (ACPI_SUCCESS(AcpiEvaluateObject (sc->handle, + IBM_NAME_EVENTS_AVAILMASK, &input, &result))) + sc->events_availmask = out_obj.Integer.Value; + break; + default: + device_printf(dev, "Unknown firmware version 0x%x\n", hkey); + break; + } + } else sc->events_availmask = 0xffffffff; SYSCTL_ADD_UINT(sc->sysctl_ctx, - SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - "availmask", CTLFLAG_RD, - &sc->events_availmask, 0, "Mask of supported events"); + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "availmask", CTLFLAG_RD, + &sc->events_availmask, 0, "Mask of supported events"); } /* Hook up proc nodes */ From owner-svn-src-head@freebsd.org Wed Apr 24 23:18:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05C021584185; Wed, 24 Apr 2019 23:18:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8FF853EC; Wed, 24 Apr 2019 23:18:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8834D1B251; Wed, 24 Apr 2019 23:18:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ONIAYI063036; Wed, 24 Apr 2019 23:18:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONIA3E063035; Wed, 24 Apr 2019 23:18:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904242318.x3ONIA3E063035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 23:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346648 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 346648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E8FF853EC 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)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:18:11 -0000 Author: jhb Date: Wed Apr 24 23:18:10 2019 New Revision: 346648 URL: https://svnweb.freebsd.org/changeset/base/346648 Log: Fix requests for "plain" SHA digests of an empty buffer. To workaround limitations in the crypto engine, empty buffers are handled by manually constructing the final length block as the payload passed to the crypto engine and disabling the normal "final" handling. For HMAC this length block should hold the length of a single block since the hash is actually the hash of the IPAD digest, but for "plain" SHA the length should be zero instead. Reported by: NIST SHA1 test failure MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Apr 24 23:10:19 2019 (r346647) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Apr 24 23:18:10 2019 (r346648) @@ -537,8 +537,9 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, dst = (char *)(crwr + 1) + kctx_len + DUMMY_BYTES; if (crd->crd_len == 0) { dst[0] = 0x80; - *(uint64_t *)(dst + axf->blocksize - sizeof(uint64_t)) = - htobe64(axf->blocksize << 3); + if (s->mode == HMAC) + *(uint64_t *)(dst + axf->blocksize - sizeof(uint64_t)) = + htobe64(axf->blocksize << 3); } else if (imm_len != 0) crypto_copydata(crp->crp_flags, crp->crp_buf, crd->crd_skip, crd->crd_len, dst); From owner-svn-src-head@freebsd.org Wed Apr 24 23:27:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5AA715843DA; Wed, 24 Apr 2019 23:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F5985894; Wed, 24 Apr 2019 23:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E3BF1B3F7; Wed, 24 Apr 2019 23:27:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ONRdtf068697; Wed, 24 Apr 2019 23:27:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONRdEm068696; Wed, 24 Apr 2019 23:27:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904242327.x3ONRdEm068696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 23:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346649 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 346649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48F5985894 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:27:40 -0000 Author: jhb Date: Wed Apr 24 23:27:39 2019 New Revision: 346649 URL: https://svnweb.freebsd.org/changeset/base/346649 Log: Don't panic for empty CCM requests. A request to encrypt an empty payload without any AAD is unusual, but it is defined behavior. Removing this assertion removes a panic and instead returns the correct tag for an empty buffer. Reviewed by: cem, sef MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20043 Modified: head/sys/opencrypto/cbc_mac.c Modified: head/sys/opencrypto/cbc_mac.c ============================================================================== --- head/sys/opencrypto/cbc_mac.c Wed Apr 24 23:18:10 2019 (r346648) +++ head/sys/opencrypto/cbc_mac.c Wed Apr 24 23:27:39 2019 (r346649) @@ -82,9 +82,6 @@ AES_CBC_MAC_Reinit(struct aes_cbc_mac_ctx *ctx, const uint8_t *bp = b0, flags = 0; uint8_t L = 0; uint64_t dataLength = ctx->cryptDataLength; - - KASSERT(ctx->authDataLength != 0 || ctx->cryptDataLength != 0, - ("Auth Data and Data lengths cannot both be 0")); KASSERT(nonceLen >= 7 && nonceLen <= 13, ("nonceLen must be between 7 and 13 bytes")); From owner-svn-src-head@freebsd.org Wed Apr 24 23:31:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3080015844FE; Wed, 24 Apr 2019 23:31:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D71FD85CB1; Wed, 24 Apr 2019 23:31:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACC4E1B567; Wed, 24 Apr 2019 23:31:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ONVkGb073439; Wed, 24 Apr 2019 23:31:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONVkKa073437; Wed, 24 Apr 2019 23:31:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904242331.x3ONVkKa073437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 23:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346650 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 346650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D71FD85CB1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:31:47 -0000 Author: jhb Date: Wed Apr 24 23:31:46 2019 New Revision: 346650 URL: https://svnweb.freebsd.org/changeset/base/346650 Log: Add support for AES-CCM to ccr(4). This is fairly similar to the AES-GCM support in ccr(4) in that it will fall back to software for certain cases (requests with only AAD and requests that are too large). Tested by: cryptocheck, cryptotest.py MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/dev/cxgbe/crypto/t4_crypto.h Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Apr 24 23:27:39 2019 (r346649) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Apr 24 23:31:46 2019 (r346650) @@ -150,6 +150,10 @@ struct ccr_session_gmac { char ghash_h[GMAC_BLOCK_LEN]; }; +struct ccr_session_ccm_mac { + int hash_len; +}; + struct ccr_session_blkcipher { unsigned int cipher_mode; unsigned int key_len; @@ -162,10 +166,11 @@ struct ccr_session_blkcipher { struct ccr_session { bool active; int pending; - enum { HASH, HMAC, BLKCIPHER, AUTHENC, GCM } mode; + enum { HASH, HMAC, BLKCIPHER, AUTHENC, GCM, CCM } mode; union { struct ccr_session_hmac hmac; struct ccr_session_gmac gmac; + struct ccr_session_ccm_mac ccm_mac; }; struct ccr_session_blkcipher blkcipher; }; @@ -208,6 +213,8 @@ struct ccr_softc { uint64_t stats_authenc_decrypt; uint64_t stats_gcm_encrypt; uint64_t stats_gcm_decrypt; + uint64_t stats_ccm_encrypt; + uint64_t stats_ccm_decrypt; uint64_t stats_wr_nomem; uint64_t stats_inflight; uint64_t stats_mac_error; @@ -383,7 +390,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr u_int wr_len, u_int imm_len, u_int sgl_len, u_int hash_size, struct cryptop *crp) { - u_int cctx_size; + u_int cctx_size, idata_len; cctx_size = sizeof(struct _key_ctx) + kctx_len; crwr->wreq.op_to_cctx_size = htobe32( @@ -417,9 +424,11 @@ ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16)); crwr->sc_imm.cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM) | - V_ULP_TX_SC_MORE(imm_len != 0 ? 0 : 1)); - crwr->sc_imm.len = htobe32(wr_len - offsetof(struct chcr_wr, sec_cpl) - - sgl_len); + V_ULP_TX_SC_MORE(sgl_len != 0 ? 1 : 0)); + idata_len = wr_len - offsetof(struct chcr_wr, sec_cpl) - sgl_len; + if (imm_len % 16 != 0) + idata_len -= 16 - imm_len % 16; + crwr->sc_imm.len = htobe32(idata_len); } static int @@ -1567,6 +1576,481 @@ out: } static void +generate_ccm_b0(struct cryptodesc *crda, struct cryptodesc *crde, + u_int hash_size_in_response, const char *iv, char *b0) +{ + u_int i, payload_len; + + /* NB: L is already set in the first byte of the IV. */ + memcpy(b0, iv, CCM_B0_SIZE); + + /* Set length of hash in bits 3 - 5. */ + b0[0] |= (((hash_size_in_response - 2) / 2) << 3); + + /* Store the payload length as a big-endian value. */ + payload_len = crde->crd_len; + for (i = 0; i < iv[0]; i++) { + b0[CCM_CBC_BLOCK_LEN - 1 - i] = payload_len; + payload_len >>= 8; + } + + /* + * If there is AAD in the request, set bit 6 in the flags + * field and store the AAD length as a big-endian value at the + * start of block 1. This only assumes a 16-bit AAD length + * since T6 doesn't support large AAD sizes. + */ + if (crda->crd_len != 0) { + b0[0] |= (1 << 6); + *(uint16_t *)(b0 + CCM_B0_SIZE) = htobe16(crda->crd_len); + } +} + +static int +ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, + struct cryptodesc *crda, struct cryptodesc *crde) +{ + char iv[CHCR_MAX_CRYPTO_IV_LEN]; + struct ulptx_idata *idata; + struct chcr_wr *crwr; + struct wrqe *wr; + char *dst; + u_int iv_len, kctx_len, op_type, transhdr_len, wr_len; + u_int aad_len, b0_len, hash_size_in_response, imm_len; + u_int aad_start, aad_stop, cipher_start, cipher_stop, auth_insert; + u_int hmac_ctrl, input_len; + int dsgl_nsegs, dsgl_len; + int sgl_nsegs, sgl_len; + int error; + + if (s->blkcipher.key_len == 0) + return (EINVAL); + + /* + * The crypto engine doesn't handle CCM requests with an empty + * payload, so handle those in software instead. + */ + if (crde->crd_len == 0) + return (EMSGSIZE); + + /* + * AAD is only permitted before the cipher/plain text, not + * after. + */ + if (crda->crd_len + crda->crd_skip > crde->crd_len + crde->crd_skip) + return (EMSGSIZE); + + /* + * CCM always includes block 0 in the AAD before AAD from the + * request. + */ + b0_len = CCM_B0_SIZE; + if (crda->crd_len != 0) + b0_len += CCM_AAD_FIELD_SIZE; + aad_len = b0_len + crda->crd_len; + + /* + * Always assume a 12 byte input IV for now since that is what + * OCF always generates. The full IV in the work request is + * 16 bytes. + */ + iv_len = AES_BLOCK_LEN; + + if (iv_len + aad_len > MAX_AAD_LEN) + return (EMSGSIZE); + + hash_size_in_response = s->ccm_mac.hash_len; + if (crde->crd_flags & CRD_F_ENCRYPT) + op_type = CHCR_ENCRYPT_OP; + else + op_type = CHCR_DECRYPT_OP; + + /* + * The output buffer consists of the cipher text followed by + * the tag when encrypting. For decryption it only contains + * the plain text. + * + * Due to a firmware bug, the output buffer must include a + * dummy output buffer for the IV and AAD prior to the real + * output buffer. + */ + if (op_type == CHCR_ENCRYPT_OP) { + if (iv_len + aad_len + crde->crd_len + hash_size_in_response > + MAX_REQUEST_SIZE) + return (EFBIG); + } else { + if (iv_len + aad_len + crde->crd_len > MAX_REQUEST_SIZE) + return (EFBIG); + } + sglist_reset(sc->sg_dsgl); + error = sglist_append_sglist(sc->sg_dsgl, sc->sg_iv_aad, 0, iv_len + + aad_len); + if (error) + return (error); + error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, crde->crd_skip, + crde->crd_len); + if (error) + return (error); + if (op_type == CHCR_ENCRYPT_OP) { + error = sglist_append_sglist(sc->sg_dsgl, sc->sg_crp, + crda->crd_inject, hash_size_in_response); + if (error) + return (error); + } + dsgl_nsegs = ccr_count_sgl(sc->sg_dsgl, DSGL_SGE_MAXLEN); + if (dsgl_nsegs > MAX_RX_PHYS_DSGL_SGE) + return (EFBIG); + dsgl_len = ccr_phys_dsgl_len(dsgl_nsegs); + + /* + * The 'key' part of the key context consists of two copies of + * the AES key. + */ + kctx_len = roundup2(s->blkcipher.key_len, 16) * 2; + transhdr_len = CIPHER_TRANSHDR_SIZE(kctx_len, dsgl_len); + + /* + * The input buffer consists of the IV, AAD (including block + * 0), and then the cipher/plain text. For decryption + * requests the hash is appended after the cipher text. + * + * The IV is always stored at the start of the input buffer + * even though it may be duplicated in the payload. The + * crypto engine doesn't work properly if the IV offset points + * inside of the AAD region, so a second copy is always + * required. + */ + input_len = aad_len + crde->crd_len; + if (op_type == CHCR_DECRYPT_OP) + input_len += hash_size_in_response; + if (input_len > MAX_REQUEST_SIZE) + return (EFBIG); + if (ccr_use_imm_data(transhdr_len, iv_len + input_len)) { + imm_len = input_len; + sgl_nsegs = 0; + sgl_len = 0; + } else { + /* Block 0 is passed as immediate data. */ + imm_len = b0_len; + + sglist_reset(sc->sg_ulptx); + if (crda->crd_len != 0) { + error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, + crda->crd_skip, crda->crd_len); + if (error) + return (error); + } + error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, + crde->crd_skip, crde->crd_len); + if (error) + return (error); + if (op_type == CHCR_DECRYPT_OP) { + error = sglist_append_sglist(sc->sg_ulptx, sc->sg_crp, + crda->crd_inject, hash_size_in_response); + if (error) + return (error); + } + sgl_nsegs = sc->sg_ulptx->sg_nseg; + sgl_len = ccr_ulptx_sgl_len(sgl_nsegs); + } + + aad_start = iv_len + 1; + aad_stop = aad_start + aad_len - 1; + cipher_start = aad_stop + 1; + if (op_type == CHCR_DECRYPT_OP) + cipher_stop = hash_size_in_response; + else + cipher_stop = 0; + if (op_type == CHCR_DECRYPT_OP) + auth_insert = hash_size_in_response; + else + auth_insert = 0; + + wr_len = roundup2(transhdr_len, 16) + iv_len + roundup2(imm_len, 16) + + sgl_len; + if (wr_len > SGE_MAX_WR_LEN) + return (EFBIG); + wr = alloc_wrqe(wr_len, sc->txq); + if (wr == NULL) { + sc->stats_wr_nomem++; + return (ENOMEM); + } + crwr = wrtod(wr); + memset(crwr, 0, wr_len); + + /* + * Read the nonce from the request or generate a random one if + * none is provided. Use the nonce to generate the full IV + * with the counter set to 0. + */ + memset(iv, 0, iv_len); + iv[0] = (15 - AES_CCM_IV_LEN) - 1; + if (op_type == CHCR_ENCRYPT_OP) { + if (crde->crd_flags & CRD_F_IV_EXPLICIT) + memcpy(iv + 1, crde->crd_iv, AES_CCM_IV_LEN); + else + arc4rand(iv + 1, AES_CCM_IV_LEN, 0); + if ((crde->crd_flags & CRD_F_IV_PRESENT) == 0) + crypto_copyback(crp->crp_flags, crp->crp_buf, + crde->crd_inject, AES_CCM_IV_LEN, iv + 1); + } else { + if (crde->crd_flags & CRD_F_IV_EXPLICIT) + memcpy(iv + 1, crde->crd_iv, AES_CCM_IV_LEN); + else + crypto_copydata(crp->crp_flags, crp->crp_buf, + crde->crd_inject, AES_CCM_IV_LEN, iv + 1); + } + + ccr_populate_wreq(sc, crwr, kctx_len, wr_len, imm_len, sgl_len, 0, + crp); + + /* XXX: Hardcodes SGE loopback channel of 0. */ + crwr->sec_cpl.op_ivinsrtofst = htobe32( + V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | + V_CPL_TX_SEC_PDU_RXCHID(sc->tx_channel_id) | + V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | + V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | + V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); + + crwr->sec_cpl.pldlen = htobe32(iv_len + input_len); + + /* + * NB: cipherstop is explicitly set to 0. See comments above + * in ccr_gcm(). + */ + crwr->sec_cpl.aadstart_cipherstop_hi = htobe32( + V_CPL_TX_SEC_PDU_AADSTART(aad_start) | + V_CPL_TX_SEC_PDU_AADSTOP(aad_stop) | + V_CPL_TX_SEC_PDU_CIPHERSTART(cipher_start) | + V_CPL_TX_SEC_PDU_CIPHERSTOP_HI(0)); + crwr->sec_cpl.cipherstop_lo_authinsert = htobe32( + V_CPL_TX_SEC_PDU_CIPHERSTOP_LO(0) | + V_CPL_TX_SEC_PDU_AUTHSTART(cipher_start) | + V_CPL_TX_SEC_PDU_AUTHSTOP(cipher_stop) | + V_CPL_TX_SEC_PDU_AUTHINSERT(auth_insert)); + + /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ + hmac_ctrl = ccr_hmac_ctrl(AES_CBC_MAC_HASH_LEN, hash_size_in_response); + crwr->sec_cpl.seqno_numivs = htobe32( + V_SCMD_SEQ_NO_CTRL(0) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_ENC_DEC_CTRL(op_type) | + V_SCMD_CIPH_AUTH_SEQ_CTRL(op_type == CHCR_ENCRYPT_OP ? 0 : 1) | + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_AES_CCM) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_CBCMAC) | + V_SCMD_HMAC_CTRL(hmac_ctrl) | + V_SCMD_IV_SIZE(iv_len / 2) | + V_SCMD_NUM_IVS(0)); + crwr->sec_cpl.ivgen_hdrlen = htobe32( + V_SCMD_IV_GEN_CTRL(0) | + V_SCMD_MORE_FRAGS(0) | V_SCMD_LAST_FRAG(0) | V_SCMD_MAC_ONLY(0) | + V_SCMD_AADIVDROP(0) | V_SCMD_HDR_LEN(dsgl_len)); + + crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; + memcpy(crwr->key_ctx.key, s->blkcipher.enckey, s->blkcipher.key_len); + memcpy(crwr->key_ctx.key + roundup(s->blkcipher.key_len, 16), + s->blkcipher.enckey, s->blkcipher.key_len); + + dst = (char *)(crwr + 1) + kctx_len; + ccr_write_phys_dsgl(sc, dst, dsgl_nsegs); + dst += sizeof(struct cpl_rx_phys_dsgl) + dsgl_len; + memcpy(dst, iv, iv_len); + dst += iv_len; + generate_ccm_b0(crda, crde, hash_size_in_response, iv, dst); + if (sgl_nsegs == 0) { + dst += b0_len; + if (crda->crd_len != 0) { + crypto_copydata(crp->crp_flags, crp->crp_buf, + crda->crd_skip, crda->crd_len, dst); + dst += crda->crd_len; + } + crypto_copydata(crp->crp_flags, crp->crp_buf, crde->crd_skip, + crde->crd_len, dst); + dst += crde->crd_len; + if (op_type == CHCR_DECRYPT_OP) + crypto_copydata(crp->crp_flags, crp->crp_buf, + crda->crd_inject, hash_size_in_response, dst); + } else { + dst += CCM_B0_SIZE; + if (b0_len > CCM_B0_SIZE) { + /* + * If there is AAD, insert padding including a + * ULP_TX_SC_NOOP so that the ULP_TX_SC_DSGL + * is 16-byte aligned. + */ + KASSERT(b0_len - CCM_B0_SIZE == CCM_AAD_FIELD_SIZE, + ("b0_len mismatch")); + memset(dst + CCM_AAD_FIELD_SIZE, 0, + 8 - CCM_AAD_FIELD_SIZE); + idata = (void *)(dst + 8); + idata->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); + idata->len = htobe32(0); + dst = (void *)(idata + 1); + } + ccr_write_ulptx_sgl(sc, dst, sgl_nsegs); + } + + /* XXX: TODO backpressure */ + t4_wrq_tx(sc->adapter, wr); + + return (0); +} + +static int +ccr_ccm_done(struct ccr_softc *sc, struct ccr_session *s, + struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) +{ + + /* + * The updated IV to permit chained requests is at + * cpl->data[2], but OCF doesn't permit chained requests. + * + * Note that the hardware should always verify the CBC MAC + * hash. + */ + return (error); +} + +/* + * Handle a CCM request that is not supported by the crypto engine by + * performing the operation in software. Derived from swcr_authenc(). + */ +static void +ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp, + struct cryptodesc *crda, struct cryptodesc *crde) +{ + struct auth_hash *axf; + struct enc_xform *exf; + union authctx *auth_ctx; + uint8_t *kschedule; + char block[CCM_CBC_BLOCK_LEN]; + char digest[AES_CBC_MAC_HASH_LEN]; + char iv[AES_CCM_IV_LEN]; + int error, i, len; + + auth_ctx = NULL; + kschedule = NULL; + + /* Initialize the MAC. */ + switch (s->blkcipher.key_len) { + case 16: + axf = &auth_hash_ccm_cbc_mac_128; + break; + case 24: + axf = &auth_hash_ccm_cbc_mac_192; + break; + case 32: + axf = &auth_hash_ccm_cbc_mac_256; + break; + default: + error = EINVAL; + goto out; + } + auth_ctx = malloc(axf->ctxsize, M_CCR, M_NOWAIT); + if (auth_ctx == NULL) { + error = ENOMEM; + goto out; + } + axf->Init(auth_ctx); + axf->Setkey(auth_ctx, s->blkcipher.enckey, s->blkcipher.key_len); + + /* Initialize the cipher. */ + exf = &enc_xform_ccm; + error = exf->setkey(&kschedule, s->blkcipher.enckey, + s->blkcipher.key_len); + if (error) + goto out; + + if (crde->crd_flags & CRD_F_ENCRYPT) { + if (crde->crd_flags & CRD_F_IV_EXPLICIT) + memcpy(iv, crde->crd_iv, AES_CCM_IV_LEN); + else + arc4rand(iv, AES_CCM_IV_LEN, 0); + if ((crde->crd_flags & CRD_F_IV_PRESENT) == 0) + crypto_copyback(crp->crp_flags, crp->crp_buf, + crde->crd_inject, AES_CCM_IV_LEN, iv); + } else { + if (crde->crd_flags & CRD_F_IV_EXPLICIT) + memcpy(iv, crde->crd_iv, AES_CCM_IV_LEN); + else + crypto_copydata(crp->crp_flags, crp->crp_buf, + crde->crd_inject, AES_CCM_IV_LEN, iv); + } + + auth_ctx->aes_cbc_mac_ctx.authDataLength = crda->crd_len; + auth_ctx->aes_cbc_mac_ctx.cryptDataLength = crde->crd_len; + axf->Reinit(auth_ctx, iv, sizeof(iv)); + + /* MAC the AAD. */ + for (i = 0; i < crda->crd_len; i += sizeof(block)) { + len = imin(crda->crd_len - i, sizeof(block)); + crypto_copydata(crp->crp_flags, crp->crp_buf, crda->crd_skip + + i, len, block); + bzero(block + len, sizeof(block) - len); + axf->Update(auth_ctx, block, sizeof(block)); + } + + exf->reinit(kschedule, iv); + + /* Do encryption/decryption with MAC */ + for (i = 0; i < crde->crd_len; i += sizeof(block)) { + len = imin(crde->crd_len - i, sizeof(block)); + crypto_copydata(crp->crp_flags, crp->crp_buf, crde->crd_skip + + i, len, block); + bzero(block + len, sizeof(block) - len); + if (crde->crd_flags & CRD_F_ENCRYPT) { + axf->Update(auth_ctx, block, len); + exf->encrypt(kschedule, block); + crypto_copyback(crp->crp_flags, crp->crp_buf, + crde->crd_skip + i, len, block); + } else { + exf->decrypt(kschedule, block); + axf->Update(auth_ctx, block, len); + } + } + + /* Finalize MAC. */ + axf->Final(digest, auth_ctx); + + /* Inject or validate tag. */ + if (crde->crd_flags & CRD_F_ENCRYPT) { + crypto_copyback(crp->crp_flags, crp->crp_buf, crda->crd_inject, + sizeof(digest), digest); + error = 0; + } else { + char digest2[GMAC_DIGEST_LEN]; + + crypto_copydata(crp->crp_flags, crp->crp_buf, crda->crd_inject, + sizeof(digest2), digest2); + if (timingsafe_bcmp(digest, digest2, sizeof(digest)) == 0) { + error = 0; + + /* Tag matches, decrypt data. */ + exf->reinit(kschedule, iv); + for (i = 0; i < crde->crd_len; i += sizeof(block)) { + len = imin(crde->crd_len - i, sizeof(block)); + crypto_copydata(crp->crp_flags, crp->crp_buf, + crde->crd_skip + i, len, block); + bzero(block + len, sizeof(block) - len); + exf->decrypt(kschedule, block); + crypto_copyback(crp->crp_flags, crp->crp_buf, + crde->crd_skip + i, len, block); + } + } else + error = EBADMSG; + } + + exf->zerokey(&kschedule); +out: + if (auth_ctx != NULL) { + memset(auth_ctx, 0, axf->ctxsize); + free(auth_ctx, M_CCR); + } + crp->crp_etype = error; + crypto_done(crp); +} + +static void ccr_identify(driver_t *driver, device_t parent) { struct adapter *sc; @@ -1627,6 +2111,10 @@ ccr_sysctls(struct ccr_softc *sc) &sc->stats_gcm_encrypt, 0, "AES-GCM encryption requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "gcm_decrypt", CTLFLAG_RD, &sc->stats_gcm_decrypt, 0, "AES-GCM decryption requests submitted"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "ccm_encrypt", CTLFLAG_RD, + &sc->stats_ccm_encrypt, 0, "AES-CCM encryption requests submitted"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "ccm_decrypt", CTLFLAG_RD, + &sc->stats_ccm_decrypt, 0, "AES-CCM decryption requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "wr_nomem", CTLFLAG_RD, &sc->stats_wr_nomem, 0, "Work request memory allocation failures"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "inflight", CTLFLAG_RD, @@ -1695,6 +2183,8 @@ ccr_attach(device_t dev) crypto_register(cid, CRYPTO_AES_192_NIST_GMAC, 0, 0); crypto_register(cid, CRYPTO_AES_256_NIST_GMAC, 0, 0); crypto_register(cid, CRYPTO_AES_XTS, 0, 0); + crypto_register(cid, CRYPTO_AES_CCM_16, 0, 0); + crypto_register(cid, CRYPTO_AES_CCM_CBC_MAC, 0, 0); return (0); } @@ -1895,6 +2385,23 @@ ccr_aes_setkey(struct ccr_session *s, int alg, const v opad_present = 0; kctx_len += GMAC_BLOCK_LEN; break; + case CCM: + switch (kbits) { + case 128: + mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; + break; + case 192: + mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_192; + break; + case 256: + mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; + break; + default: + panic("should not get here"); + } + opad_present = 0; + kctx_len *= 2; + break; default: mk_size = CHCR_KEYCTX_NO_KEY; opad_present = 0; @@ -1948,6 +2455,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: + case CRYPTO_AES_CCM_CBC_MAC: if (hash) return (EINVAL); hash = c; @@ -1994,6 +2502,9 @@ ccr_newsession(device_t dev, crypto_session_t cses, st auth_mode = SCMD_AUTH_MODE_GHASH; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; break; + case CRYPTO_AES_CCM_CBC_MAC: + auth_mode = SCMD_AUTH_MODE_CBCMAC; + break; } switch (c->cri_alg) { case CRYPTO_SHA1_HMAC: @@ -2009,6 +2520,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st case CRYPTO_AES_ICM: case CRYPTO_AES_NIST_GCM_16: case CRYPTO_AES_XTS: + case CRYPTO_AES_CCM_16: if (cipher) return (EINVAL); cipher = c; @@ -2029,6 +2541,10 @@ ccr_newsession(device_t dev, crypto_session_t cses, st cipher_mode = SCMD_CIPH_MODE_AES_XTS; iv_len = AES_BLOCK_LEN; break; + case CRYPTO_AES_CCM_16: + cipher_mode = SCMD_CIPH_MODE_AES_CCM; + iv_len = AES_CCM_IV_LEN; + break; } if (c->cri_key != NULL) { error = ccr_aes_check_keylen(c->cri_alg, @@ -2043,13 +2559,19 @@ ccr_newsession(device_t dev, crypto_session_t cses, st } if (gcm_hash != (cipher_mode == SCMD_CIPH_MODE_AES_GCM)) return (EINVAL); + if ((auth_mode == SCMD_AUTH_MODE_CBCMAC) != + (cipher_mode == SCMD_CIPH_MODE_AES_CCM)) + return (EINVAL); if (hash == NULL && cipher == NULL) return (EINVAL); if (hash != NULL) { - if ((hmac || gcm_hash) && hash->cri_key == NULL) - return (EINVAL); - if (!(hmac || gcm_hash) && hash->cri_key != NULL) - return (EINVAL); + if (hmac || gcm_hash || auth_mode == SCMD_AUTH_MODE_CBCMAC) { + if (hash->cri_key == NULL) + return (EINVAL); + } else { + if (hash->cri_key != NULL) + return (EINVAL); + } } sc = device_get_softc(dev); @@ -2073,6 +2595,8 @@ ccr_newsession(device_t dev, crypto_session_t cses, st if (gcm_hash) s->mode = GCM; + else if (cipher_mode == SCMD_CIPH_MODE_AES_CCM) + s->mode = CCM; else if (hash != NULL && cipher != NULL) s->mode = AUTHENC; else if (hash != NULL) { @@ -2090,6 +2614,11 @@ ccr_newsession(device_t dev, crypto_session_t cses, st else s->gmac.hash_len = hash->cri_mlen; ccr_init_gmac_hash(s, hash->cri_key, hash->cri_klen); + } else if (auth_mode == SCMD_AUTH_MODE_CBCMAC) { + if (hash->cri_mlen == 0) + s->ccm_mac.hash_len = AES_CBC_MAC_HASH_LEN; + else + s->ccm_mac.hash_len = hash->cri_mlen; } else if (hash != NULL) { s->hmac.auth_hash = auth_hash; s->hmac.auth_mode = auth_mode; @@ -2270,6 +2799,37 @@ ccr_process(device_t dev, struct cryptop *crp, int hin sc->stats_gcm_decrypt++; } break; + case CCM: + error = 0; + if (crd->crd_alg == CRYPTO_AES_CCM_16) { + crde = crd; + crda = crd->crd_next; + } else { + crda = crd; + crde = crd->crd_next; + } + if (crde->crd_flags & CRD_F_KEY_EXPLICIT) { + error = ccr_aes_check_keylen(crde->crd_alg, + crde->crd_klen); + if (error) + break; + ccr_aes_setkey(s, crde->crd_alg, crde->crd_key, + crde->crd_klen); + } + error = ccr_ccm(sc, s, crp, crda, crde); + if (error == EMSGSIZE) { + sc->stats_sw_fallback++; + mtx_unlock(&sc->lock); + ccr_ccm_soft(s, crp, crda, crde); + return (0); + } + if (error == 0) { + if (crde->crd_flags & CRD_F_ENCRYPT) + sc->stats_ccm_encrypt++; + else + sc->stats_ccm_decrypt++; + } + break; } if (error == 0) { @@ -2330,6 +2890,9 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_hea break; case GCM: error = ccr_gcm_done(sc, s, crp, cpl, error); + break; + case CCM: + error = ccr_ccm_done(sc, s, crp, cpl, error); break; } Modified: head/sys/dev/cxgbe/crypto/t4_crypto.h ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.h Wed Apr 24 23:27:39 2019 (r346649) +++ head/sys/dev/cxgbe/crypto/t4_crypto.h Wed Apr 24 23:31:46 2019 (r346650) @@ -126,6 +126,9 @@ struct phys_sge_pairs { }; /* From chr_crypto.h */ +#define CCM_B0_SIZE 16 +#define CCM_AAD_FIELD_SIZE 2 + #define CHCR_AES_MAX_KEY_LEN (AES_XTS_MAX_KEY) #define CHCR_MAX_CRYPTO_IV_LEN 16 /* AES IV len */ From owner-svn-src-head@freebsd.org Wed Apr 24 23:35:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7089C1584751; Wed, 24 Apr 2019 23:35:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 100B985F03; Wed, 24 Apr 2019 23:35:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F35CF1B5AC; Wed, 24 Apr 2019 23:35:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ONZASL073663; Wed, 24 Apr 2019 23:35:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONZA82073662; Wed, 24 Apr 2019 23:35:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904242335.x3ONZA82073662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 24 Apr 2019 23:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346651 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 346651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 100B985F03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:35:11 -0000 Author: jhb Date: Wed Apr 24 23:35:10 2019 New Revision: 346651 URL: https://svnweb.freebsd.org/changeset/base/346651 Log: Parse MIPS relocations to unbreak kldxref on MIPS. Parse the R_MIPS_32 and R_MIPS_64 relocations. Both Elf_Rel and Elf_Rela relocations are handled since O32 MIPS uses Elf_Rel while N64 uses Elf_Rela. Note that R_MIPS_32 is only handled for 32-bit mips and R_MIPS_64 for 64-bit. N32 is untested. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D19870 Added: head/usr.sbin/kldxref/ef_mips.c (contents, props changed) Added: head/usr.sbin/kldxref/ef_mips.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/kldxref/ef_mips.c Wed Apr 24 23:35:10 2019 (r346651) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 John Baldwin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * 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 + +#include +#include + +#include "ef.h" + +/* + * Apply relocations to the values we got from the file. `relbase' is the + * target relocation address of the section, and `dataoff' is the target + * relocation address of the data in `dest'. + */ +int +ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, + Elf_Off dataoff, size_t len, void *dest) +{ + Elf_Addr *where, val; + const Elf_Rel *rel; + const Elf_Rela *rela; + Elf_Addr addend, addr; + Elf_Size rtype, symidx; + + switch (reltype) { + case EF_RELOC_REL: + rel = (const Elf_Rel *)reldata; + where = (Elf_Addr *)((char *)dest + relbase + rel->r_offset - + dataoff); + addend = 0; + rtype = ELF_R_TYPE(rel->r_info); + symidx = ELF_R_SYM(rel->r_info); + break; + case EF_RELOC_RELA: + rela = (const Elf_Rela *)reldata; + where = (Elf_Addr *)((char *)dest + relbase + rela->r_offset - + dataoff); + addend = rela->r_addend; + rtype = ELF_R_TYPE(rela->r_info); + symidx = ELF_R_SYM(rela->r_info); + break; + default: + return (EINVAL); + } + + if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) + return (0); + + if (reltype == EF_RELOC_REL) + addend = *where; + + switch (rtype) { +#ifdef __LP64__ + case R_MIPS_64: /* S + A */ +#else + case R_MIPS_32: /* S + A */ +#endif + addr = EF_SYMADDR(ef, symidx); + val = addr + addend; + *where = val; + break; + default: + warnx("unhandled relocation type %d", (int)rtype); + } + return (0); +} From owner-svn-src-head@freebsd.org Wed Apr 24 23:51:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FAC91584AA0; Wed, 24 Apr 2019 23:51: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 1DF70865BA; Wed, 24 Apr 2019 23:51:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDB201B8A4; Wed, 24 Apr 2019 23:51: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 x3ONpCYv081205; Wed, 24 Apr 2019 23:51:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONpC2s081204; Wed, 24 Apr 2019 23:51:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904242351.x3ONpC2s081204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 24 Apr 2019 23:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346652 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DF70865BA 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:51:13 -0000 Author: ian Date: Wed Apr 24 23:51:12 2019 New Revision: 346652 URL: https://svnweb.freebsd.org/changeset/base/346652 Log: Complain and exit the script if the 'make install' phase fails. Also, there is no need to install any debug files. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Wed Apr 24 23:35:10 2019 (r346651) +++ head/tools/boot/rootgen.sh Wed Apr 24 23:51:12 2019 (r346652) @@ -783,7 +783,11 @@ EOF # XXX cp /boot/device.hints ${DESTDIR}/boot/device.hints # Assume we're already built -make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes +make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes WITHOUT_DEBUG_FILES=yes +if [ $? -ne 0 ]; then + echo "make install failed" + exit 1 +fi # Copy init, /bin/sh, minimal libraries and testing /etc/rc mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin \ ${DESTDIR}/lib ${DESTDIR}/libexec \ From owner-svn-src-head@freebsd.org Wed Apr 24 23:52:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 289D31584CA7; Wed, 24 Apr 2019 23:52:39 +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 C321B8684E; Wed, 24 Apr 2019 23:52:38 +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 9B9001B90E; Wed, 24 Apr 2019 23:52:38 +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 x3ONqcdw084233; Wed, 24 Apr 2019 23:52:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ONqcKh084232; Wed, 24 Apr 2019 23:52:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904242352.x3ONqcKh084232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 24 Apr 2019 23:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346653 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C321B8684E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 23:52:39 -0000 Author: ian Date: Wed Apr 24 23:52:38 2019 New Revision: 346653 URL: https://svnweb.freebsd.org/changeset/base/346653 Log: The zfs module has grown a dependency on zcl_nfs4.ko, so copy it into all the test images. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Wed Apr 24 23:51:12 2019 (r346652) +++ head/tools/boot/rootgen.sh Wed Apr 24 23:52:38 2019 (r346653) @@ -110,6 +110,7 @@ mk_nogeli_gpt_zfs_legacy() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -148,6 +149,7 @@ mk_nogeli_gpt_zfs_uefi() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -187,6 +189,7 @@ mk_nogeli_gpt_zfs_both() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -268,6 +271,7 @@ mk_nogeli_mbr_zfs_legacy() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -309,6 +313,7 @@ mk_nogeli_mbr_zfs_uefi() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -350,6 +355,7 @@ mk_nogeli_mbr_zfs_both() { zfs_load=YES opensolaris_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko # end tweaks @@ -500,6 +506,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko @@ -543,6 +550,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko @@ -587,6 +595,7 @@ zfs_load=YES opensolaris_load=YES geom_eli_load=YES EOF + cp /boot/kernel/acl_nfs4.ko ${mntpt}/boot/kernel/acl_nfs4.ko cp /boot/kernel/zfs.ko ${mntpt}/boot/kernel/zfs.ko cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko cp /boot/kernel/geom_eli.ko ${mntpt}/boot/kernel/geom_eli.ko From owner-svn-src-head@freebsd.org Thu Apr 25 00:08:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5034B1585163; Thu, 25 Apr 2019 00:08:16 +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 EABEF86D77; Thu, 25 Apr 2019 00:08:15 +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 B62BF1BAC5; Thu, 25 Apr 2019 00:08:15 +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 x3P08FX8089804; Thu, 25 Apr 2019 00:08:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3P08FfB089803; Thu, 25 Apr 2019 00:08:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904250008.x3P08FfB089803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 25 Apr 2019 00:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346654 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EABEF86D77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 00:08:16 -0000 Author: ian Date: Thu Apr 25 00:08:15 2019 New Revision: 346654 URL: https://svnweb.freebsd.org/changeset/base/346654 Log: For the geli-gpt-zfs test images, both bios and uefi flavors, add a dummy ufs partition as p2, and put the zfs partition at p3, to test the ability of the zfs probe code to find a zfs pool on something other than the first partition. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Wed Apr 24 23:52:38 2019 (r346653) +++ head/tools/boot/rootgen.sh Thu Apr 25 00:08:15 2019 (r346654) @@ -487,15 +487,20 @@ mk_geli_gpt_zfs_legacy() { bios=$7 pool=geli-gpt-zfs-legacy - dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 )) + # Note that in this flavor we create an empty p2 ufs partition, and put + # the bootable zfs stuff on p3, just to test the ability of the zfs probe + # probe routines to find a pool on a partition other than the first one. + + dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 )) md=$(mdconfig -f ${img}) gpart create -s gpt ${md} gpart add -t freebsd-boot -s 400k -a 4k ${md} # <= ~540k + gpart add -t freebsd-ufs -s 100m ${md} gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 - echo ${passphrase} | geli attach -j - ${md}p2 - zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 + zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need @@ -516,7 +521,7 @@ EOF zpool set bootfs=${pool}/ROOT/default ${pool} zpool set autoexpand=on ${pool} zpool export ${pool} - geli detach ${md}p2 + geli detach ${md}p3 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md} mdconfig -d -u ${md} } @@ -531,15 +536,20 @@ mk_geli_gpt_zfs_uefi() { bios=$7 pool=geli-gpt-zfs-uefi - dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 )) + # Note that in this flavor we create an empty p2 ufs partition, and put + # the bootable zfs stuff on p3, just to test the ability of the zfs probe + # probe routines to find a pool on a partition other than the first one. + + dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 )) md=$(mdconfig -f ${img}) gpart create -s gpt ${md} gpart add -t efi -s ${espsize}k -a 4k ${md} + gpart add -t freebsd-ufs -s 100m ${md} gpart add -t freebsd-zfs -l root $md # install-boot will make this bootable - echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2 - echo ${passphrase} | geli attach -j - ${md}p2 - zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli + echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3 + echo ${passphrase} | geli attach -j - ${md}p3 + zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli zpool set bootfs=${pool} ${pool} zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need @@ -560,7 +570,7 @@ EOF zpool set bootfs=${pool}/ROOT/default ${pool} zpool set autoexpand=on ${pool} zpool export ${pool} - geli detach ${md}p2 + geli detach ${md}p3 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md} mdconfig -d -u ${md} } From owner-svn-src-head@freebsd.org Thu Apr 25 02:16:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10261588BDF; Thu, 25 Apr 2019 02:16:49 +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 4866B8B4A3; Thu, 25 Apr 2019 02:16:49 +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 2AD6B1D147; Thu, 25 Apr 2019 02:16:49 +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 x3P2GnJc058771; Thu, 25 Apr 2019 02:16:49 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3P2GnUE058770; Thu, 25 Apr 2019 02:16:49 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201904250216.x3P2GnUE058770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 25 Apr 2019 02:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346657 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 346657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4866B8B4A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 02:16:49 -0000 Author: bcran Date: Thu Apr 25 02:16:48 2019 New Revision: 346657 URL: https://svnweb.freebsd.org/changeset/base/346657 Log: ACPI SPCR: handle BaudRate=0 From https://github.com/tianocore/edk2-platforms/commit/7d8dc6544c93a5f5a03c83316489ba8700946e9f "The mcbin (and likely others) have a nonstandard uart clock. This means that the earlycon programming will incorrectly set the baud rate if it is specified. The way around this is to tell the kernel to continue using the preprogrammed baud rate. This is done by setting the baud to 0." Our drivers (uart_dev_ns8250) do respect zero, but SPCR would error. Let's not error. Submitted by: Greg V Reviewed by: mw, imp, bcran Differential Revision: https://reviews.freebsd.org/D19914 Modified: head/sys/dev/uart/uart_cpu_arm64.c Modified: head/sys/dev/uart/uart_cpu_arm64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_arm64.c Thu Apr 25 00:58:11 2019 (r346656) +++ head/sys/dev/uart/uart_cpu_arm64.c Thu Apr 25 02:16:48 2019 (r346657) @@ -128,6 +128,13 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_sp goto out; switch(spcr->BaudRate) { + case 0: + /* + * A BaudRate of 0 is a special value which means not to + * change the rate that's already programmed. + */ + *baud = 0; + break; case 3: *baud = 9600; break; From owner-svn-src-head@freebsd.org Thu Apr 25 04:08:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804C6158B3B8; Thu, 25 Apr 2019 04:08:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BCC08ED99; Thu, 25 Apr 2019 04:08:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl1-x644.google.com with SMTP id e92so8591572plb.6; Wed, 24 Apr 2019 21:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p8jbiuyxaplEvCnupBR5vHGr5oPJxeMrOPaiyUBQtkU=; b=gWt/kJ0uTajqf/X81TNMc4oMtTNWVAgwHKJqkuROP+b9UjrJbXgpVmUPKfRpB87LL5 Xdj1g0Gn+1DehdMC+UsK8XSxESiJ+MPlt8uKruj1lFAehcR8XcdMhC2Js9E0VSoorod7 qCDyqytu1QcW/xy+BupmKmumcquErtGvUTfw3qnqatIBgpbDPnfUSHZJTBF7yrLcU5z3 XwToe/TYzcYeD/7aw5zyYqWSg5Ia2Ww41MsxwWf4/PZaO+dtxUFSD6/HXqAsw/IefttO ONZwd39ZiJ0T1FOQnteJaQC21HL4qYYZgncWlSS70z4f20Wc5ZubS0DbN4XEFFHWSSqH 7fPg== 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=p8jbiuyxaplEvCnupBR5vHGr5oPJxeMrOPaiyUBQtkU=; b=DX5Ffg5v5HudFulNWYGvYOFOJAyGi37uPy4aWqUhg4ITtr7ixfE4JJanGHO5LRQsjA 7nXmke1HYnNhGwNz6hIkji/vhZajJvagw7h38KVVNRvZnsW5Caa9ofLnyNH0vHd3MLhk LCxk1DhAm3k/Bwt1WMdN2CuMPoTpFG8YIXXRyDnDqANM+64khI6LlnaGzga1dTPGJf4S nVa+uRM+9HS1jYqH5eerGhjfaFGLBiaLluXu8gBA0Kj9HfO0s9aZVl04g3RQLz4ysuNG LWMkRQE49cwsiV+mpfPrJ785346Abjxq4OihSDh07WOqiA7KHyOKMJas1imdhtrM/D6z Te9w== X-Gm-Message-State: APjAAAX0bdAcl65qeX0nk6IaGvw2BETQ3rk6n+cXKJA+8rz+mAWeyM9k BdqiL6WKaPGMixLuwXdZcSt+svoq X-Google-Smtp-Source: APXvYqzerPyAuR0783n/aSAHriAZhgsBlwOubA+3vXnVg0cf3OBhE+QoW6qtQx44XSBYIiMdtq2Prg== X-Received: by 2002:a17:902:b481:: with SMTP id y1mr36988969plr.161.1556165304761; Wed, 24 Apr 2019 21:08:24 -0700 (PDT) Received: from spy (122-117-120-220.HINET-IP.hinet.net. [122.117.120.220]) by smtp.gmail.com with ESMTPSA id j22sm689678pfi.139.2019.04.24.21.08.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 21:08:23 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Apr 2019 00:08:17 -0400 From: Mark Johnston To: Wojciech Macek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190425040817.GA3789@spy> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904230636.x3N6aWQK057863@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 1BCC08ED99 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gWt/kJ0u; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::644 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-3.28 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; 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]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.6.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]; NEURAL_HAM_SHORT(-0.78)[-0.777,0]; IP_SCORE(-0.79)[ip: (1.50), ipnet: 2607:f8b0::/32(-3.13), asn: 15169(-2.26), country: US(-0.06)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 04:08:28 -0000 On Tue, Apr 23, 2019 at 06:36:32AM +0000, Wojciech Macek wrote: > Author: wma > Date: Tue Apr 23 06:36:32 2019 > New Revision: 346593 > URL: https://svnweb.freebsd.org/changeset/base/346593 > > Log: > This patch offers a workaround to buf_ring reordering > visible on armv7 and armv8. Similar issue to rS302292. > > Obtained from: Semihalf > Authored by: Michal Krawczyk > Approved by: wma > Differential Revision: https://reviews.freebsd.org/D19932 > > Modified: > head/sys/sys/buf_ring.h > > Modified: head/sys/sys/buf_ring.h > ============================================================================== > --- head/sys/sys/buf_ring.h Tue Apr 23 04:06:26 2019 (r346592) > +++ head/sys/sys/buf_ring.h Tue Apr 23 06:36:32 2019 (r346593) > @@ -310,14 +310,23 @@ buf_ring_peek_clear_sc(struct buf_ring *br) > if (!mtx_owned(br->br_lock)) > panic("lock not held on single consumer dequeue"); > #endif > - /* > - * I believe it is safe to not have a memory barrier > - * here because we control cons and tail is worst case > - * a lagging indicator so we worst case we might > - * return NULL immediately after a buffer has been enqueued > - */ > + > if (br->br_cons_head == br->br_prod_tail) > return (NULL); > + > +#if defined(__arm__) || defined(__aarch64__) > + /* > + * The barrier is required there on ARM and ARM64 to ensure, that > + * br->br_ring[br->br_cons_head] will not be fetched before the above > + * condition is checked. > + * Without the barrier, it is possible, that buffer will be fetched > + * before the enqueue will put mbuf into br, then, in the meantime, the > + * enqueue will update the array and the br_prod_tail, and the > + * conditional check will be true, so we will return previously fetched > + * (and invalid) buffer. > + */ > + atomic_thread_fence_acq(); > +#endif Why is it specific to ARM? From owner-svn-src-head@freebsd.org Thu Apr 25 05:38:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19481158D005 for ; Thu, 25 Apr 2019 05:38:34 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9BB26AFF4 for ; Thu, 25 Apr 2019 05:38:33 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-it1-x12b.google.com with SMTP id e13so10275360itk.4 for ; Wed, 24 Apr 2019 22:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MDx2VGmameH1C/S1ojWDxPsqka/2FqiBypmLlYHY8x4=; b=wCD6l6wds+QN741w83bbLWxyHrv2cKrsz7vNubIdCoZ8uPmgTu8xsUiRqN15mbIxff l8C4vGztBMEKN28CJM1zn/r05TS/gYra0sR7uoiAwtIPktG8WVchuyhszFaVOFgk0V8S h0mE2Y2LAXOXOfgMcBTSjgckndvds5csi+MCCBrH3fPV+iFi2QN7ZYRVxzCoL2tmrFwr G1riQQdjCxxy3RkEVc1Ec0M6RT92zMcNeppYNVghFL9a9SuZRish/NXFXr0AVCcd412n KNOc1QJc7e0rJUYGWiTH0lUKFVNH+n7ESGMXsONgMNTheHCieXLGicuR2T4moC+/76X7 noQg== 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=MDx2VGmameH1C/S1ojWDxPsqka/2FqiBypmLlYHY8x4=; b=j3u2EM8VA82VmgAjr0gUQzHDm56nq3Spm61cTugp7k6aWLLULUfl33kP1ngsoSJxTj wVmb3j3Hz1XndyyHC7I9SzN9ysF/v9z1pEsSHSp8j41r5HIi2t1b6NwEnq7Aaki1jG3n v1zpdECCFRYS7WFL3IPzSHvRvZyD3wvPYscDVQlr19vI/NKgf76CcaLsrUhl219yvbUb PjekVcXj7kQB/WFr/XZqA8i1igaty5j5oyB1tsZA/uMnPSAyrUtzYsaCKEHj9mbgUY5o +bih03/sUgi2Gs9FdIlxier/TnXsa8uoAyi8phlBSeUA+xBCEpy9B4+EodDcy3X5QfU2 syWg== X-Gm-Message-State: APjAAAWowpb3kotaevvyuP31wdIp7ub9mCglW0Wx2yam5qpnofjBta9F gXr6aSTFv7ABB3If+lMUi7YAoBJfA7S6yypzI7rUJQ== X-Google-Smtp-Source: APXvYqzUMwvWGrN5YfeRPAo5N1W3BcVYJWVrMpnd8EG9V9Z0b6kzuKAashR36tXBa7CyaMNvc00oEu0Z0AZvqmNZ1g4= X-Received: by 2002:a24:5905:: with SMTP id p5mr2483274itb.171.1556170712456; Wed, 24 Apr 2019 22:38:32 -0700 (PDT) MIME-Version: 1.0 References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> In-Reply-To: <20190425040817.GA3789@spy> From: Wojciech Macek Date: Thu, 25 Apr 2019 07:38:21 +0200 Message-ID: Subject: Re: svn commit: r346593 - head/sys/sys To: Mark Johnston Cc: Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: A9BB26AFF4 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.920,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 05:38:34 -0000 Intel does not reorder reads against the condition "if" here. I know for sure that ARM does, but therestill might be some other architectures that also suffers such behavior - I just don't have any means to verify. I remember the discussion for rS302292 where we agreed that this kind of patches should be the least impacting in perfomrance as possible. Adding unconditional memory barrier causes significant performance drop on Intel, where in fact, the issue was never seen. Wojtek czw., 25 kwi 2019 o 06:08 Mark Johnston napisa=C5=82(a)= : > On Tue, Apr 23, 2019 at 06:36:32AM +0000, Wojciech Macek wrote: > > Author: wma > > Date: Tue Apr 23 06:36:32 2019 > > New Revision: 346593 > > URL: https://svnweb.freebsd.org/changeset/base/346593 > > > > Log: > > This patch offers a workaround to buf_ring reordering > > visible on armv7 and armv8. Similar issue to rS302292. > > > > Obtained from: Semihalf > > Authored by: Michal Krawczyk > > Approved by: wma > > Differential Revision: https://reviews.freebsd.org/D19932 > > > > Modified: > > head/sys/sys/buf_ring.h > > > > Modified: head/sys/sys/buf_ring.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/sys/buf_ring.h Tue Apr 23 04:06:26 2019 (r346592) > > +++ head/sys/sys/buf_ring.h Tue Apr 23 06:36:32 2019 (r346593) > > @@ -310,14 +310,23 @@ buf_ring_peek_clear_sc(struct buf_ring *br) > > if (!mtx_owned(br->br_lock)) > > panic("lock not held on single consumer dequeue"); > > #endif > > - /* > > - * I believe it is safe to not have a memory barrier > > - * here because we control cons and tail is worst case > > - * a lagging indicator so we worst case we might > > - * return NULL immediately after a buffer has been enqueued > > - */ > > + > > if (br->br_cons_head =3D=3D br->br_prod_tail) > > return (NULL); > > + > > +#if defined(__arm__) || defined(__aarch64__) > > + /* > > + * The barrier is required there on ARM and ARM64 to ensure, that > > + * br->br_ring[br->br_cons_head] will not be fetched before the > above > > + * condition is checked. > > + * Without the barrier, it is possible, that buffer will be fetch= ed > > + * before the enqueue will put mbuf into br, then, in the > meantime, the > > + * enqueue will update the array and the br_prod_tail, and the > > + * conditional check will be true, so we will return previously > fetched > > + * (and invalid) buffer. > > + */ > > + atomic_thread_fence_acq(); > > +#endif > > Why is it specific to ARM? > From owner-svn-src-head@freebsd.org Thu Apr 25 06:09:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E0B158D81C; Thu, 25 Apr 2019 06:09:41 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f50.google.com (mail-yw1-f50.google.com [209.85.161.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0496C028; Thu, 25 Apr 2019 06:09:41 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f50.google.com with SMTP id a62so2384105ywa.4; Wed, 24 Apr 2019 23:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bjPRfKJ1YWVtT7rbsypdHltYU6kzvWNa1jPBHPttt/c=; b=IqclpWORxAfjyYK3t0tEkqIQfvzlSoH4ftwFtWt2j93hjfXoiCxa/zj57FpxArH3ef S2sfUHV2cwFAfax07v7x5rqIcwbowNogQOfi5zc5U3ljnoxSqi3EafITTHQYYVy7DSYG NGN0kRKacaowWUfRiNzFsqhx6umwuYzf6q/e2Oz6zREFtQJW98ri8u2U2IkVD0tdgNpl pdfhZpU2TeThXnAcD9RdNCD+lwcOFO3J14xEcSNTfAe0JdxV/+UB5zby0ilY4DX0I3Ss RjrzMZQbov1OCQaAzOS15C3JCcfz6/Bmzm2+5lycF0AYpn93qKMP7MUT/bBYOBSlhSER GzEg== X-Gm-Message-State: APjAAAUlPV6958SY6HJPNbptDYw2Uw+RoFlCLqRvS8xhRcgv4iKRjPOD QzrD64nem+VIqHsXPSdcygutcZP5f+o+YRd0CdMvSRYk X-Google-Smtp-Source: APXvYqwN2crRAUk/b9pQWba3LAk+CwHa7S8KUxfKFYnsVhyqNdWmDvqiAQk6sv9Y5ZNhKRbxnO5tTbQ4LfMoFGl28uQ= X-Received: by 2002:a0d:c444:: with SMTP id g65mr30669271ywd.77.1556172579742; Wed, 24 Apr 2019 23:09:39 -0700 (PDT) MIME-Version: 1.0 References: <201904242030.x3OKUkgN073331@repo.freebsd.org> In-Reply-To: <201904242030.x3OKUkgN073331@repo.freebsd.org> From: Li-Wen Hsu Date: Thu, 25 Apr 2019 15:09:28 +0900 Message-ID: Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys To: Tycho Nightingale Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2C0496C028 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.88)[-0.876,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 06:09:41 -0000 On Thu, Apr 25, 2019 at 5:31 AM Tycho Nightingale wrote: > > Author: tychon > Date: Wed Apr 24 20:30:45 2019 > New Revision: 346645 > URL: https://svnweb.freebsd.org/changeset/base/346645 ... > Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 19:56:02 2019 (r346644) > +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 20:30:45 2019 (r346645) ... > +PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, > + linux_dma_trie_free); Here we got errors in build on 32-bit platforms use gcc: /usr/src/sys/compat/linuxkpi/common/src/linux_pci.c:456:1: error: static_assert failed due to requirement 'sizeof (((struct linux_dma_obj *)0)->dma_addr) == sizeof(unsigned long long)' "compile-time assertion failed" PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/sys/pctrie.h:41:10: note: expanded from macro 'PCTRIE_DEFINE' \ ^ /usr/src/sys/sys/systm.h:120:21: note: expanded from macro '\ CTASSERT' #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") ^ ~ /usr/src/sys/compat/linuxkpi/common/src/linux_pci.c:456:1: error: incompatible pointer types returning 'dma_addr_t *' (aka 'unsigned int *') from a function with result type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types] PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/sys/pctrie.h:63:9: note: expanded from macro 'PCTRIE_DEFINE' return &ptr->field; \ ^~~~~~~~~~~ 2 errors generated. *** [linux_pci.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/linuxkpi Can you check this? Full build log is available at: https://ci.freebsd.org/job/FreeBSD-head-armv7-build/4250/console Thanks, Li-Wen From owner-svn-src-head@freebsd.org Thu Apr 25 07:15:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFFD158EA50; Thu, 25 Apr 2019 07:15:27 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121FA6DBB4; Thu, 25 Apr 2019 07:15:25 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f66.google.com with SMTP id 10so7894419wmk.0; Thu, 25 Apr 2019 00:15:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nBSqTqqOWk5ANCtfxmll8aIJDxSrLHn4pJ8rNrq/PHs=; b=R1jqM+NbdCC/kXIOyqqz6wqlQkhDJ++vPkE1W1SUdmyvR6zXE7Qr7yG6atIB74vfwW UIDvjr2XSnU7vre42n0riUU18HXvZXWcVPqwqL8zzD3M2YbJ/ZoMss4g1bjm2rpuC/hC 7C+ve6LiJU/av+xwJ2kWHyHVjd37B9ZbUqOAMEhzTJSS3btYvJBWCO62eRA+5VWtNi+K OYmapP27FRu+pip423/7NlsHEwHpW7X8KMj095qeV0JQ4g1DOx5TJsRvJyoErFB1krEJ raKdiGt/jz+MDYssFRyoCororUy43r1vdgffc9YfEWLQmAeVcW7hpDNtkuYSoZyGCTht zk3w== X-Gm-Message-State: APjAAAXQM/We4/PaZfhThvMrUxTH0CcB7mQl0NnO+Xau/Fv6O2EvhmPw RWMA5D20YKtipoCVetKEaELrj4nt X-Google-Smtp-Source: APXvYqxCdTd/6bMdUoJxyyO89pHy+nuYs3vLftfv5NwF8/YhaRpVzsZ3l+x1SV5vA7YHS9Q3zVj3eQ== X-Received: by 2002:a1c:eb12:: with SMTP id j18mr2424879wmh.48.1556176212915; Thu, 25 Apr 2019 00:10:12 -0700 (PDT) Received: from [10.0.0.30] (bzq-79-182-94-172.red.bezeqint.net. [79.182.94.172]) by smtp.gmail.com with ESMTPSA id v1sm21579478wrd.47.2019.04.25.00.10.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 00:10:12 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> From: Slava Shwartsman Message-ID: <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> Date: Thu, 25 Apr 2019 10:10:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 121FA6DBB4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-4.13 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.87)[-0.873,0]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.128.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.24)[ipnet: 209.85.128.0/17(-3.88), asn: 15169(-2.26), country: US(-0.06)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 07:15:27 -0000 On 17-Apr-19 00:28, John Baldwin wrote: > On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>> Author: slavash >>>> Date: Wed Dec 5 14:25:03 2018 >>>> New Revision: 341586 >>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>> >>>> Log: >>>> mlx5en: Implement backpressure indication. >>>> >>>> The backpressure indication is implemented using an unlimited rate type of >>>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>>> a tag, it can then query the destination driver queue for the current >>>> amount of space available in the send queue. >>>> >>>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>>> without any need of synchronization. >>>> >>>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>>> two different tag types which end up in the driver which need to be distinguished. >>>> >>>> Submitted by: hselasky@ >>>> Approved by: hselasky (mentor) >>>> MFC after: 1 week >>>> Sponsored by: Mellanox Technologies >>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>> struct mlx5e_sq *sq; >>>> int ret; >>>> >>>> - sq = mlx5e_select_queue(ifp, mb); >>>> - if (unlikely(sq == NULL)) { >>>> -#ifdef RATELIMIT >>>> - /* Check for route change */ >>>> - if (mb->m_pkthdr.snd_tag != NULL && >>>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>>> + if (mb->m_pkthdr.snd_tag != NULL) { >>>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>> + if (unlikely(sq == NULL)) { >>>> + /* Check for route change */ >>>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>> + /* Free mbuf */ >>>> + m_freem(mb); >>>> + >>>> + /* >>>> + * Tell upper layers about route >>>> + * change and to re-transmit this >>>> + * packet: >>>> + */ >>>> + return (EAGAIN); >>>> + } >>> >>> Hi, >>> >>> I just discovered something strange and found that this commit is the >>> cause. >>> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >>> vlan100. >>> Via vlan500 it receives some packets flows. Then it routes these packets >>> into vlan100. >>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>> >>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>> CPU ID FUNCTION:NAME >>> 23 54338 ip6_output:return 35 >>> 16 54338 ip6_output:return 35 >>> 21 54338 ip6_output:return 35 >>> 22 54338 ip6_output:return 35 >>> 24 54338 ip6_output:return 35 >>> 23 54338 ip6_output:return 35 >>> 14 54338 ip6_output:return 35 >>> ^C >>> >>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>> CPU ID FUNCTION:NAME >>> 16 69030 mlx5e_xmit:return 35 >>> 23 69030 mlx5e_xmit:return 35 >>> 26 69030 mlx5e_xmit:return 35 >>> 25 69030 mlx5e_xmit:return 35 >>> 24 69030 mlx5e_xmit:return 35 >>> 21 69030 mlx5e_xmit:return 35 >>> 26 69030 mlx5e_xmit:return 35 >>> ^C >>> >>> The kernel config is GENERIC. >>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>> >> >> Hi, >> >> This might be a case where rcvif in the mbuf's pktheader is not cleared >> before the packet is fed back on the wire. >> >> John Baldwin is working on the send tags implementation, to eliminate >> the EAGAIN handling in the network drivers. > > I will try to push this branch sooner then since it affects more than just > TLS. Part of the change includes a new flag we can use to assert that we Thanks John! > aren't just getting a stale rcvif (though there are also now assertions in > ip_output that should catch this case I think). > Hi Andrey, Yes, we were able to reproduce this issue in house. If you don't mind, I prefer to wait for John's update - where he eliminates the EAGAIN handling in the network drivers. Slava From owner-svn-src-head@freebsd.org Thu Apr 25 08:22:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CF7159006D; Thu, 25 Apr 2019 08:22:33 +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 06D4C6FDBC; Thu, 25 Apr 2019 08:22:31 +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 x3P8MNrG094223 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Apr 2019 11:22:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3P8MNrG094223 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3P8MMPT094222; Thu, 25 Apr 2019 11:22:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Apr 2019 11:22:22 +0300 From: Konstantin Belousov To: Wojciech Macek Cc: Mark Johnston , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190425082222.GJ12936@kib.kiev.ua> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 08:22:33 -0000 On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > Intel does not reorder reads against the condition "if" here. I know for > sure that ARM does, but therestill might be some other architectures that > also suffers such behavior - I just don't have any means to verify. > I remember the discussion for rS302292 where we agreed that this kind of > patches should be the least impacting in perfomrance as possible. Adding > unconditional memory barrier causes significant performance drop on Intel, > where in fact, the issue was never seen. > Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory barrier. If you need read/read fence on some architectures, I am sure that you need compiler barrier on all. > Wojtek > > czw., 25 kwi 2019 o 06:08 Mark Johnston napisał(a): > > > On Tue, Apr 23, 2019 at 06:36:32AM +0000, Wojciech Macek wrote: > > > Author: wma > > > Date: Tue Apr 23 06:36:32 2019 > > > New Revision: 346593 > > > URL: https://svnweb.freebsd.org/changeset/base/346593 > > > > > > Log: > > > This patch offers a workaround to buf_ring reordering > > > visible on armv7 and armv8. Similar issue to rS302292. > > > > > > Obtained from: Semihalf > > > Authored by: Michal Krawczyk > > > Approved by: wma > > > Differential Revision: https://reviews.freebsd.org/D19932 > > > > > > Modified: > > > head/sys/sys/buf_ring.h > > > > > > Modified: head/sys/sys/buf_ring.h > > > > > ============================================================================== > > > --- head/sys/sys/buf_ring.h Tue Apr 23 04:06:26 2019 (r346592) > > > +++ head/sys/sys/buf_ring.h Tue Apr 23 06:36:32 2019 (r346593) > > > @@ -310,14 +310,23 @@ buf_ring_peek_clear_sc(struct buf_ring *br) > > > if (!mtx_owned(br->br_lock)) > > > panic("lock not held on single consumer dequeue"); > > > #endif > > > - /* > > > - * I believe it is safe to not have a memory barrier > > > - * here because we control cons and tail is worst case > > > - * a lagging indicator so we worst case we might > > > - * return NULL immediately after a buffer has been enqueued > > > - */ > > > + > > > if (br->br_cons_head == br->br_prod_tail) > > > return (NULL); > > > + > > > +#if defined(__arm__) || defined(__aarch64__) > > > + /* > > > + * The barrier is required there on ARM and ARM64 to ensure, that > > > + * br->br_ring[br->br_cons_head] will not be fetched before the > > above > > > + * condition is checked. > > > + * Without the barrier, it is possible, that buffer will be fetched > > > + * before the enqueue will put mbuf into br, then, in the > > meantime, the > > > + * enqueue will update the array and the br_prod_tail, and the > > > + * conditional check will be true, so we will return previously > > fetched > > > + * (and invalid) buffer. > > > + */ > > > + atomic_thread_fence_acq(); > > > +#endif > > > > Why is it specific to ARM? > > From owner-svn-src-head@freebsd.org Thu Apr 25 09:13:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C79A159166A; Thu, 25 Apr 2019 09:13:16 +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 1FEDB720E3; Thu, 25 Apr 2019 09:13:16 +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 EEBCB2195B; Thu, 25 Apr 2019 09:13:15 +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 x3P9DF1A083317; Thu, 25 Apr 2019 09:13:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3P9DF6o083316; Thu, 25 Apr 2019 09:13:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904250913.x3P9DF6o083316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Apr 2019 09:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346664 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 346664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FEDB720E3 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 09:13:16 -0000 Author: hselasky Date: Thu Apr 25 09:13:15 2019 New Revision: 346664 URL: https://svnweb.freebsd.org/changeset/base/346664 Log: LinuxKPI buildfix for 32-bit DMA architectures after r346645. The APIs expect a 64-bit DMA key. This is fine as long as the DMA is less than or equal to 64 bits, which is currently the case. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 08:28:54 2019 (r346663) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 09:13:15 2019 (r346664) @@ -406,9 +406,11 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) mtx_unlock(&Giant); } +CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t)); + struct linux_dma_obj { void *vaddr; - dma_addr_t dma_addr; + uint64_t dma_addr; bus_dmamap_t dmamap; }; From owner-svn-src-head@freebsd.org Thu Apr 25 09:14:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BA715916E5; Thu, 25 Apr 2019 09:14:26 +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 EE19672247; Thu, 25 Apr 2019 09:14:25 +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 893B1260281; Thu, 25 Apr 2019 11:14:23 +0200 (CEST) Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys To: Li-Wen Hsu , Tycho Nightingale Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904242030.x3OKUkgN073331@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 25 Apr 2019 11:13:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EE19672247 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 09:14:26 -0000 On 4/25/19 8:09 AM, Li-Wen Hsu wrote: > On Thu, Apr 25, 2019 at 5:31 AM Tycho Nightingale wrote: >> >> Author: tychon >> Date: Wed Apr 24 20:30:45 2019 >> New Revision: 346645 >> URL: https://svnweb.freebsd.org/changeset/base/346645 > ... >> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 19:56:02 2019 (r346644) >> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 20:30:45 2019 (r346645) > ... >> +PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, linux_dma_trie_alloc, >> + linux_dma_trie_free); > > Here we got errors in build on 32-bit platforms use gcc: > Should be fixed by r346664. --HPS From owner-svn-src-head@freebsd.org Thu Apr 25 09:52:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CFD15920D9; Thu, 25 Apr 2019 09:52:49 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (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 54A38736B9; Thu, 25 Apr 2019 09:52:49 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 5539014FB39; Thu, 25 Apr 2019 05:52:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= vqKJxMKhNSJx0m3HmLZl5RpZMMI=; b=C/NHq+FB1BHLYB9Lohg5B282NFwpfaqb efWJeimsGhAfIOxLEgNk8noQjjLFxe6V14h+9k24liAXo+ngUyhUmvkD+cbqaPmv OEWCeceJjsVr8FY6hCxlwPvSzRszlrZLMUWFxSDNurMeQL2UzEYtj1coSBdx2zvY 7pNOjEyu8ow= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4D31F14FB38; Thu, 25 Apr 2019 05:52:43 -0400 (EDT) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id AD44814FB37; Thu, 25 Apr 2019 05:52:42 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys From: Tycho Nightingale In-Reply-To: Date: Thu, 25 Apr 2019 05:52:41 -0400 Cc: Li-Wen Hsu , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <64889DCB-FC29-4617-B9AD-925137A49296@freebsd.org> References: <201904242030.x3OKUkgN073331@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: DEB2C8E6-673F-11E9-B4C4-1646B3964D18-09779102!pb-smtp1.pobox.com X-Rspamd-Queue-Id: 54A38736B9 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.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 09:52:49 -0000 > On Apr 25, 2019, at 5:13 AM, Hans Petter Selasky = wrote: >=20 > On 4/25/19 8:09 AM, Li-Wen Hsu wrote: >> On Thu, Apr 25, 2019 at 5:31 AM Tycho Nightingale = wrote: >>>=20 >>> Author: tychon >>> Date: Wed Apr 24 20:30:45 2019 >>> New Revision: 346645 >>> URL: https://svnweb.freebsd.org/changeset/base/346645 >> ... >>> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.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/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 = 19:56:02 2019 (r346644) >>> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 = 20:30:45 2019 (r346645) >> ... >>> +PCTRIE_DEFINE(LINUX_DMA, linux_dma_obj, dma_addr, = linux_dma_trie_alloc, >>> + linux_dma_trie_free); >> Here we got errors in build on 32-bit platforms use gcc: >=20 > Should be fixed by r346664. Sorry about that. Thanks for fixing it! Tycho= From owner-svn-src-head@freebsd.org Thu Apr 25 12:44:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7682815962B6; Thu, 25 Apr 2019 12:44:09 +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 1B78B82F2A; Thu, 25 Apr 2019 12:44:09 +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 EA23123E0D; Thu, 25 Apr 2019 12:44:08 +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 x3PCi845096202; Thu, 25 Apr 2019 12:44:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PCi8g0096201; Thu, 25 Apr 2019 12:44:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904251244.x3PCi8g0096201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 12:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346670 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B78B82F2A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 12:44:09 -0000 Author: kevans Date: Thu Apr 25 12:44:08 2019 New Revision: 346670 URL: https://svnweb.freebsd.org/changeset/base/346670 Log: tun/tap: close race between destroy/ioctl handler It seems that there should be a better way to handle this, but this seems to be the more common approach and it should likely get replaced in all of the places it happens... Basically, thread 1 is in the process of destroying the tun/tap while thread 2 is executing one of the ioctls that requires the tun/tap mutex and the mutex is destroyed before the ioctl handler can acquire it. This is only one of the races described/found in PR 233955. PR: 233955 Reviewed by: ae MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20027 Modified: head/sys/net/if_tap.c head/sys/net/if_tun.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Apr 25 12:02:17 2019 (r346669) +++ head/sys/net/if_tap.c Thu Apr 25 12:44:08 2019 (r346670) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +165,9 @@ MALLOC_DECLARE(M_TAP); MALLOC_DEFINE(M_TAP, CDEV_NAME, "Ethernet tunnel interface"); SYSCTL_INT(_debug, OID_AUTO, if_tap_debug, CTLFLAG_RW, &tapdebug, 0, ""); +static struct sx tap_ioctl_sx; +SX_SYSINIT(tap_ioctl_sx, &tap_ioctl_sx, "tap_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, "Ethernet tunnel software network interface"); @@ -217,6 +222,10 @@ tap_destroy(struct tap_softc *tp) struct ifnet *ifp = tp->tap_ifp; CURVNET_SET(ifp->if_vnet); + sx_xlock(&tap_ioctl_sx); + ifp->if_softc = NULL; + sx_xunlock(&tap_ioctl_sx); + destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); knlist_clear(&tp->tap_rsel.si_note, 0); @@ -600,12 +609,18 @@ tapifinit(void *xtp) static int tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct tap_softc *tp = ifp->if_softc; + struct tap_softc *tp; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; struct ifmediareq *ifmr = NULL; int dummy, error = 0; + sx_xlock(&tap_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ case SIOCADDMULTI: @@ -648,6 +663,8 @@ tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } +bad: + sx_xunlock(&tap_ioctl_sx); return (error); } /* tapifioctl */ Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Thu Apr 25 12:02:17 2019 (r346669) +++ head/sys/net/if_tun.c Thu Apr 25 12:44:08 2019 (r346670) @@ -20,6 +20,7 @@ #include "opt_inet6.h" #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +117,9 @@ static struct clonedevs *tunclones; static TAILQ_HEAD(,tun_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); +static struct sx tun_ioctl_sx; +SX_SYSINIT(tun_ioctl_sx, &tun_ioctl_sx, "tun_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, "IP tunnel software network interface."); @@ -278,6 +283,10 @@ tun_destroy(struct tun_softc *tp) mtx_unlock(&tp->tun_mtx); CURVNET_SET(TUN2IFP(tp)->if_vnet); + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); + dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); @@ -588,10 +597,16 @@ static int tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; - struct tun_softc *tp = ifp->if_softc; + struct tun_softc *tp; struct ifstat *ifs; int error = 0; + sx_xlock(&tun_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -618,6 +633,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data default: error = EINVAL; } +bad: + sx_xunlock(&tun_ioctl_sx); return (error); } From owner-svn-src-head@freebsd.org Thu Apr 25 13:46:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 026321597A64; Thu, 25 Apr 2019 13:46:13 +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 9A83485331; Thu, 25 Apr 2019 13:46: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 7442424846; Thu, 25 Apr 2019 13:46: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 x3PDkCBd027989; Thu, 25 Apr 2019 13:46:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PDkCKQ027988; Thu, 25 Apr 2019 13:46:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904251346.x3PDkCKQ027988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 13:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346671 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A83485331 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.928,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 13:46:13 -0000 Author: kevans Date: Thu Apr 25 13:46:12 2019 New Revision: 346671 URL: https://svnweb.freebsd.org/changeset/base/346671 Log: tun(4): Don't allow open of open or dying devices Previously, a pid check was used to prevent open of the tun(4); this works, but may not make the most sense as we don't prevent the owner process from opening the tun device multiple times. The potential race described near tun_pid should not be an issue: if a tun(4) is to be handed off, its fd has to have been sent via control message or some other mechanism that duplicates the fd to the receiving process so that it may set the pid. Otherwise, the pid gets cleared when the original process closes it and you have no effective handoff mechanism. Close up another potential issue with handing a tun(4) off by not clobbering state if the closer isn't the controller anymore. If we want some state to be cleared, we should do that a little more surgically. Additionally, nothing prevents a dying tun(4) from being "reopened" in the middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a bad time. Return EBUSY if we're marked for destruction, as well, and the consumer will need to deal with it. The associated character device will be destroyed in short order. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20033 Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Thu Apr 25 12:44:08 2019 (r346670) +++ head/sys/net/if_tun.c Thu Apr 25 13:46:12 2019 (r346671) @@ -81,16 +81,10 @@ struct tun_softc { #define TUN_RWAIT 0x0040 #define TUN_ASYNC 0x0080 #define TUN_IFHEAD 0x0100 +#define TUN_DYING 0x0200 #define TUN_READY (TUN_OPEN | TUN_INITED) - /* - * XXXRW: tun_pid is used to exclusively lock /dev/tun. Is this - * actually needed? Can we just return EBUSY if already open? - * Problem is that this involved inherent races when a tun device - * is handed off from one process to another, as opposed to just - * being slightly stale informationally. - */ pid_t tun_pid; /* owning pid */ struct ifnet *tun_ifp; /* the interface */ struct sigio *tun_sigio; /* information for async I/O */ @@ -277,6 +271,7 @@ tun_destroy(struct tun_softc *tp) struct cdev *dev; mtx_lock(&tp->tun_mtx); + tp->tun_flags |= TUN_DYING; if ((tp->tun_flags & TUN_OPEN) != 0) cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); else @@ -473,19 +468,13 @@ tunopen(struct cdev *dev, int flag, int mode, struct t tp = dev->si_drv1; } - /* - * XXXRW: This use of tun_pid is subject to error due to the - * fact that a reference to the tunnel can live beyond the - * death of the process that created it. Can we replace this - * with a simple busy flag? - */ mtx_lock(&tp->tun_mtx); - if (tp->tun_pid != 0 && tp->tun_pid != td->td_proc->p_pid) { + if ((tp->tun_flags & (TUN_OPEN | TUN_DYING)) != 0) { mtx_unlock(&tp->tun_mtx); return (EBUSY); } - tp->tun_pid = td->td_proc->p_pid; + tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; ifp = TUN2IFP(tp); if_link_state_change(ifp, LINK_STATE_UP); @@ -509,6 +498,16 @@ tunclose(struct cdev *dev, int foo, int bar, struct th ifp = TUN2IFP(tp); mtx_lock(&tp->tun_mtx); + /* + * Simply close the device if this isn't the controlling process. This + * may happen if, for instance, the tunnel has been handed off to + * another process. The original controller should be able to close it + * without putting us into an inconsistent state. + */ + if (td->td_proc->p_pid != tp->tun_pid) { + mtx_unlock(&tp->tun_mtx); + return (0); + } /* * junk all pending output From owner-svn-src-head@freebsd.org Thu Apr 25 15:09:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FEF51599BE8; Thu, 25 Apr 2019 15:09:22 +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 CA8BA89692; Thu, 25 Apr 2019 15:09:21 +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 A70C4256FE; Thu, 25 Apr 2019 15:09:21 +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 x3PF9LP9075119; Thu, 25 Apr 2019 15:09:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PF9LCE075118; Thu, 25 Apr 2019 15:09:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904251509.x3PF9LCE075118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 25 Apr 2019 15:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346675 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 346675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA8BA89692 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 15:09:22 -0000 Author: ian Date: Thu Apr 25 15:09:21 2019 New Revision: 346675 URL: https://svnweb.freebsd.org/changeset/base/346675 Log: Restore the ability to open a raw disk or partition in loader(8). The disk_open() function searches for "the best partition" when slice and partition information is not provided as part of the device name. As of r345477 the slice and partition fields of a disk_devdesc are initialized to D_SLICEWILD and D_PARTWILD; in the past they were initialized to -1, which was sometimes interpreted as meaning 'wildcard' and sometimes as 'open the raw partition' depending on the context. So as an unintended side effect of r345477 it became basically impossible to ever open a disk or partition without doing the 'best partition' search. One visible effect of that was the inability to open the raw disk to read the partition table correctly in zfs_probe_dev(), leading to failures to find the zfs pool unless it was on the first partition. Now instead of always initializing slice and partition to wildcards, the disk_parsedev() function initializes them based on the presence of a path/file name following the device. If there is any path or filename following the ':' that ends the device name, then slice and partition are initialized to D_SLICEWILD and D_PARTWILD. If there is nothing after the ':' then it is considered to be a request to open the raw device or partition itself (not a file stored within it), and the fields are initialized to D_SLICENONE and D_PARTNONE. With this change in place, all the tests in src/tools/boot are succesful again, including the recently-added cases of booting from a zfs pool on a partition other than slice 1 of the device. PR: 236981 Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Thu Apr 25 14:41:29 2019 (r346674) +++ head/stand/common/disk.c Thu Apr 25 15:09:21 2019 (r346675) @@ -392,8 +392,20 @@ disk_parsedev(struct disk_devdesc *dev, const char *de np = devspec; unit = -1; - slice = D_SLICEWILD; - partition = D_PARTWILD; + /* + * If there is path/file info after the device info, then any missing + * slice or partition info should be considered a request to search for + * an appropriate partition. Otherwise we want to open the raw device + * itself and not try to fill in missing info by searching. + */ + if ((cp = strchr(np, ':')) != NULL && cp[1] != '\0') { + slice = D_SLICEWILD; + partition = D_PARTWILD; + } else { + slice = D_SLICENONE; + partition = D_PARTNONE; + } + if (*np != '\0' && *np != ':') { unit = strtol(np, &cp, 10); if (cp == np) From owner-svn-src-head@freebsd.org Thu Apr 25 15:37:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CC98159A718; Thu, 25 Apr 2019 15:37:31 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E14C08AC5A; Thu, 25 Apr 2019 15:37:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62EC025C66; Thu, 25 Apr 2019 15:37:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PFbUYi091414; Thu, 25 Apr 2019 15:37:30 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PFbSWm091406; Thu, 25 Apr 2019 15:37:28 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201904251537.x3PFbSWm091406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 25 Apr 2019 15:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346677 - in head/sys: dev/cxgbe dev/mlx5/mlx5_en kern netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/mlx5/mlx5_en kern netinet netinet6 X-SVN-Commit-Revision: 346677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E14C08AC5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 15:37:31 -0000 Author: gallatin Date: Thu Apr 25 15:37:28 2019 New Revision: 346677 URL: https://svnweb.freebsd.org/changeset/base/346677 Log: Track TCP connection's NUMA domain in the inpcb Drivers can now pass up numa domain information via the mbuf numa domain field. This information is then used by TCP syncache_socket() to associate that information with the inpcb. The domain information is then fed back into transmitted mbufs in ip{6}_output(). This mechanism is nearly identical to what is done to track RSS hash values in the inp_flowid. Follow on changes will use this information for lacp egress port selection, binding TCP pacers to the appropriate NUMA domain, etc. Reviewed by: markj, kib, slavash, bz, scottl, jtl, tuexen Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20028 Modified: head/sys/dev/cxgbe/t4_sge.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/kern/uipc_mbuf.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/ip6_output.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/dev/cxgbe/t4_sge.c Thu Apr 25 15:37:28 2019 (r346677) @@ -2046,6 +2046,9 @@ t4_eth_rx(struct sge_iq *iq, const struct rss_header * rxq->vlan_extraction++; } +#ifdef NUMA + m0->m_pkthdr.numa_domain = ifp->if_numa_domain; +#endif #if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { if (sort_before_lro(lro)) { Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Thu Apr 25 15:37:28 2019 (r346677) @@ -520,6 +520,9 @@ rx_common: mlx5e_build_rx_mbuf(cqe, rq, mb, byte_cnt); rq->stats.bytes += byte_cnt; rq->stats.packets++; +#ifdef NUMA + mb->m_pkthdr.numa_domain = rq->ifp->if_numa_domain; +#endif #if !defined(HAVE_TCP_LRO_RX) tcp_lro_queue_mbuf(&rq->lro, mb); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/kern/uipc_mbuf.c Thu Apr 25 15:37:28 2019 (r346677) @@ -341,6 +341,9 @@ m_pkthdr_init(struct mbuf *m, int how) #endif m->m_data = m->m_pktdat; bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); +#ifdef NUMA + m->m_pkthdr.numa_domain = M_NODOM; +#endif #ifdef MAC /* If the label init fails, fail the alloc */ error = mac_mbuf_init(m, how); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/netinet/in_pcb.c Thu Apr 25 15:37:28 2019 (r346677) @@ -510,6 +510,9 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbin if (inp == NULL) return (ENOBUFS); bzero(&inp->inp_start_zero, inp_zero_size); +#ifdef NUMA + inp->inp_numa_domain = M_NODOM; +#endif inp->inp_pcbinfo = pcbinfo; inp->inp_socket = so; inp->inp_cred = crhold(so->so_cred); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/netinet/in_pcb.h Thu Apr 25 15:37:28 2019 (r346677) @@ -272,7 +272,7 @@ struct inpcb { inp_hpts_calls :1, /* (i) from output hpts */ inp_input_calls :1, /* (i) from input hpts */ inp_spare_bits2 : 4; - uint8_t inp_spare_byte; /* Compiler hole */ + uint8_t inp_numa_domain; /* numa domain */ void *inp_ppcb; /* (i) pointer to per-protocol pcb */ struct socket *inp_socket; /* (i) back pointer to socket */ uint32_t inp_hptsslot; /* Hpts wheel slot this tcb is Lock(i&b) */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/netinet/ip_output.c Thu Apr 25 15:37:28 2019 (r346677) @@ -247,6 +247,9 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } +#ifdef NUMA + m->m_pkthdr.numa_domain = inp->inp_numa_domain; +#endif } if (ro == NULL) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/netinet/tcp_syncache.c Thu Apr 25 15:37:28 2019 (r346677) @@ -777,6 +777,9 @@ syncache_socket(struct syncache *sc, struct socket *ls if (m != NULL && M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { inp->inp_flowid = m->m_pkthdr.flowid; inp->inp_flowtype = M_HASHTYPE_GET(m); +#ifdef NUMA + inp->inp_numa_domain = m->m_pkthdr.numa_domain; +#endif } /* Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Apr 25 15:31:35 2019 (r346676) +++ head/sys/netinet6/ip6_output.c Thu Apr 25 15:37:28 2019 (r346677) @@ -322,6 +322,9 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } +#ifdef NUMA + m->m_pkthdr.numa_domain = inp->inp_numa_domain; +#endif } #if defined(IPSEC) || defined(IPSEC_SUPPORT) From owner-svn-src-head@freebsd.org Thu Apr 25 15:48:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F5E159AA3E; Thu, 25 Apr 2019 15:48: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 483B78B2DA; Thu, 25 Apr 2019 15:48: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 2F64B25E5C; Thu, 25 Apr 2019 15:48: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 x3PFmNsj096473; Thu, 25 Apr 2019 15:48:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PFmNWC096472; Thu, 25 Apr 2019 15:48:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904251548.x3PFmNWC096472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 25 Apr 2019 15:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346678 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 483B78B2DA 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 15:48:24 -0000 Author: bde Date: Thu Apr 25 15:48:23 2019 New Revision: 346678 URL: https://svnweb.freebsd.org/changeset/base/346678 Log: Restore doing nothing for calls to VGLEnd() after the first. I broke this in r346631. VGLEnd() clears some state variables as it restores state, but not all of them, so it still needs to clear a single state variable to indicate that it has completed. Put this clearing back where it was (at the start instead of the end) to avoid moving bugs in the signal handling. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Thu Apr 25 15:37:28 2019 (r346677) +++ head/lib/libvgl/main.c Thu Apr 25 15:48:23 2019 (r346678) @@ -73,6 +73,7 @@ struct vt_mode smode; if (!VGLInitDone) return; + VGLInitDone = 0; signal(SIGUSR1, SIG_IGN); signal(SIGUSR2, SIG_IGN); VGLSwitchPending = 0; From owner-svn-src-head@freebsd.org Thu Apr 25 15:51:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E964159ABAF; Thu, 25 Apr 2019 15:51: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 33BF28B6EE; Thu, 25 Apr 2019 15:51: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 7D9FC25E99; Thu, 25 Apr 2019 15:51:09 +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 x3PFp9Zn096835; Thu, 25 Apr 2019 15:51:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PFp9iU096834; Thu, 25 Apr 2019 15:51:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904251551.x3PFp9iU096834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 15:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346680 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 346680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33BF28B6EE 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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 15:51:12 -0000 Author: kevans Date: Thu Apr 25 15:51:09 2019 New Revision: 346680 URL: https://svnweb.freebsd.org/changeset/base/346680 Log: libbe(3): Copy received properties as well This was inherently broken on send|recv datasets. Reported and tested by: Wes Maag MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu Apr 25 15:51:00 2019 (r346679) +++ head/lib/libbe/be.c Thu Apr 25 15:51:09 2019 (r346680) @@ -431,8 +431,12 @@ be_deep_clone_prop(int prop, void *cb) /* Just continue if we fail to read a property */ return (ZPROP_CONT); - /* Only copy locally defined properties */ - if (src != ZPROP_SRC_LOCAL) + /* + * Only copy locally defined or received properties. This continues + * to avoid temporary/default/local properties intentionally without + * breaking received datasets. + */ + if (src != ZPROP_SRC_LOCAL && src != ZPROP_SRC_RECEIVED) return (ZPROP_CONT); /* Augment mountpoint with altroot, if needed */ From owner-svn-src-head@freebsd.org Thu Apr 25 16:45:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3C9159C353; Thu, 25 Apr 2019 16:45:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3574F8E00D; Thu, 25 Apr 2019 16:45:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3CD2689F; Thu, 25 Apr 2019 16:45:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PGjPhl029411; Thu, 25 Apr 2019 16:45:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PGjPRo029408; Thu, 25 Apr 2019 16:45:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251645.x3PGjPRo029408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 16:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346682 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 346682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3574F8E00D 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 16:45:26 -0000 Author: manu Date: Thu Apr 25 16:45:24 2019 New Revision: 346682 URL: https://svnweb.freebsd.org/changeset/base/346682 Log: mtree: Add more runtime package tag When using pkgbase those empty directories aren't packaged otherwise. Reviewed by: bapt MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20056 Modified: head/etc/mtree/BSD.sendmail.dist head/etc/mtree/BSD.usr.dist head/etc/mtree/BSD.var.dist Modified: head/etc/mtree/BSD.sendmail.dist ============================================================================== --- head/etc/mtree/BSD.sendmail.dist Thu Apr 25 15:56:32 2019 (r346681) +++ head/etc/mtree/BSD.sendmail.dist Thu Apr 25 16:45:24 2019 (r346682) @@ -6,7 +6,7 @@ /set type=dir uname=root gname=wheel mode=0755 . nochange var nochange - spool nochange + spool nochange tags=package=runtime clientmqueue uname=smmsp gname=smmsp mode=0770 .. .. Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Apr 25 15:56:32 2019 (r346681) +++ head/etc/mtree/BSD.usr.dist Thu Apr 25 16:45:24 2019 (r346682) @@ -428,9 +428,9 @@ .. keys pkg - revoked + revoked tags=package=runtime .. - trusted + trusted tags=package=runtime .. .. .. Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Thu Apr 25 15:56:32 2019 (r346681) +++ head/etc/mtree/BSD.var.dist Thu Apr 25 16:45:24 2019 (r346682) @@ -32,7 +32,7 @@ .. crash .. - cron + cron tags=package=runtime tabs mode=0700 .. .. @@ -59,21 +59,21 @@ .. .. .. - empty mode=0555 flags=schg + empty mode=0555 flags=schg tags=package=runtime .. games gname=games mode=0775 .. heimdal mode=0700 .. - log + log tags=package=runtime .. - mail gname=mail mode=0775 + mail gname=mail mode=0775 tags=package=runtime .. msgs uname=daemon .. preserve .. - run + run tags=package=runtime dhclient .. ppp gname=network mode=0770 @@ -101,7 +101,7 @@ .. /set gname=wheel .. - tmp mode=01777 + tmp mode=01777 tags=package=runtime vi.recover mode=01777 .. .. From owner-svn-src-head@freebsd.org Thu Apr 25 16:47:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9A42159C3D1; Thu, 25 Apr 2019 16:47:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7638E181; Thu, 25 Apr 2019 16:47:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C27E268A4; Thu, 25 Apr 2019 16:47:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PGlGau029524; Thu, 25 Apr 2019 16:47:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PGlGWL029523; Thu, 25 Apr 2019 16:47:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251647.x3PGlGWL029523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 16:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346683 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 346683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D7638E181 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 16:47:17 -0000 Author: manu Date: Thu Apr 25 16:47:15 2019 New Revision: 346683 URL: https://svnweb.freebsd.org/changeset/base/346683 Log: bsdinstall: up the interface before calling dhclient MFC after: 1 week Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Apr 25 16:45:24 2019 (r346682) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Apr 25 16:47:15 2019 (r346683) @@ -49,6 +49,7 @@ esac dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $DIALOG_OK ]; then if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + ifconfig $INTERFACE up dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0 err=$( dhclient $INTERFACE 2>&1 ) if [ $? -ne 0 ]; then From owner-svn-src-head@freebsd.org Thu Apr 25 18:13:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCCDD159E372; Thu, 25 Apr 2019 18:13:56 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9C991C21; Thu, 25 Apr 2019 18:13:56 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43791278B6; Thu, 25 Apr 2019 18:13:56 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIDuAb078017; Thu, 25 Apr 2019 18:13:56 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIDut8078016; Thu, 25 Apr 2019 18:13:56 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201904251813.x3PIDut8078016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 25 Apr 2019 18:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346687 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 346687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D9C991C21 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:13:57 -0000 Author: tychon Date: Thu Apr 25 18:13:55 2019 New Revision: 346687 URL: https://svnweb.freebsd.org/changeset/base/346687 Log: LinuxKPI buildfix for ppc64 after r346645. Proposed by: hselasky Sponsored by: Dell EMC Isilon Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 17:28:36 2019 (r346686) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 18:13:55 2019 (r346687) @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) dma_mask, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ - BUS_SPACE_MAXADDR, /* maxsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ 1, /* nsegments */ - BUS_SPACE_MAXADDR, /* maxsegsz */ + BUS_SPACE_MAXSIZE, /* maxsegsz */ 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &priv->dmat); From owner-svn-src-head@freebsd.org Thu Apr 25 18:22:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF15F159E714; Thu, 25 Apr 2019 18:22:23 +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 747F592241; Thu, 25 Apr 2019 18:22:23 +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 5087627A58; Thu, 25 Apr 2019 18:22:23 +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 x3PIMNEX083388; Thu, 25 Apr 2019 18:22:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIMN71083387; Thu, 25 Apr 2019 18:22:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904251822.x3PIMN71083387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 18:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346688 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 747F592241 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:22:24 -0000 Author: kevans Date: Thu Apr 25 18:22:22 2019 New Revision: 346688 URL: https://svnweb.freebsd.org/changeset/base/346688 Log: tap(4): Add a MODULE_VERSION Otherwise tap(4) can be loaded by loader despite being compiled into the kernel, causing a panic as things try to double-initialize. PR: 220867 MFC after: 3 days Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Apr 25 18:13:55 2019 (r346687) +++ head/sys/net/if_tap.c Thu Apr 25 18:22:22 2019 (r346688) @@ -180,6 +180,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); +MODULE_VERSION(if_tun, 1); static int tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-head@freebsd.org Thu Apr 25 18:22:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDE2159E761; Thu, 25 Apr 2019 18:22:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C577923F7; Thu, 25 Apr 2019 18:22:40 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x433.google.com with SMTP id e24so303429pfi.12; Thu, 25 Apr 2019 11:22:40 -0700 (PDT) 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=c6l92s/6Fl/z7J94UsZR75rEjS2S/eCxioH+D7RfLQ8=; b=G4SZC349jxXaELdluU8f0WXHNnhd7aHUuVCWKW51lIg05dY2x8zamVyKm6P+h1l/uH EtPrR9DRVgHxZFUpfAhd1xyaORo4tDtvaqMzLqa+1NuB+JzbcsX9IfX/FAn29sHaTp+P PolDBl0r9pOXQKjZz3DKeexUz2uIdenrB+ktVUUTdWGM9atCdMjsNrN4m9AAV7Ot8GxJ zXO5ee4Qeffu6EZVzkqK6JkZ35lpc+hfuxYlCyYYr9ucJ89shmlZhf/ZIgaGLkWlYwIy eubRZO0E9DbzQ+lXOglhWoSSdXHdqF42GCztNOCwHqjEETBsKPSsHTImucNZFBgVTQok 6hMQ== 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=c6l92s/6Fl/z7J94UsZR75rEjS2S/eCxioH+D7RfLQ8=; b=B7sy8A9P3MoazGbdQuVW+lhJkp/nSqeGGUfnmNUf/T2bNwHZx1fdFwkp4U2I9D1JQW ISrmnD+VMYeI7Lr9AooFgXAM6zzOFi9qfjDaRvwVsWQMhABb+VWMtW+KJsZ/dhG5aAaE aJXVDO593pZfchHoGo3fsshlrqUJt8djfxZOFmU8heYTp6SRO1NNeCcWQzD7NqS1ngnL NR0v5KgPjVReL4cgqz6mlru7cfvba7QCXmb7n9eFT/msyQHjnGAE2xE9C7Stc8cyKffl 4nqyeuB6MqoXupi2KWQToSLC98uAAECK1CSrkJ1krAaTDKYLTXs8GILIBoG3t3wbPDvy 88Yg== X-Gm-Message-State: APjAAAUA9vWNEI/vTf9iJXXEdIKo0CBPZ5y8f7rP2FL51kRMbhsFB6iw PVIri8NG7+FmdK78vwD7Ii3WD+6Z X-Google-Smtp-Source: APXvYqxLYBbDEddMRtvPDRARtg5fq4LHGfMKOrZYjn9aMMb8TeDNDRu/PVagbBpXgrOmy6zbGEoOPQ== X-Received: by 2002:a65:625a:: with SMTP id q26mr39453713pgv.68.1556216556104; Thu, 25 Apr 2019 11:22:36 -0700 (PDT) Received: from ?IPv6:2607:fb90:a69f:57f8:cc0d:c287:78db:87a6? ([2607:fb90:a69f:57f8:cc0d:c287:78db:87a6]) by smtp.gmail.com with ESMTPSA id a3sm35391429pfn.182.2019.04.25.11.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 11:22:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r346683 - head/usr.sbin/bsdinstall/scripts From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201904251647.x3PGlGWL029523@repo.freebsd.org> Date: Thu, 25 Apr 2019 11:22:34 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7DEA4472-397B-4193-8180-359E0FC6DA0E@gmail.com> References: <201904251647.x3PGlGWL029523@repo.freebsd.org> To: Emmanuel Vadot X-Rspamd-Queue-Id: 0C577923F7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:22:41 -0000 > On Apr 25, 2019, at 09:47, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Thu Apr 25 16:47:15 2019 > New Revision: 346683 > URL: https://svnweb.freebsd.org/changeset/base/346683 >=20 > Log: > bsdinstall: up the interface before calling dhclient Hi Emmanuel! Just curious.. What issue did you see when the interface wasn=E2=80=99t U= Ped? Thank you! -Enji= From owner-svn-src-head@freebsd.org Thu Apr 25 18:24:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1AA159E8DA; Thu, 25 Apr 2019 18:24:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B58492684; Thu, 25 Apr 2019 18:24:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3PIOXhG049367; Thu, 25 Apr 2019 11:24:33 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3PIOXmK049366; Thu, 25 Apr 2019 11:24:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904251824.x3PIOXmK049366@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346688 - head/sys/net In-Reply-To: <201904251822.x3PIMN71083387@repo.freebsd.org> To: Kyle Evans Date: Thu, 25 Apr 2019 11:24:33 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 5B58492684 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:24:36 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Thu Apr 25 18:22:22 2019 > New Revision: 346688 > URL: https://svnweb.freebsd.org/changeset/base/346688 > > Log: > tap(4): Add a MODULE_VERSION ^^^ > > Otherwise tap(4) can be loaded by loader despite being compiled into the > kernel, causing a panic as things try to double-initialize. > > PR: 220867 > MFC after: 3 days > > Modified: > head/sys/net/if_tap.c ^^^ > > Modified: head/sys/net/if_tap.c > ============================================================================== > --- head/sys/net/if_tap.c Thu Apr 25 18:13:55 2019 (r346687) > +++ head/sys/net/if_tap.c Thu Apr 25 18:22:22 2019 (r346688) > @@ -180,6 +180,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL > SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); > > DEV_MODULE(if_tap, tapmodevent, NULL); ^^^ > +MODULE_VERSION(if_tun, 1); ^^^ If wrong, ok, please fix, if correct, please this needs a very complete comment as to what it is if_tun. > static int > tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 25 18:26:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 091B6159E9E3; Thu, 25 Apr 2019 18:26:35 +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 A41D792854; Thu, 25 Apr 2019 18:26:34 +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 7B10F27A67; Thu, 25 Apr 2019 18:26:34 +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 x3PIQYCX083742; Thu, 25 Apr 2019 18:26:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIQYmg083741; Thu, 25 Apr 2019 18:26:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904251826.x3PIQYmg083741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 18:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346689 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A41D792854 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:26:35 -0000 Author: kevans Date: Thu Apr 25 18:26:34 2019 New Revision: 346689 URL: https://svnweb.freebsd.org/changeset/base/346689 Log: tap(4): Correct driver name... Reported by: rgrimes Pointy hat to: kevans MFC after: 3 days X-MFC-With: r346688 Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Apr 25 18:22:22 2019 (r346688) +++ head/sys/net/if_tap.c Thu Apr 25 18:26:34 2019 (r346689) @@ -180,7 +180,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); -MODULE_VERSION(if_tun, 1); +MODULE_VERSION(if_tap, 1); static int tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-head@freebsd.org Thu Apr 25 18:27:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD6F1159EA37; Thu, 25 Apr 2019 18:27:21 +0000 (UTC) (envelope-from kevans@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 645229299A; Thu, 25 Apr 2019 18:27:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 03AF07DA3; Thu, 25 Apr 2019 18:27:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f47.google.com with SMTP id j20so530573lfh.2; Thu, 25 Apr 2019 11:27:20 -0700 (PDT) X-Gm-Message-State: APjAAAWKM8sL0lOgVFfITUwoM+LfBRsooPDTBbRfvizz/6+cPDAd1W1g uX6JJIawdePwMeAm54CvVCyxcJANu21tLk+dfxs= X-Google-Smtp-Source: APXvYqz0LRiwL5a0W2YUzjx223JAmpgSbyoiCHXa/5aYjXwhb7QTX+KRrjR4UgpNaxi39oATPm5vZgTtJC1gEEcMFpE= X-Received: by 2002:a19:7d04:: with SMTP id y4mr4238642lfc.153.1556216839732; Thu, 25 Apr 2019 11:27:19 -0700 (PDT) MIME-Version: 1.0 References: <201904251822.x3PIMN71083387@repo.freebsd.org> <201904251824.x3PIOXmK049366@gndrsh.dnsmgr.net> In-Reply-To: <201904251824.x3PIOXmK049366@gndrsh.dnsmgr.net> From: Kyle Evans Date: Thu, 25 Apr 2019 13:26:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346688 - head/sys/net To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 645229299A 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_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:27:21 -0000 On Thu, Apr 25, 2019 at 1:24 PM Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > Author: kevans > > Date: Thu Apr 25 18:22:22 2019 > > New Revision: 346688 > > URL: https://svnweb.freebsd.org/changeset/base/346688 > > > > Log: > > tap(4): Add a MODULE_VERSION > ^^^ > > > > Otherwise tap(4) can be loaded by loader despite being compiled into the > > kernel, causing a panic as things try to double-initialize. > > > > PR: 220867 > > MFC after: 3 days > > > > Modified: > > head/sys/net/if_tap.c > ^^^ > > > > Modified: head/sys/net/if_tap.c > > ============================================================================== > > --- head/sys/net/if_tap.c Thu Apr 25 18:13:55 2019 (r346687) > > +++ head/sys/net/if_tap.c Thu Apr 25 18:22:22 2019 (r346688) > > @@ -180,6 +180,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL > > SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); > > > > DEV_MODULE(if_tap, tapmodevent, NULL); > ^^^ > > +MODULE_VERSION(if_tun, 1); > ^^^ > If wrong, ok, please fix, if correct, please this needs a very > complete comment as to what it is if_tun. > *sigh* I had one job to do, and I goofed it. Thanks for pointing that out... Kyle Evans From owner-svn-src-head@freebsd.org Thu Apr 25 18:38:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4178159F04B; Thu, 25 Apr 2019 18:38:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 575CA93BC0; Thu, 25 Apr 2019 18:38:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F37627C38; Thu, 25 Apr 2019 18:38:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIccLE090852; Thu, 25 Apr 2019 18:38:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIcc3l090850; Thu, 25 Apr 2019 18:38:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251838.x3PIcc3l090850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346691 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_sid X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_sid X-SVN-Commit-Revision: 346691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 575CA93BC0 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:38:40 -0000 Author: manu Date: Thu Apr 25 18:38:38 2019 New Revision: 346691 URL: https://svnweb.freebsd.org/changeset/base/346691 Log: arm: allwinner: Add pnpinfo for aw_sid and add module Makefile MFC after: 1 month Added: head/sys/modules/allwinner/aw_sid/ head/sys/modules/allwinner/aw_sid/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/aw_sid.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Thu Apr 25 18:30:47 2019 (r346690) +++ head/sys/arm/allwinner/aw_sid.c Thu Apr 25 18:38:38 2019 (r346691) @@ -414,3 +414,4 @@ static devclass_t aw_sid_devclass; EARLY_DRIVER_MODULE(aw_sid, simplebus, aw_sid_driver, aw_sid_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_FIRST); MODULE_VERSION(aw_sid, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:30:47 2019 (r346690) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:38:38 2019 (r346691) @@ -2,6 +2,7 @@ # Build modules specific to Allwinner. SUBDIR = \ + aw_sid \ aw_spi \ .include Added: head/sys/modules/allwinner/aw_sid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_sid/Makefile Thu Apr 25 18:38:38 2019 (r346691) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_sid +SRCS= aw_sid.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:39:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E740159F0D4; Thu, 25 Apr 2019 18:39:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6DD493D3E; Thu, 25 Apr 2019 18:39:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C37EB27C3A; Thu, 25 Apr 2019 18:39:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIdgGq090943; Thu, 25 Apr 2019 18:39:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIdgZw090940; Thu, 25 Apr 2019 18:39:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251839.x3PIdgZw090940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346692 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_thermal X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_thermal X-SVN-Commit-Revision: 346692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6DD493D3E 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:39:43 -0000 Author: manu Date: Thu Apr 25 18:39:41 2019 New Revision: 346692 URL: https://svnweb.freebsd.org/changeset/base/346692 Log: arm: allwinner: Add pnp info to aw_thermal and compile it as module too MFC after: 1 month Added: head/sys/modules/allwinner/aw_thermal/ head/sys/modules/allwinner/aw_thermal/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/aw_thermal.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Thu Apr 25 18:38:38 2019 (r346691) +++ head/sys/arm/allwinner/aw_thermal.c Thu Apr 25 18:39:41 2019 (r346692) @@ -728,3 +728,5 @@ static devclass_t aw_thermal_devclass; DRIVER_MODULE(aw_thermal, simplebus, aw_thermal_driver, aw_thermal_devclass, 0, 0); MODULE_VERSION(aw_thermal, 1); +MODULE_DEPEND(aw_thermal, aw_sid, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:38:38 2019 (r346691) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:39:41 2019 (r346692) @@ -4,5 +4,6 @@ SUBDIR = \ aw_sid \ aw_spi \ + aw_thermal .include Added: head/sys/modules/allwinner/aw_thermal/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_thermal/Makefile Thu Apr 25 18:39:41 2019 (r346692) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_thermal +SRCS= aw_thermal.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:40:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D28F159F157; Thu, 25 Apr 2019 18:40:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1127993E84; Thu, 25 Apr 2019 18:40:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAAB327C3E; Thu, 25 Apr 2019 18:40:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIeOA0091051; Thu, 25 Apr 2019 18:40:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIeObh091048; Thu, 25 Apr 2019 18:40:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251840.x3PIeObh091048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346693 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/axp81x X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/axp81x X-SVN-Commit-Revision: 346693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1127993E84 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:40:25 -0000 Author: manu Date: Thu Apr 25 18:40:23 2019 New Revision: 346693 URL: https://svnweb.freebsd.org/changeset/base/346693 Log: arm: allwinner: Add pnp info to axp81x and compile it as module too MFC after: 1 month Added: head/sys/modules/allwinner/axp81x/ head/sys/modules/allwinner/axp81x/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/axp81x.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Thu Apr 25 18:39:41 2019 (r346692) +++ head/sys/arm/allwinner/axp81x.c Thu Apr 25 18:40:23 2019 (r346693) @@ -1619,3 +1619,4 @@ EARLY_DRIVER_MODULE(ofw_gpiobus, axp8xx_pmu, ofw_gpiob DRIVER_MODULE(gpioc, axp8xx_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp8xx, 1); MODULE_DEPEND(axp8xx, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:39:41 2019 (r346692) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:40:23 2019 (r346693) @@ -4,6 +4,7 @@ SUBDIR = \ aw_sid \ aw_spi \ - aw_thermal + aw_thermal \ + axp81x .include Added: head/sys/modules/allwinner/axp81x/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/axp81x/Makefile Thu Apr 25 18:40:23 2019 (r346693) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= axp81x +SRCS= axp81x.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + iicbus_if.h + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:41:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6014D159F1FE; Thu, 25 Apr 2019 18:41:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08731940FE; Thu, 25 Apr 2019 18:41:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8E0527D6A; Thu, 25 Apr 2019 18:41:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIf5kD092001; Thu, 25 Apr 2019 18:41:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIf5CB091998; Thu, 25 Apr 2019 18:41:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251841.x3PIf5CB091998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346694 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_rtc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_rtc X-SVN-Commit-Revision: 346694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08731940FE 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:41:06 -0000 Author: manu Date: Thu Apr 25 18:41:05 2019 New Revision: 346694 URL: https://svnweb.freebsd.org/changeset/base/346694 Log: arm: allwinner: Add pnp info to aw_rtc and compile it as module too MFC after: 1 month Added: head/sys/modules/allwinner/aw_rtc/ head/sys/modules/allwinner/aw_rtc/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/aw_rtc.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Thu Apr 25 18:40:23 2019 (r346693) +++ head/sys/arm/allwinner/aw_rtc.c Thu Apr 25 18:41:05 2019 (r346694) @@ -185,6 +185,8 @@ static devclass_t aw_rtc_devclass; EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(aw_rtc, 1); +SIMPLEBUS_PNP_INFO(compat_data); static int aw_rtc_probe(device_t dev) Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:40:23 2019 (r346693) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:41:05 2019 (r346694) @@ -2,6 +2,7 @@ # Build modules specific to Allwinner. SUBDIR = \ + aw_rtc \ aw_sid \ aw_spi \ aw_thermal \ Added: head/sys/modules/allwinner/aw_rtc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_rtc/Makefile Thu Apr 25 18:41:05 2019 (r346694) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_rtc +SRCS= aw_rtc.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + spibus_if.h \ + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:42:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D2F5159F42E; Thu, 25 Apr 2019 18:42:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7E67944EE; Thu, 25 Apr 2019 18:42:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84A6F27DC5; Thu, 25 Apr 2019 18:42:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIg8JZ095883; Thu, 25 Apr 2019 18:42:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIg8Eb095880; Thu, 25 Apr 2019 18:42:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904251842.x3PIg8Eb095880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Apr 2019 18:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346695 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 346695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7E67944EE 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:42:09 -0000 Author: jhb Date: Thu Apr 25 18:42:07 2019 New Revision: 346695 URL: https://svnweb.freebsd.org/changeset/base/346695 Log: Remove p_code from struct proc. Contrary to the comments, it was never used by core dumps or debuggers. Instead, it used to hold the signal code of a pending signal, but that was replaced by the 'ksi_code' member of ksiginfo_t when signal information was reworked in 7.0. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D20047 Modified: head/sys/kern/kern_sig.c head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Apr 25 18:41:05 2019 (r346694) +++ head/sys/kern/kern_sig.c Thu Apr 25 18:42:07 2019 (r346695) @@ -1996,7 +1996,6 @@ trapsignal(struct thread *td, ksiginfo_t *ksi) ps->ps_sigact[_SIG_IDX(sig)] = SIG_DFL; } mtx_unlock(&ps->ps_mtx); - p->p_code = code; /* XXX for core dump/debugger */ p->p_sig = sig; /* XXX to verify code */ tdsendsignal(p, td, sig, ksi); } @@ -3062,7 +3061,6 @@ postsig(int sig) returnmask = td->td_sigmask; if (p->p_sig == sig) { - p->p_code = 0; p->p_sig = 0; } (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Apr 25 18:41:05 2019 (r346694) +++ head/sys/kern/kern_thread.c Thu Apr 25 18:42:07 2019 (r346695) @@ -90,11 +90,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0xb0, "struct proc KBI p_flag"); _Static_assert(offsetof(struct proc, p_pid) == 0xbc, "struct proc KBI p_pid"); -_Static_assert(offsetof(struct proc, p_filemon) == 0x3d0, +_Static_assert(offsetof(struct proc, p_filemon) == 0x3c8, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e8, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e0, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c8, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c0, "struct proc KBI p_emuldata"); #endif #ifdef __i386__ @@ -110,11 +110,11 @@ _Static_assert(offsetof(struct proc, p_flag) == 0x68, "struct proc KBI p_flag"); _Static_assert(offsetof(struct proc, p_pid) == 0x74, "struct proc KBI p_pid"); -_Static_assert(offsetof(struct proc, p_filemon) == 0x27c, +_Static_assert(offsetof(struct proc, p_filemon) == 0x278, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x290, +_Static_assert(offsetof(struct proc, p_comm) == 0x28c, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x31c, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x318, "struct proc KBI p_emuldata"); #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Apr 25 18:41:05 2019 (r346694) +++ head/sys/sys/proc.h Thu Apr 25 18:42:07 2019 (r346695) @@ -617,7 +617,6 @@ struct proc { struct sigiolst p_sigiolst; /* (c) List of sigio sources. */ int p_sigparent; /* (c) Signal to parent on exit. */ int p_sig; /* (n) For core dump/debugger XXX. */ - u_long p_code; /* (n) For core dump/debugger XXX. */ u_int p_stops; /* (c) Stop event bitmask. */ u_int p_stype; /* (c) Stop event type. */ char p_step; /* (c) Process is stopped. */ From owner-svn-src-head@freebsd.org Thu Apr 25 18:42:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243C9159F4B0; Thu, 25 Apr 2019 18:42:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D82894697; Thu, 25 Apr 2019 18:42:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67E1E27DDF; Thu, 25 Apr 2019 18:42:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIgSvA095943; Thu, 25 Apr 2019 18:42:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIgR1w095940; Thu, 25 Apr 2019 18:42:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251842.x3PIgR1w095940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346696 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/if_awg X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/if_awg X-SVN-Commit-Revision: 346696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D82894697 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:42:29 -0000 Author: manu Date: Thu Apr 25 18:42:27 2019 New Revision: 346696 URL: https://svnweb.freebsd.org/changeset/base/346696 Log: arm: allwinner: Add pnp info to if_awg and compile it as module too While here make it depend on aw_sid as it's needed for mac generation. MFC after: 1 month Added: head/sys/modules/allwinner/if_awg/ head/sys/modules/allwinner/if_awg/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/if_awg.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Thu Apr 25 18:42:07 2019 (r346695) +++ head/sys/arm/allwinner/if_awg.c Thu Apr 25 18:42:27 2019 (r346696) @@ -1967,6 +1967,7 @@ static devclass_t awg_devclass; DRIVER_MODULE(awg, simplebus, awg_driver, awg_devclass, 0, 0); DRIVER_MODULE(miibus, awg, miibus_driver, miibus_devclass, 0, 0); - MODULE_DEPEND(awg, ether, 1, 1, 1); MODULE_DEPEND(awg, miibus, 1, 1, 1); +MODULE_DEPEND(awg, aw_sid, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:42:07 2019 (r346695) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:42:27 2019 (r346696) @@ -6,6 +6,7 @@ SUBDIR = \ aw_sid \ aw_spi \ aw_thermal \ - axp81x + axp81x \ + if_awg .include Added: head/sys/modules/allwinner/if_awg/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/if_awg/Makefile Thu Apr 25 18:42:27 2019 (r346696) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= if_awg +SRCS= if_awg.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:43:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9985159F534; Thu, 25 Apr 2019 18:43:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C4E947E5; Thu, 25 Apr 2019 18:43:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 404E627DE3; Thu, 25 Apr 2019 18:43:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIh23k096025; Thu, 25 Apr 2019 18:43:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIh1No096021; Thu, 25 Apr 2019 18:43:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251843.x3PIh1No096021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346697 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_rsb X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_rsb X-SVN-Commit-Revision: 346697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62C4E947E5 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:43:03 -0000 Author: manu Date: Thu Apr 25 18:43:01 2019 New Revision: 346697 URL: https://svnweb.freebsd.org/changeset/base/346697 Log: arm: allwinner: Add pnp info to aw_rsb and compile it as module too MFC after: 1 month Added: head/sys/modules/allwinner/aw_rsb/ head/sys/modules/allwinner/aw_rsb/Makefile (contents, props changed) Modified: head/sys/arm/allwinner/aw_rsb.c head/sys/modules/allwinner/Makefile Modified: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- head/sys/arm/allwinner/aw_rsb.c Thu Apr 25 18:42:27 2019 (r346696) +++ head/sys/arm/allwinner/aw_rsb.c Thu Apr 25 18:43:01 2019 (r346697) @@ -496,3 +496,5 @@ EARLY_DRIVER_MODULE(iicbus, rsb, iicbus_driver, iicbus EARLY_DRIVER_MODULE(rsb, simplebus, rsb_driver, rsb_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(rsb, 1); +MODULE_DEPEND(rsb, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:42:27 2019 (r346696) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:43:01 2019 (r346697) @@ -3,6 +3,7 @@ SUBDIR = \ aw_rtc \ + aw_rsb \ aw_sid \ aw_spi \ aw_thermal \ Added: head/sys/modules/allwinner/aw_rsb/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_rsb/Makefile Thu Apr 25 18:43:01 2019 (r346697) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_rsb +SRCS= aw_rsb.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + iicbus_if.h + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:43:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35C84159F56C; Thu, 25 Apr 2019 18:43:10 +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 4063A94874; Thu, 25 Apr 2019 18:43:09 +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 x3PIh0Hf034811 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Apr 2019 21:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3PIh0Hf034811 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3PIh0nB034810; Thu, 25 Apr 2019 21:43:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Apr 2019 21:43:00 +0300 From: Konstantin Belousov To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346687 - head/sys/compat/linuxkpi/common/src Message-ID: <20190425184300.GM12936@kib.kiev.ua> References: <201904251813.x3PIDut8078016@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904251813.x3PIDut8078016@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:43:10 -0000 On Thu, Apr 25, 2019 at 06:13:56PM +0000, Tycho Nightingale wrote: > Author: tychon > Date: Thu Apr 25 18:13:55 2019 > New Revision: 346687 > URL: https://svnweb.freebsd.org/changeset/base/346687 > > Log: > LinuxKPI buildfix for ppc64 after r346645. > > Proposed by: hselasky > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/compat/linuxkpi/common/src/linux_pci.c > > Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 17:28:36 2019 (r346686) > +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 18:13:55 2019 (r346687) > @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) > dma_mask, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filtfunc, filtfuncarg */ > - BUS_SPACE_MAXADDR, /* maxsize */ > + BUS_SPACE_MAXSIZE, /* maxsize */ > 1, /* nsegments */ > - BUS_SPACE_MAXADDR, /* maxsegsz */ > + BUS_SPACE_MAXSIZE, /* maxsegsz */ > 0, /* flags */ > NULL, NULL, /* lockfunc, lockfuncarg */ > &priv->dmat); It seems that amd64 BUS_SPACE_MAXSIZE is 4G, I do not know why. Either we should fix that, or the following fix is more appropriate. i386 and ppc both have PAE-like configs where maxaddr is 64bit but maxsize is 32bit. diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 4e93827e2e9..ed0d5575b05 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -137,9 +137,17 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) dma_mask, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ +#if defined(__i386__) || defined(__powerpc__) + BUS_SPACE_MAXSIZE, +#else BUS_SPACE_MAXADDR, /* maxsize */ +#endif 1, /* nsegments */ +#if defined(__i386__) || defined(__powerpc__) + BUS_SPACE_MAXSIZE, +#else BUS_SPACE_MAXADDR, /* maxsegsz */ +#endif 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &priv->dmat); From owner-svn-src-head@freebsd.org Thu Apr 25 18:44:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F685159F632; Thu, 25 Apr 2019 18:44:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A872C94AFE; Thu, 25 Apr 2019 18:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83F2027DE4; Thu, 25 Apr 2019 18:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PIi4jh096129; Thu, 25 Apr 2019 18:44:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PIi4PC096127; Thu, 25 Apr 2019 18:44:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904251844.x3PIi4PC096127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 18:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346698 - in head/sys/modules/allwinner: . aw_pwm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/modules/allwinner: . aw_pwm X-SVN-Commit-Revision: 346698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A872C94AFE 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:44:05 -0000 Author: manu Date: Thu Apr 25 18:44:03 2019 New Revision: 346698 URL: https://svnweb.freebsd.org/changeset/base/346698 Log: arm: allwinner: aw_pwm: compile it as module too MFC after: 1 month Added: head/sys/modules/allwinner/aw_pwm/ head/sys/modules/allwinner/aw_pwm/Makefile (contents, props changed) Modified: head/sys/modules/allwinner/Makefile Modified: head/sys/modules/allwinner/Makefile ============================================================================== --- head/sys/modules/allwinner/Makefile Thu Apr 25 18:43:01 2019 (r346697) +++ head/sys/modules/allwinner/Makefile Thu Apr 25 18:44:03 2019 (r346698) @@ -2,6 +2,7 @@ # Build modules specific to Allwinner. SUBDIR = \ + aw_pwm \ aw_rtc \ aw_rsb \ aw_sid \ Added: head/sys/modules/allwinner/aw_pwm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_pwm/Makefile Thu Apr 25 18:44:03 2019 (r346698) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_pwm +SRCS= aw_pwm.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + pwm_if.h + +.include From owner-svn-src-head@freebsd.org Thu Apr 25 18:46:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5EC2159F7B4; Thu, 25 Apr 2019 18:46:53 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BACE94D44; Thu, 25 Apr 2019 18:46:53 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3PIkpSn049476; Thu, 25 Apr 2019 11:46:51 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3PIkpHL049475; Thu, 25 Apr 2019 11:46:51 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904251846.x3PIkpHL049475@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346688 - head/sys/net In-Reply-To: To: Kyle Evans Date: Thu, 25 Apr 2019 11:46:51 -0700 (PDT) CC: "Rodney W. Grimes" , 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: 5BACE94D44 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:46:54 -0000 > On Thu, Apr 25, 2019 at 1:24 PM Rodney W. Grimes > wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > Author: kevans > > > Date: Thu Apr 25 18:22:22 2019 > > > New Revision: 346688 > > > URL: https://svnweb.freebsd.org/changeset/base/346688 > > > > > > Log: > > > tap(4): Add a MODULE_VERSION > > ^^^ > > > > > > Otherwise tap(4) can be loaded by loader despite being compiled into the > > > kernel, causing a panic as things try to double-initialize. > > > > > > PR: 220867 > > > MFC after: 3 days > > > > > > Modified: > > > head/sys/net/if_tap.c > > ^^^ > > > > > > Modified: head/sys/net/if_tap.c > > > ============================================================================== > > > --- head/sys/net/if_tap.c Thu Apr 25 18:13:55 2019 (r346687) > > > +++ head/sys/net/if_tap.c Thu Apr 25 18:22:22 2019 (r346688) > > > @@ -180,6 +180,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL > > > SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); > > > > > > DEV_MODULE(if_tap, tapmodevent, NULL); > > ^^^ > > > +MODULE_VERSION(if_tun, 1); > > ^^^ > > If wrong, ok, please fix, if correct, please this needs a very > > complete comment as to what it is if_tun. > > > > *sigh* > > I had one job to do, and I goofed it. Thanks for pointing that out... Well it is 25/27 correct :-) > Kyle Evans -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 25 18:48:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24516159F84E; Thu, 25 Apr 2019 18:48:04 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 59FB694EAE; Thu, 25 Apr 2019 18:48:02 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id f1a32a7d; Thu, 25 Apr 2019 20:48:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=BH+uO1iqI2JIdJxI9GuiahIjDqI=; b=ZOnyobrTZVcXPvYZk75tg7EbHgrO mnPMw8GKoI3ltfD4BbSJBcaWyCmO5LsY52wV8VFNf50yQExMRds4TurFGkXrHRE3 IgToadk2zc8TeQ2Y38HOoPrZCeCkvza9ocdrgkmu9vDbmIrrS8+je/Yo0nN8spva UAkUHndv43Zztgg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=QT6kCwkGajMCXVrm8cjwh9SMfFzvh/xCTLr9xLpE45K8v+GOpPd6knDH ZA3ZbRhj0t4fGt85aSTi2sWNCrA76StSoRIv1n4SmGOQJMwqR2zBbvHVYahlYfL3 wWhUcIPOfuY0IDrTC9bwbN2YFPf1BU5mH0mRjJHK17fpVwcDToU= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 89b81c63 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 25 Apr 2019 20:48:00 +0200 (CEST) Date: Thu, 25 Apr 2019 20:48:00 +0200 From: Emmanuel Vadot To: Enji Cooper Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346683 - head/usr.sbin/bsdinstall/scripts Message-Id: <20190425204800.122bf65f9311d372182b4a37@bidouilliste.com> In-Reply-To: <7DEA4472-397B-4193-8180-359E0FC6DA0E@gmail.com> References: <201904251647.x3PGlGWL029523@repo.freebsd.org> <7DEA4472-397B-4193-8180-359E0FC6DA0E@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 59FB694EAE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:48:04 -0000 On Thu, 25 Apr 2019 11:22:34 -0700 Enji Cooper wrote: >=20 > > On Apr 25, 2019, at 09:47, Emmanuel Vadot wrote: > >=20 > > Author: manu > > Date: Thu Apr 25 16:47:15 2019 > > New Revision: 346683 > > URL: https://svnweb.freebsd.org/changeset/base/346683 > >=20 > > Log: > > bsdinstall: up the interface before calling dhclient >=20 > Hi Emmanuel! > Just curious.. What issue did you see when the interface wasn?t UPed? > Thank you! > -Enji Hi Enji, dhclient cannot get the lease (obviously), and so the installer doesn't store the dhcp configuration in rc.conf I don't know if it's related to the device (ix(4) in that case) but since netconfig_ipv6 also ifconfig up when setting radv we might want to do the same for ipv4. Cheers, --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Apr 25 18:50:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F0A159F94D; Thu, 25 Apr 2019 18:50:15 +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 5A4DB9515C; Thu, 25 Apr 2019 18:50:15 +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 A037A7FEF; Thu, 25 Apr 2019 18:50:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346687 - head/sys/compat/linuxkpi/common/src To: Konstantin Belousov , Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904251813.x3PIDut8078016@repo.freebsd.org> <20190425184300.GM12936@kib.kiev.ua> 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: <78fc1980-3436-6155-a3bd-a3e85c6a5001@FreeBSD.org> Date: Thu, 25 Apr 2019 11:50:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190425184300.GM12936@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5A4DB9515C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:50:15 -0000 On 4/25/19 11:43 AM, Konstantin Belousov wrote: > On Thu, Apr 25, 2019 at 06:13:56PM +0000, Tycho Nightingale wrote: >> Author: tychon >> Date: Thu Apr 25 18:13:55 2019 >> New Revision: 346687 >> URL: https://svnweb.freebsd.org/changeset/base/346687 >> >> Log: >> LinuxKPI buildfix for ppc64 after r346645. >> >> Proposed by: hselasky >> Sponsored by: Dell EMC Isilon >> >> Modified: >> head/sys/compat/linuxkpi/common/src/linux_pci.c >> >> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 17:28:36 2019 (r346686) >> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 18:13:55 2019 (r346687) >> @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) >> dma_mask, /* lowaddr */ >> BUS_SPACE_MAXADDR, /* highaddr */ >> NULL, NULL, /* filtfunc, filtfuncarg */ >> - BUS_SPACE_MAXADDR, /* maxsize */ >> + BUS_SPACE_MAXSIZE, /* maxsize */ >> 1, /* nsegments */ >> - BUS_SPACE_MAXADDR, /* maxsegsz */ >> + BUS_SPACE_MAXSIZE, /* maxsegsz */ >> 0, /* flags */ >> NULL, NULL, /* lockfunc, lockfuncarg */ >> &priv->dmat); > > It seems that amd64 BUS_SPACE_MAXSIZE is 4G, I do not know why. > Either we should fix that, or the following fix is more appropriate. > i386 and ppc both have PAE-like configs where maxaddr is 64bit but > maxsize is 32bit. I think we should fix amd64's maxsize. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 25 18:56:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED098159FBB4; Thu, 25 Apr 2019 18:56:46 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.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 BE47895710; Thu, 25 Apr 2019 18:56:44 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C3B8564480; Thu, 25 Apr 2019 14:56:42 -0400 (EDT) (envelope-from tychon@freebsd.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= 1L0O1CY96RVWKbQ8Cx4TsuuVaNI=; b=xKPT7gw+RH6aOd8co5OJCmK30NSwg7xs a6vwgaZkdAz78fCVpARuvafsIo5boZFkMEIWgMlBfSCiudzbH5m4CyPUEh9nVCOl w/JpcdNVTXmF57c+c66lASKXTBZtiivXxtWLAqAuAVUaJaLtJq7px3aQ1TlRrdVj TiblzrovU+A= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id BBA3A6447F; Thu, 25 Apr 2019 14:56:42 -0400 (EDT) (envelope-from tychon@freebsd.org) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id D9AB56447D; Thu, 25 Apr 2019 14:56:39 -0400 (EDT) (envelope-from tychon@freebsd.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346687 - head/sys/compat/linuxkpi/common/src From: Tycho Nightingale In-Reply-To: <78fc1980-3436-6155-a3bd-a3e85c6a5001@FreeBSD.org> Date: Thu, 25 Apr 2019 14:56:36 -0400 Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <57248B07-6950-4AA0-8A92-B1D0C613E3DA@freebsd.org> References: <201904251813.x3PIDut8078016@repo.freebsd.org> <20190425184300.GM12936@kib.kiev.ua> <78fc1980-3436-6155-a3bd-a3e85c6a5001@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: DC251A38-678B-11E9-B169-D01F9763A999-09779102!pb-smtp20.pobox.com X-Rspamd-Queue-Id: BE47895710 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:56:47 -0000 > On Apr 25, 2019, at 2:50 PM, John Baldwin wrote: >=20 > On 4/25/19 11:43 AM, Konstantin Belousov wrote: >> On Thu, Apr 25, 2019 at 06:13:56PM +0000, Tycho Nightingale wrote: >>> Author: tychon >>> Date: Thu Apr 25 18:13:55 2019 >>> New Revision: 346687 >>> URL: https://svnweb.freebsd.org/changeset/base/346687 >>>=20 >>> Log: >>> LinuxKPI buildfix for ppc64 after r346645. >>>=20 >>> Proposed by: hselasky >>> Sponsored by: Dell EMC Isilon >>>=20 >>> Modified: >>> head/sys/compat/linuxkpi/common/src/linux_pci.c >>>=20 >>> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.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/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 = 17:28:36 2019 (r346686) >>> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 = 18:13:55 2019 (r346687) >>> @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 = dma_mask) >>> dma_mask, /* lowaddr */ >>> BUS_SPACE_MAXADDR, /* highaddr */ >>> NULL, NULL, /* filtfunc, filtfuncarg */ >>> - BUS_SPACE_MAXADDR, /* maxsize */ >>> + BUS_SPACE_MAXSIZE, /* maxsize */ >>> 1, /* nsegments */ >>> - BUS_SPACE_MAXADDR, /* maxsegsz */ >>> + BUS_SPACE_MAXSIZE, /* maxsegsz */ >>> 0, /* flags */ >>> NULL, NULL, /* lockfunc, lockfuncarg */ >>> &priv->dmat); >>=20 >> It seems that amd64 BUS_SPACE_MAXSIZE is 4G, I do not know why. >> Either we should fix that, or the following fix is more appropriate. >> i386 and ppc both have PAE-like configs where maxaddr is 64bit but >> maxsize is 32bit. >=20 > I think we should fix amd64's maxsize. That sounds reasonable. Perhaps this was a conservative choice along = with the 4GB DMA boundary which I removed recently. After some testing I can make this change. Tycho= From owner-svn-src-head@freebsd.org Thu Apr 25 19:11:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22783159FEFE; Thu, 25 Apr 2019 19:11:08 +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 4384395EDA; Thu, 25 Apr 2019 19:11:07 +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 x3PJAxNg041774 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Apr 2019 22:11:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3PJAxNg041774 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3PJAxqG041773; Thu, 25 Apr 2019 22:10:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Apr 2019 22:10:59 +0300 From: Konstantin Belousov To: Tycho Nightingale Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346687 - head/sys/compat/linuxkpi/common/src Message-ID: <20190425191059.GN12936@kib.kiev.ua> References: <201904251813.x3PIDut8078016@repo.freebsd.org> <20190425184300.GM12936@kib.kiev.ua> <78fc1980-3436-6155-a3bd-a3e85c6a5001@FreeBSD.org> <57248B07-6950-4AA0-8A92-B1D0C613E3DA@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57248B07-6950-4AA0-8A92-B1D0C613E3DA@freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 19:11:08 -0000 On Thu, Apr 25, 2019 at 02:56:36PM -0400, Tycho Nightingale wrote: > > > > On Apr 25, 2019, at 2:50 PM, John Baldwin wrote: > > > > On 4/25/19 11:43 AM, Konstantin Belousov wrote: > >> On Thu, Apr 25, 2019 at 06:13:56PM +0000, Tycho Nightingale wrote: > >>> Author: tychon > >>> Date: Thu Apr 25 18:13:55 2019 > >>> New Revision: 346687 > >>> URL: https://svnweb.freebsd.org/changeset/base/346687 > >>> > >>> Log: > >>> LinuxKPI buildfix for ppc64 after r346645. > >>> > >>> Proposed by: hselasky > >>> Sponsored by: Dell EMC Isilon > >>> > >>> Modified: > >>> head/sys/compat/linuxkpi/common/src/linux_pci.c > >>> > >>> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c > >>> ============================================================================== > >>> --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 17:28:36 2019 (r346686) > >>> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 18:13:55 2019 (r346687) > >>> @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) > >>> dma_mask, /* lowaddr */ > >>> BUS_SPACE_MAXADDR, /* highaddr */ > >>> NULL, NULL, /* filtfunc, filtfuncarg */ > >>> - BUS_SPACE_MAXADDR, /* maxsize */ > >>> + BUS_SPACE_MAXSIZE, /* maxsize */ > >>> 1, /* nsegments */ > >>> - BUS_SPACE_MAXADDR, /* maxsegsz */ > >>> + BUS_SPACE_MAXSIZE, /* maxsegsz */ > >>> 0, /* flags */ > >>> NULL, NULL, /* lockfunc, lockfuncarg */ > >>> &priv->dmat); > >> > >> It seems that amd64 BUS_SPACE_MAXSIZE is 4G, I do not know why. > >> Either we should fix that, or the following fix is more appropriate. > >> i386 and ppc both have PAE-like configs where maxaddr is 64bit but > >> maxsize is 32bit. > > > > I think we should fix amd64's maxsize. > > That sounds reasonable. Perhaps this was a conservative choice along with the 4GB DMA boundary which I removed recently. > > After some testing I can make this change. Please do. From owner-svn-src-head@freebsd.org Thu Apr 25 19:18:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D067C15A0326; Thu, 25 Apr 2019 19:18:12 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2F46967DE; Thu, 25 Apr 2019 19:18:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id f125so449710qke.6; Thu, 25 Apr 2019 12:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ULfUMHSe9EwQCA4Q6kt6JJKOCEAzqz6NA48i42sUDCk=; b=odaA9pt/t04j498nkXBKf8XDAjpntaP4z6Gc+jbwfj6EO+CavTQXYouqKmxVfCezXp 20ZQmsbzEZ9YBxYr3gB3SfXq3h13wF8B6anBVnO9xcwx4e9tUIYDDTAlcTLOM3xKlM2W RAYZ3w48KMgBVC3SrHNuzNRhQ8q1ka3C43pJTVn6I/f/YOazkEv30WQ3oPiq/hpSoPI7 F/Gy8asBV+4q1Ozu7iIxoDTDXlyDpGNM5cp9wU9FPxuUR4wrtogT7iT35EWKZH3JoslQ uV8PFxyeeqRn4tUQziZ0udwIK9/hcFoJpEbCPyT56ynp8yLafYlX/f3RAB5RZc7i3HqT cA8A== 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=ULfUMHSe9EwQCA4Q6kt6JJKOCEAzqz6NA48i42sUDCk=; b=KKYPXUai4cynCRfEDX+zOlRi5BfrQIdTbVNNsVTRw293OgaqKfKaKAgCc0EemcxNLn qmGTP+Ors/7Rk9/bxcMlQZvhXWPD/KUxfAe5P9fL1PCiFNkjR+JquVyG6EZo/nh4556U 0XJCO90dZXMSnkEWmbAhIodo3R611gVLdlSpLCwGk1Qp08z1iK4nzh+OWqrHCBUYq0ir Tb5DofVf5wPYYav1AudVRcrFObwAI3vop1P4L+qrFf+mWO8z+lytkbOp7A9DANhtVOlR EKodeG2DxvcYp628CZ2Zil6s4Tvb18U4UQCiFye6dozyxjEDR9CGV3IVE2Ku/javOXdY qPNQ== X-Gm-Message-State: APjAAAXPWHgESuotGNamoBymI9r7nR7djleHz1KI+hz89MK92+rPd+w6 b7jpfMvPbjJvNnzlFFtL412bn4w7wNNS++Rs/UL7dQ== X-Google-Smtp-Source: APXvYqw0OQkFrWJnbfYBdujXtu4gVdR2HyhZzYOJr6FcueXHGHv5IgPScpsi3KAdSpGiz4vbcWz3cGa1Tts5xwnYDQc= X-Received: by 2002:ae9:e309:: with SMTP id v9mr19774846qkf.121.1556219890840; Thu, 25 Apr 2019 12:18:10 -0700 (PDT) MIME-Version: 1.0 References: <201904191343.x3JDhYVF010453@repo.freebsd.org> In-Reply-To: <201904191343.x3JDhYVF010453@repo.freebsd.org> From: Ryan Stone Date: Thu, 25 Apr 2019 15:17:59 -0400 Message-ID: Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin , Ed Maste Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C2F46967DE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=odaA9pt/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2607:f8b0:4864:20::72a as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-6.37 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[a.2.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]; IP_SCORE(-2.92)[ip: (-9.12), ipnet: 2607:f8b0::/32(-3.14), asn: 15169(-2.25), country: US(-0.06)]; NEURAL_HAM_SHORT(-0.44)[-0.445,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 19:18:13 -0000 This change makes me *very* uncomfortable. It was originally brought in due to issues with Adaptec RAID cards using the aac(9) driver. The symptoms of the bug included silent corruption of data as it was written to disk. Are we sure that this change is a good idea, given how catastrophic it is when a device gets this wrong? On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale wrote: > > Author: tychon > Date: Fri Apr 19 13:43:33 2019 > New Revision: 346386 > URL: https://svnweb.freebsd.org/changeset/base/346386 > > Log: > remove the 4GB boundary requirement on PCI DMA segments > > Reviewed by: kib > Discussed with: jhb > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D19867 > > Modified: > head/sys/dev/bge/if_bgereg.h > head/sys/dev/pci/pci.c > head/sys/dev/pci/pcivar.h > head/sys/dev/twa/tw_osl.h > head/sys/dev/twa/tw_osl_freebsd.c > head/sys/x86/iommu/intel_ctx.c > > Modified: head/sys/dev/bge/if_bgereg.h > ============================================================================== > --- head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 (r346386) > @@ -3067,3 +3067,11 @@ struct bge_softc { > #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, MA_OWNED) > #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) > #define BGE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->bge_mtx) > + > +#ifdef BUS_SPACE_MAXADDR > +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > +#define BGE_DMA_BOUNDARY (0x100000000) > +#else > +#define BGE_DMA_BOUNDARY 0 > +#endif > +#endif > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 (r346386) > @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) > { > struct pci_softc *sc; > int busno, domain; > -#ifdef PCI_DMA_BOUNDARY > - int error, tag_valid; > -#endif > #ifdef PCI_RES_BUS > int rid; > #endif > @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) > if (bootverbose) > device_printf(dev, "domain=%d, physical bus=%d\n", > domain, busno); > -#ifdef PCI_DMA_BOUNDARY > - tag_valid = 0; > - if (device_get_devclass(device_get_parent(device_get_parent(dev))) != > - devclass_find("pci")) { > - error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, > - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, > - NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, > - BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); > - if (error) > - device_printf(dev, "Failed to create DMA tag: %d\n", > - error); > - else > - tag_valid = 1; > - } > - if (!tag_valid) > -#endif > - sc->sc_dma_tag = bus_get_dma_tag(dev); > + sc->sc_dma_tag = bus_get_dma_tag(dev); > return (0); > } > > > Modified: head/sys/dev/pci/pcivar.h > ============================================================================== > --- head/sys/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 (r346386) > @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, int pcie_location); > > void pci_print_faulted_dev(void); > > -#ifdef BUS_SPACE_MAXADDR > -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > -#define PCI_DMA_BOUNDARY 0x100000000 > -#else > -#define PCI_DMA_BOUNDARY 0 > -#endif > -#endif > - > #endif /* _SYS_BUS_H_ */ > > /* > > Modified: head/sys/dev/twa/tw_osl.h > ============================================================================== > --- head/sys/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 (r346386) > @@ -57,6 +57,12 @@ > #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) > #define TW_OSLI_MAX_NUM_AENS 0x100 > > +#ifdef PAE > +#define TW_OSLI_DMA_BOUNDARY (1u << 31) > +#else > +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) > +#endif > + > /* Possible values of req->state. */ > #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ > #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ > > Modified: head/sys/dev/twa/tw_osl_freebsd.c > ============================================================================== > --- head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 (r346386) > @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) > /* Create the parent dma tag. */ > if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */ > sc->alignment, /* alignment */ > - 0, /* boundary */ > + TW_OSLI_DMA_BOUNDARY, /* boundary */ > BUS_SPACE_MAXADDR, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg */ > > Modified: head/sys/x86/iommu/intel_ctx.c > ============================================================================== > --- head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 (r346385) > +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 (r346386) > @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev) > maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR); > ctx->ctx_tag.common.ref_count = 1; /* Prevent free */ > ctx->ctx_tag.common.impl = &bus_dma_dmar_impl; > - ctx->ctx_tag.common.boundary = PCI_DMA_BOUNDARY; > + ctx->ctx_tag.common.boundary = 0; > ctx->ctx_tag.common.lowaddr = maxaddr; > ctx->ctx_tag.common.highaddr = maxaddr; > ctx->ctx_tag.common.maxsize = maxaddr; > From owner-svn-src-head@freebsd.org Thu Apr 25 19:21:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A15515A05B6; Thu, 25 Apr 2019 19:21:05 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8F996A63; Thu, 25 Apr 2019 19:21:05 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x72c.google.com with SMTP id k189so480640qkc.0; Thu, 25 Apr 2019 12:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zDxOZ6gW1NzGNMmUcUQdInU1vW8YjVjLcn8ciK4jCyE=; b=GbJnQD8PGZMugWky8ux/McOmze/v/eX3vyI689Fl341Sfu0r7nv6FkSYu/fCU/1hi0 vJhJFEZnRdgjQjcYsCc+0UN7VU6BDel7vMWOcCsxzB0f+LXRxtq1qlCjjPRzFEJJrpkF n4lIVlBZosYPue/8L4liJD8jHeQzLddzdEqqIT89uYvHS5yaTGfRClLuXE4BaXYLee27 eYpgJ1/7V3dm62t50wlmP6bGWTS9FQHQ+/MM3/znwi7DqFAdr4usiqtR4Ep+bqGHEShU aY7MMUOH5yTRRRGRjVg7OESPyzwajquMZtGUUhS9KolbfHG1cYtpOwxiGCQkRbiq64QD gbAQ== 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=zDxOZ6gW1NzGNMmUcUQdInU1vW8YjVjLcn8ciK4jCyE=; b=GW1q2ETFNcaF6IMixrMKY62ew7fA50VKtNenZsXseyijL4/nHL5scuu/6rYVKgaXG0 zBHd306T5C1KPj3r5fltkLs3SE3+/bWbtL/D3EPbgiR7xUBAdBPobOQ/BbOQHQjxJt2V XUK+N/xvpOZRd1MaZvkGybACv035tHYXQuYmj2TZFNUm3l9lBR6fiRLXp/uoqhLe/Tlc WIFSz/fLNcmJE3SSBv9reelMoiQpV03JpdMdUby4z/GE+2CL0peKPKI3ZcOYcx+9pDh+ Sj3vJL4MNQSub4VgEXtpBkXZ4BfdY9D9NGvui53jwOdZtzArgDcbUfyoIFt/fU0Km39O DNEg== X-Gm-Message-State: APjAAAW29L5EyFV2sqBwGzBrr31LVAUgnhfeyGsKewe4lAOJDnoPJ2Nz WwUK+Iwcep8FFmYZQLHOZjNMP3ne8Ie8WF7pl2v78HHBPvk= X-Google-Smtp-Source: APXvYqyYPuJTFUCBTswASgBRFj+Ktox5VquLxH+4j7/oc/P9BqucPds7M7pGx6/7/uCwbV72SDQe9CtQFpZgBtbxlo8= X-Received: by 2002:a05:620a:1486:: with SMTP id w6mr10395989qkj.4.1556220064573; Thu, 25 Apr 2019 12:21:04 -0700 (PDT) MIME-Version: 1.0 References: <201904191343.x3JDhYVF010453@repo.freebsd.org> In-Reply-To: From: Ryan Stone Date: Thu, 25 Apr 2019 15:20:53 -0400 Message-ID: Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin , Ed Maste Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3F8F996A63 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.85 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.85)[-0.854,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 19:21:05 -0000 Following up, this is what will have to be re-instated in the aac driver: http://svn.freebsd.org/changeset/base/232260 However, my biggest concern is that we have no idea how many new devices with the broken behaviour might have been introduced since we fixed the problem in general. How does Linux handle the issue? On Thu, Apr 25, 2019 at 3:17 PM Ryan Stone wrote: > > This change makes me *very* uncomfortable. It was originally brought > in due to issues with Adaptec RAID cards using the aac(9) driver. The > symptoms of the bug included silent corruption of data as it was > written to disk. Are we sure that this change is a good idea, given > how catastrophic it is when a device gets this wrong? > > On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale wrote: > > > > Author: tychon > > Date: Fri Apr 19 13:43:33 2019 > > New Revision: 346386 > > URL: https://svnweb.freebsd.org/changeset/base/346386 > > > > Log: > > remove the 4GB boundary requirement on PCI DMA segments > > > > Reviewed by: kib > > Discussed with: jhb > > Sponsored by: Dell EMC Isilon > > Differential Revision: https://reviews.freebsd.org/D19867 > > > > Modified: > > head/sys/dev/bge/if_bgereg.h > > head/sys/dev/pci/pci.c > > head/sys/dev/pci/pcivar.h > > head/sys/dev/twa/tw_osl.h > > head/sys/dev/twa/tw_osl_freebsd.c > > head/sys/x86/iommu/intel_ctx.c > > > > Modified: head/sys/dev/bge/if_bgereg.h > > ============================================================================== > > --- head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 (r346386) > > @@ -3067,3 +3067,11 @@ struct bge_softc { > > #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, MA_OWNED) > > #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) > > #define BGE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->bge_mtx) > > + > > +#ifdef BUS_SPACE_MAXADDR > > +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > > +#define BGE_DMA_BOUNDARY (0x100000000) > > +#else > > +#define BGE_DMA_BOUNDARY 0 > > +#endif > > +#endif > > > > Modified: head/sys/dev/pci/pci.c > > ============================================================================== > > --- head/sys/dev/pci/pci.c Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 (r346386) > > @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) > > { > > struct pci_softc *sc; > > int busno, domain; > > -#ifdef PCI_DMA_BOUNDARY > > - int error, tag_valid; > > -#endif > > #ifdef PCI_RES_BUS > > int rid; > > #endif > > @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) > > if (bootverbose) > > device_printf(dev, "domain=%d, physical bus=%d\n", > > domain, busno); > > -#ifdef PCI_DMA_BOUNDARY > > - tag_valid = 0; > > - if (device_get_devclass(device_get_parent(device_get_parent(dev))) != > > - devclass_find("pci")) { > > - error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, > > - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, > > - NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, > > - BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); > > - if (error) > > - device_printf(dev, "Failed to create DMA tag: %d\n", > > - error); > > - else > > - tag_valid = 1; > > - } > > - if (!tag_valid) > > -#endif > > - sc->sc_dma_tag = bus_get_dma_tag(dev); > > + sc->sc_dma_tag = bus_get_dma_tag(dev); > > return (0); > > } > > > > > > Modified: head/sys/dev/pci/pcivar.h > > ============================================================================== > > --- head/sys/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 (r346386) > > @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, int pcie_location); > > > > void pci_print_faulted_dev(void); > > > > -#ifdef BUS_SPACE_MAXADDR > > -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > > -#define PCI_DMA_BOUNDARY 0x100000000 > > -#else > > -#define PCI_DMA_BOUNDARY 0 > > -#endif > > -#endif > > - > > #endif /* _SYS_BUS_H_ */ > > > > /* > > > > Modified: head/sys/dev/twa/tw_osl.h > > ============================================================================== > > --- head/sys/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 (r346386) > > @@ -57,6 +57,12 @@ > > #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) > > #define TW_OSLI_MAX_NUM_AENS 0x100 > > > > +#ifdef PAE > > +#define TW_OSLI_DMA_BOUNDARY (1u << 31) > > +#else > > +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) > > +#endif > > + > > /* Possible values of req->state. */ > > #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ > > #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ > > > > Modified: head/sys/dev/twa/tw_osl_freebsd.c > > ============================================================================== > > --- head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 (r346386) > > @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) > > /* Create the parent dma tag. */ > > if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */ > > sc->alignment, /* alignment */ > > - 0, /* boundary */ > > + TW_OSLI_DMA_BOUNDARY, /* boundary */ > > BUS_SPACE_MAXADDR, /* lowaddr */ > > BUS_SPACE_MAXADDR, /* highaddr */ > > NULL, NULL, /* filter, filterarg */ > > > > Modified: head/sys/x86/iommu/intel_ctx.c > > ============================================================================== > > --- head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 (r346385) > > +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 (r346386) > > @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev) > > maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR); > > ctx->ctx_tag.common.ref_count = 1; /* Prevent free */ > > ctx->ctx_tag.common.impl = &bus_dma_dmar_impl; > > - ctx->ctx_tag.common.boundary = PCI_DMA_BOUNDARY; > > + ctx->ctx_tag.common.boundary = 0; > > ctx->ctx_tag.common.lowaddr = maxaddr; > > ctx->ctx_tag.common.highaddr = maxaddr; > > ctx->ctx_tag.common.maxsize = maxaddr; > > From owner-svn-src-head@freebsd.org Thu Apr 25 20:02:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E0B015A111D; Thu, 25 Apr 2019 20:02: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 F1E7E97FA7; Thu, 25 Apr 2019 20:02:11 +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 CB47DBBA; Thu, 25 Apr 2019 20:02:11 +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 x3PK2B40039032; Thu, 25 Apr 2019 20:02:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PK2BXV039031; Thu, 25 Apr 2019 20:02:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904252002.x3PK2BXV039031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 20:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346700 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 346700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1E7E97FA7 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(-0.99)[-0.995,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:02:12 -0000 Author: kevans Date: Thu Apr 25 20:02:11 2019 New Revision: 346700 URL: https://svnweb.freebsd.org/changeset/base/346700 Log: libbe(3): Fix mis-application of patch (SHLIBDIR) Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of the patch, leaving it to get installed to the wrong place and subsequently removed via ObsoleteFiles. Reported by: jkim MFC after: 3 days X-MFC-With: r346546 Modified: head/lib/libbe/Makefile Modified: head/lib/libbe/Makefile ============================================================================== --- head/lib/libbe/Makefile Thu Apr 25 18:49:29 2019 (r346699) +++ head/lib/libbe/Makefile Thu Apr 25 20:02:11 2019 (r346700) @@ -4,7 +4,7 @@ PACKAGE= lib${LIB} LIB= be -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 1 SHLIB_MINOR= 0 From owner-svn-src-head@freebsd.org Thu Apr 25 20:08:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B83515A12D0; Thu, 25 Apr 2019 20:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F014683A3; Thu, 25 Apr 2019 20:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1124BE6; Thu, 25 Apr 2019 20:08:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PK8i2k039322; Thu, 25 Apr 2019 20:08:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PK8iCA039319; Thu, 25 Apr 2019 20:08:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904252008.x3PK8iCA039319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 25 Apr 2019 20:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346701 - in head/stand: efi/loader fdt X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/stand: efi/loader fdt X-SVN-Commit-Revision: 346701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F014683A3 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(-0.99)[-0.995,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:08:45 -0000 Author: manu Date: Thu Apr 25 20:08:43 2019 New Revision: 346701 URL: https://svnweb.freebsd.org/changeset/base/346701 Log: loader: fdt: Add fdt_is_setup function When efi_autoload is called it will call fdt_setup_fdtp which setup the dtb and overlays. If a user already loaded at dtb or overlays or just printed the efi provided dtb, this will re-setup everything and also re-applying the overlays. Test that everything is setup before doing it again. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D20059 Modified: head/stand/efi/loader/autoload.c head/stand/fdt/fdt_loader_cmd.c head/stand/fdt/fdt_platform.h Modified: head/stand/efi/loader/autoload.c ============================================================================== --- head/stand/efi/loader/autoload.c Thu Apr 25 20:02:11 2019 (r346700) +++ head/stand/efi/loader/autoload.c Thu Apr 25 20:08:43 2019 (r346701) @@ -50,7 +50,8 @@ efi_autoload(void) * imply that we're on a platform where FDT is a requirement. If we * fix this, then the error handling here should be fixed accordingly. */ - fdt_setup_fdtp(); + if (fdt_is_setup() == 0) + fdt_setup_fdtp(); #endif return (0); } Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Thu Apr 25 20:02:11 2019 (r346700) +++ head/stand/fdt/fdt_loader_cmd.c Thu Apr 25 20:08:43 2019 (r346701) @@ -510,6 +510,16 @@ fdt_apply_overlays() } int +fdt_is_setup(void) +{ + + if (fdtp != NULL) + return (1); + + return (0); +} + +int fdt_setup_fdtp() { struct preloaded_file *bfp; Modified: head/stand/fdt/fdt_platform.h ============================================================================== --- head/stand/fdt/fdt_platform.h Thu Apr 25 20:02:11 2019 (r346700) +++ head/stand/fdt/fdt_platform.h Thu Apr 25 20:08:43 2019 (r346701) @@ -48,6 +48,7 @@ int fdt_load_dtb_addr(struct fdt_header *); int fdt_load_dtb_file(const char *); void fdt_load_dtb_overlays(const char *); int fdt_setup_fdtp(void); +int fdt_is_setup(void); /* The platform library needs to implement these functions */ int fdt_platform_load_dtb(void); From owner-svn-src-head@freebsd.org Thu Apr 25 20:09:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0135D15A1355; Thu, 25 Apr 2019 20:09: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 996B76850E; Thu, 25 Apr 2019 20:09:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76866BEB; Thu, 25 Apr 2019 20:09: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 x3PK9oHU039445; Thu, 25 Apr 2019 20:09:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PK9oMg039443; Thu, 25 Apr 2019 20:09:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904252009.x3PK9oMg039443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 25 Apr 2019 20:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346702 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 346702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 996B76850E 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:09:51 -0000 Author: imp Date: Thu Apr 25 20:09:49 2019 New Revision: 346702 URL: https://svnweb.freebsd.org/changeset/base/346702 Log: Add efi_freebsd_delenv Add a wrapper around efi_delenv akin to efi_freebsd_getenv and efi_getenv. Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/efienv.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Thu Apr 25 20:08:43 2019 (r346701) +++ head/stand/efi/include/efilib.h Thu Apr 25 20:09:49 2019 (r346702) @@ -126,6 +126,7 @@ void cpy16to8(const CHAR16 *, char *, size_t); */ EFI_STATUS efi_delenv(EFI_GUID *guid, const char *varname); +EFI_STATUS efi_freebsd_delenv(const char *varname); EFI_STATUS efi_freebsd_getenv(const char *v, void *data, __size_t *len); EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len); EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len); Modified: head/stand/efi/libefi/efienv.c ============================================================================== --- head/stand/efi/libefi/efienv.c Thu Apr 25 20:08:43 2019 (r346701) +++ head/stand/efi/libefi/efienv.c Thu Apr 25 20:09:49 2019 (r346702) @@ -119,5 +119,11 @@ efi_delenv(EFI_GUID *guid, const char *name) rv = RS->SetVariable(var, guid, 0, 0, NULL); free(var); - return rv; + return (rv); +} + +EFI_STATUS +efi_freebsd_delenv(const char *name) +{ + return (efi_delenv(&FreeBSDBootVarGUID, name)); } From owner-svn-src-head@freebsd.org Thu Apr 25 20:10:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE4A915A1396; Thu, 25 Apr 2019 20:10:03 +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 66A1368686; Thu, 25 Apr 2019 20:10: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 4391BBEF; Thu, 25 Apr 2019 20:10: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 x3PKA3Kr039538; Thu, 25 Apr 2019 20:10:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PKA3MF039537; Thu, 25 Apr 2019 20:10:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904252010.x3PKA3MF039537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 25 Apr 2019 20:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346703 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66A1368686 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:10:04 -0000 Author: imp Date: Thu Apr 25 20:10:02 2019 New Revision: 346703 URL: https://svnweb.freebsd.org/changeset/base/346703 Log: Move initialization of the block device handles earlier (we're just snagging them from UEFI BIOS). Call the device type init routines earlier as well, as they don't depend on how the console is setup. This will allow us to read files earlier in boot, so any rare error messages that this might move only to the EFI console will be an acceptable price to pay. Also tweak the order of has_kbd so it resides next to the rest of the console code. It needs to be after we initialize the buffer cache. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Apr 25 20:09:49 2019 (r346702) +++ head/stand/efi/loader/main.c Thu Apr 25 20:10:02 2019 (r346703) @@ -783,13 +783,30 @@ main(int argc, CHAR16 *argv[]) /* Init the time source */ efi_time_init(); - has_kbd = has_keyboard(); - /* * Initialise the block cache. Set the upper limit. */ bcache_init(32768, 512); + /* + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. + */ + 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)(); + + /* + * Detect console settings two different ways: one via the command + * args (eg -h) or via the UEFI ConOut variable. + */ + has_kbd = has_keyboard(); howto = parse_args(argc, argv); if (!has_kbd && (howto & RB_PROBE)) howto |= RB_SERIAL | RB_MULTIPLE; @@ -852,20 +869,6 @@ main(int argc, CHAR16 *argv[]) if ((s = getenv("fail_timeout")) != NULL) fail_timeout = strtol(s, NULL, 10); - /* - * Scan the BLOCK IO MEDIA handles then - * march through the device switch probing for things. - */ - 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:"); for (i = 0; i < argc; i++) @@ -877,8 +880,6 @@ main(int argc, CHAR16 *argv[]) printf(" EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); printf(" Console: %s (%#x)\n", getenv("console"), howto); - - /* Determine the devpath of our image so we can prefer it. */ text = efi_devpath_name(boot_img->FilePath); From owner-svn-src-head@freebsd.org Thu Apr 25 20:23:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683E415A1827; Thu, 25 Apr 2019 20:23:14 +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 0774E6A25D; Thu, 25 Apr 2019 20:23: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 CFD8DF4E; Thu, 25 Apr 2019 20:23:13 +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 x3PKNDTp049536; Thu, 25 Apr 2019 20:23:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PKNDHg049535; Thu, 25 Apr 2019 20:23:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904252023.x3PKNDHg049535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 25 Apr 2019 20:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346704 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0774E6A25D 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:23:14 -0000 Author: imp Date: Thu Apr 25 20:23:13 2019 New Revision: 346704 URL: https://svnweb.freebsd.org/changeset/base/346704 Log: Add the proper range of years for Netflix's copyright on this file. Note that I wrote it. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Apr 25 20:10:02 2019 (r346703) +++ head/stand/efi/loader/main.c Thu Apr 25 20:23:13 2019 (r346704) @@ -3,7 +3,7 @@ * Copyright (c) 2006 Marcel Moolenaar * All rights reserved. * - * Copyright (c) 2018 Netflix, Inc. + * Copyright (c) 2016-2019 Netflix, Inc. written by M. Warner Losh * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Thu Apr 25 20:37:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E5315A1DA3; Thu, 25 Apr 2019 20:37:45 +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 903886AA86; Thu, 25 Apr 2019 20:37:45 +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 B03898C37; Thu, 25 Apr 2019 20:37:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu To: Ryan Stone , Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste References: <201904191343.x3JDhYVF010453@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <5c43013c-1fc6-57c2-6dec-1fdfc5213fb3@FreeBSD.org> Date: Thu, 25 Apr 2019 13:37:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 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: 903886AA86 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:37:46 -0000 I had looked for the aac change, but wasn't able to find it, perhaps because I looked at tags created in aac.c rather than aac_pci.c. I agree aac will need to be re-patched. I'm not really certain how many other devices are actually broken. They would all be due to a firmware bug, nothing inherent in PCI. I believe twa(4) and bge(4) issues predated aac(4) FWIW. Unfortunately, the main bit of discussion about moving the limit into the PCI bus itself seems to be an IRC discussion on 2/28/12 that resulted in revision r232267 as a quick MFC'able fix, but I don't have a log of that conversation. :( I couldn't find anything in e-mail either that was definitive for why this might have been inherent in PCI-e vs a few firmware writers having similar bugs. On 4/25/19 12:20 PM, Ryan Stone wrote: > Following up, this is what will have to be re-instated in the aac driver: > > http://svn.freebsd.org/changeset/base/232260 > > However, my biggest concern is that we have no idea how many new > devices with the broken behaviour might have been introduced since we > fixed the problem in general. How does Linux handle the issue? > > On Thu, Apr 25, 2019 at 3:17 PM Ryan Stone wrote: >> >> This change makes me *very* uncomfortable. It was originally brought >> in due to issues with Adaptec RAID cards using the aac(9) driver. The >> symptoms of the bug included silent corruption of data as it was >> written to disk. Are we sure that this change is a good idea, given >> how catastrophic it is when a device gets this wrong? >> >> On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale wrote: >>> >>> Author: tychon >>> Date: Fri Apr 19 13:43:33 2019 >>> New Revision: 346386 >>> URL: https://svnweb.freebsd.org/changeset/base/346386 >>> >>> Log: >>> remove the 4GB boundary requirement on PCI DMA segments >>> >>> Reviewed by: kib >>> Discussed with: jhb >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: https://reviews.freebsd.org/D19867 >>> >>> Modified: >>> head/sys/dev/bge/if_bgereg.h >>> head/sys/dev/pci/pci.c >>> head/sys/dev/pci/pcivar.h >>> head/sys/dev/twa/tw_osl.h >>> head/sys/dev/twa/tw_osl_freebsd.c >>> head/sys/x86/iommu/intel_ctx.c >>> >>> Modified: head/sys/dev/bge/if_bgereg.h >>> ============================================================================== >>> --- head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -3067,3 +3067,11 @@ struct bge_softc { >>> #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, MA_OWNED) >>> #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) >>> #define BGE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->bge_mtx) >>> + >>> +#ifdef BUS_SPACE_MAXADDR >>> +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>> +#define BGE_DMA_BOUNDARY (0x100000000) >>> +#else >>> +#define BGE_DMA_BOUNDARY 0 >>> +#endif >>> +#endif >>> >>> Modified: head/sys/dev/pci/pci.c >>> ============================================================================== >>> --- head/sys/dev/pci/pci.c Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) >>> { >>> struct pci_softc *sc; >>> int busno, domain; >>> -#ifdef PCI_DMA_BOUNDARY >>> - int error, tag_valid; >>> -#endif >>> #ifdef PCI_RES_BUS >>> int rid; >>> #endif >>> @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) >>> if (bootverbose) >>> device_printf(dev, "domain=%d, physical bus=%d\n", >>> domain, busno); >>> -#ifdef PCI_DMA_BOUNDARY >>> - tag_valid = 0; >>> - if (device_get_devclass(device_get_parent(device_get_parent(dev))) != >>> - devclass_find("pci")) { >>> - error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, >>> - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, >>> - NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, >>> - BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); >>> - if (error) >>> - device_printf(dev, "Failed to create DMA tag: %d\n", >>> - error); >>> - else >>> - tag_valid = 1; >>> - } >>> - if (!tag_valid) >>> -#endif >>> - sc->sc_dma_tag = bus_get_dma_tag(dev); >>> + sc->sc_dma_tag = bus_get_dma_tag(dev); >>> return (0); >>> } >>> >>> >>> Modified: head/sys/dev/pci/pcivar.h >>> ============================================================================== >>> --- head/sys/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, int pcie_location); >>> >>> void pci_print_faulted_dev(void); >>> >>> -#ifdef BUS_SPACE_MAXADDR >>> -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>> -#define PCI_DMA_BOUNDARY 0x100000000 >>> -#else >>> -#define PCI_DMA_BOUNDARY 0 >>> -#endif >>> -#endif >>> - >>> #endif /* _SYS_BUS_H_ */ >>> >>> /* >>> >>> Modified: head/sys/dev/twa/tw_osl.h >>> ============================================================================== >>> --- head/sys/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -57,6 +57,12 @@ >>> #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) >>> #define TW_OSLI_MAX_NUM_AENS 0x100 >>> >>> +#ifdef PAE >>> +#define TW_OSLI_DMA_BOUNDARY (1u << 31) >>> +#else >>> +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) >>> +#endif >>> + >>> /* Possible values of req->state. */ >>> #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ >>> #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ >>> >>> Modified: head/sys/dev/twa/tw_osl_freebsd.c >>> ============================================================================== >>> --- head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) >>> /* Create the parent dma tag. */ >>> if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */ >>> sc->alignment, /* alignment */ >>> - 0, /* boundary */ >>> + TW_OSLI_DMA_BOUNDARY, /* boundary */ >>> BUS_SPACE_MAXADDR, /* lowaddr */ >>> BUS_SPACE_MAXADDR, /* highaddr */ >>> NULL, NULL, /* filter, filterarg */ >>> >>> Modified: head/sys/x86/iommu/intel_ctx.c >>> ============================================================================== >>> --- head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 (r346385) >>> +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 (r346386) >>> @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev) >>> maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR); >>> ctx->ctx_tag.common.ref_count = 1; /* Prevent free */ >>> ctx->ctx_tag.common.impl = &bus_dma_dmar_impl; >>> - ctx->ctx_tag.common.boundary = PCI_DMA_BOUNDARY; >>> + ctx->ctx_tag.common.boundary = 0; >>> ctx->ctx_tag.common.lowaddr = maxaddr; >>> ctx->ctx_tag.common.highaddr = maxaddr; >>> ctx->ctx_tag.common.maxsize = maxaddr; >>> > -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 25 20:48:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2189215A21A7; Thu, 25 Apr 2019 20:48:26 +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 B9BE56B031; Thu, 25 Apr 2019 20:48: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 9241212B8; Thu, 25 Apr 2019 20:48: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 x3PKmPnR060817; Thu, 25 Apr 2019 20:48:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PKmPsH060816; Thu, 25 Apr 2019 20:48:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904252048.x3PKmPsH060816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Apr 2019 20:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346705 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 346705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9BE56B031 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.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:48:26 -0000 Author: kevans Date: Thu Apr 25 20:48:25 2019 New Revision: 346705 URL: https://svnweb.freebsd.org/changeset/base/346705 Log: libbe(3): Fix libcompat build SHLIBDIR should still be optionally set, just before src.opts.mk is included so that libcompat can properly override it. This fixes lib32 failures reported by both Jenkins and Michael Butler. Reported by: Michael Butler MFC after: 3 days X-MFC-With: r346546 Modified: head/lib/libbe/Makefile Modified: head/lib/libbe/Makefile ============================================================================== --- head/lib/libbe/Makefile Thu Apr 25 20:23:13 2019 (r346704) +++ head/lib/libbe/Makefile Thu Apr 25 20:48:25 2019 (r346705) @@ -1,10 +1,11 @@ # $FreeBSD$ +SHLIBDIR?= /lib + .include PACKAGE= lib${LIB} LIB= be -SHLIBDIR= /lib SHLIB_MAJOR= 1 SHLIB_MINOR= 0 From owner-svn-src-head@freebsd.org Thu Apr 25 21:24:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93D2915A2D18; Thu, 25 Apr 2019 21:24:57 +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 2EA616C623; Thu, 25 Apr 2019 21:24:57 +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 134AB19A4; Thu, 25 Apr 2019 21:24:57 +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 x3PLOumF081665; Thu, 25 Apr 2019 21:24:56 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PLOuC2081663; Thu, 25 Apr 2019 21:24:56 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201904252124.x3PLOuC2081663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 25 Apr 2019 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346708 - in head: share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head: share/man/man4 sys/net X-SVN-Commit-Revision: 346708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EA616C623 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 21:24:57 -0000 Author: shurd Date: Thu Apr 25 21:24:56 2019 New Revision: 346708 URL: https://svnweb.freebsd.org/changeset/base/346708 Log: iflib: Better control over queue core assignment By default, cores are now assigned to queues in a sequential manner rather than all NICs starting at the first core. On a four-core system with two NICs each using two queue pairs, the nic:queue -> core mapping has changed from this: 0:0 -> 0, 0:1 -> 1 1:0 -> 0, 1:1 -> 1 To this: 0:0 -> 0, 0:1 -> 1 1:0 -> 2, 1:1 -> 3 Additionally, a device can now be configured to use separate cores for TX and RX queues. Two new tunables have been added, dev.X.Y.iflib.separate_txrx and dev.X.Y.iflib.core_offset. If core_offset is set, the NIC is not part of the auto-assigned sequence. Reviewed by: marius MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D20029 Modified: head/share/man/man4/iflib.4 head/sys/net/iflib.c Modified: head/share/man/man4/iflib.4 ============================================================================== --- head/share/man/man4/iflib.4 Thu Apr 25 21:09:07 2019 (r346707) +++ head/share/man/man4/iflib.4 Thu Apr 25 21:24:56 2019 (r346708) @@ -55,6 +55,16 @@ If zero, the number of TX queues is derived from the n socket connected to the controller. .It Va disable_msix Disables MSI-X interrupts for the device. +.It Va core_offset +Specifies a starting core offset to assign queues to. +If the value is unspecified or 65535, cores are assigned sequentially across +controllers. +.It Va separate_txrx +Requests that RX and TX queues not be paired on the same core. +If this is zero or not set, an RX and TX queue pair will be assigned to each +core. +When set to a non-zero value, TX queues are assigned to cores following the +last RX queue. .El .Pp These Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Apr 25 21:09:07 2019 (r346707) +++ head/sys/net/iflib.c Thu Apr 25 21:24:56 2019 (r346708) @@ -189,6 +189,9 @@ struct iflib_ctx { uint16_t ifc_sysctl_qs_eq_override; uint16_t ifc_sysctl_rx_budget; uint16_t ifc_sysctl_tx_abdicate; + uint16_t ifc_sysctl_core_offset; +#define CORE_OFFSET_UNSPECIFIED 0xffff + uint8_t ifc_sysctl_separate_txrx; qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; @@ -723,6 +726,18 @@ static void iflib_free_intr_mem(if_ctx_t ctx); static struct mbuf * iflib_fixup_rx(struct mbuf *m); #endif +static SLIST_HEAD(cpu_offset_list, cpu_offset) cpu_offsets = + SLIST_HEAD_INITIALIZER(cpu_offsets); +struct cpu_offset { + SLIST_ENTRY(cpu_offset) entries; + cpuset_t set; + unsigned int refcount; + uint16_t offset; +}; +static struct mtx cpu_offset_mtx; +MTX_SYSINIT(iflib_cpu_offset, &cpu_offset_mtx, "iflib_cpu_offset lock", + MTX_DEF); + NETDUMP_DEFINE(iflib); #ifdef DEV_NETMAP @@ -4461,6 +4476,71 @@ iflib_rem_pfil(if_ctx_t ctx) pfil_head_unregister(pfil); } +static uint16_t +get_ctx_core_offset(if_ctx_t ctx) +{ + if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + struct cpu_offset *op; + uint16_t qc; + uint16_t ret = ctx->ifc_sysctl_core_offset; + + if (ret != CORE_OFFSET_UNSPECIFIED) + return (ret); + + if (ctx->ifc_sysctl_separate_txrx) + qc = scctx->isc_ntxqsets + scctx->isc_nrxqsets; + else + qc = max(scctx->isc_ntxqsets, scctx->isc_nrxqsets); + + mtx_lock(&cpu_offset_mtx); + SLIST_FOREACH(op, &cpu_offsets, entries) { + if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) { + ret = op->offset; + op->offset += qc; + MPASS(op->refcount < UINT_MAX); + op->refcount++; + break; + } + } + if (ret == CORE_OFFSET_UNSPECIFIED) { + ret = 0; + op = malloc(sizeof(struct cpu_offset), M_IFLIB, + M_NOWAIT | M_ZERO); + if (op == NULL) { + device_printf(ctx->ifc_dev, + "allocation for cpu offset failed.\n"); + } else { + op->offset = qc; + op->refcount = 1; + CPU_COPY(&ctx->ifc_cpus, &op->set); + SLIST_INSERT_HEAD(&cpu_offsets, op, entries); + } + } + mtx_unlock(&cpu_offset_mtx); + + return (ret); +} + +static void +unref_ctx_core_offset(if_ctx_t ctx) +{ + struct cpu_offset *op, *top; + + mtx_lock(&cpu_offset_mtx); + SLIST_FOREACH_SAFE(op, &cpu_offsets, entries, top) { + if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) { + MPASS(op->refcount > 0); + op->refcount--; + if (op->refcount == 0) { + SLIST_REMOVE(&cpu_offsets, op, cpu_offset, entries); + free(op, M_IFLIB); + } + break; + } + } + mtx_unlock(&cpu_offset_mtx); +} + int iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ctxp) { @@ -4613,6 +4693,11 @@ iflib_device_register(device_t dev, void *sc, if_share goto fail_queues; /* + * Now that we know how many queues there are, get the core offset. + */ + ctx->ifc_sysctl_core_offset = get_ctx_core_offset(ctx); + + /* * Group taskqueues aren't properly set up until SMP is started, * so we disable interrupts until we can handle them post * SI_SUB_SMP. @@ -5037,6 +5122,7 @@ iflib_device_deregister(if_ctx_t ctx) iflib_rx_structures_free(ctx); if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); + unref_ctx_core_offset(ctx); STATE_LOCK_DESTROY(ctx); free(ctx, M_IFLIB); return (0); @@ -5655,7 +5741,7 @@ find_child_with_core(int cpu, struct cpu_group *grp) * Find the nth "close" core to the specified core * "close" is defined as the deepest level that shares * at least an L2 cache. With threads, this will be - * threads on the same core. If the sahred cache is L3 + * threads on the same core. If the shared cache is L3 * or higher, simply returns the same core. */ static int @@ -5739,10 +5825,13 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, ifl const char *name) { device_t dev; - int err, cpuid, tid; + int co, cpuid, err, tid; dev = ctx->ifc_dev; - cpuid = find_nth(ctx, qid); + co = ctx->ifc_sysctl_core_offset; + if (ctx->ifc_sysctl_separate_txrx && type == IFLIB_INTR_TX) + co += ctx->ifc_softc_ctx.isc_nrxqsets; + cpuid = find_nth(ctx, qid + co); tid = get_core_offset(ctx, type, qid); MPASS(tid >= 0); cpuid = find_close_core(cpuid, tid); @@ -6344,6 +6433,13 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "tx_abdicate", CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, "cause tx to abdicate instead of running to completion"); + ctx->ifc_sysctl_core_offset = CORE_OFFSET_UNSPECIFIED; + SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "core_offset", + CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, + "offset to start using cores at"); + SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "separate_txrx", + CTLFLAG_RDTUN, &ctx->ifc_sysctl_separate_txrx, 0, + "use separate cores for TX and RX"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", From owner-svn-src-head@freebsd.org Thu Apr 25 21:25:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04DFF15A2D59; Thu, 25 Apr 2019 21:25:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8426C791; Thu, 25 Apr 2019 21:25:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BED919C0; Thu, 25 Apr 2019 21:25:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PLPWSu081746; Thu, 25 Apr 2019 21:25:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PLPWcV081745; Thu, 25 Apr 2019 21:25:32 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904252125.x3PLPWcV081745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Apr 2019 21:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346709 - head/usr.sbin/nfsdumpstate X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 346709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F8426C791 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 21:25:33 -0000 Author: rmacklem Date: Thu Apr 25 21:25:32 2019 New Revision: 346709 URL: https://svnweb.freebsd.org/changeset/base/346709 Log: Add support to nfsdumpstate for printing of INET6 addresses for locks. r346190 added support for printing of INET6 addresses for the "-o" option (all opens) but missed adding support for INET6 addresses for the "-l" option. This patch adds that support. PR: 223036 MFC after: 1 week Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- head/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu Apr 25 21:24:56 2019 (r346708) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu Apr 25 21:25:32 2019 (r346709) @@ -176,6 +176,7 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; + char nbuf[INET6_ADDRSTRLEN]; dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; @@ -183,7 +184,7 @@ dump_lockstate(char *fname) if (nfssvc(NFSSVC_DUMPLOCKS, &dumplocklist) < 0) errx(1, "Can't dump locks for %s\n", fname); - printf("%-11s %-36s %-15s %s\n", + printf("%-11s %-36s %-45s %s\n", "Open/Lock", " Stateid or Lock Range", "Clientaddr", @@ -213,11 +214,26 @@ dump_lockstate(char *fname) lock_flags(lp[cnt].ndlck_flags), lp[cnt].ndlck_first, lp[cnt].ndlck_end); - if (lp[cnt].ndlck_addrfam == AF_INET) - printf("%-15s ", + switch (lp[cnt].ndlck_addrfam) { +#ifdef INET + case AF_INET: + printf("%-45s ", inet_ntoa(lp[cnt].ndlck_cbaddr.sin_addr)); - else - printf("%-15s ", " "); + break; +#endif +#ifdef INET6 + case AF_INET6: + if (inet_ntop(AF_INET6, &lp[cnt].ndlck_cbaddr.sin6_addr, + nbuf, sizeof(nbuf)) != NULL) + printf("%-45s ", nbuf); + else + printf("%-45s ", " "); + break; +#endif + default: + printf("%-45s ", " "); + break; + } for (i = 0; i < lp[cnt].ndlck_owner.nclid_idlen; i++) printf("%02x", lp[cnt].ndlck_owner.nclid_id[i]); printf(" "); From owner-svn-src-head@freebsd.org Thu Apr 25 21:54:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8D215A37D6; Thu, 25 Apr 2019 21:54:33 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF0EE6D8C6; Thu, 25 Apr 2019 21:54:32 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9988F1EC0; Thu, 25 Apr 2019 21:54:32 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PLsWbL097377; Thu, 25 Apr 2019 21:54:32 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PLsW6K097376; Thu, 25 Apr 2019 21:54:32 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201904252154.x3PLsW6K097376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 25 Apr 2019 21:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346712 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 346712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF0EE6D8C6 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(-0.99)[-0.995,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 21:54:33 -0000 Author: johalun Date: Thu Apr 25 21:54:32 2019 New Revision: 346712 URL: https://svnweb.freebsd.org/changeset/base/346712 Log: Don't call cdev_init where cdev_alloc is called. cdev_alloc already handles initialization. Reported by: johalun Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19565 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Apr 25 21:42:02 2019 (r346711) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Apr 25 21:54:32 2019 (r346712) @@ -2328,7 +2328,7 @@ __register_chrdev(unsigned int major, unsigned int bas for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add(cdev, makedev(major, i), 1); @@ -2350,7 +2350,7 @@ __register_chrdev_p(unsigned int major, unsigned int b for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); From owner-svn-src-head@freebsd.org Thu Apr 25 22:27:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38BC715A3DDE; Thu, 25 Apr 2019 22:27:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C52356E4A1; Thu, 25 Apr 2019 22:27: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 A9D3923F2; Thu, 25 Apr 2019 22:27: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 x3PMRu3e013463; Thu, 25 Apr 2019 22:27:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PMRuYc013462; Thu, 25 Apr 2019 22:27:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904252227.x3PMRuYc013462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 25 Apr 2019 22:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346713 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 346713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C52356E4A1 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.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 22:27:57 -0000 Author: ian Date: Thu Apr 25 22:27:56 2019 New Revision: 346713 URL: https://svnweb.freebsd.org/changeset/base/346713 Log: Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to change, not the variable used to return the original pin state. PR: 237378 Reported by: Mori Hiroki Modified: head/sys/dev/gpio/gpioc.c Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Thu Apr 25 21:54:32 2019 (r346712) +++ head/sys/dev/gpio/gpioc.c Thu Apr 25 22:27:56 2019 (r346713) @@ -192,7 +192,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg case GPIOACCESS32: a32 = (struct gpio_access_32 *)arg; res = GPIO_PIN_ACCESS_32(sc->sc_pdev, a32->first_pin, - a32->clear_pins, a32->orig_pins, &a32->orig_pins); + a32->clear_pins, a32->change_pins, &a32->orig_pins); break; case GPIOCONFIG32: c32 = (struct gpio_config_32 *)arg; From owner-svn-src-head@freebsd.org Thu Apr 25 22:51:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1384F15803EB; Thu, 25 Apr 2019 22:51:39 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBAFC6EEB9; Thu, 25 Apr 2019 22:51:38 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9868F27A5; Thu, 25 Apr 2019 22:51:38 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PMpclC028353; Thu, 25 Apr 2019 22:51:38 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PMpbUh028345; Thu, 25 Apr 2019 22:51:37 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201904252251.x3PMpbUh028345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 25 Apr 2019 22:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346714 - in head/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in head/sys/amd64: include vmm vmm/amd vmm/intel vmm/io X-SVN-Commit-Revision: 346714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBAFC6EEB9 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.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 22:51:39 -0000 Author: rgrimes Date: Thu Apr 25 22:51:36 2019 New Revision: 346714 URL: https://svnweb.freebsd.org/changeset/base/346714 Log: Add accessor function for vm->maxcpus Replace most VM_MAXCPU constant useses with an accessor function to vm->maxcpus which for now is initialized and kept at the value of VM_MAXCPUS. This is a rework of Fabian Freyer (fabian.freyer_physik.tu-berlin.de) work from D10070 to adjust it for the cpu topology changes that occured in r332298 Submitted by: Fabian Freyer (fabian.freyer_physik.tu-berlin.de) Reviewed by: Patrick Mooney Approved by: bde (mentor), jhb (maintainer) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18755 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_stat.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/include/vmm.h Thu Apr 25 22:51:36 2019 (r346714) @@ -186,6 +186,7 @@ int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); +uint16_t vm_get_maxcpus(struct vm *vm); void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus); int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/amd/svm.c Thu Apr 25 22:51:36 2019 (r346714) @@ -524,6 +524,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) struct svm_vcpu *vcpu; vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; + uint16_t maxcpus; svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); if (((uintptr_t)svm_sc & PAGE_MASK) != 0) @@ -577,7 +578,8 @@ svm_vminit(struct vm *vm, pmap_t pmap) iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); pml4_pa = svm_sc->nptp; - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(svm_sc->vm); + for (i = 0; i < maxcpus; i++) { vcpu = svm_get_vcpu(svm_sc, i); vcpu->nextrip = ~0; vcpu->lastcpu = NOCPU; Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/intel/vmx.c Thu Apr 25 22:51:36 2019 (r346714) @@ -943,6 +943,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) struct vmx *vmx; struct vmcs *vmcs; uint32_t exc_bitmap; + uint16_t maxcpus; vmx = malloc(sizeof(struct vmx), M_VMX, M_WAITOK | M_ZERO); if ((uintptr_t)vmx & PAGE_MASK) { @@ -1004,7 +1005,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) KASSERT(error == 0, ("vm_map_mmio(apicbase) error %d", error)); } - for (i = 0; i < VM_MAXCPU; i++) { + maxcpus = vm_get_maxcpus(vm); + for (i = 0; i < maxcpus; i++) { vmcs = &vmx->vmcs[i]; vmcs->identifier = vmx_revision(); error = vmclear(vmcs); @@ -3002,11 +3004,13 @@ vmx_vmcleanup(void *arg) { int i; struct vmx *vmx = arg; + uint16_t maxcpus; if (apic_access_virtualization(vmx, 0)) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); - for (i = 0; i < VM_MAXCPU; i++) + maxcpus = vm_get_maxcpus(vmx->vm); + for (i = 0; i < maxcpus; i++) vpid_free(vmx->state[i].vpid); free(vmx, M_VMX); Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/io/vlapic.c Thu Apr 25 22:51:36 2019 (r346714) @@ -838,7 +838,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < VM_MAXCPU) + if (vcpuid < vm_get_maxcpus(vm)) CPU_SET(vcpuid, dmask); } else { /* @@ -965,6 +965,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool struct vlapic *vlapic2; struct vm_exit *vmexit; struct LAPIC *lapic; + uint16_t maxcpus; lapic = vlapic->apic_page; lapic->icr_lo &= ~APIC_DELSTAT_PEND; @@ -1026,11 +1027,12 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool return (0); /* handled completely in the kernel */ } + maxcpus = vm_get_maxcpus(vlapic->vm); if (mode == APIC_DELMODE_INIT) { if ((icrval & APIC_LEVEL_MASK) == APIC_LEVEL_DEASSERT) return (0); - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* move from INIT to waiting-for-SIPI state */ @@ -1043,7 +1045,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool } if (mode == APIC_DELMODE_STARTUP) { - if (vlapic->vcpuid == 0 && dest != 0 && dest < VM_MAXCPU) { + if (vlapic->vcpuid == 0 && dest != 0 && dest < maxcpus) { vlapic2 = vm_lapic(vlapic->vm, dest); /* @@ -1447,7 +1449,8 @@ void vlapic_init(struct vlapic *vlapic) { KASSERT(vlapic->vm != NULL, ("vlapic_init: vm is not initialized")); - KASSERT(vlapic->vcpuid >= 0 && vlapic->vcpuid < VM_MAXCPU, + KASSERT(vlapic->vcpuid >= 0 && + vlapic->vcpuid < vm_get_maxcpus(vlapic->vm), ("vlapic_init: vcpuid is not initialized")); KASSERT(vlapic->apic_page != NULL, ("vlapic_init: apic_page is not " "initialized")); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/vmm.c Thu Apr 25 22:51:36 2019 (r346714) @@ -276,7 +276,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create) { struct vcpu *vcpu; - KASSERT(vcpu_id >= 0 && vcpu_id < VM_MAXCPU, + KASSERT(vcpu_id >= 0 && vcpu_id < vm->maxcpus, ("vcpu_init: invalid vcpu %d", vcpu_id)); vcpu = &vm->vcpu[vcpu_id]; @@ -315,7 +315,7 @@ vm_exitinfo(struct vm *vm, int cpuid) { struct vcpu *vcpu; - if (cpuid < 0 || cpuid >= VM_MAXCPU) + if (cpuid < 0 || cpuid >= vm->maxcpus) panic("vm_exitinfo: invalid cpuid %d", cpuid); vcpu = &vm->vcpu[cpuid]; @@ -428,7 +428,7 @@ vm_init(struct vm *vm, bool create) vm->suspend = 0; CPU_ZERO(&vm->suspended_cpus); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_init(vm, i, create); } @@ -466,7 +466,7 @@ vm_create(const char *name, struct vm **retvm) vm->sockets = 1; vm->cores = cores_per_package; /* XXX backwards compatibility */ vm->threads = threads_per_core; /* XXX backwards compatibility */ - vm->maxcpus = 0; /* XXX not implemented */ + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ vm_init(vm, true); @@ -484,19 +484,25 @@ vm_get_topology(struct vm *vm, uint16_t *sockets, uint *maxcpus = vm->maxcpus; } +uint16_t +vm_get_maxcpus(struct vm *vm) +{ + return (vm->maxcpus); +} + int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus) { if (maxcpus != 0) return (EINVAL); /* XXX remove when supported */ - if ((sockets * cores * threads) > VM_MAXCPU) + if ((sockets * cores * threads) > vm->maxcpus) return (EINVAL); /* XXX need to check sockets * cores * threads == vCPU, how? */ vm->sockets = sockets; vm->cores = cores; vm->threads = threads; - vm->maxcpus = maxcpus; + vm->maxcpus = VM_MAXCPU; /* XXX temp to keep code working */ return(0); } @@ -521,7 +527,7 @@ vm_cleanup(struct vm *vm, bool destroy) vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); - for (i = 0; i < VM_MAXCPU; i++) + for (i = 0; i < vm->maxcpus; i++) vcpu_cleanup(vm, i, destroy); VMCLEANUP(vm->cookie); @@ -956,9 +962,9 @@ vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, * guaranteed if at least one vcpu is in the VCPU_FROZEN state. */ int state; - KASSERT(vcpuid >= -1 && vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d", + KASSERT(vcpuid >= -1 && vcpuid < vm->maxcpus, ("%s: invalid vcpuid %d", __func__, vcpuid)); - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (vcpuid != -1 && vcpuid != i) continue; state = vcpu_get_state(vm, i, NULL); @@ -1004,7 +1010,7 @@ int vm_get_register(struct vm *vm, int vcpu, int reg, uint64_t *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1019,7 +1025,7 @@ vm_set_register(struct vm *vm, int vcpuid, int reg, ui struct vcpu *vcpu; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (reg >= VM_REG_LAST) @@ -1073,7 +1079,7 @@ vm_get_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1086,7 +1092,7 @@ int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (!is_segment_register(reg) && !is_descriptor_table(reg)) @@ -1258,7 +1264,7 @@ static void vm_handle_rendezvous(struct vm *vm, int vcpuid) { - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_handle_rendezvous: invalid vcpuid %d", vcpuid)); mtx_lock(&vm->rendezvous_mtx); @@ -1537,7 +1543,7 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *ret /* * Wakeup the other sleeping vcpus and return to userspace. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->suspended_cpus)) { vcpu_notify_event(vm, i, false); } @@ -1579,7 +1585,7 @@ vm_suspend(struct vm *vm, enum vm_suspend_how how) /* * Notify all active vcpus that they are now suspended. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->active_cpus)) vcpu_notify_event(vm, i, false); } @@ -1665,7 +1671,7 @@ vm_run(struct vm *vm, struct vm_run *vmrun) vcpuid = vmrun->cpuid; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (!CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -1766,7 +1772,7 @@ vm_restart_instruction(void *arg, int vcpuid) int error; vm = arg; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1805,7 +1811,7 @@ vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t in struct vcpu *vcpu; int type, vector; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -1946,7 +1952,8 @@ vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t * uint64_t info1, info2; int valid; - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); + KASSERT(vcpuid >= 0 && + vcpuid < vm->maxcpus, ("invalid vcpu %d", vcpuid)); vcpu = &vm->vcpu[vcpuid]; @@ -1986,7 +1993,7 @@ vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *in { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2003,7 +2010,7 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vec uint64_t regval; int error; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (vector < 0 || vector >= 32) @@ -2094,7 +2101,7 @@ vm_inject_nmi(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2109,7 +2116,7 @@ vm_nmi_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2122,7 +2129,7 @@ vm_nmi_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_nmi_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2141,7 +2148,7 @@ vm_inject_extint(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); vcpu = &vm->vcpu[vcpuid]; @@ -2156,7 +2163,7 @@ vm_extint_pending(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2169,7 +2176,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) { struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_extint_pending: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2184,7 +2191,7 @@ vm_extint_clear(struct vm *vm, int vcpuid) int vm_get_capability(struct vm *vm, int vcpu, int type, int *retval) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2196,7 +2203,7 @@ vm_get_capability(struct vm *vm, int vcpu, int type, i int vm_set_capability(struct vm *vm, int vcpu, int type, int val) { - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm->maxcpus) return (EINVAL); if (type < 0 || type >= VM_CAP_MAX) @@ -2281,7 +2288,7 @@ vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_st int error; struct vcpu *vcpu; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_set_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2299,7 +2306,7 @@ vcpu_get_state(struct vm *vm, int vcpuid, int *hostcpu struct vcpu *vcpu; enum vcpu_state state; - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) panic("vm_get_run_state: invalid vcpuid %d", vcpuid); vcpu = &vm->vcpu[vcpuid]; @@ -2317,7 +2324,7 @@ int vm_activate_cpu(struct vm *vm, int vcpuid) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (CPU_ISSET(vcpuid, &vm->active_cpus)) @@ -2333,12 +2340,12 @@ vm_suspend_cpu(struct vm *vm, int vcpuid) { int i; - if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + if (vcpuid < -1 || vcpuid >= vm->maxcpus) return (EINVAL); if (vcpuid == -1) { vm->debug_cpus = vm->active_cpus; - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &vm->active_cpus)) vcpu_notify_event(vm, i, false); } @@ -2356,7 +2363,7 @@ int vm_resume_cpu(struct vm *vm, int vcpuid) { - if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + if (vcpuid < -1 || vcpuid >= vm->maxcpus) return (EINVAL); if (vcpuid == -1) { @@ -2408,7 +2415,7 @@ vcpu_stats(struct vm *vm, int vcpuid) int vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state *state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); *state = vm->vcpu[vcpuid].x2apic_state; @@ -2419,7 +2426,7 @@ vm_get_x2apic_state(struct vm *vm, int vcpuid, enum x2 int vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state) { - if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + if (vcpuid < 0 || vcpuid >= vm->maxcpus) return (EINVAL); if (state >= X2APIC_STATE_LAST) @@ -2506,7 +2513,7 @@ vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t * Enforce that this function is called without any locks */ WITNESS_WARN(WARN_PANIC, NULL, "vm_smp_rendezvous"); - KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < VM_MAXCPU), + KASSERT(vcpuid == -1 || (vcpuid >= 0 && vcpuid < vm->maxcpus), ("vm_smp_rendezvous: invalid vcpuid %d", vcpuid)); restart: @@ -2536,7 +2543,7 @@ restart: * Wake up any sleeping vcpus and trigger a VM-exit in any running * vcpus so they handle the rendezvous as soon as possible. */ - for (i = 0; i < VM_MAXCPU; i++) { + for (i = 0; i < vm->maxcpus; i++) { if (CPU_ISSET(i, &dest)) vcpu_notify_event(vm, i, false); } Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/vmm_dev.c Thu Apr 25 22:51:36 2019 (r346714) @@ -111,7 +111,7 @@ vcpu_lock_one(struct vmmdev_softc *sc, int vcpu) { int error; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(sc->vm)) return (EINVAL); error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); @@ -136,8 +136,10 @@ static int vcpu_lock_all(struct vmmdev_softc *sc) { int error, vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) { + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) { error = vcpu_lock_one(sc, vcpu); if (error) break; @@ -155,8 +157,10 @@ static void vcpu_unlock_all(struct vmmdev_softc *sc) { int vcpu; + uint16_t maxcpus; - for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) + maxcpus = vm_get_maxcpus(sc->vm); + for (vcpu = 0; vcpu < maxcpus; vcpu++) vcpu_unlock_one(sc, vcpu); } @@ -191,6 +195,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_paddr_t gpa, maxaddr; void *hpa, *cookie; struct vmmdev_softc *sc; + uint16_t lastcpu; error = vmm_priv_check(curthread->td_ucred); if (error) @@ -203,7 +208,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -222,7 +228,8 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag * Since this device does not support lseek(2), dd(1) will * read(2) blocks of data to simulate the lseek(2). */ - hpa = vm_gpa_hold(sc->vm, VM_MAXCPU - 1, gpa, c, prot, &cookie); + hpa = vm_gpa_hold(sc->vm, lastcpu, gpa, c, + prot, &cookie); if (hpa == NULL) { if (uio->uio_rw == UIO_READ && gpa < maxaddr) error = uiomove(__DECONST(void *, zero_region), @@ -234,7 +241,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag vm_gpa_release(cookie); } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -437,7 +444,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da * Lock a vcpu to make sure that the memory map cannot be * modified while it is being inspected. */ - vcpu = VM_MAXCPU - 1; + vcpu = vm_get_maxcpus(sc->vm) - 1; error = vcpu_lock_one(sc, vcpu); if (error) goto done; @@ -797,6 +804,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of size_t len; vm_ooffset_t segoff, first, last; int error, found, segid; + uint16_t lastcpu; bool sysmem; error = vmm_priv_check(curthread->td_ucred); @@ -817,7 +825,8 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of /* * Get a read lock on the guest memory map by freezing any vcpu. */ - error = vcpu_lock_one(sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(sc->vm) - 1; + error = vcpu_lock_one(sc, lastcpu); if (error) return (error); @@ -846,7 +855,7 @@ vmmdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of error = EINVAL; } } - vcpu_unlock_one(sc, VM_MAXCPU - 1); + vcpu_unlock_one(sc, lastcpu); return (error); } @@ -1045,6 +1054,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of vm_ooffset_t first, last; size_t seglen; int error; + uint16_t lastcpu; bool sysmem; dsc = cdev->si_drv1; @@ -1058,7 +1068,8 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of if ((nprot & PROT_EXEC) || first < 0 || first >= last) return (EINVAL); - error = vcpu_lock_one(dsc->sc, VM_MAXCPU - 1); + lastcpu = vm_get_maxcpus(dsc->sc->vm) - 1; + error = vcpu_lock_one(dsc->sc, lastcpu); if (error) return (error); @@ -1066,7 +1077,7 @@ devmem_mmap_single(struct cdev *cdev, vm_ooffset_t *of KASSERT(error == 0 && !sysmem && *objp != NULL, ("%s: invalid devmem segment %d", __func__, dsc->segid)); - vcpu_unlock_one(dsc->sc, VM_MAXCPU - 1); + vcpu_unlock_one(dsc->sc, lastcpu); if (seglen >= last) { vm_object_reference(*objp); Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/vmm_lapic.c Thu Apr 25 22:51:36 2019 (r346714) @@ -56,7 +56,7 @@ lapic_set_intr(struct vm *vm, int cpu, int vector, boo { struct vlapic *vlapic; - if (cpu < 0 || cpu >= VM_MAXCPU) + if (cpu < 0 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); /* @@ -79,7 +79,7 @@ lapic_set_local_intr(struct vm *vm, int cpu, int vecto cpuset_t dmask; int error; - if (cpu < -1 || cpu >= VM_MAXCPU) + if (cpu < -1 || cpu >= vm_get_maxcpus(vm)) return (EINVAL); if (cpu == -1) Modified: head/sys/amd64/vmm/vmm_stat.c ============================================================================== --- head/sys/amd64/vmm/vmm_stat.c Thu Apr 25 22:27:56 2019 (r346713) +++ head/sys/amd64/vmm/vmm_stat.c Thu Apr 25 22:51:36 2019 (r346714) @@ -88,7 +88,7 @@ vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *stats; int i; - if (vcpu < 0 || vcpu >= VM_MAXCPU) + if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm)) return (EINVAL); /* Let stats functions update their counters */ From owner-svn-src-head@freebsd.org Thu Apr 25 22:52:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A4B1580658; Thu, 25 Apr 2019 22:52:45 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C90A76F219; Thu, 25 Apr 2019 22:52:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A59442907; Thu, 25 Apr 2019 22:52:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PMqiji028467; Thu, 25 Apr 2019 22:52:44 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PMqiuI028466; Thu, 25 Apr 2019 22:52:44 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201904252252.x3PMqiuI028466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 25 Apr 2019 22:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346715 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 346715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C90A76F219 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(-0.99)[-0.995,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 22:52:45 -0000 Author: rgrimes Date: Thu Apr 25 22:52:44 2019 New Revision: 346715 URL: https://svnweb.freebsd.org/changeset/base/346715 Log: Acpi MADT table correction for VM_MAXCPU > 21 The bhyve acpi MADT table was given a static space of 256 (0x100) bytes, this is enough space to allow VM_MAXCPU to be 21, this patch changes that so VM_MAXCPU can be of arbitrary value and not overflow the space by actually calculating the space needed for the table. PR: 212782 Reviewed by: Patrick Mooney Approved by: bde (mentor), jhb (maintainer) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18815 Modified: head/usr.sbin/bhyve/acpi.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu Apr 25 22:51:36 2019 (r346714) +++ head/usr.sbin/bhyve/acpi.c Thu Apr 25 22:52:44 2019 (r346715) @@ -39,7 +39,9 @@ * The tables are placed in the guest's ROM area just below 1MB physical, * above the MPTable. * - * Layout + * Layout (No longer correct at FADT and beyond due to properly + * calculating the size of the MADT to allow for changes to + * VM_MAXCPU above 21 which overflows this layout.) * ------ * RSDP -> 0xf2400 (36 bytes fixed) * RSDT -> 0xf2440 (36 bytes + 4*7 table addrs, 4 used) @@ -74,18 +76,31 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" /* - * Define the base address of the ACPI tables, and the offsets to - * the individual tables + * Define the base address of the ACPI tables, the sizes of some tables, + * and the offsets to the individual tables, */ #define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 -#define FADT_OFFSET 0x200 -#define HPET_OFFSET 0x340 -#define MCFG_OFFSET 0x380 -#define FACS_OFFSET 0x3C0 -#define DSDT_OFFSET 0x400 +/* + * The MADT consists of: + * 44 Fixed Header + * 8 * maxcpu Processor Local APIC entries + * 12 I/O APIC entry + * 2 * 10 Interrupt Source Override entires + * 6 Local APIC NMI entry + */ +#define MADT_SIZE (44 + VM_MAXCPU*8 + 12 + 2*10 + 6) +#define FADT_OFFSET (MADT_OFFSET + MADT_SIZE) +#define FADT_SIZE 0x140 +#define HPET_OFFSET (FADT_OFFSET + FADT_SIZE) +#define HPET_SIZE 0x40 +#define MCFG_OFFSET (HPET_OFFSET + HPET_SIZE) +#define MCFG_SIZE 0x40 +#define FACS_OFFSET (MCFG_OFFSET + MCFG_SIZE) +#define FACS_SIZE 0x40 +#define DSDT_OFFSET (FACS_OFFSET + FACS_SIZE) #define BHYVE_ASL_TEMPLATE "bhyve.XXXXXXX" #define BHYVE_ASL_SUFFIX ".aml" From owner-svn-src-head@freebsd.org Thu Apr 25 22:53:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D25015807E7; Thu, 25 Apr 2019 22:53:57 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDC6A6F5B8; Thu, 25 Apr 2019 22:53:56 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 937EF291D; Thu, 25 Apr 2019 22:53:56 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3PMruxT028616; Thu, 25 Apr 2019 22:53:56 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3PMru86028614; Thu, 25 Apr 2019 22:53:56 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201904252253.x3PMru86028614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 25 Apr 2019 22:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346717 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 346717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDC6A6F5B8 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 22:53:57 -0000 Author: rgrimes Date: Thu Apr 25 22:53:55 2019 New Revision: 346717 URL: https://svnweb.freebsd.org/changeset/base/346717 Log: Make bhyve SMBIOS table topology aware When the CPU Topology was added to bhyve in r332298 the SMBIOS table was missed, this table passes topology information to the system and was still using the old concept of each vCPU is a socket with 1 core and 1 thread. This code did not even try to use the old sysctl information to adjust this data. Correct that by building a proper SMBios table, mapping the > 254 cases to 0 per the SMBios 2.6 specification that is claimed by the structure. Reviewed by: Patrick Mooney Approved by: bde and/or phk (mentor), jhb (maintainer) MFC: 3 days Differential Revision: https://reviews.freebsd.org/D18998 Modified: head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Thu Apr 25 22:53:25 2019 (r346716) +++ head/usr.sbin/bhyve/bhyverun.h Thu Apr 25 22:53:55 2019 (r346717) @@ -36,6 +36,7 @@ struct vmctx; extern int guest_ncpus; +extern uint16_t cores, sockets, threads; extern char *guest_uuid_str; extern char *vmname; Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Thu Apr 25 22:53:25 2019 (r346716) +++ head/usr.sbin/bhyve/smbiostbl.c Thu Apr 25 22:53:55 2019 (r346717) @@ -636,7 +636,7 @@ smbios_type4_initializer(struct smbios_structure *temp { int i; - for (i = 0; i < guest_ncpus; i++) { + for (i = 0; i < sockets; i++) { struct smbios_table_type4 *type4; char *p; int nstrings, len; @@ -655,6 +655,16 @@ smbios_type4_initializer(struct smbios_structure *temp *(*endaddr) = '\0'; (*endaddr)++; type4->socket = nstrings + 1; + /* Revise cores and threads after update to smbios 3.0 */ + if (cores > 254) + type4->cores = 0; + else + type4->cores = cores; + /* This threads is total threads in a socket */ + if ((cores * threads) > 254) + type4->threads = 0; + else + type4->threads = (cores * threads); curaddr = *endaddr; } From owner-svn-src-head@freebsd.org Thu Apr 25 23:25:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8D915813B6; Thu, 25 Apr 2019 23:25:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CCA4706A0; Thu, 25 Apr 2019 23:25:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qt1-x82a.google.com with SMTP id g7so2205112qtc.0; Thu, 25 Apr 2019 16:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+5/spy+iE82CgetAR58bX7J3IFAaBbCHXrjj6GkNvhA=; b=p/0vZ1ZFCbA/LXSLtYdVOV43x4kTzQYFw4Ye3WvRHBOuaX9YqA1dVa3EAZ9x7tiRa+ sqSwlpI3FdAfMjFnRUQ1YI4WbargX8E6ZyydVDGD7SsrG8Jk7ZXMpxSLPuzwX85TK2Xw xQplFvHa4jrEO3Mu33mPrEnbWVmFufKNzmb6uCdMH+bwPCwpzkYEGFrjvR24SQmvoPNH ckFxbmdYjXbwXScsHE7Zm87hXU/mG+f8+S/jDg8A5/IArZNuhlweFP4KCdsh6Uhu4zQR WRecB6yO4B6/Hb9vwO2t5QCf/JYW1nwiJW4GRMvIY7mfU010Oj6XLw2UQeSsWo2oWJep 8oLA== 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=+5/spy+iE82CgetAR58bX7J3IFAaBbCHXrjj6GkNvhA=; b=kvn3IB5TLO988f/qA5pJVbBIYTfNre3eQdCedUpIh0X4+3UT+4qvYV4o99xaiLQ5GY x0SG8cSMKHWGv0XCbXjaTItiIgQeREapFSo3TVGdpWABVs4G3c30fuQyQeENOdRlESir qFcQRocvzvRNzDFOE472HHiaaIbBUP2dIchzWOSMemliEKEeUVzo0NIs55rDs0SkOPxx ns23Vh72mLxyzrp0//61LKC2mh9ugLUuS7neuATV5Dgh8oo3wtFyK1iWX/IF5Hvi3X35 w/ajnMADCBzxcaWkUmpx5aGC7xt44/kRpllkoXeNESJeCHfWNmO811TTFxgY0ASFb8f3 72Dw== X-Gm-Message-State: APjAAAW3UwUXc7k2rXqDs2ocQJIDzxkTt8gyTG07QdoB+9zcqSiVpwsC nS8UF0vrjre4PMYbVjh7WYzzGTec4LnzpC85lo3PObAE X-Google-Smtp-Source: APXvYqwNnhbpOZ0ER5bQ0PMreahrNyFhlTa/+TdVrjo3epNcnyswpNKZN6OuLbNFVcLNFjvCP/zBOJqN2J0rKEHveQ0= X-Received: by 2002:aed:24a3:: with SMTP id t32mr18608908qtc.206.1556234710440; Thu, 25 Apr 2019 16:25:10 -0700 (PDT) MIME-Version: 1.0 References: <201904191343.x3JDhYVF010453@repo.freebsd.org> <5c43013c-1fc6-57c2-6dec-1fdfc5213fb3@FreeBSD.org> In-Reply-To: <5c43013c-1fc6-57c2-6dec-1fdfc5213fb3@FreeBSD.org> From: Ryan Stone Date: Thu, 25 Apr 2019 19:24:59 -0400 Message-ID: Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu To: John Baldwin Cc: Tycho Nightingale , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , scottl@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2CCA4706A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 23:25:11 -0000 +scottl@, who I believe explained this to us in the first place. As I recall, it had something to do with 64-bit DMA being expressed as segment base + 32-bit offset. DMA engines that blindly try to cross a 32-bit boundary end up back at the start of the segment and read/write the wrong memory location. On Thu, Apr 25, 2019 at 4:37 PM John Baldwin wrote: > > I had looked for the aac change, but wasn't able to find it, perhaps because I > looked at tags created in aac.c rather than aac_pci.c. I agree aac will need to > be re-patched. I'm not really certain how many other devices are actually broken. > They would all be due to a firmware bug, nothing inherent in PCI. > > I believe twa(4) and bge(4) issues predated aac(4) FWIW. > > Unfortunately, the main bit of discussion about moving the limit into the PCI bus > itself seems to be an IRC discussion on 2/28/12 that resulted in revision r232267 > as a quick MFC'able fix, but I don't have a log of that conversation. :( I > couldn't find anything in e-mail either that was definitive for why this might have > been inherent in PCI-e vs a few firmware writers having similar bugs. > > On 4/25/19 12:20 PM, Ryan Stone wrote: > > Following up, this is what will have to be re-instated in the aac driver: > > > > http://svn.freebsd.org/changeset/base/232260 > > > > However, my biggest concern is that we have no idea how many new > > devices with the broken behaviour might have been introduced since we > > fixed the problem in general. How does Linux handle the issue? > > > > On Thu, Apr 25, 2019 at 3:17 PM Ryan Stone wrote: > >> > >> This change makes me *very* uncomfortable. It was originally brought > >> in due to issues with Adaptec RAID cards using the aac(9) driver. The > >> symptoms of the bug included silent corruption of data as it was > >> written to disk. Are we sure that this change is a good idea, given > >> how catastrophic it is when a device gets this wrong? > >> > >> On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale wrote: > >>> > >>> Author: tychon > >>> Date: Fri Apr 19 13:43:33 2019 > >>> New Revision: 346386 > >>> URL: https://svnweb.freebsd.org/changeset/base/346386 > >>> > >>> Log: > >>> remove the 4GB boundary requirement on PCI DMA segments > >>> > >>> Reviewed by: kib > >>> Discussed with: jhb > >>> Sponsored by: Dell EMC Isilon > >>> Differential Revision: https://reviews.freebsd.org/D19867 > >>> > >>> Modified: > >>> head/sys/dev/bge/if_bgereg.h > >>> head/sys/dev/pci/pci.c > >>> head/sys/dev/pci/pcivar.h > >>> head/sys/dev/twa/tw_osl.h > >>> head/sys/dev/twa/tw_osl_freebsd.c > >>> head/sys/x86/iommu/intel_ctx.c > >>> > >>> Modified: head/sys/dev/bge/if_bgereg.h > >>> ============================================================================== > >>> --- head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -3067,3 +3067,11 @@ struct bge_softc { > >>> #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, MA_OWNED) > >>> #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) > >>> #define BGE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->bge_mtx) > >>> + > >>> +#ifdef BUS_SPACE_MAXADDR > >>> +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > >>> +#define BGE_DMA_BOUNDARY (0x100000000) > >>> +#else > >>> +#define BGE_DMA_BOUNDARY 0 > >>> +#endif > >>> +#endif > >>> > >>> Modified: head/sys/dev/pci/pci.c > >>> ============================================================================== > >>> --- head/sys/dev/pci/pci.c Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) > >>> { > >>> struct pci_softc *sc; > >>> int busno, domain; > >>> -#ifdef PCI_DMA_BOUNDARY > >>> - int error, tag_valid; > >>> -#endif > >>> #ifdef PCI_RES_BUS > >>> int rid; > >>> #endif > >>> @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) > >>> if (bootverbose) > >>> device_printf(dev, "domain=%d, physical bus=%d\n", > >>> domain, busno); > >>> -#ifdef PCI_DMA_BOUNDARY > >>> - tag_valid = 0; > >>> - if (device_get_devclass(device_get_parent(device_get_parent(dev))) != > >>> - devclass_find("pci")) { > >>> - error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, > >>> - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, > >>> - NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, > >>> - BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag); > >>> - if (error) > >>> - device_printf(dev, "Failed to create DMA tag: %d\n", > >>> - error); > >>> - else > >>> - tag_valid = 1; > >>> - } > >>> - if (!tag_valid) > >>> -#endif > >>> - sc->sc_dma_tag = bus_get_dma_tag(dev); > >>> + sc->sc_dma_tag = bus_get_dma_tag(dev); > >>> return (0); > >>> } > >>> > >>> > >>> Modified: head/sys/dev/pci/pcivar.h > >>> ============================================================================== > >>> --- head/sys/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, int pcie_location); > >>> > >>> void pci_print_faulted_dev(void); > >>> > >>> -#ifdef BUS_SPACE_MAXADDR > >>> -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > >>> -#define PCI_DMA_BOUNDARY 0x100000000 > >>> -#else > >>> -#define PCI_DMA_BOUNDARY 0 > >>> -#endif > >>> -#endif > >>> - > >>> #endif /* _SYS_BUS_H_ */ > >>> > >>> /* > >>> > >>> Modified: head/sys/dev/twa/tw_osl.h > >>> ============================================================================== > >>> --- head/sys/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -57,6 +57,12 @@ > >>> #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) > >>> #define TW_OSLI_MAX_NUM_AENS 0x100 > >>> > >>> +#ifdef PAE > >>> +#define TW_OSLI_DMA_BOUNDARY (1u << 31) > >>> +#else > >>> +#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) > >>> +#endif > >>> + > >>> /* Possible values of req->state. */ > >>> #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ > >>> #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ > >>> > >>> Modified: head/sys/dev/twa/tw_osl_freebsd.c > >>> ============================================================================== > >>> --- head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) > >>> /* Create the parent dma tag. */ > >>> if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */ > >>> sc->alignment, /* alignment */ > >>> - 0, /* boundary */ > >>> + TW_OSLI_DMA_BOUNDARY, /* boundary */ > >>> BUS_SPACE_MAXADDR, /* lowaddr */ > >>> BUS_SPACE_MAXADDR, /* highaddr */ > >>> NULL, NULL, /* filter, filterarg */ > >>> > >>> Modified: head/sys/x86/iommu/intel_ctx.c > >>> ============================================================================== > >>> --- head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 (r346385) > >>> +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 (r346386) > >>> @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev) > >>> maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR); > >>> ctx->ctx_tag.common.ref_count = 1; /* Prevent free */ > >>> ctx->ctx_tag.common.impl = &bus_dma_dmar_impl; > >>> - ctx->ctx_tag.common.boundary = PCI_DMA_BOUNDARY; > >>> + ctx->ctx_tag.common.boundary = 0; > >>> ctx->ctx_tag.common.lowaddr = maxaddr; > >>> ctx->ctx_tag.common.highaddr = maxaddr; > >>> ctx->ctx_tag.common.maxsize = maxaddr; > >>> > > > > > -- > John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 25 23:31:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 248BF15816B8; Thu, 25 Apr 2019 23:31:23 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BADBE70A4B; Thu, 25 Apr 2019 23:31:22 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A7E3C213CA; Thu, 25 Apr 2019 19:31:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 25 Apr 2019 19:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=r D6HjTdozHzcHFir9eX65De5oyL3bL0U4E8gvxuKY5c=; b=MnG3OZMv5/wV0MhQG yNHMz69ytguseBkqSFW1LCpGPiQR3JmQZS4reWmqty5Y3xbNmCB0aZcrSHaPWFSJ VztTP0EYGmK/F8NkGmca+B53EZjUjdmjyS7q0slUsn1tlFt98p4/F7wo6xDpA7y1 xgAJFeYNNMZhqFt6NWqawPjmIqZtp6/1x1cgdt8v+xiEXnpJ/NCsY0HWe07Wbw4M zRbEPQ9qyp3Yd+hmrak+6dPXygSNKE/otpunq1XgukCZJpsBA5yYNm1lLffsUieO Jq3WNIUfS1El5qSTRf7cYYA8Pcq75HDYIjkdW5ENQp39fD6u4D98WDKmDUBBLrtS AlKIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=rD6HjTdozHzcHFir9eX65De5oyL3bL0U4E8gvxuKY 5c=; b=DNlHhG3qQ4QFdr3XZyfTFGz5eZcH4cEldbBa01WvDCg5shA0dHFdDYcYs yyYqYobfvmc9im6PmG2eBdMlVGbmot2N7EZXwhNAtfPXQFFnbyXLJ4lPED8fJj8E Lnsvk+zRx/oWFozDcDgUqej40jcyAvopl6zXqj3BcbDnjz3G1J8vcOmwph0cyTI9 Rex1R8Al0pW3er52QlniGr3EJarkglbwT6R4OG1RQPmRoXhEz6tWt4LGVrh+u6Vj jQhfdPvlX9IlPCVUyD9ARZ9nqF+1NqY/CGeNxNgrv2G64mV5GaZBSsFIT7vV6Qvt rAY0gSsEH03T7aUzczu58982zp93A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrheehgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucffohhmrghinhepfh hrvggvsghsugdrohhrghenucfkphepudejgedrvdduhedrgeekrdeinecurfgrrhgrmhep mhgrihhlfhhrohhmpehstghothhtlhesshgrmhhstghordhorhhgnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from [172.20.10.2] (6.sub-174-215-48.myvzw.com [174.215.48.6]) by mail.messagingengine.com (Postfix) with ESMTPA id 997FBE4122; Thu, 25 Apr 2019 19:31:19 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu From: Scott Long In-Reply-To: Date: Thu, 25 Apr 2019 16:31:18 -0700 Cc: John Baldwin , Tycho Nightingale , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , scottl@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1356DF49-8D68-45E7-9D29-7FE0097C7B1F@samsco.org> References: <201904191343.x3JDhYVF010453@repo.freebsd.org> <5c43013c-1fc6-57c2-6dec-1fdfc5213fb3@FreeBSD.org> To: Ryan Stone X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: BADBE70A4B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 23:31:23 -0000 Yeah, it might be turning into an old wives tale at this point. I = clearly remember it being discussed at the PCI-SIG in late 2003 when PCIe 1.0 was in its = final draft stages. However, that was a long time ago, and it=E2=80=99s = possible that even if it=E2=80=99s a limitation in some version or another of the spec, = that most hardware and firmware just silently account for it. At the time (and even now) = it didn=E2=80=99t seem like an onerous limitation to place on drivers, especially with it = being quite easy to implement in FreeBSD. So I=E2=80=99m on the fence; it = might be a bit of trivia that=E2=80=99s not relevant, and maybe wasn=E2=80=99t ever = relevant, but it=E2=80=99s also cheap insurance. Scott > On Apr 25, 2019, at 4:24 PM, Ryan Stone wrote: >=20 > +scottl@, who I believe explained this to us in the first place. >=20 > As I recall, it had something to do with 64-bit DMA being expressed as > segment base + 32-bit offset. DMA engines that blindly try to cross a > 32-bit boundary end up back at the start of the segment and read/write > the wrong memory location. >=20 > On Thu, Apr 25, 2019 at 4:37 PM John Baldwin wrote: >>=20 >> I had looked for the aac change, but wasn't able to find it, perhaps = because I >> looked at tags created in aac.c rather than aac_pci.c. I agree aac = will need to >> be re-patched. I'm not really certain how many other devices are = actually broken. >> They would all be due to a firmware bug, nothing inherent in PCI. >>=20 >> I believe twa(4) and bge(4) issues predated aac(4) FWIW. >>=20 >> Unfortunately, the main bit of discussion about moving the limit into = the PCI bus >> itself seems to be an IRC discussion on 2/28/12 that resulted in = revision r232267 >> as a quick MFC'able fix, but I don't have a log of that conversation. = :( I >> couldn't find anything in e-mail either that was definitive for why = this might have >> been inherent in PCI-e vs a few firmware writers having similar bugs. >>=20 >> On 4/25/19 12:20 PM, Ryan Stone wrote: >>> Following up, this is what will have to be re-instated in the aac = driver: >>>=20 >>> http://svn.freebsd.org/changeset/base/232260 >>>=20 >>> However, my biggest concern is that we have no idea how many new >>> devices with the broken behaviour might have been introduced since = we >>> fixed the problem in general. How does Linux handle the issue? >>>=20 >>> On Thu, Apr 25, 2019 at 3:17 PM Ryan Stone = wrote: >>>>=20 >>>> This change makes me *very* uncomfortable. It was originally = brought >>>> in due to issues with Adaptec RAID cards using the aac(9) driver. = The >>>> symptoms of the bug included silent corruption of data as it was >>>> written to disk. Are we sure that this change is a good idea, = given >>>> how catastrophic it is when a device gets this wrong? >>>>=20 >>>> On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale = wrote: >>>>>=20 >>>>> Author: tychon >>>>> Date: Fri Apr 19 13:43:33 2019 >>>>> New Revision: 346386 >>>>> URL: https://svnweb.freebsd.org/changeset/base/346386 >>>>>=20 >>>>> Log: >>>>> remove the 4GB boundary requirement on PCI DMA segments >>>>>=20 >>>>> Reviewed by: kib >>>>> Discussed with: jhb >>>>> Sponsored by: Dell EMC Isilon >>>>> Differential Revision: https://reviews.freebsd.org/D19867 >>>>>=20 >>>>> Modified: >>>>> head/sys/dev/bge/if_bgereg.h >>>>> head/sys/dev/pci/pci.c >>>>> head/sys/dev/pci/pcivar.h >>>>> head/sys/dev/twa/tw_osl.h >>>>> head/sys/dev/twa/tw_osl_freebsd.c >>>>> head/sys/x86/iommu/intel_ctx.c >>>>>=20 >>>>> Modified: head/sys/dev/bge/if_bgereg.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/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -3067,3 +3067,11 @@ struct bge_softc { >>>>> #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, = MA_OWNED) >>>>> #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) >>>>> #define BGE_LOCK_DESTROY(_sc) = mtx_destroy(&(_sc)->bge_mtx) >>>>> + >>>>> +#ifdef BUS_SPACE_MAXADDR >>>>> +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>>>> +#define BGE_DMA_BOUNDARY (0x100000000) >>>>> +#else >>>>> +#define BGE_DMA_BOUNDARY 0 >>>>> +#endif >>>>> +#endif >>>>>=20 >>>>> Modified: head/sys/dev/pci/pci.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/pci/pci.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) >>>>> { >>>>> struct pci_softc *sc; >>>>> int busno, domain; >>>>> -#ifdef PCI_DMA_BOUNDARY >>>>> - int error, tag_valid; >>>>> -#endif >>>>> #ifdef PCI_RES_BUS >>>>> int rid; >>>>> #endif >>>>> @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) >>>>> if (bootverbose) >>>>> device_printf(dev, "domain=3D%d, physical = bus=3D%d\n", >>>>> domain, busno); >>>>> -#ifdef PCI_DMA_BOUNDARY >>>>> - tag_valid =3D 0; >>>>> - if = (device_get_devclass(device_get_parent(device_get_parent(dev))) !=3D >>>>> - devclass_find("pci")) { >>>>> - error =3D bus_dma_tag_create(bus_get_dma_tag(dev), = 1, >>>>> - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, = BUS_SPACE_MAXADDR, >>>>> - NULL, NULL, BUS_SPACE_MAXSIZE, = BUS_SPACE_UNRESTRICTED, >>>>> - BUS_SPACE_MAXSIZE, 0, NULL, NULL, = &sc->sc_dma_tag); >>>>> - if (error) >>>>> - device_printf(dev, "Failed to create DMA = tag: %d\n", >>>>> - error); >>>>> - else >>>>> - tag_valid =3D 1; >>>>> - } >>>>> - if (!tag_valid) >>>>> -#endif >>>>> - sc->sc_dma_tag =3D bus_get_dma_tag(dev); >>>>> + sc->sc_dma_tag =3D bus_get_dma_tag(dev); >>>>> return (0); >>>>> } >>>>>=20 >>>>>=20 >>>>> Modified: head/sys/dev/pci/pcivar.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/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, int = pcie_location); >>>>>=20 >>>>> void pci_print_faulted_dev(void); >>>>>=20 >>>>> -#ifdef BUS_SPACE_MAXADDR >>>>> -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>>>> -#define PCI_DMA_BOUNDARY 0x100000000 >>>>> -#else >>>>> -#define PCI_DMA_BOUNDARY 0 >>>>> -#endif >>>>> -#endif >>>>> - >>>>> #endif /* _SYS_BUS_H_ */ >>>>>=20 >>>>> /* >>>>>=20 >>>>> Modified: head/sys/dev/twa/tw_osl.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/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -57,6 +57,12 @@ >>>>> #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - = 2) >>>>> #define TW_OSLI_MAX_NUM_AENS 0x100 >>>>>=20 >>>>> +#ifdef PAE >>>>> +#define TW_OSLI_DMA_BOUNDARY (1u << 31) >>>>> +#else >>>>> +#define TW_OSLI_DMA_BOUNDARY = ((bus_size_t)((uint64_t)1 << 32)) >>>>> +#endif >>>>> + >>>>> /* Possible values of req->state. */ >>>>> #define TW_OSLI_REQ_STATE_INIT 0x0 /* being = initialized */ >>>>> #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL = */ >>>>>=20 >>>>> Modified: head/sys/dev/twa/tw_osl_freebsd.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/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) >>>>> /* Create the parent dma tag. */ >>>>> if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* = parent */ >>>>> sc->alignment, /* = alignment */ >>>>> - 0, /* = boundary */ >>>>> + TW_OSLI_DMA_BOUNDARY, /* = boundary */ >>>>> BUS_SPACE_MAXADDR, /* lowaddr = */ >>>>> BUS_SPACE_MAXADDR, /* highaddr = */ >>>>> NULL, NULL, /* filter, = filterarg */ >>>>>=20 >>>>> Modified: head/sys/x86/iommu/intel_ctx.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/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>> +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>> @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t = dev) >>>>> maxaddr =3D MIN(ctx->domain->end, BUS_SPACE_MAXADDR); >>>>> ctx->ctx_tag.common.ref_count =3D 1; /* Prevent free */ >>>>> ctx->ctx_tag.common.impl =3D &bus_dma_dmar_impl; >>>>> - ctx->ctx_tag.common.boundary =3D PCI_DMA_BOUNDARY; >>>>> + ctx->ctx_tag.common.boundary =3D 0; >>>>> ctx->ctx_tag.common.lowaddr =3D maxaddr; >>>>> ctx->ctx_tag.common.highaddr =3D maxaddr; >>>>> ctx->ctx_tag.common.maxsize =3D maxaddr; >>>>>=20 >>>=20 >>=20 >>=20 >> -- >> John Baldwin From owner-svn-src-head@freebsd.org Fri Apr 26 01:09:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDC9A158331B; Fri, 26 Apr 2019 01:09:54 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) (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 6450D73388; Fri, 26 Apr 2019 01:09:54 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 25B3E411DF; Thu, 25 Apr 2019 21:09:46 -0400 (EDT) (envelope-from tychon@freebsd.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= mhr3hNM0KU3BZNDEelljGOWsFa0=; b=iALdXOnXVPoMqYbDXRb3uy/ZeRqX2jVM BrOFcZD2ZVNYv3jKxVwjj4wJjvsZ1oi00we3iSU3YqQzuYA+RwQaJ1C/y1dDVjAl U/qftXV3xWy8WIsxGUiHkYRsItmWe5agOVeHGFpO+4ofopTBFtqsHtHchOS3Rli2 LNIRSfw50FU= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 1D2E1411DD; Thu, 25 Apr 2019 21:09:46 -0400 (EDT) (envelope-from tychon@freebsd.org) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id EFD33411DA; Thu, 25 Apr 2019 21:09:42 -0400 (EDT) (envelope-from tychon@freebsd.org) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu From: Tycho Nightingale In-Reply-To: <1356DF49-8D68-45E7-9D29-7FE0097C7B1F@samsco.org> Date: Thu, 25 Apr 2019 21:09:40 -0400 Cc: Ryan Stone , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Ed Maste , scottl@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <17472070-FDB0-4292-B9BF-C033D5B4F634@freebsd.org> References: <201904191343.x3JDhYVF010453@repo.freebsd.org> <5c43013c-1fc6-57c2-6dec-1fdfc5213fb3@FreeBSD.org> <1356DF49-8D68-45E7-9D29-7FE0097C7B1F@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: F9A71D2A-67BF-11E9-A35C-EE24A11ADF13-09779102!pb-smtp21.pobox.com X-Rspamd-Queue-Id: 6450D73388 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.984,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 01:09:55 -0000 As Ryan suggests r232260 should be recommitted to get acc(4) fixed. However, given the age of the devices involved and the lack of support = by the standard, I=E2=80=99d say the threshold isn=E2=80=99t met to = reinstate the boundary globally preemptively. To get the insurance, which may not even be necessary, you start to = contort working drivers. For example the insurance can cause legitimate = mappings to fail to load. Since bus_dma(9) has no interface to return = the =E2=80=9Cactive=E2=80=9D boundary and only returns the EFBIG when = boundary constraint causes a mapping to fail to load this causes a = rather cryptic failure when a driver. E.g. with the insurance a a tiny = 8 byte region will fail to load into a single segment on ioat(4) if it = happens to cross an invisible 4GB boundary instituted by the parent. = You need create a tag which allows multiple segments. How many = segments? Well it depends on how many artificial boundaries; it starts = to get ugly. Seems better to support the handful of those devices which = need hand-holding at the tag level for those devices. Tycho > On Apr 25, 2019, at 7:31 PM, Scott Long wrote: >=20 > Yeah, it might be turning into an old wives tale at this point. I = clearly remember > it being discussed at the PCI-SIG in late 2003 when PCIe 1.0 was in = its final > draft stages. However, that was a long time ago, and it=E2=80=99s = possible that even > if it=E2=80=99s a limitation in some version or another of the spec, = that most hardware > and firmware just silently account for it. At the time (and even now) = it didn=E2=80=99t > seem like an onerous limitation to place on drivers, especially with = it being > quite easy to implement in FreeBSD. So I=E2=80=99m on the fence; it = might be a bit of > trivia that=E2=80=99s not relevant, and maybe wasn=E2=80=99t ever = relevant, but it=E2=80=99s also cheap > insurance. >=20 > Scott >=20 >=20 >> On Apr 25, 2019, at 4:24 PM, Ryan Stone wrote: >>=20 >> +scottl@, who I believe explained this to us in the first place. >>=20 >> As I recall, it had something to do with 64-bit DMA being expressed = as >> segment base + 32-bit offset. DMA engines that blindly try to cross = a >> 32-bit boundary end up back at the start of the segment and = read/write >> the wrong memory location. >>=20 >> On Thu, Apr 25, 2019 at 4:37 PM John Baldwin wrote: >>>=20 >>> I had looked for the aac change, but wasn't able to find it, perhaps = because I >>> looked at tags created in aac.c rather than aac_pci.c. I agree aac = will need to >>> be re-patched. I'm not really certain how many other devices are = actually broken. >>> They would all be due to a firmware bug, nothing inherent in PCI. >>>=20 >>> I believe twa(4) and bge(4) issues predated aac(4) FWIW. >>>=20 >>> Unfortunately, the main bit of discussion about moving the limit = into the PCI bus >>> itself seems to be an IRC discussion on 2/28/12 that resulted in = revision r232267 >>> as a quick MFC'able fix, but I don't have a log of that = conversation. :( I >>> couldn't find anything in e-mail either that was definitive for why = this might have >>> been inherent in PCI-e vs a few firmware writers having similar = bugs. >>>=20 >>> On 4/25/19 12:20 PM, Ryan Stone wrote: >>>> Following up, this is what will have to be re-instated in the aac = driver: >>>>=20 >>>> http://svn.freebsd.org/changeset/base/232260 >>>>=20 >>>> However, my biggest concern is that we have no idea how many new >>>> devices with the broken behaviour might have been introduced since = we >>>> fixed the problem in general. How does Linux handle the issue? >>>>=20 >>>> On Thu, Apr 25, 2019 at 3:17 PM Ryan Stone = wrote: >>>>>=20 >>>>> This change makes me *very* uncomfortable. It was originally = brought >>>>> in due to issues with Adaptec RAID cards using the aac(9) driver. = The >>>>> symptoms of the bug included silent corruption of data as it was >>>>> written to disk. Are we sure that this change is a good idea, = given >>>>> how catastrophic it is when a device gets this wrong? >>>>>=20 >>>>> On Fri, Apr 19, 2019 at 9:43 AM Tycho Nightingale = wrote: >>>>>>=20 >>>>>> Author: tychon >>>>>> Date: Fri Apr 19 13:43:33 2019 >>>>>> New Revision: 346386 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/346386 >>>>>>=20 >>>>>> Log: >>>>>> remove the 4GB boundary requirement on PCI DMA segments >>>>>>=20 >>>>>> Reviewed by: kib >>>>>> Discussed with: jhb >>>>>> Sponsored by: Dell EMC Isilon >>>>>> Differential Revision: https://reviews.freebsd.org/D19867 >>>>>>=20 >>>>>> Modified: >>>>>> head/sys/dev/bge/if_bgereg.h >>>>>> head/sys/dev/pci/pci.c >>>>>> head/sys/dev/pci/pcivar.h >>>>>> head/sys/dev/twa/tw_osl.h >>>>>> head/sys/dev/twa/tw_osl_freebsd.c >>>>>> head/sys/x86/iommu/intel_ctx.c >>>>>>=20 >>>>>> Modified: head/sys/dev/bge/if_bgereg.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/dev/bge/if_bgereg.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/dev/bge/if_bgereg.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -3067,3 +3067,11 @@ struct bge_softc { >>>>>> #define BGE_LOCK_ASSERT(_sc) = mtx_assert(&(_sc)->bge_mtx, MA_OWNED) >>>>>> #define BGE_UNLOCK(_sc) = mtx_unlock(&(_sc)->bge_mtx) >>>>>> #define BGE_LOCK_DESTROY(_sc) = mtx_destroy(&(_sc)->bge_mtx) >>>>>> + >>>>>> +#ifdef BUS_SPACE_MAXADDR >>>>>> +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>>>>> +#define BGE_DMA_BOUNDARY (0x100000000) >>>>>> +#else >>>>>> +#define BGE_DMA_BOUNDARY 0 >>>>>> +#endif >>>>>> +#endif >>>>>>=20 >>>>>> Modified: head/sys/dev/pci/pci.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/pci/pci.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/dev/pci/pci.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev) >>>>>> { >>>>>> struct pci_softc *sc; >>>>>> int busno, domain; >>>>>> -#ifdef PCI_DMA_BOUNDARY >>>>>> - int error, tag_valid; >>>>>> -#endif >>>>>> #ifdef PCI_RES_BUS >>>>>> int rid; >>>>>> #endif >>>>>> @@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev) >>>>>> if (bootverbose) >>>>>> device_printf(dev, "domain=3D%d, physical = bus=3D%d\n", >>>>>> domain, busno); >>>>>> -#ifdef PCI_DMA_BOUNDARY >>>>>> - tag_valid =3D 0; >>>>>> - if = (device_get_devclass(device_get_parent(device_get_parent(dev))) !=3D >>>>>> - devclass_find("pci")) { >>>>>> - error =3D = bus_dma_tag_create(bus_get_dma_tag(dev), 1, >>>>>> - PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, = BUS_SPACE_MAXADDR, >>>>>> - NULL, NULL, BUS_SPACE_MAXSIZE, = BUS_SPACE_UNRESTRICTED, >>>>>> - BUS_SPACE_MAXSIZE, 0, NULL, NULL, = &sc->sc_dma_tag); >>>>>> - if (error) >>>>>> - device_printf(dev, "Failed to create DMA = tag: %d\n", >>>>>> - error); >>>>>> - else >>>>>> - tag_valid =3D 1; >>>>>> - } >>>>>> - if (!tag_valid) >>>>>> -#endif >>>>>> - sc->sc_dma_tag =3D bus_get_dma_tag(dev); >>>>>> + sc->sc_dma_tag =3D bus_get_dma_tag(dev); >>>>>> return (0); >>>>>> } >>>>>>=20 >>>>>>=20 >>>>>> Modified: head/sys/dev/pci/pcivar.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/dev/pci/pcivar.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/dev/pci/pcivar.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -693,14 +693,6 @@ int pcie_link_reset(device_t port, = int pcie_location); >>>>>>=20 >>>>>> void pci_print_faulted_dev(void); >>>>>>=20 >>>>>> -#ifdef BUS_SPACE_MAXADDR >>>>>> -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >>>>>> -#define PCI_DMA_BOUNDARY 0x100000000 >>>>>> -#else >>>>>> -#define PCI_DMA_BOUNDARY 0 >>>>>> -#endif >>>>>> -#endif >>>>>> - >>>>>> #endif /* _SYS_BUS_H_ */ >>>>>>=20 >>>>>> /* >>>>>>=20 >>>>>> Modified: head/sys/dev/twa/tw_osl.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/dev/twa/tw_osl.h Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/dev/twa/tw_osl.h Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -57,6 +57,12 @@ >>>>>> #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS = - 2) >>>>>> #define TW_OSLI_MAX_NUM_AENS 0x100 >>>>>>=20 >>>>>> +#ifdef PAE >>>>>> +#define TW_OSLI_DMA_BOUNDARY (1u << 31) >>>>>> +#else >>>>>> +#define TW_OSLI_DMA_BOUNDARY = ((bus_size_t)((uint64_t)1 << 32)) >>>>>> +#endif >>>>>> + >>>>>> /* Possible values of req->state. */ >>>>>> #define TW_OSLI_REQ_STATE_INIT 0x0 /* being = initialized */ >>>>>> #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL = */ >>>>>>=20 >>>>>> Modified: head/sys/dev/twa/tw_osl_freebsd.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/twa/tw_osl_freebsd.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/dev/twa/tw_osl_freebsd.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc) >>>>>> /* Create the parent dma tag. */ >>>>>> if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* = parent */ >>>>>> sc->alignment, /* = alignment */ >>>>>> - 0, /* = boundary */ >>>>>> + TW_OSLI_DMA_BOUNDARY, /* = boundary */ >>>>>> BUS_SPACE_MAXADDR, /* lowaddr = */ >>>>>> BUS_SPACE_MAXADDR, /* highaddr = */ >>>>>> NULL, NULL, /* filter, = filterarg */ >>>>>>=20 >>>>>> Modified: head/sys/x86/iommu/intel_ctx.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/x86/iommu/intel_ctx.c Fri Apr 19 13:23:41 2019 = (r346385) >>>>>> +++ head/sys/x86/iommu/intel_ctx.c Fri Apr 19 13:43:33 2019 = (r346386) >>>>>> @@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t = dev) >>>>>> maxaddr =3D MIN(ctx->domain->end, BUS_SPACE_MAXADDR); >>>>>> ctx->ctx_tag.common.ref_count =3D 1; /* Prevent free */ >>>>>> ctx->ctx_tag.common.impl =3D &bus_dma_dmar_impl; >>>>>> - ctx->ctx_tag.common.boundary =3D PCI_DMA_BOUNDARY; >>>>>> + ctx->ctx_tag.common.boundary =3D 0; >>>>>> ctx->ctx_tag.common.lowaddr =3D maxaddr; >>>>>> ctx->ctx_tag.common.highaddr =3D maxaddr; >>>>>> ctx->ctx_tag.common.maxsize =3D maxaddr; >>>>>>=20 >>>>=20 >>>=20 >>>=20 >>> -- >>> John Baldwin >=20 >=20 From owner-svn-src-head@freebsd.org Fri Apr 26 02:30:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E6FF1585562; Fri, 26 Apr 2019 02:30:05 +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 C878E763DF; Fri, 26 Apr 2019 02:30:04 +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 8A5FF4FE2; Fri, 26 Apr 2019 02:30:04 +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 x3Q2U47I038522; Fri, 26 Apr 2019 02:30:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3Q2U4ge038520; Fri, 26 Apr 2019 02:30:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904260230.x3Q2U4ge038520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 26 Apr 2019 02:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346728 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 346728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C878E763DF 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 02:30:05 -0000 Author: jhibbits Date: Fri Apr 26 02:30:03 2019 New Revision: 346728 URL: https://svnweb.freebsd.org/changeset/base/346728 Log: powerpc: Add another feature2 flag, and update power9 definition Also fix the definition of PPC_FEATURE2_HTM_NOSUSPEND, a bad line copy. This now closer matches Linux's definition. Modified: head/sys/powerpc/include/cpu.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Fri Apr 26 02:19:25 2019 (r346727) +++ head/sys/powerpc/include/cpu.h Fri Apr 26 02:30:03 2019 (r346728) @@ -81,6 +81,7 @@ extern u_long cpu_features2; #define PPC_FEATURE2_ARCH_2_07 0x80000000 #define PPC_FEATURE2_HTM 0x40000000 #define PPC_FEATURE2_DSCR 0x20000000 +#define PPC_FEATURE2_EBB 0x10000000 #define PPC_FEATURE2_ISEL 0x08000000 #define PPC_FEATURE2_TAR 0x04000000 #define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 @@ -89,7 +90,7 @@ extern u_long cpu_features2; #define PPC_FEATURE2_HAS_IEEE128 0x00400000 #define PPC_FEATURE2_DARN 0x00200000 #define PPC_FEATURE2_SCV 0x00100000 -#define PPC_FEATURE2_HTM_NOSUSPEND 0x01000000 +#define PPC_FEATURE2_HTM_NOSUSPEND 0x00080000 #define PPC_FEATURE_BITMASK \ "\20" \ Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Fri Apr 26 02:19:25 2019 (r346727) +++ head/sys/powerpc/powerpc/cpu.c Fri Apr 26 02:30:03 2019 (r346728) @@ -183,7 +183,8 @@ static const struct cputab models[] = { PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | - PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_EBB | PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | + PPC_FEATURE2_HAS_VEC_CRYPTO | PPC_FEATURE2_HTM_NOSC | PPC_FEATURE2_ARCH_3_00 | PPC_FEATURE2_HAS_IEEE128 | PPC_FEATURE2_DARN, cpu_powerx_setup }, { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN, From owner-svn-src-head@freebsd.org Fri Apr 26 03:13:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA4CD1586740; Fri, 26 Apr 2019 03:13:45 +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 6AD9E77D9F; Fri, 26 Apr 2019 03:13:45 +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 E7F3258B6; Fri, 26 Apr 2019 03:13:44 +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 x3Q3DimY065485; Fri, 26 Apr 2019 03:13:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3Q3DiUG065484; Fri, 26 Apr 2019 03:13:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904260313.x3Q3DiUG065484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 26 Apr 2019 03:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346729 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 346729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AD9E77D9F 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 03:13:46 -0000 Author: jhibbits Date: Fri Apr 26 03:13:44 2019 New Revision: 346729 URL: https://svnweb.freebsd.org/changeset/base/346729 Log: powerpc: Fix whitespace in SPR header. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Fri Apr 26 02:30:03 2019 (r346728) +++ head/sys/powerpc/include/spr.h Fri Apr 26 03:13:44 2019 (r346729) @@ -122,19 +122,19 @@ #define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ #define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ #define SPR_FSCR 0x099 /* Facility Status and Control Register */ -#define FSCR_IC_MASK 0xFF00000000000000ULL /* FSCR[0:7] is Interrupt Cause */ -#define FSCR_IC_FP 0x0000000000000000ULL /* FP unavailable */ -#define FSCR_IC_VSX 0x0100000000000000ULL /* VSX unavailable */ -#define FSCR_IC_DSCR 0x0200000000000000ULL /* Access to the DSCR at SPRs 3 or 17 */ -#define FSCR_IC_PM 0x0300000000000000ULL /* Read or write access of a Performance Monitor SPR in group A */ -#define FSCR_IC_BHRB 0x0400000000000000ULL /* Execution of a BHRB Instruction */ -#define FSCR_IC_HTM 0x0500000000000000ULL /* Access to a Transactional Memory */ +#define FSCR_IC_MASK 0xFF00000000000000ULL /* FSCR[0:7] is Interrupt Cause */ +#define FSCR_IC_FP 0x0000000000000000ULL /* FP unavailable */ +#define FSCR_IC_VSX 0x0100000000000000ULL /* VSX unavailable */ +#define FSCR_IC_DSCR 0x0200000000000000ULL /* Access to the DSCR at SPRs 3 or 17 */ +#define FSCR_IC_PM 0x0300000000000000ULL /* Read or write access of a Performance Monitor SPR in group A */ +#define FSCR_IC_BHRB 0x0400000000000000ULL /* Execution of a BHRB Instruction */ +#define FSCR_IC_HTM 0x0500000000000000ULL /* Access to a Transactional Memory */ /* Reserved 0x0600000000000000ULL */ -#define FSCR_IC_EBB 0x0700000000000000ULL /* Access to Event-Based Branch */ -#define FSCR_IC_TAR 0x0800000000000000ULL /* Access to Target Address Register */ -#define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ -#define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ -#define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ +#define FSCR_IC_EBB 0x0700000000000000ULL /* Access to Event-Based Branch */ +#define FSCR_IC_TAR 0x0800000000000000ULL /* Access to Target Address Register */ +#define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ +#define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ +#define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ From owner-svn-src-head@freebsd.org Fri Apr 26 03:18:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2998F1586839; Fri, 26 Apr 2019 03:18:51 +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 C127C77F37; Fri, 26 Apr 2019 03:18:50 +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 9611958B9; Fri, 26 Apr 2019 03:18:50 +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 x3Q3Ioex065726; Fri, 26 Apr 2019 03:18:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3Q3IoZZ065725; Fri, 26 Apr 2019 03:18:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904260318.x3Q3IoZZ065725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 26 Apr 2019 03:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346730 - in head/sys/powerpc: aim powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim powerpc X-SVN-Commit-Revision: 346730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C127C77F37 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 03:18:51 -0000 Author: jhibbits Date: Fri Apr 26 03:18:49 2019 New Revision: 346730 URL: https://svnweb.freebsd.org/changeset/base/346730 Log: powerpc64: Clear FSCR SPR, so that it's in a known state This now turns any access to the DSCR SPR into a SIGILL. Later commits will make DCSR work correctly on POWER8 and POWER9. PR: 237208 Modified: head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Fri Apr 26 03:13:44 2019 (r346729) +++ head/sys/powerpc/aim/mp_cpudep.c Fri Apr 26 03:18:49 2019 (r346730) @@ -98,6 +98,12 @@ cpudep_ap_early_bootstrap(void) mtspr(SPR_LPCR, lpcr); isync(); + + /* + * Nuke FSCR, to be managed on a per-process basis + * later. + */ + mtspr(SPR_FSCR, 0); } #endif break; Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Fri Apr 26 03:13:44 2019 (r346729) +++ head/sys/powerpc/powerpc/cpu.c Fri Apr 26 03:18:49 2019 (r346730) @@ -663,6 +663,9 @@ cpu_powerx_setup(int cpuid, uint16_t vers) if ((mfmsr() & PSL_HV) == 0) return; + /* Nuke the FSCR, to disable all facilities. */ + mtspr(SPR_FSCR, 0); + /* Configure power-saving */ switch (vers) { case IBMPOWER8: From owner-svn-src-head@freebsd.org Fri Apr 26 06:05:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6099B158A500; Fri, 26 Apr 2019 06:05:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8FD484B60; Fri, 26 Apr 2019 06:05:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl1-x631.google.com with SMTP id x15so995727pln.9; Thu, 25 Apr 2019 23:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F88BkHvr1bWX8eSRoYfCHcwUo9jqxFOAd+ta9G+dnMw=; b=EuwZAWOQBjBDZDBTe5GG3khmT1kMzwp01EwsfrEaEPKZKQlbHiRGn2ey4me4ofAPOV PqPAADaZKwWxdQWs5sHjPbHV+yt13k0NiE9dsSgpjwkCYxSAxBSUlYqI0Sim7tFiDEo7 G50jD+Y4XqwnRSWs652VQpIliSuRSwZduMc3sIEf9ZCmk6g+/LYstuCcDAIwNF8TZ9h6 qVpA1q8dHk1KwtncYf7O8Q3ZUlS4JQ7bEMxQIG6tgc8s8MyH5cdTnwGuY31OM95De6et Bjc+r9hmL/DmYPaBJFUve/TrJ4jpTGwhW3uZhNAK3wfd/nJucEPQNtlasrIL+0lrpLCU bOmA== 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=F88BkHvr1bWX8eSRoYfCHcwUo9jqxFOAd+ta9G+dnMw=; b=UyzpZ0YiNBiBBKONV4llLGMwqJiAxZrlpRm2IliwNkfn9PE51+I0pce7SpFIkD1DrH jJTpeDeYiw4sM7k6S02GwmC7Vn1GhgNYDpIUU4vFf/CgW76PgbjValXmm6ydatmy9wDo VaWUXdmWG0oKPF9kW6idrFj8Je9hy5WIJKnHnXO7JX5NL4OeWw62NWc6Z0cMYiEvah9y rGByxQMbkiGWdKSio3CRzdxLn515LhtCKoVc2xvyMblBBlAC/yIDlQzjgqgcelRpnBQ9 FIsCkm1D3CiAkgGrbrF7xJMC+tpPLQTM8e2S3OsbLwpLkS7aCetqYOwUFUVJuB89vt99 XHKA== X-Gm-Message-State: APjAAAU6oE4buTu9FWpKl1AhDUdb1bWZTIlKp0KlkaqwdUv8KcYkFkfO hZsYP4JU5ncn4impxyjdlqyN1tul X-Google-Smtp-Source: APXvYqyLNGbyBlXkv1v/OGyXxegLUmdUh55mbjaPE8afNvRy1AhU0UBX+iZkcLtDM0N723DVb/oeVg== X-Received: by 2002:a17:902:266:: with SMTP id 93mr44175236plc.201.1556258707871; Thu, 25 Apr 2019 23:05:07 -0700 (PDT) Received: from spy ([180.217.236.228]) by smtp.gmail.com with ESMTPSA id n65sm58618407pfb.160.2019.04.25.23.05.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 23:05:06 -0700 (PDT) Sender: Mark Johnston Date: Fri, 26 Apr 2019 02:04:56 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190426060456.GA59853@spy> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190425082222.GJ12936@kib.kiev.ua> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: C8FD484B60 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.952,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 06:05:10 -0000 On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: > On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > > Intel does not reorder reads against the condition "if" here. I know for > > sure that ARM does, but therestill might be some other architectures that > > also suffers such behavior - I just don't have any means to verify. > > I remember the discussion for rS302292 where we agreed that this kind of > > patches should be the least impacting in perfomrance as possible. Adding > > unconditional memory barrier causes significant performance drop on Intel, > > where in fact, the issue was never seen. > > > Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory > barrier. If you need read/read fence on some architectures, I am sure > that you need compiler barrier on all. To add a bit, one reason to prefer atomic(9) to explicit fences is precisely because it issues fences only when required by a given CPU architecture. There is no "unconditional memory barrier" added by the diff even without the #ifdef. From owner-svn-src-head@freebsd.org Fri Apr 26 07:38:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88DA0158BDED; Fri, 26 Apr 2019 07:38:45 +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 BC1C287335; Fri, 26 Apr 2019 07:38:44 +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 x3Q7cbQP044429 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 26 Apr 2019 10:38:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3Q7cbQP044429 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3Q7caLf044428; Fri, 26 Apr 2019 10:38:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Apr 2019 10:38:36 +0300 From: Konstantin Belousov To: Mark Johnston Cc: Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190426073836.GP12936@kib.kiev.ua> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> <20190426060456.GA59853@spy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426060456.GA59853@spy> User-Agent: Mutt/1.11.4 (2019-03-13) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 07:38:45 -0000 On Fri, Apr 26, 2019 at 02:04:56AM -0400, Mark Johnston wrote: > On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: > > On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > > > Intel does not reorder reads against the condition "if" here. I know for > > > sure that ARM does, but therestill might be some other architectures that > > > also suffers such behavior - I just don't have any means to verify. > > > I remember the discussion for rS302292 where we agreed that this kind of > > > patches should be the least impacting in perfomrance as possible. Adding > > > unconditional memory barrier causes significant performance drop on Intel, > > > where in fact, the issue was never seen. > > > > > Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory > > barrier. If you need read/read fence on some architectures, I am sure > > that you need compiler barrier on all. > > To add a bit, one reason to prefer atomic(9) to explicit fences is > precisely because it issues fences only when required by a given > CPU architecture. There is no "unconditional memory barrier" added by > the diff even without the #ifdef. Well, atomic_thread_fence_acq() is the explicit fence. And on x86 it does add unconditional compiler memory barrier. From owner-svn-src-head@freebsd.org Fri Apr 26 07:48:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC395158C312; Fri, 26 Apr 2019 07:48:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7800B87CC2; Fri, 26 Apr 2019 07:48:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg1-x52a.google.com with SMTP id y27so479012pgl.12; Fri, 26 Apr 2019 00:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UhBLQixYGEk4j66mPYcoVX/cDmK4Flg8GblaXXSBIuc=; b=oRbU1+AKiV/ye84/wLeV6zinltbLu98r1j+AX3FdA9ULYqlAZ8u5mq6+tsmhLfJQZp Ohmb07egi6k8B2v5XK9tCFfW3bbg+5OKnzrib+NWglubDdKeq/8hDuax16kuEw4yI6FT OiWwfcQkJc/9WNFBY6x4MkIVJ4f/jhK1yZiYZNQLkMiHulpeYwoN/3HzwdvSJHKPDWhq bafHwVvj1qZdP/amNUxx4r4F0pIL2KGgOgWwjf5MokgoVMfy4XZA6yR0ZqweMWof4jgV PfDrZ8GOCHmXhs1MTc6mMw/kPaZLGGuvPVHxlMKJ9VUY5jy6xkxTEuYq4IZVG5qw8iO+ 9ZZQ== 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=UhBLQixYGEk4j66mPYcoVX/cDmK4Flg8GblaXXSBIuc=; b=cpIV3Wa7zeDOEO58j+rCyqoXnKbmZ5FLnFUIxIaY52tIMYqZodbUEjucruILjuByST S1P5p12HaEOMFbnWOFo0Q2bNfTa7z43WdI6L2tDfdXWBi6UkM79KCRtMVAFVQUGl/oej rdmo5amnd86SYEeQouNP/2sVu3v8hbcn8NQmlB/UwdwDTHDuf+hbWn8JUByDq9f8XDqG 9Pj465jGxPEUgVDvawb+6ZeB+TFG5CJWx8/4S3mNQAtk39wfAB65/MSmJ1oTwbHbDGeI e85T5Skb/ClYYdWOk1RwBepNy+fKX4HjPSCJxm3Bn6jorz8FUS9ygbI50AXdA1lxX+Xz Ssvg== X-Gm-Message-State: APjAAAVC24MZGc7qM99Kt7Qy21XJspcbjmCcTOldN5lidMW3z39Td127 wFA+rVDMU7d1RAwfNEQUJ2A= X-Google-Smtp-Source: APXvYqxhzCNBKNAE12RWNwiKta6CyKkoD5Kj+qh+QHwhXet2IeWhcDFKLjoXgQiBvS5m6HagHEWQMw== X-Received: by 2002:a65:6659:: with SMTP id z25mr41823227pgv.10.1556264889163; Fri, 26 Apr 2019 00:48:09 -0700 (PDT) Received: from spy ([180.217.236.228]) by smtp.gmail.com with ESMTPSA id b13sm33965350pfd.12.2019.04.26.00.48.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 00:48:07 -0700 (PDT) Sender: Mark Johnston Date: Fri, 26 Apr 2019 03:47:59 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190426074759.GA2695@spy> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> <20190426060456.GA59853@spy> <20190426073836.GP12936@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426073836.GP12936@kib.kiev.ua> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 7800B87CC2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 07:48:11 -0000 On Fri, Apr 26, 2019 at 10:38:36AM +0300, Konstantin Belousov wrote: > On Fri, Apr 26, 2019 at 02:04:56AM -0400, Mark Johnston wrote: > > On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: > > > On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > > > > Intel does not reorder reads against the condition "if" here. I know for > > > > sure that ARM does, but therestill might be some other architectures that > > > > also suffers such behavior - I just don't have any means to verify. > > > > I remember the discussion for rS302292 where we agreed that this kind of > > > > patches should be the least impacting in perfomrance as possible. Adding > > > > unconditional memory barrier causes significant performance drop on Intel, > > > > where in fact, the issue was never seen. > > > > > > > Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory > > > barrier. If you need read/read fence on some architectures, I am sure > > > that you need compiler barrier on all. > > > > To add a bit, one reason to prefer atomic(9) to explicit fences is > > precisely because it issues fences only when required by a given > > CPU architecture. There is no "unconditional memory barrier" added by > > the diff even without the #ifdef. > Well, atomic_thread_fence_acq() is the explicit fence. And on x86 it > does add unconditional compiler memory barrier. I only mean that with atomic_thread_fence_acq() on x86, the CPU does not see any fences. Based on the original commit it seems that a compiler barrier is required on all platforms, at a minimum. From owner-svn-src-head@freebsd.org Fri Apr 26 10:04:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9BDF158F734; Fri, 26 Apr 2019 10:04:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 46DB18C714; Fri, 26 Apr 2019 10:04:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 37D9510DA73; Fri, 26 Apr 2019 20:04:29 +1000 (AEST) Date: Fri, 26 Apr 2019 20:04:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: Konstantin Belousov , Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys In-Reply-To: <20190426074759.GA2695@spy> Message-ID: <20190426195450.B932@besplex.bde.org> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> <20190426060456.GA59853@spy> <20190426073836.GP12936@kib.kiev.ua> <20190426074759.GA2695@spy> 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 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=CwzFhwaq-sNMpCd2lM8A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 46DB18C714 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 10:04:42 -0000 On Fri, 26 Apr 2019, Mark Johnston wrote: > On Fri, Apr 26, 2019 at 10:38:36AM +0300, Konstantin Belousov wrote: >> On Fri, Apr 26, 2019 at 02:04:56AM -0400, Mark Johnston wrote: >>> On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: >>>> On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: >>>>> Intel does not reorder reads against the condition "if" here. I know for >>>>> sure that ARM does, but therestill might be some other architectures that >>>>> also suffers such behavior - I just don't have any means to verify. >>>>> I remember the discussion for rS302292 where we agreed that this kind of >>>>> patches should be the least impacting in perfomrance as possible. Adding >>>>> unconditional memory barrier causes significant performance drop on Intel, >>>>> where in fact, the issue was never seen. >>>>> >>>> Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory >>>> barrier. If you need read/read fence on some architectures, I am sure >>>> that you need compiler barrier on all. >>> >>> To add a bit, one reason to prefer atomic(9) to explicit fences is >>> precisely because it issues fences only when required by a given >>> CPU architecture. There is no "unconditional memory barrier" added by >>> the diff even without the #ifdef. >> Well, atomic_thread_fence_acq() is the explicit fence. And on x86 it >> does add unconditional compiler memory barrier. > > I only mean that with atomic_thread_fence_acq() on x86, the CPU does not > see any fences. > > Based on the original commit it seems that a compiler barrier is > required on all platforms, at a minimum. buf_ring.h has some volatile variables which might give sufficient barriers. But no one knows what volatile does, so reasoning about it is even harder than reasoning about ordering from atomic ops. I think the volatiles give program order for the volatile variables only (plus ordering of other variables from dependencies on the volatile variables), while the compiler barrier gives program order for all variables. Bruce From owner-svn-src-head@freebsd.org Fri Apr 26 10:22:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2141E158FC71; Fri, 26 Apr 2019 10:22:36 +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 826D48D019; Fri, 26 Apr 2019 10:22:35 +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 x3QAMQRi027894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 26 Apr 2019 13:22:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3QAMQRi027894 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3QAMP9f027893; Fri, 26 Apr 2019 13:22:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Apr 2019 13:22:25 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Mark Johnston , Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190426102225.GQ12936@kib.kiev.ua> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> <20190426060456.GA59853@spy> <20190426073836.GP12936@kib.kiev.ua> <20190426074759.GA2695@spy> <20190426195450.B932@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426195450.B932@besplex.bde.org> User-Agent: Mutt/1.11.4 (2019-03-13) 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 10:22:36 -0000 On Fri, Apr 26, 2019 at 08:04:29PM +1000, Bruce Evans wrote: > On Fri, 26 Apr 2019, Mark Johnston wrote: > > > On Fri, Apr 26, 2019 at 10:38:36AM +0300, Konstantin Belousov wrote: > >> On Fri, Apr 26, 2019 at 02:04:56AM -0400, Mark Johnston wrote: > >>> On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: > >>>> On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > >>>>> Intel does not reorder reads against the condition "if" here. I know for > >>>>> sure that ARM does, but therestill might be some other architectures that > >>>>> also suffers such behavior - I just don't have any means to verify. > >>>>> I remember the discussion for rS302292 where we agreed that this kind of > >>>>> patches should be the least impacting in perfomrance as possible. Adding > >>>>> unconditional memory barrier causes significant performance drop on Intel, > >>>>> where in fact, the issue was never seen. > >>>>> > >>>> Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory > >>>> barrier. If you need read/read fence on some architectures, I am sure > >>>> that you need compiler barrier on all. > >>> > >>> To add a bit, one reason to prefer atomic(9) to explicit fences is > >>> precisely because it issues fences only when required by a given > >>> CPU architecture. There is no "unconditional memory barrier" added by > >>> the diff even without the #ifdef. > >> Well, atomic_thread_fence_acq() is the explicit fence. And on x86 it > >> does add unconditional compiler memory barrier. > > > > I only mean that with atomic_thread_fence_acq() on x86, the CPU does not > > see any fences. > > > > Based on the original commit it seems that a compiler barrier is > > required on all platforms, at a minimum. > > buf_ring.h has some volatile variables which might give sufficient barriers. > But no one knows what volatile does, so reasoning about it is even harder > than reasoning about ordering from atomic ops. I think the volatiles give > program order for the volatile variables only (plus ordering of other variables > from dependencies on the volatile variables), while the compiler barrier > gives program order for all variables. No, volatile does not give any ordering. For gcc-like compilers, documentation implies that the volatile accesses are guarenteed to occur, i.e. they cannot be optimized out. We use volatiles to implement relaxed atomics in atomic(9) API. For Java, volatile reads have acquire semantic, and volatile writes are releases. From owner-svn-src-head@freebsd.org Fri Apr 26 12:55:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEFF415938D5; Fri, 26 Apr 2019 12:55:53 +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 62C0D6B6BB; Fri, 26 Apr 2019 12:55:53 +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 3E3C2BDD7; Fri, 26 Apr 2019 12:55:53 +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 x3QCtr6j069935; Fri, 26 Apr 2019 12:55:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QCtqtP069933; Fri, 26 Apr 2019 12:55:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904261255.x3QCtqtP069933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Apr 2019 12:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346739 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 346739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62C0D6B6BB 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 12:55:53 -0000 Author: emaste Date: Fri Apr 26 12:55:52 2019 New Revision: 346739 URL: https://svnweb.freebsd.org/changeset/base/346739 Log: make sysent after r346273 (readlinkat arg correction) PR: 197915 Reminded by: dchagin Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Apr 26 11:28:59 2019 (r346738) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Apr 26 12:55:52 2019 (r346739) @@ -10460,7 +10460,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* readlinkat */ case 500: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* renameat */ case 501: Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Fri Apr 26 11:28:59 2019 (r346738) +++ head/sys/kern/systrace_args.c Fri Apr 26 12:55:52 2019 (r346739) @@ -10421,7 +10421,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * /* readlinkat */ case 500: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* renameat */ case 501: From owner-svn-src-head@freebsd.org Fri Apr 26 13:04:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150DF1593DDE; Fri, 26 Apr 2019 13:04:11 +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 AC0416BFD7; Fri, 26 Apr 2019 13:04:10 +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 870C7BFAB; Fri, 26 Apr 2019 13:04:10 +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 x3QD4AYV075192; Fri, 26 Apr 2019 13:04:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QD4AHU075191; Fri, 26 Apr 2019 13:04:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261304.x3QD4AHU075191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 13:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346743 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC0416BFD7 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 13:04:11 -0000 Author: bde Date: Fri Apr 26 13:04:10 2019 New Revision: 346743 URL: https://svnweb.freebsd.org/changeset/base/346743 Log: Fix an off-by-1 error for copying overlapping bitmaps in r346416. For nonzero height, the first line in the original order was not copied, and for zero height, garbage lines before the first were copied until a crash occurred. Modified: head/lib/libvgl/bitmap.c Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Fri Apr 26 13:00:25 2019 (r346742) +++ head/lib/libvgl/bitmap.c Fri Apr 26 13:04:10 2019 (r346743) @@ -207,7 +207,7 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, yextra = 0; ystep = 1; if (src->Bitmap == dst->Bitmap && srcy < dsty) { - yend = srcy; + yend = srcy - 1; yextra = hight - 1; ystep = -1; } From owner-svn-src-head@freebsd.org Fri Apr 26 13:22:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E130E15942B4; Fri, 26 Apr 2019 13:22:55 +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 87E3D6CA1C; Fri, 26 Apr 2019 13:22:55 +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 6404EC300; Fri, 26 Apr 2019 13:22:55 +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 x3QDMtfq086011; Fri, 26 Apr 2019 13:22:55 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QDMtOM086010; Fri, 26 Apr 2019 13:22:55 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261322.x3QDMtOM086010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 13:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346744 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87E3D6CA1C 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.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 13:22:56 -0000 Author: bde Date: Fri Apr 26 13:22:54 2019 New Revision: 346744 URL: https://svnweb.freebsd.org/changeset/base/346744 Log: Restore the line width in VGLEnd(). The line width may be changed by VGLSetVScreenSize(), but is not restored by mode switches to at least standard text mode, so must be restored explicitly. Standard text mode displayed blanks when the line width was doubled. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Fri Apr 26 13:04:10 2019 (r346743) +++ head/lib/libvgl/main.c Fri Apr 26 13:22:54 2019 (r346744) @@ -64,6 +64,7 @@ static unsigned int VGLCurWindow; static int VGLInitDone = 0; static video_info_t VGLOldModeInfo; static vid_info_t VGLOldVInfo; +static int VGLOldVXsize; void VGLEnd() @@ -85,6 +86,8 @@ struct vt_mode smode; munmap(VGLMem, VGLAdpInfo.va_window_size); } + ioctl(0, FBIO_SETLINEWIDTH, &VGLOldVXsize); + if (VGLOldMode >= M_VESA_BASE) ioctl(0, _IO('V', VGLOldMode - M_VESA_BASE), 0); else @@ -322,6 +325,7 @@ VGLInit(int mode) depth = VGLModeInfo.vi_depth; if (depth == 15) depth = 16; + VGLOldVXsize = VGLDisplay->VXsize = VGLAdpInfo.va_line_width *8/(depth/VGLModeInfo.vi_planes); VGLDisplay->VYsize = VGLBufSize/VGLModeInfo.vi_planes/VGLAdpInfo.va_line_width; From owner-svn-src-head@freebsd.org Fri Apr 26 13:49:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C5AA1594D42; Fri, 26 Apr 2019 13:49:07 +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 037B16D939; Fri, 26 Apr 2019 13:49:07 +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 B3951C684; Fri, 26 Apr 2019 13:49:06 +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 x3QDn6S6096806; Fri, 26 Apr 2019 13:49:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QDn64N096804; Fri, 26 Apr 2019 13:49:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261349.x3QDn64N096804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 13:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346745 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 037B16D939 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.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 13:49:07 -0000 Author: bde Date: Fri Apr 26 13:49:06 2019 New Revision: 346745 URL: https://svnweb.freebsd.org/changeset/base/346745 Log: Fix the only known remaining (libvgl) bug for 24-bit modes, and enable support for 24-bit modes. The non-segmented case has worked for a long time, but the segmented case could never have worked since 24-bit accesses may cross a window boundary but the window was not changed in the middle of the specialized 24-bit accesses for writing a single pixel. Modified: head/lib/libvgl/main.c head/lib/libvgl/simple.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Fri Apr 26 13:22:54 2019 (r346744) +++ head/lib/libvgl/main.c Fri Apr 26 13:49:06 2019 (r346745) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" -/* XXX Direct Color 24bits modes unsupported */ - #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) @@ -223,11 +221,9 @@ VGLInit(int mode) case 2: VGLDisplay->Type = VIDBUF16; break; -#if notyet case 3: VGLDisplay->Type = VIDBUF24; break; -#endif case 4: VGLDisplay->Type = VIDBUF32; break; Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Fri Apr 26 13:22:54 2019 (r346744) +++ head/lib/libvgl/simple.c Fri Apr 26 13:49:06 2019 (r346745) @@ -51,7 +51,7 @@ static byte VGLSavePaletteBlue[256]; void VGLSetXY(VGLBitmap *object, int x, int y, u_long color) { - int offset, undermouse; + int offset, soffset, undermouse; VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { @@ -67,7 +67,6 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color switch (object->Type) { case VIDBUF8S: case VIDBUF16S: - case VIDBUF24S: case VIDBUF32S: offset = VGLSetSegment(offset); /* FALLTHROUGH */ @@ -89,6 +88,25 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color break; case 4: memcpy(&object->Bitmap[offset], &color, 4); + break; + } + break; + case VIDBUF24S: + soffset = VGLSetSegment(offset); + color = htole32(color); + switch (VGLAdpInfo.va_window_size - soffset) { + case 1: + memcpy(&object->Bitmap[soffset], &color, 1); + soffset = VGLSetSegment(offset + 1); + memcpy(&object->Bitmap[soffset], (byte *)&color + 1, 2); + break; + case 2: + memcpy(&object->Bitmap[soffset], &color, 2); + soffset = VGLSetSegment(offset + 2); + memcpy(&object->Bitmap[soffset], (byte *)&color + 2, 1); + break; + default: + memcpy(&object->Bitmap[soffset], &color, 3); break; } break; From owner-svn-src-head@freebsd.org Fri Apr 26 14:44:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F7231595F03; Fri, 26 Apr 2019 14:44:21 +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 C96716F684; Fri, 26 Apr 2019 14:44:20 +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 9B59FD0FB; Fri, 26 Apr 2019 14:44:20 +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 x3QEiKUD028497; Fri, 26 Apr 2019 14:44:20 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QEiKZe028496; Fri, 26 Apr 2019 14:44:20 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261444.x3QEiKZe028496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 14:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346747 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96716F684 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 14:44:21 -0000 Author: bde Date: Fri Apr 26 14:44:20 2019 New Revision: 346747 URL: https://svnweb.freebsd.org/changeset/base/346747 Log: Remove save/restore of the crtc and gdc registers when showing and hiding the mouse cursor. The showing and hiding is often done asynchronously in a not very safe signal handler, but the state of these registers and much more is protected from the signal handler in a better way by deferring mouse signals while the state is in use. Modified: head/lib/libvgl/mouse.c Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Fri Apr 26 14:15:58 2019 (r346746) +++ head/lib/libvgl/mouse.c Fri Apr 26 14:44:20 2019 (r346747) @@ -108,18 +108,11 @@ VGLMousePointerShow() byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4]; VGLBitmap buffer = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf); - byte crtcidx, crtcval, gdcidx, gdcval; int pos; if (!VGLMouseVisible) { INTOFF(); VGLMouseVisible = 1; - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - crtcidx = inb(0x3c4); - crtcval = inb(0x3c5); - gdcidx = inb(0x3ce); - gdcval = inb(0x3cf); - } buffer.PixelBytes = VGLDisplay->PixelBytes; __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, &buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); @@ -130,12 +123,6 @@ VGLMousePointerShow() VGLDisplay->PixelBytes); __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - outb(0x3c4, crtcidx); - outb(0x3c5, crtcval); - outb(0x3ce, gdcidx); - outb(0x3cf, gdcval); - } INTON(); } } @@ -143,25 +130,11 @@ VGLMousePointerShow() void VGLMousePointerHide() { - byte crtcidx, crtcval, gdcidx, gdcval; - if (VGLMouseVisible) { INTOFF(); VGLMouseVisible = 0; - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - crtcidx = inb(0x3c4); - crtcval = inb(0x3c5); - gdcidx = inb(0x3ce); - gdcval = inb(0x3cf); - } __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) { - outb(0x3c4, crtcidx); - outb(0x3c5, crtcval); - outb(0x3ce, gdcidx); - outb(0x3cf, gdcval); - } INTON(); } } From owner-svn-src-head@freebsd.org Fri Apr 26 14:44:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 957C11595F7D; Fri, 26 Apr 2019 14:44:51 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E05F6F875; Fri, 26 Apr 2019 14:44:51 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D36FD0FE; Fri, 26 Apr 2019 14:44:51 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3QEipKl028729; Fri, 26 Apr 2019 14:44:51 GMT (envelope-from lev@FreeBSD.org) Received: (from lev@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QEipja028728; Fri, 26 Apr 2019 14:44:51 GMT (envelope-from lev@FreeBSD.org) Message-Id: <201904261444.x3QEipja028728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lev set sender to lev@FreeBSD.org using -f From: "Lev A. Serebryakov" Date: Fri, 26 Apr 2019 14:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346749 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: lev X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 346749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E05F6F875 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 14:44:51 -0000 Author: lev (ports committer) Date: Fri Apr 26 14:44:50 2019 New Revision: 346749 URL: https://svnweb.freebsd.org/changeset/base/346749 Log: Make mdmfs verbose if diskless boot is verbose. Approved by: ian@ Differential Revision: D17104 Modified: head/libexec/rc/rc.initdiskless Modified: head/libexec/rc/rc.initdiskless ============================================================================== --- head/libexec/rc/rc.initdiskless Fri Apr 26 14:44:46 2019 (r346748) +++ head/libexec/rc/rc.initdiskless Fri Apr 26 14:44:50 2019 (r346749) @@ -208,7 +208,11 @@ handle_remount() { # $1 = mount point # The 'auto' parameter will attempt to use tmpfs(5), falls back to md(4). # $1 is size in 512-byte sectors, $2 is the mount point. mount_md() { - /sbin/mdmfs -s $1 auto $2 + if [ ${o_verbose} -gt 0 ] ; then + /sbin/mdmfs -XL -s $1 auto $2 + else + /sbin/mdmfs -s $1 auto $2 + fi } # Create the memory filesystem if it has not already been created From owner-svn-src-head@freebsd.org Fri Apr 26 14:44:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2248C1595F6A; Fri, 26 Apr 2019 14:44:47 +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 3AF996F86B; Fri, 26 Apr 2019 14:44:47 +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 145D9D0FD; Fri, 26 Apr 2019 14:44:47 +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 x3QEik5J028682; Fri, 26 Apr 2019 14:44:46 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QEikNp028681; Fri, 26 Apr 2019 14:44:46 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201904261444.x3QEikNp028681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 26 Apr 2019 14:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346748 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AF996F86B 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.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 14:44:50 -0000 Author: bcran Date: Fri Apr 26 14:44:46 2019 New Revision: 346748 URL: https://svnweb.freebsd.org/changeset/base/346748 Log: Fix tools/boot/ci-qemu-test.sh and make some improvements Update ci-qemu-test.sh o Update the path to the OVMF file, which is now in /usr/local/share/uefi-edk2-qemu. o Use the more modern q35, pc-q35-3.0 (Q35 + ICH9, 2009) QEMU machine instead of the default, obsolete pc, pc-i440fx-3.0 (i440FX + PIIX, 1996). For example this adds ACPI support. o Specify the system firmware using the newer pflash drive syntax instead of bios. o Remove extra, unneeded devices by passing -nodefaults. o Change text to talk about 'firmware' instead of 'bios', since UEFI isn't a BIOS. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D20074 Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Fri Apr 26 14:44:20 2019 (r346747) +++ head/tools/boot/ci-qemu-test.sh Fri Apr 26 14:44:46 2019 (r346748) @@ -81,10 +81,10 @@ if [ -z "${SRCTOP}" ]; then die "Cannot locate top of source tree" fi -# Locate the uefi bios file used by qemu. -: ${OVMF:=/usr/local/share/UEFI-firmware/QEMU_UEFI_CODE_x86_64.fd} +# Locate the uefi firmware file used by qemu. +: ${OVMF:=/usr/local/share/uefi-edk2-qemu/QEMU_UEFI_CODE-x86_64.fd} if [ ! -r "${OVMF}" ]; then - die "Cannot read UEFI bios file ${OVMF}" + die "Cannot read UEFI firmware file ${OVMF}" fi # Create a temp dir to hold the boot image. @@ -97,7 +97,8 @@ trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUI # And, boot in QEMU. : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ - qemu-system-x86_64 -m 256M -bios ${OVMF} \ + qemu-system-x86_64 -M q35 -m 256M -nodefaults \ + -drive if=pflash,format=raw,readonly,file=${OVMF} \ -serial stdio -vga none -nographic -monitor none \ -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} From owner-svn-src-head@freebsd.org Fri Apr 26 15:01:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F04159659D; Fri, 26 Apr 2019 15:01:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11C6A7017E; Fri, 26 Apr 2019 15:01:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEFB8D40D; Fri, 26 Apr 2019 15:00:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3QF0xcW034390; Fri, 26 Apr 2019 15:00:59 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QF0x7S034389; Fri, 26 Apr 2019 15:00:59 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904261500.x3QF0x7S034389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 26 Apr 2019 15:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346750 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 346750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11C6A7017E 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.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 15:01:00 -0000 Author: asomers Date: Fri Apr 26 15:00:59 2019 New Revision: 346750 URL: https://svnweb.freebsd.org/changeset/base/346750 Log: [skip ci] fix typo in comment from r59840 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 26 14:44:50 2019 (r346749) +++ head/sys/kern/vfs_bio.c Fri Apr 26 15:00:59 2019 (r346750) @@ -4424,7 +4424,7 @@ bufwait(struct buf *bp) * read error occurred, or if the op was a write. B_CACHE is never * set if the buffer is invalid or otherwise uncacheable. * - * biodone does not mess with B_INVAL, allowing the I/O routine or the + * bufdone does not mess with B_INVAL, allowing the I/O routine or the * initiator to leave B_INVAL set to brelse the buffer out of existence * in the biodone routine. */ From owner-svn-src-head@freebsd.org Fri Apr 26 15:43:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E13C51597156; Fri, 26 Apr 2019 15:43:15 +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 7FB5071AF2; Fri, 26 Apr 2019 15:43:15 +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 5B5CADB88; Fri, 26 Apr 2019 15:43:15 +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 x3QFhFKv060381; Fri, 26 Apr 2019 15:43:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QFhEFE060379; Fri, 26 Apr 2019 15:43:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904261543.x3QFhEFE060379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 26 Apr 2019 15:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346751 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 346751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FB5071AF2 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.996,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 15:43:16 -0000 Author: ian Date: Fri Apr 26 15:43:14 2019 New Revision: 346751 URL: https://svnweb.freebsd.org/changeset/base/346751 Log: Add a manpage for elf_aux_info(3) Differential Revision: https://reviews.freebsd.org/D20063 Added: head/lib/libc/gen/auxv.3 (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Apr 26 15:00:59 2019 (r346750) +++ head/lib/libc/gen/Makefile.inc Fri Apr 26 15:43:14 2019 (r346751) @@ -193,6 +193,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map MAN+= alarm.3 \ arc4random.3 \ + auxv.3 \ basename.3 \ cap_rights_get.3 \ cap_sandboxed.3 \ @@ -321,6 +322,7 @@ MAN+= alarm.3 \ MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 +MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 Added: head/lib/libc/gen/auxv.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/auxv.3 Fri Apr 26 15:43:14 2019 (r346751) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 25, 2019 +.Dt ELF_AUX_INFO 3 +.Os +.Sh NAME +.Nm elf_aux_info +.Nd extract data from the elf auxiliary vector of the current process +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/auxv.h +.Ft int +.Fn elf_aux_info "int aux" "void *buf" "int buflen" +.Sh DESCRIPTION +The +.Fn elf_aux_info +function retrieves the auxiliary info vector requested in +.Va aux . +The information is stored into the provided buffer if it will fit. +The following values, defined in +.In sys/elf_common.h +can be requested: +.Bl -tag -width AT_OSRELDATE +.It AT_CANARY +The canary value for SSP. +.It AT_HWCAP +CPU / hardware feature flags. +.It AT_HWCAP2 +CPU / hardware feature flags. +.It AT_NCPUS +Number of CPUs. +.It AT_OSRELDATE +Kernel OSRELDATE. +.It AT_PAGESIZES +Vector of page sizes. +.It AT_PAGESZ +Page size in bytes. +.It AT_TIMEKEEP +Pointer to VDSO timehands (for library internal use). +.El +.Sh RETURN VALUES +Returns zero on success, or an error number on failure. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +An unknown item was requested. +.It Bq Er EINVAL +The provided buffer was not the right size for the requested item. +.It Bq Er ENOENT +The requested item is not available. +.El +.Sh HISTORY +The +.Fn elf_aux_info +function appeared in +.Fx 12.0 . +.Sh BUGS +Only a small subset of available auxiliary info vector items are +accessible with this function. +Some items require a "right-sized" buffer while others just require a +"big enough" buffer. From owner-svn-src-head@freebsd.org Fri Apr 26 16:14:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 654451597A7E; Fri, 26 Apr 2019 16:14: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 08D0472A6E; Fri, 26 Apr 2019 16:14: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 D1A17E0C1; Fri, 26 Apr 2019 16:14:23 +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 x3QGENEX076351; Fri, 26 Apr 2019 16:14:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QGENod076350; Fri, 26 Apr 2019 16:14:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261614.x3QGENod076350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 16:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346752 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08D0472A6E 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.996,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 16:14:24 -0000 Author: bde Date: Fri Apr 26 16:14:23 2019 New Revision: 346752 URL: https://svnweb.freebsd.org/changeset/base/346752 Log: In VGLClear(), check for the overlap of the mouse cursor in the whole display, not just in the unpanned top left corner. This currently makes no difference since the kernel erroneously doesn't allow moving the cursor completely outside of the unpanned corner. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Fri Apr 26 15:43:14 2019 (r346751) +++ head/lib/libvgl/simple.c Fri Apr 26 16:14:23 2019 (r346752) @@ -476,7 +476,7 @@ VGLClear(VGLBitmap *object, u_long color) VGLCheckSwitch(); if (object == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(0, 0, object->Xsize, object->Ysize); + mouseoverlap = VGLMouseOverlap(0, 0, object->VXsize, object->VYsize); if (mouseoverlap) VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); From owner-svn-src-head@freebsd.org Fri Apr 26 16:21:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BBF41597D7E; Fri, 26 Apr 2019 16:21:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A70772FB2; Fri, 26 Apr 2019 16:21:46 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x144.google.com with SMTP id y134so6745103itc.5; Fri, 26 Apr 2019 09:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=wdcBadMHDbWgfGXvs+ul7v4Kefxqr6fSZzmKD/ZUP8g=; b=Gpc/J4pUbKIUBu3LV+TtoRyHZGyrsb+tXxtLbE9plqzx6E2Lq9nokUtYglg2v4t2mV WlckT3lKCMPLePL5tn2Z1RZHyS/QXwk73qljmAIatrU7MfOm7pheeXrBFUNogBL3Mm0S wdi27uu/pnHniWStsbRJHF40S/z0OkNtBrGYRXzpooqN/E+rAZOeS9nMlNE4oYBv1dfG Oyhv3/GorFBFQGklq9MFLMv51lZI1OnBR27/9h9CfbeHUm5W4ipoaOtMJfnWKN4J0E1E J0EscBRYBD1BsdaXp3G+D96HktLRjqI8iH9rBHXxWRwA9xHU1UGOOLRr9HkgxDEqYeyw /6WA== 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 :in-reply-to:references:organization:mime-version :content-transfer-encoding; bh=wdcBadMHDbWgfGXvs+ul7v4Kefxqr6fSZzmKD/ZUP8g=; b=M71H5q7/1qgjJpI6ii7Xe9JpbOjhOgbC1YYveFiCAk3DNxAAHRxPT4igXc0nJH7gGU pQpAw72Vty9ICkZPc0XOgXENcrp8oj7N9Pe2h5Fowh8OcOlTKPdl25ctw5Wk/tI8vLmo f23MJtZGflgyuVk0E/yVRUw8Re3leE7L1LsuYy7+EbvFHm67c4ySLV6Bj8EKb/xbddWh dGIDjSDTd+lSl7KBjJB4ijT0Z8Fbmk3HbHnsIvogoC/GBfnbQFXYQg55tn6CI+zvcYnz AcoeZRzVXZ3PdJY6xriKChnvZueuWKfuQHUisOFb1a7dhDT6OvpkTiET5zuCcOIZERhM ueDw== X-Gm-Message-State: APjAAAWKPdpePDY89k77olzedKZXmYr78TfG3qqR5XZZ91pHkhTK6ygC tpv6IfWNWW9ZzlZpkP1LZd777aSD X-Google-Smtp-Source: APXvYqxMSxwIl8eiwVEVV9kbJjtIWoOQ9P1B+tJVLkdPD3xqb1Ss/0FpKcJoU7mKh0aHT91JoJUTQQ== X-Received: by 2002:a24:7294:: with SMTP id x142mr8854179itc.7.1556295705135; Fri, 26 Apr 2019 09:21:45 -0700 (PDT) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id b8sm12585336itb.20.2019.04.26.09.21.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 09:21:44 -0700 (PDT) Sender: Justin Hibbits Date: Fri, 26 Apr 2019 11:21:41 -0500 From: Justin Hibbits To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346588 - head/lib/libc/powerpc64/string Message-ID: <20190426112141.78632e17@titan.knownspace> In-Reply-To: <20190423102442.GA86961@FreeBSD.org> References: <201904230253.x3N2rrrh041288@repo.freebsd.org> <20190423102442.GA86961@FreeBSD.org> Organization: FreeBSD X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8A70772FB2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Gpc/J4pU; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::144 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-3.80 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.80)[ip: (1.49), ipnet: 2607:f8b0::/32(-3.16), asn: 15169(-2.26), country: US(-0.06)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.4.1.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]; NEURAL_HAM_SHORT(-0.79)[-0.788,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[jhibbits@FreeBSD.org,chmeeedalf@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@FreeBSD.org,chmeeedalf@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 16:21:47 -0000 On Tue, 23 Apr 2019 10:24:42 +0000 Alexey Dokuchaev wrote: > On Tue, Apr 23, 2019 at 02:53:53AM +0000, Justin Hibbits wrote: > > New Revision: 346588 > > URL: https://svnweb.freebsd.org/changeset/base/346588 > > > > Log: > > powerpc64: Rewrite strcmp in asm to take advantage of word size > > ... > > Some performance gain rates between the current and the optimized > > solution: > > > > String size (bytes) Gain rate > > <=8 0.59% > > <=16 1.92% > > 32 3.02% > > 64 5.60% > > 128 10.16% > > 256 18.05% > > 512 30.18% > > 1024 42.82% > > Nice! This should help to speed up buildworld quite a bit. Would it > be feasible to patch ppc32 in a similar fashion? Thanks, > > ./danfe This actually uses 'cmpb' which is only available on PowerISA 2.05+, so I'll need to pull it out for now, and re-enable it once we have ifuncs. As it stands, this commit broke the G5 and POWER4/POWER5. - Justin From owner-svn-src-head@freebsd.org Fri Apr 26 16:38:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C0B7159829E; Fri, 26 Apr 2019 16:38: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 C45C773899; Fri, 26 Apr 2019 16:38:23 +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 A0AF2E43D; Fri, 26 Apr 2019 16:38:23 +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 x3QGcNxA086854; Fri, 26 Apr 2019 16:38:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QGcNCF086853; Fri, 26 Apr 2019 16:38:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261638.x3QGcNCF086853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 16:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346754 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C45C773899 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.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 16:38:24 -0000 Author: bde Date: Fri Apr 26 16:38:23 2019 New Revision: 346754 URL: https://svnweb.freebsd.org/changeset/base/346754 Log: Merge __VGLGetXY() back into VGLGetXY(). They were split to simplify the organization of fixes for the mouse cursor, but after optimizations VGLGetXY() automatically avoids the mouse cursor. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Fri Apr 26 16:26:01 2019 (r346753) +++ head/lib/libvgl/simple.c Fri Apr 26 16:38:23 2019 (r346754) @@ -133,12 +133,19 @@ set_planar: } } -static u_long -__VGLGetXY(VGLBitmap *object, int x, int y) +u_long +VGLGetXY(VGLBitmap *object, int x, int y) { - int offset; u_long color; + int offset; + VGLCheckSwitch(); + if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) + return 0; + if (object == VGLDisplay) + object = &VGLVDisplay; + else if (object->Type != MEMBUF) + return 0; /* invalid */ offset = (y * object->VXsize + x) * object->PixelBytes; switch (object->PixelBytes) { case 1: @@ -155,19 +162,6 @@ __VGLGetXY(VGLBitmap *object, int x, int y) return le32toh(color); } return 0; /* invalid */ -} - -u_long -VGLGetXY(VGLBitmap *object, int x, int y) -{ - VGLCheckSwitch(); - if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) - return 0; - if (object == VGLDisplay) - object = &VGLVDisplay; - else if (object->Type != MEMBUF) - return 0; /* invalid */ - return __VGLGetXY(object, x, y); } /* From owner-svn-src-head@freebsd.org Fri Apr 26 17:58:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF83159A262; Fri, 26 Apr 2019 17:58:46 +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 091C776F67; Fri, 26 Apr 2019 17:58:46 +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 EAC6CF25A; Fri, 26 Apr 2019 17:58:45 +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 x3QHwjjj029657; Fri, 26 Apr 2019 17:58:45 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QHwjnD029652; Fri, 26 Apr 2019 17:58:45 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201904261758.x3QHwjnD029652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 26 Apr 2019 17:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346759 - in head/stand: . common efi/loader i386/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: . common efi/loader i386/loader X-SVN-Commit-Revision: 346759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 091C776F67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 17:58:46 -0000 Author: tsoome Date: Fri Apr 26 17:58:44 2019 New Revision: 346759 URL: https://svnweb.freebsd.org/changeset/base/346759 Log: loader: implement map-vdisk and unmap-vdisk commands illumos update: https://www.illumos.org/issues/10598 Add map-vdisk and unmap-vdisk commands to create virtual disk interface on top of file. This will allow to use disk image from file system to load and start the kernel. By mapping file, we create vdiskX device, the device will be listed by lsdev [-v] and can be accessed directly as ls vdisk0p1:/path or can be used as value for currdev variable. vdisk strategy function does not use bcache as we have bcache used with backing file. vdisk can be unmapped when all consumers have closed the open files. In first iteration we do not support the zfs images because zfs pools do keep the device open (there is no "zpool export" mechanism). Adding zfs support is relatively simple, we just need to run zfs disk probe after mapping is done. Differential Revision: https://reviews.freebsd.org/D19733 Added: head/stand/common/vdisk.c (contents, props changed) Modified: head/stand/common/help.common head/stand/efi/loader/conf.c head/stand/i386/loader/conf.c head/stand/loader.mk Modified: head/stand/common/help.common ============================================================================== --- head/stand/common/help.common Fri Apr 26 17:28:06 2019 (r346758) +++ head/stand/common/help.common Fri Apr 26 17:58:44 2019 (r346759) @@ -99,6 +99,13 @@ List loaded modules. If [-v] is specified, print more details. ################################################################################ +# Tmap-vdisk DMap virtual disk + + map-vdisk filename + + Map file as virtual disk. + +################################################################################ # Tmore DPage files more [ ...] @@ -395,6 +402,13 @@ unload This command removes any kernel and all loaded modules from memory. + +################################################################################ +# Tunmap-vdisk DUnmap virtual disk + + unmap-vdisk diskname + + Delete virtual disk mapping. ################################################################################ # Tunset DUnset a variable Added: head/stand/common/vdisk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/common/vdisk.c Fri Apr 26 17:58:44 2019 (r346759) @@ -0,0 +1,417 @@ +/*- + * Copyright 2019 Toomas Soome + * + * 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 + +static int vdisk_init(void); +static int vdisk_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int vdisk_open(struct open_file *, ...); +static int vdisk_close(struct open_file *); +static int vdisk_ioctl(struct open_file *, u_long, void *); +static int vdisk_print(int); + +struct devsw vdisk_dev = { + .dv_name = "vdisk", + .dv_type = DEVT_DISK, + .dv_init = vdisk_init, + .dv_strategy = vdisk_strategy, + .dv_open = vdisk_open, + .dv_close = vdisk_close, + .dv_ioctl = vdisk_ioctl, + .dv_print = vdisk_print, + .dv_cleanup = NULL +}; + +typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t; + +typedef struct vdisk_info +{ + STAILQ_ENTRY(vdisk_info) vdisk_link; /* link in device list */ + char *vdisk_path; + int vdisk_unit; + int vdisk_fd; + uint64_t vdisk_size; /* size in bytes */ + uint32_t vdisk_sectorsz; + uint32_t vdisk_open; /* reference counter */ +} vdisk_info_t; + +static vdisk_info_list_t vdisk_list; /* list of mapped vdisks. */ + +static vdisk_info_t * +vdisk_get_info(struct devdesc *dev) +{ + vdisk_info_t *vd; + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (vd->vdisk_unit == dev->d_unit) + return (vd); + } + return (vd); +} + +COMMAND_SET(map_vdisk, "map-vdisk", "map file as virtual disk", command_mapvd); + +static int +command_mapvd(int argc, char *argv[]) +{ + vdisk_info_t *vd, *p; + struct stat sb; + + if (argc != 2) { + printf("usage: %s filename\n", argv[0]); + return (CMD_ERROR); + } + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (strcmp(vd->vdisk_path, argv[1]) == 0) { + printf("%s: file %s is already mapped as %s%d\n", + argv[0], argv[1], vdisk_dev.dv_name, + vd->vdisk_unit); + return (CMD_ERROR); + } + } + + if (stat(argv[1], &sb) < 0) { + /* + * ENOSYS is really ENOENT because we did try to walk + * through devsw list to try to open this file. + */ + if (errno == ENOSYS) + errno = ENOENT; + + printf("%s: stat failed: %s\n", argv[0], strerror(errno)); + return (CMD_ERROR); + } + + /* + * Avoid mapping small files. + */ + if (sb.st_size < 1024 * 1024) { + printf("%s: file %s is too small.\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + vd = calloc(1, sizeof (*vd)); + if (vd == NULL) { + printf("%s: out of memory\n", argv[0]); + return (CMD_ERROR); + } + vd->vdisk_path = strdup(argv[1]); + if (vd->vdisk_path == NULL) { + free (vd); + printf("%s: out of memory\n", argv[0]); + return (CMD_ERROR); + } + vd->vdisk_fd = open(vd->vdisk_path, O_RDONLY); + if (vd->vdisk_fd < 0) { + printf("%s: open failed: %s\n", argv[0], strerror(errno)); + free(vd->vdisk_path); + free(vd); + return (CMD_ERROR); + } + + vd->vdisk_size = sb.st_size; + vd->vdisk_sectorsz = DEV_BSIZE; + STAILQ_FOREACH(p, &vdisk_list, vdisk_link) { + vdisk_info_t *n; + if (p->vdisk_unit == vd->vdisk_unit) { + vd->vdisk_unit++; + continue; + } + n = STAILQ_NEXT(p, vdisk_link); + if (p->vdisk_unit < vd->vdisk_unit) { + if (n == NULL) { + /* p is last elem */ + STAILQ_INSERT_TAIL(&vdisk_list, vd, vdisk_link); + break; + } + if (n->vdisk_unit > vd->vdisk_unit) { + /* p < vd < n */ + STAILQ_INSERT_AFTER(&vdisk_list, p, vd, + vdisk_link); + break; + } + /* else n < vd or n == vd */ + vd->vdisk_unit++; + continue; + } + /* p > vd only if p is the first element */ + STAILQ_INSERT_HEAD(&vdisk_list, vd, vdisk_link); + break; + } + + /* if the list was empty or contiguous */ + if (p == NULL) + STAILQ_INSERT_TAIL(&vdisk_list, vd, vdisk_link); + + printf("%s: file %s is mapped as %s%d\n", argv[0], vd->vdisk_path, + vdisk_dev.dv_name, vd->vdisk_unit); + return (CMD_OK); +} + +COMMAND_SET(unmap_vdisk, "unmap-vdisk", "unmap virtual disk", command_unmapvd); + +/* + * unmap-vdisk vdiskX + */ +static int +command_unmapvd(int argc, char *argv[]) +{ + size_t len; + vdisk_info_t *vd; + long unit; + char *end; + + if (argc != 2) { + printf("usage: %s %sN\n", argv[0], vdisk_dev.dv_name); + return (CMD_ERROR); + } + + len = strlen(vdisk_dev.dv_name); + if (strncmp(vdisk_dev.dv_name, argv[1], len) != 0) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + errno = 0; + unit = strtol(argv[1] + len, &end, 10); + if (errno != 0 || (*end != '\0' && strcmp(end, ":") != 0)) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + if (vd->vdisk_unit == unit) + break; + } + + if (vd == NULL) { + printf("%s: unknown device %s\n", argv[0], argv[1]); + return (CMD_ERROR); + } + + if (vd->vdisk_open != 0) { + printf("%s: %s is in use, unable to unmap.\n", + argv[0], argv[1]); + return (CMD_ERROR); + } + + STAILQ_REMOVE(&vdisk_list, vd, vdisk_info, vdisk_link); + close(vd->vdisk_fd); + free(vd->vdisk_path); + free(vd); + printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path); + + return (CMD_OK); +} + +static int +vdisk_init(void) +{ + STAILQ_INIT(&vdisk_list); + return (0); +} + +static int +vdisk_strategy(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + ssize_t rv; + + dev = devdata; + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (size == 0 || (size % 512) != 0) + return (EIO); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + daddr_t offset; + + offset = dev->d_offset * vd->vdisk_sectorsz; + offset /= 512; + blk += offset; + } + if (lseek(vd->vdisk_fd, blk << 9, SEEK_SET) == -1) + return (EIO); + + errno = 0; + switch (rw & F_MASK) { + case F_READ: + rv = read(vd->vdisk_fd, buf, size); + break; + case F_WRITE: + rv = write(vd->vdisk_fd, buf, size); + break; + default: + return (ENOSYS); + } + + if (errno == 0 && rsize != NULL) { + *rsize = rv; + } + return (errno); +} + +static int +vdisk_open(struct open_file *f, ...) +{ + va_list args; + struct disk_devdesc *dev; + vdisk_info_t *vd; + int rc = 0; + + va_start(args, f); + dev = va_arg(args, struct disk_devdesc *); + va_end(args); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_open(dev, vd->vdisk_size, vd->vdisk_sectorsz); + } + if (rc == 0) + vd->vdisk_open++; + return (rc); +} + +static int +vdisk_close(struct open_file *f) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + + dev = (struct disk_devdesc *)(f->f_devdata); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + vd->vdisk_open--; + if (dev->dd.d_dev->dv_type == DEVT_DISK) + return (disk_close(dev)); + return (0); +} + +static int +vdisk_ioctl(struct open_file *f, u_long cmd, void *data) +{ + struct disk_devdesc *dev; + vdisk_info_t *vd; + int rc; + + dev = (struct disk_devdesc *)(f->f_devdata); + if (dev == NULL) + return (EINVAL); + vd = vdisk_get_info((struct devdesc *)dev); + if (vd == NULL) + return (EINVAL); + + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + } + + switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *)data = vd->vdisk_sectorsz; + break; + case DIOCGMEDIASIZE: + *(uint64_t *)data = vd->vdisk_size; + break; + default: + return (ENOTTY); + } + return (0); +} + +static int +vdisk_print(int verbose) +{ + int ret = 0; + vdisk_info_t *vd; + char line[80]; + + if (STAILQ_EMPTY(&vdisk_list)) + return (ret); + + printf("%s devices:", vdisk_dev.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + + STAILQ_FOREACH(vd, &vdisk_list, vdisk_link) { + struct disk_devdesc vd_dev; + + if (verbose) { + printf(" %s", vd->vdisk_path); + if ((ret = pager_output("\n")) != 0) + break; + } + snprintf(line, sizeof(line), + " %s%d", vdisk_dev.dv_name, vd->vdisk_unit); + printf("%s: %" PRIu64 " X %u blocks", line, + vd->vdisk_size / vd->vdisk_sectorsz, + vd->vdisk_sectorsz); + if ((ret = pager_output("\n")) != 0) + break; + + vd_dev.dd.d_dev = &vdisk_dev; + vd_dev.dd.d_unit = vd->vdisk_unit; + vd_dev.d_slice = -1; + vd_dev.d_partition = -1; + + ret = disk_open(&vd_dev, vd->vdisk_size, vd->vdisk_sectorsz); + if (ret == 0) { + ret = disk_print(&vd_dev, line, verbose); + disk_close(&vd_dev); + if (ret != 0) + break; + } else { + ret = 0; + } + } + + return (ret); +} Modified: head/stand/efi/loader/conf.c ============================================================================== --- head/stand/efi/loader/conf.c Fri Apr 26 17:28:06 2019 (r346758) +++ head/stand/efi/loader/conf.c Fri Apr 26 17:58:44 2019 (r346759) @@ -33,11 +33,14 @@ __FBSDID("$FreeBSD$"); #include #include +extern struct devsw vdisk_dev; + struct devsw *devsw[] = { &efipart_fddev, &efipart_cddev, &efipart_hddev, &efinet_dev, + &vdisk_dev, #ifdef EFI_ZFS_BOOT &zfs_dev, #endif Modified: head/stand/i386/loader/conf.c ============================================================================== --- head/stand/i386/loader/conf.c Fri Apr 26 17:28:06 2019 (r346758) +++ head/stand/i386/loader/conf.c Fri Apr 26 17:58:44 2019 (r346759) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #if defined(LOADER_FIREWIRE_SUPPORT) extern struct devsw fwohci; #endif +extern struct devsw vdisk_dev; /* Exported for libstand */ struct devsw *devsw[] = { @@ -60,6 +61,7 @@ struct devsw *devsw[] = { #if defined(LOADER_FIREWIRE_SUPPORT) &fwohci, #endif + &vdisk_dev, #if defined(LOADER_ZFS_SUPPORT) &zfs_dev, #endif Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Fri Apr 26 17:28:06 2019 (r346758) +++ head/stand/loader.mk Fri Apr 26 17:58:44 2019 (r346759) @@ -31,7 +31,7 @@ SRCS+= metadata.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -SRCS+= disk.c part.c +SRCS+= disk.c part.c vdisk.c .endif .if ${LOADER_NET_SUPPORT:Uno} == "yes" From owner-svn-src-head@freebsd.org Fri Apr 26 18:26:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF13159AC0E; Fri, 26 Apr 2019 18:26:00 +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 9071577DA4; Fri, 26 Apr 2019 18:26:00 +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 677CEF791; Fri, 26 Apr 2019 18:26:00 +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 x3QIQ0wR044852; Fri, 26 Apr 2019 18:26:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QIQ0pT044851; Fri, 26 Apr 2019 18:26:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904261826.x3QIQ0pT044851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 26 Apr 2019 18:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346760 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 346760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9071577DA4 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.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 18:26:01 -0000 Author: mav Date: Fri Apr 26 18:25:59 2019 New Revision: 346760 URL: https://svnweb.freebsd.org/changeset/base/346760 Log: Fix minor mismerges. No functional change. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri Apr 26 17:58:44 2019 (r346759) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri Apr 26 18:25:59 2019 (r346760) @@ -84,7 +84,7 @@ void range_tree_init(void); void range_tree_fini(void); range_tree_t *range_tree_create_impl(range_tree_ops_t *ops, void *arg, int (*avl_compare)(const void*, const void*), uint64_t gap); - range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); void range_tree_destroy(range_tree_t *rt); boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); range_seg_t *range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size); @@ -108,13 +108,6 @@ void range_tree_clear(range_tree_t *rt, uint64_t start void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); range_seg_t *range_tree_first(range_tree_t *rt); - -void rt_avl_create(range_tree_t *rt, void *arg); -void rt_avl_destroy(range_tree_t *rt, void *arg); -void rt_avl_add(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_remove(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_vacate(range_tree_t *rt, void *arg); -extern struct range_tree_ops rt_avl_ops; void rt_avl_create(range_tree_t *rt, void *arg); void rt_avl_destroy(range_tree_t *rt, void *arg); From owner-svn-src-head@freebsd.org Fri Apr 26 18:28:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA98159ACB7; Fri, 26 Apr 2019 18:28:55 +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 E3F7A77F23; Fri, 26 Apr 2019 18:28:54 +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 B72CEF793; Fri, 26 Apr 2019 18:28:54 +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 x3QISsOl045006; Fri, 26 Apr 2019 18:28:54 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QISsF4045005; Fri, 26 Apr 2019 18:28:54 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904261828.x3QISsF4045005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 26 Apr 2019 18:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346761 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3F7A77F23 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.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 18:28:55 -0000 Author: bde Date: Fri Apr 26 18:28:54 2019 New Revision: 346761 URL: https://svnweb.freebsd.org/changeset/base/346761 Log: Use __VGLBitmapCopy() directly to show the mouse cursor. The mouse cursor must be merged with the shadow buffer on the way to the screen, and __VGLBitmapCopy() now has an option to do exactly that. This is insignificantly less efficient. Modified: head/lib/libvgl/mouse.c Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Fri Apr 26 18:25:59 2019 (r346760) +++ head/lib/libvgl/mouse.c Fri Apr 26 18:28:54 2019 (r346761) @@ -105,24 +105,11 @@ static volatile sig_atomic_t VGLMsuppressint; void VGLMousePointerShow() { - byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4]; - VGLBitmap buffer = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf); - int pos; - if (!VGLMouseVisible) { INTOFF(); VGLMouseVisible = 1; - buffer.PixelBytes = VGLDisplay->PixelBytes; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, - &buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - for (pos = 0; pos < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; pos++) - if (VGLMouseAndMask->Bitmap[pos]) - bcopy(&VGLMouseOrMask->Bitmap[pos*VGLDisplay->PixelBytes], - &buffer.Bitmap[pos*VGLDisplay->PixelBytes], - VGLDisplay->PixelBytes); - __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); INTON(); } } From owner-svn-src-head@freebsd.org Fri Apr 26 19:02:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51F3E159B6F1; Fri, 26 Apr 2019 19:02:22 +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 ED95A812AD; Fri, 26 Apr 2019 19:02:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB0FEFE43; Fri, 26 Apr 2019 19:02:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3QJ2LHr066031; Fri, 26 Apr 2019 19:02:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QJ2LaW066030; Fri, 26 Apr 2019 19:02:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904261902.x3QJ2LaW066030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 26 Apr 2019 19:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346762 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 346762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED95A812AD 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.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 19:02:22 -0000 Author: mav Date: Fri Apr 26 19:02:21 2019 New Revision: 346762 URL: https://svnweb.freebsd.org/changeset/base/346762 Log: Add mutex_destroy() missed in r334844. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Apr 26 18:28:54 2019 (r346761) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Apr 26 19:02:21 2019 (r346762) @@ -498,8 +498,10 @@ dsl_pool_close(dsl_pool_t *dp) rrw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); taskq_destroy(dp->dp_vnrele_taskq); - if (dp->dp_blkstats != NULL) + if (dp->dp_blkstats != NULL) { + mutex_destroy(&dp->dp_blkstats->zab_lock); kmem_free(dp->dp_blkstats, sizeof (zfs_all_blkstats_t)); + } kmem_free(dp, sizeof (dsl_pool_t)); } From owner-svn-src-head@freebsd.org Fri Apr 26 20:15:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E22159CEA6; Fri, 26 Apr 2019 20:15:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 787FE83BC4; Fri, 26 Apr 2019 20:15:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5255218AC8; Fri, 26 Apr 2019 20:15:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3QKFmDO003799; Fri, 26 Apr 2019 20:15:48 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3QKFman003798; Fri, 26 Apr 2019 20:15:48 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904262015.x3QKFman003798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 26 Apr 2019 20:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346765 - head/sys/modules/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/modules/fusefs X-SVN-Commit-Revision: 346765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 787FE83BC4 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.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 20:15:49 -0000 Author: asomers Date: Fri Apr 26 20:15:47 2019 New Revision: 346765 URL: https://svnweb.freebsd.org/changeset/base/346765 Log: Don't symlink fusefs.ko to fuse.ko on PPC Some PPC systems (PowerNV) use msdosfs for /boot, which can't handle either symlinks or hardlinks. So on PPC, copy the module instead. This change fixes installkernel on such systems after r345350. Reported by: Brandon Bergren Reviewed by: jhibbits, rgrimes MFC after: 2 weeks MFC-With: 345350, 346441 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19993 Modified: head/sys/modules/fusefs/Makefile Modified: head/sys/modules/fusefs/Makefile ============================================================================== --- head/sys/modules/fusefs/Makefile Fri Apr 26 19:54:46 2019 (r346764) +++ head/sys/modules/fusefs/Makefile Fri Apr 26 20:15:47 2019 (r346765) @@ -8,6 +8,22 @@ SRCS= vnode_if.h \ fuse_vfsops.c fuse_vnops.c fuse_internal.c fuse_main.c # Symlink for backwards compatibility with systems installed at 12.0 or older +.if ${MACHINE_CPUARCH} != "powerpc" SYMLINKS= ${KMOD}.ko ${KMODDIR}/fuse.ko +.else +# Some PPC systems use msdosfs for /boot, which can't handle links or symlinks +afterinstall: alias alias_debug +alias: .PHONY + ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/fuse.ko +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && "${MK_KERNEL_SYMBOLS}" != "no" +alias_debug: .PHONY + ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG}.debug \ + ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/fuse.ko +.else +alias_debug: .PHONY +.endif +.endif .include From owner-svn-src-head@freebsd.org Sat Apr 27 00:53:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A98EA15A2EB1; Sat, 27 Apr 2019 00:53:42 +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 4F34E8E6A6; Sat, 27 Apr 2019 00:53:42 +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 259EF1BA46; Sat, 27 Apr 2019 00:53:42 +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 x3R0rgg3056132; Sat, 27 Apr 2019 00:53:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3R0rf9u056130; Sat, 27 Apr 2019 00:53:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904270053.x3R0rf9u056130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Apr 2019 00:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346771 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 346771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F34E8E6A6 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.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 00:53:43 -0000 Author: jhibbits Date: Sat Apr 27 00:53:41 2019 New Revision: 346771 URL: https://svnweb.freebsd.org/changeset/base/346771 Log: powerpc: micro-optimize cpu_switch() Since the non-volatile registers are restored at the end of cpu_switchin (of the new thread) they're free for us to use for our own purposes. Load the PCB_FLAGS into a non-volatile register so it's preserved across the C function calls that manage FPU and altivec state. This removes 4 loads from each file. Might be a trivial performance improvement (~12 clock cycles per context switch). MFC after: 3 weeks Modified: head/sys/powerpc/powerpc/swtch32.S head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Fri Apr 26 22:18:22 2019 (r346770) +++ head/sys/powerpc/powerpc/swtch32.S Sat Apr 27 00:53:41 2019 (r346771) @@ -98,17 +98,16 @@ ENTRY(cpu_switch) mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ - lwz %r7,PCB_FLAGS(%r17) + lwz %r18,PCB_FLAGS(%r17) /* Save FPU context if needed */ - andi. %r7, %r7, PCB_FPU + andi. %r7, %r18, PCB_FPU beq .L1 bl save_fpu .L1: mr %r3,%r14 /* restore old thread ptr */ - lwz %r7,PCB_FLAGS(%r17) /* Save Altivec context if needed */ - andi. %r7, %r7, PCB_VEC + andi. %r7, %r18, PCB_VEC beq .L2 bl save_vec @@ -151,17 +150,16 @@ blocked_loop: mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ - lwz %r6, PCB_FLAGS(%r17) + lwz %r19, PCB_FLAGS(%r17) /* Restore FPU context if needed */ - andi. %r6, %r6, PCB_FPU + andi. %r6, %r19, PCB_FPU beq .L3 mr %r3,%r2 /* Pass curthread to enable_fpu */ bl enable_fpu .L3: - lwz %r6, PCB_FLAGS(%r17) /* Restore Altivec context if needed */ - andi. %r6, %r6, PCB_VEC + andi. %r6, %r19, PCB_VEC beq .L4 mr %r3,%r2 /* Pass curthread to enable_vec */ bl enable_vec Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Fri Apr 26 22:18:22 2019 (r346770) +++ head/sys/powerpc/powerpc/swtch64.S Sat Apr 27 00:53:41 2019 (r346771) @@ -125,26 +125,24 @@ ENTRY(cpu_switch) stdu %r1,-48(%r1) - lwz %r7, PCB_FLAGS(%r17) - andi. %r7, %r7, PCB_CDSCR + lwz %r18, PCB_FLAGS(%r17) + andi. %r7, %r18, PCB_CDSCR beq .L0 /* Custom DSCR was set. Reseting it to enter kernel */ - li %r7, 0x0 - mtspr SPR_DSCR, %r7 + li %r6, 0x0 + mtspr SPR_DSCR, %r6 .L0: - lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ - andi. %r7, %r7, PCB_FPU + andi. %r7, %r18, PCB_FPU beq .L1 bl save_fpu nop .L1: mr %r3,%r14 /* restore old thread ptr */ - lwz %r7,PCB_FLAGS(%r17) /* Save Altivec context if needed */ - andi. %r7, %r7, PCB_VEC + andi. %r7, %r18, PCB_VEC beq .L2 bl save_vec nop @@ -186,30 +184,28 @@ blocked_loop: bl pmap_activate /* Activate the new address space */ nop - lwz %r6, PCB_FLAGS(%r17) + lwz %r19, PCB_FLAGS(%r17) /* Restore FPU context if needed */ - andi. %r6, %r6, PCB_FPU + andi. %r6, %r19, PCB_FPU beq .L3 mr %r3,%r13 /* Pass curthread to enable_fpu */ bl enable_fpu nop .L3: - lwz %r6, PCB_FLAGS(%r17) /* Restore Altivec context if needed */ - andi. %r6, %r6, PCB_VEC + andi. %r6, %r19, PCB_VEC beq .L31 mr %r3,%r13 /* Pass curthread to enable_vec */ bl enable_vec nop .L31: - lwz %r6, PCB_FLAGS(%r17) /* Restore Custom DSCR if needed */ - andi. %r6, %r6, PCB_CDSCR + andi. %r6, %r19, PCB_CDSCR beq .L4 - ld %r6, PCB_DSCR(%r17) /* Load the DSCR register*/ - mtspr SPR_DSCR, %r6 + ld %r7, PCB_DSCR(%r17) /* Load the DSCR register*/ + mtspr SPR_DSCR, %r7 /* thread to restore is in r3 */ .L4: From owner-svn-src-head@freebsd.org Sat Apr 27 02:33:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A6471582369; Sat, 27 Apr 2019 02:33:51 +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 B2C7E6ACE0; Sat, 27 Apr 2019 02:33:50 +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 817BC1CB0F; Sat, 27 Apr 2019 02:33:50 +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 x3R2XoTp009147; Sat, 27 Apr 2019 02:33:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3R2XnLU009143; Sat, 27 Apr 2019 02:33:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904270233.x3R2XnLU009143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Apr 2019 02:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346777 - in head/sys/powerpc: aim include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 346777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2C7E6ACE0 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.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 02:33:51 -0000 Author: jhibbits Date: Sat Apr 27 02:33:49 2019 New Revision: 346777 URL: https://svnweb.freebsd.org/changeset/base/346777 Log: powerpc: Add POWER8NVL definition The POWER8NVL (POWER8 NVLink) architecturally behaves identically to the POWER8, with a different PVR identifier. Mark it as such, so it shows up appropriately to the user. Reported by: Alexey Kardashevskiy MFC after: 2 weeks Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat Apr 27 02:24:58 2019 (r346776) +++ head/sys/powerpc/aim/aim_machdep.c Sat Apr 27 02:33:49 2019 (r346777) @@ -213,6 +213,7 @@ aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_of case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: /* XXX: get from ibm,slb-size in device tree */ n_slbs = 32; Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Apr 27 02:24:58 2019 (r346776) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Apr 27 02:33:49 2019 (r346777) @@ -85,6 +85,7 @@ cpudep_ap_early_bootstrap(void) break; case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: #ifdef __powerpc64__ if (mfmsr() & PSL_HV) { @@ -404,6 +405,7 @@ cpudep_ap_setup() case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: #ifdef __powerpc64__ if (mfmsr() & PSL_HV) { Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Apr 27 02:24:58 2019 (r346776) +++ head/sys/powerpc/include/spr.h Sat Apr 27 02:33:49 2019 (r346777) @@ -188,6 +188,7 @@ #define IBMPOWERPCA2 0x0049 #define IBMPOWER7PLUS 0x004a #define IBMPOWER8E 0x004b +#define IBMPOWER8NVL 0x004c #define IBMPOWER8 0x004d #define IBMPOWER9 0x004e #define MPC860 0x0050 Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat Apr 27 02:24:58 2019 (r346776) +++ head/sys/powerpc/powerpc/cpu.c Sat Apr 27 02:33:49 2019 (r346777) @@ -171,6 +171,13 @@ static const struct cputab models[] = { PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, + { "IBM POWER8NVL", IBMPOWER8NVL, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, { "IBM POWER8", IBMPOWER8, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | @@ -670,6 +677,7 @@ cpu_powerx_setup(int cpuid, uint16_t vers) switch (vers) { case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: cpu_idle_hook = cpu_idle_powerx; mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_PECE_WAKESET); isync(); From owner-svn-src-head@freebsd.org Sat Apr 27 08:51:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B0B5158A374 for ; Sat, 27 Apr 2019 08:51:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-13.consmr.mail.bf2.yahoo.com (sonic311-13.consmr.mail.bf2.yahoo.com [74.6.131.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2C0D75A38 for ; Sat, 27 Apr 2019 08:51:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: LlxWHhkVM1msRXNzy4wk8dQcuD1y_3a4LdJHPJcEEtDOXwWels8.bTDAdTtApN0 nHS6p7stPpsb6yKz._B9iPchJbp6eokq7cJKZ7hXWfiDQsc1LBcnVZvfgeKz1klwXi5lzFwRSukp a2hSwJQL4S8zvXUXoWh116KBeaEwtWCqF_5g0dA3fAZP5euYIXU1b2KjiRY0ox12v.L1pe0xGKSA laYJVbjVi8PeTAEW27xc0RDZ7namilVjYvINyYQ6sGZ6uZboPYtN9LgruQhYmvONJAut2XOls7JN cetEL7JgZ6Pr0l_JXbhGjTEWe1qS9S8p3dEFkPeYG3cme1KuUavXUlNC4RZvvwFZskPuYMsVicMK m6hWavi9ocBKlNQAFsOLN6tbPacjg03TYgasBpduQG33S.iPra1brcl08zxgmgN.eDfWsXS9o4v8 Rxxea3.TWMXnjiQUYQZRQzYYS5BgyLMjB1CNFUMDlXe4XwTrPxpesRyZeRVjwIukEtzZWtH2srz7 yR9c5qlzkdA5cvZZ4kTLJzma6AZje5ZLCNVRAx7Lp9gowBJdFhr8z9ODJTPgFukDtxzyYL0Jq7po CyzN5YMTX3HKmUmAgzhX7cAzoSstYZ8bAJpSx1HtMwxvqGdh4ajJBInuxJe97REVAuIyK1RswAO7 qNwjfAm5xWbBPLFlKI7XcXqjjY_tQtTiyI5afznM.lGfwsgi_ha4ev2gXpXNxIrAk28ziar7d51C tX5mVN7q77jkEhAgT7dkE93I_MCh8UBB_65nfVFoCHaO06nZRamPmpfhgDw0nJ8kFpW0yJW8DLO5 mgqTj90fNPldImrYDtyKM.GEVQcHbJa4YF4zRaU_BIbfC4tjEI6H0K7I.rH0cbMyt2ddgRGmtCbc lqzE75FwQdiF6yPBDHy0tP5htf3wSzjrSA7I3ZeXDseHR.xvBg2CMHKdmLln1xHl6gfuqAdb7z25 pDmMDf7jcoasT_8OFoarcDSe8yCXIalfr6Htzv1aNrr00qSpw11mKbK3YOb1kn1nzTQ30Il3XIoN R8to6kJRK6l3a4j5rNQ2WZ3lnfYa0pTklRO3D3DX7W6nvM.fwZxf0opSFypf_0LBGqdDme5DehhY RGn8izu32TrzlHw.dRgL4Uv4PywanXlZREonnJtVAEyPNTDxMlhXHC2u95RlS4URt4Zue1xh.394 WpWPB Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Sat, 27 Apr 2019 08:50:55 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp412.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 72364bc812dd473439ca6bd33c1d4c63; Sat, 27 Apr 2019 08:50:50 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346588 - head/lib/libc/powerpc64/string Message-Id: Date: Sat, 27 Apr 2019 01:50:48 -0700 To: svn-src-head@freebsd.org, Justin Hibbits X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: D2C0D75A38 X-Spamd-Bar: ++++ X-Spamd-Result: default: False [4.67 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.84)[0.844,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.43)[ip: (4.38), ipnet: 74.6.128.0/21(1.57), asn: 26101(1.26), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.92)[0.916,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.99)[0.990,0]; RCVD_IN_DNSWL_NONE(0.00)[123.131.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 08:51:02 -0000 Justin Hibbits jhibbits at FreeBSD.org wrote on Fri Apr 26 16:21:47 UTC 2019 : > This actually uses 'cmpb' which is only available on PowerISA 2.05+, = so > I'll need to pull it out for now, and re-enable it once we have > ifuncs. As it stands, this commit broke the G5 and POWER4/POWER5. As I understand the code like: xor %r8,%r8,%r8 /* %r8 <- Zero. */ xor %r0,%r5,%r6 /* Check if double words are different. = */ cmpb %r7,%r5,%r8 /* Check if double words contain zero. = */ /* * If double words are different or contain zero, * find what byte is different or contains zero, * else load next double words. */ or. %r9,%r7,%r0 bne .Lstrcmp_check_zeros_differences (and similarly for the loop. . .): A) Each byte of %r5 that is non-zero needs that byte of %r7 to be zero. B) Each byte of %r5 that is zero need that byte of %r7 to be non-zero. (cmpb assigns 0xff for non-zero as I understand, but even one non-zero bit is sufficient for the overall code structure.) If I've got that much correct, then the following might be an alternative to cmpb for now. I'll explain the code via commented c/c++-ish code and then show the assembler notation: unsigned long ul_has_zero_byte(unsigned long b) { unsigned long constexpr low_7bits_of_bytes{0x7f7f7f7f'7f7f7f7ful}; // Illustrating = byte transformations: unsigned long const x=3D b & low_7bits_of_bytes; // 0x00->0x00, = 0x80->0x00, other->ms-bit-in-byte=3D=3D0 unsigned long const y=3D x + low_7bits_of_bytes; // ->0x7f, = ->0x7f, ->ms-bit-in-byte=3D=3D1 unsigned long const z=3D b | y | low_7bits_of_bytes; // ->0x7f, = ->0xff, ->0xff return ~z; // ->0x80, = ->0x00, ->0x00 } (used in a powerpc64 context, so unsigned long being 64 bits). So, not using %r8 as zero but for a different value, each cmpb can be replaced by: # Only once to set up the value in %r8 (Note: 32639=3D0x7f7f): lis r8,32639 ori r8,r8,32639 rldimi r8,r8,32,0 # each "cmpb %r7,%r5,%r8" replaced by: and r7,r5,r8 add r7,r7,r8 nor r5,r7,r5 andc r5,r5,r8 (The code is from compiler output, but with registers adjusted to match the context.) The c/c++-ish code came from thinking about material from Hacker's Delight Second Edition and the specific criteria needed here: it uses part of Figure 6-2 "Find First 0-Byte, branch-free code", adjusted for width and for returning something sufficient here. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Apr 27 14:48:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D898C15947B0; Sat, 27 Apr 2019 14:48:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB9D880DE; Sat, 27 Apr 2019 14:48:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A3FA24809; Sat, 27 Apr 2019 14:48:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3REmSoo092493; Sat, 27 Apr 2019 14:48:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3REmSnv092491; Sat, 27 Apr 2019 14:48:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904271448.x3REmSnv092491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 27 Apr 2019 14:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346787 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 346787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DB9D880DE 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.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 14:48:29 -0000 Author: manu Date: Sat Apr 27 14:48:27 2019 New Revision: 346787 URL: https://svnweb.freebsd.org/changeset/base/346787 Log: arm64: allwinner: Add compatible strings for clock devices used on both Allwinner H3 and H5 Allwinner H3 and H5 share many internal components, that's why they can use the same drivers. This patch adds the compatible strings to enable clock drivers probing on Allwinner NanoPI NEO2 device. Tested on: NanoPi NEO2 (by submitter), OrangePi PC2 (by manu) Submitted by: Manuel Stühn (freebsdnewbie@freenet.de) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D20069 Modified: head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/aw_syscon.c Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Sat Apr 27 05:35:51 2019 (r346786) +++ head/sys/arm/allwinner/aw_rtc.c Sat Apr 27 14:48:27 2019 (r346787) @@ -137,6 +137,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, + { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Sat Apr 27 05:35:51 2019 (r346786) +++ head/sys/arm/allwinner/aw_syscon.c Sat Apr 27 14:48:27 2019 (r346787) @@ -53,6 +53,7 @@ static struct ofw_compat_data compat_data[] = { {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, {"allwinner,sun8i-h3-system-control", 1}, + {"allwinner,sun50i-h5-system-control", 1}, {NULL, 0} }; From owner-svn-src-head@freebsd.org Sat Apr 27 14:56:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918E71594AC3; Sat, 27 Apr 2019 14:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3400D88603; Sat, 27 Apr 2019 14:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EEE9249BD; Sat, 27 Apr 2019 14:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3REuOYN097622; Sat, 27 Apr 2019 14:56:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3REuOtV097621; Sat, 27 Apr 2019 14:56:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904271456.x3REuOtV097621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 27 Apr 2019 14:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346788 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 346788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3400D88603 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.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 14:56:25 -0000 Author: manu Date: Sat Apr 27 14:56:24 2019 New Revision: 346788 URL: https://svnweb.freebsd.org/changeset/base/346788 Log: arm64: allwinner: ccu_de2: Remove H5 compatible We don't have the display engine driver commited in FreeBSD yet so it is useless to expose the clocks yet (and also it have not been tested on H5). Reported by: Manuel Stühn (freebsdnewbie@freenet.de) PR: 237571 MFC after: 1 week Modified: head/sys/arm/allwinner/clkng/ccu_de2.c Modified: head/sys/arm/allwinner/clkng/ccu_de2.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_de2.c Sat Apr 27 14:48:27 2019 (r346787) +++ head/sys/arm/allwinner/clkng/ccu_de2.c Sat Apr 27 14:56:24 2019 (r346788) @@ -115,7 +115,6 @@ static struct aw_ccung_clk de2_ccu_clks[] = { static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-de2-clk", 1}, - {"allwinner,sun50i-h5-de2-clk", 1}, {NULL, 0} }; From owner-svn-src-head@freebsd.org Sat Apr 27 14:59:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155D31594B7C; Sat, 27 Apr 2019 14:59:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD43788784; Sat, 27 Apr 2019 14:59:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847ED249C0; Sat, 27 Apr 2019 14:59:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3REx8rm097779; Sat, 27 Apr 2019 14:59:08 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3REx8QM097778; Sat, 27 Apr 2019 14:59:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904271459.x3REx8QM097778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 27 Apr 2019 14:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346789 - head/sys/arm/allwinner/a10 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/a10 X-SVN-Commit-Revision: 346789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD43788784 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.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 14:59:09 -0000 Author: manu Date: Sat Apr 27 14:59:08 2019 New Revision: 346789 URL: https://svnweb.freebsd.org/changeset/base/346789 Log: arm: allwinner: a10: Correct pin functions PB20 and PB21 alternate function 1 is i2c2 not i2c1 Reported by: Horiki Mori (yamori813@yahoo.co.jp) PR: 237401 MFC after: 1 week Modified: head/sys/arm/allwinner/a10/a10_padconf.c Modified: head/sys/arm/allwinner/a10/a10_padconf.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_padconf.c Sat Apr 27 14:56:24 2019 (r346788) +++ head/sys/arm/allwinner/a10/a10_padconf.c Sat Apr 27 14:59:08 2019 (r346789) @@ -77,8 +77,8 @@ const static struct allwinner_pins a10_pins[] = { {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, From owner-svn-src-head@freebsd.org Sat Apr 27 15:23:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 970F81595679; Sat, 27 Apr 2019 15:23:09 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECB5089516; Sat, 27 Apr 2019 15:23:08 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 75f35a9e; Sat, 27 Apr 2019 17:23:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=Iup1rIuLlWa1 CBEJDkG54lpj9qQ=; b=O3tVd3hrjWJ+lYWjWlIbfn9ioXGiRUb1/w3bnRUfS90e tVv+aSF+ibzPjuS6oouuAGA14gHTO69qE8RXfQsvEReMOKc5im00Z3LzCv9z3IaP axDuS9bhi560nmVeu1QhCjX/NkcRartGjNFXbNMB8Ll2FDZm65iUB0lj53UDpzg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=JIfDcO FgRW3QwJORVmqPjVveWAurg1TZ2yYobsJHgs6h6HQUHDS54Q+xlUGzo+hf5OJaCd oGc5OadsdH/BmUFmXn9oIKHmcNMqZdZOHveKAmaJfiIB4lpkRrE3g4HfoIOZz8Gi FBdPeCz8ldl+d5xLOQzEljK+OTv9QLbWuNQDM= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 55d5dd0e TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 27 Apr 2019 17:23:00 +0200 (CEST) Date: Sat, 27 Apr 2019 17:23:00 +0200 From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346788 - head/sys/arm/allwinner/clkng Message-Id: <20190427172300.eee4575d5a4049b5b11de741@bidouilliste.com> In-Reply-To: <201904271456.x3REuOtV097621@repo.freebsd.org> References: <201904271456.x3REuOtV097621@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: ECB5089516 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 15:23:09 -0000 On Sat, 27 Apr 2019 14:56:24 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Sat Apr 27 14:56:24 2019 > New Revision: 346788 > URL: https://svnweb.freebsd.org/changeset/base/346788 >=20 > Log: > arm64: allwinner: ccu_de2: Remove H5 compatible > =20 > We don't have the display engine driver commited in FreeBSD yet so it is > useless to expose the clocks yet (and also it have not been tested on H= 5). My initial though were wrong. I though I've never tested the clocks on H5 but I did (but the full display engine wasn't tested). What happened is that since r346271 aw_rtc now attaches at BUS_PASS_BUS + MIDDLE as it exposes clocks used by the ccu (clock and control unit) and the CCU attaches at BUS_PASS_BUS + LAST which is the same bus pass as the de2_ccu. Since the de2ccu node is before the ccu node in the DTB it is processed first. A proper fix would be to check if the needed clocks are already registed in the probe function. And this I guess a lots of driver will need this I'll see how to make a generic function that drivers could use. =20 > Reported by: Manuel St=FChn (freebsdnewbie@freenet.de) > PR: 237571 > MFC after: 1 week >=20 > Modified: > head/sys/arm/allwinner/clkng/ccu_de2.c >=20 > Modified: head/sys/arm/allwinner/clkng/ccu_de2.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/arm/allwinner/clkng/ccu_de2.c Sat Apr 27 14:48:27 2019 (r346= 787) > +++ head/sys/arm/allwinner/clkng/ccu_de2.c Sat Apr 27 14:56:24 2019 (r346= 788) > @@ -115,7 +115,6 @@ static struct aw_ccung_clk de2_ccu_clks[] =3D { > =20 > static struct ofw_compat_data compat_data[] =3D { > {"allwinner,sun50i-a64-de2-clk", 1}, > - {"allwinner,sun50i-h5-de2-clk", 1}, > {NULL, 0} > }; > =20 --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Sat Apr 27 16:28:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7B811597095; Sat, 27 Apr 2019 16:28:36 +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 7D47E8B525; Sat, 27 Apr 2019 16:28:36 +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 57E6025936; Sat, 27 Apr 2019 16:28:36 +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 x3RGSajj044700; Sat, 27 Apr 2019 16:28:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3RGSZh9044693; Sat, 27 Apr 2019 16:28:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904271628.x3RGSZh9044693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Apr 2019 16:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346790 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 346790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D47E8B525 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.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 16:28:37 -0000 Author: jhibbits Date: Sat Apr 27 16:28:34 2019 New Revision: 346790 URL: https://svnweb.freebsd.org/changeset/base/346790 Log: powerpc64: Add the DSCR facility on POWER8 and later The Data Stream Control Register (DSCR) is privileged on POWER7, but unprivileged (different register) on POWER8 and later. However, it's now guarded by a new register, the Facility Status and Control Register, instead of the MSR like other pre-existing facilities (FPU, Altivec). The FSCR must be managed explicitly, since it's effectively an extension of the MSR. Tested by: Brandon Bergren Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/swtch64.S head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/include/pcb.h Sat Apr 27 16:28:34 2019 (r346790) @@ -47,6 +47,7 @@ struct pcb { register_t pcb_toc; /* toc pointer */ register_t pcb_lr; /* link register */ register_t pcb_dscr; /* dscr value */ + register_t pcb_fscr; struct pmap *pcb_pm; /* pmap of our vmspace */ jmp_buf *pcb_onfault; /* For use during copyin/copyout */ @@ -57,6 +58,7 @@ struct pcb { #define PCB_VSX 0x8 /* Process had VSX initialized */ #define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */ #define PCB_HTM 0x20 /* Process had HTM initialized */ +#define PCB_CFSCR 0x40 /* Process had FSCR updated */ struct fpu { union { double fpr; Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/include/spr.h Sat Apr 27 16:28:34 2019 (r346790) @@ -93,11 +93,12 @@ #define SPR_MQ 0x000 /* .6. 601 MQ register */ #define SPR_XER 0x001 /* 468 Fixed Point Exception Register */ +#define SPR_DSCR 0x003 /* .6. Data Stream Control Register (Unprivileged) */ #define SPR_RTCU_R 0x004 /* .6. 601 RTC Upper - Read */ #define SPR_RTCL_R 0x005 /* .6. 601 RTC Lower - Read */ #define SPR_LR 0x008 /* 468 Link Register */ #define SPR_CTR 0x009 /* 468 Count Register */ -#define SPR_DSCR 0x011 /* Data Stream Control Register */ +#define SPR_DSCRP 0x011 /* Data Stream Control Register (Privileged) */ #define SPR_DSISR 0x012 /* .68 DSI exception source */ #define DSISR_DIRECT 0x80000000 /* Direct-store error exception */ #define DSISR_NOTFOUND 0x40000000 /* Translation not found */ @@ -135,6 +136,7 @@ #define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ #define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ #define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ +#define FSCR_DSCR 0x0000000000000004ULL /* DSCR available in PR state */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 27 16:28:34 2019 (r346790) @@ -124,6 +124,8 @@ static int grab_mcontext32(struct thread *td, mcontext static int grab_mcontext(struct thread *, mcontext_t *, int); +static void cleanup_power_extras(struct thread *); + #ifdef __powerpc64__ extern struct sysentvec elf64_freebsd_sysvec_v2; #endif @@ -506,6 +508,30 @@ set_mcontext(struct thread *td, mcontext_t *mcp) } /* + * Clean up extra POWER state. Some per-process registers and states are not + * managed by the MSR, so must be cleaned up explicitly on thread exit. + * + * Currently this includes: + * DSCR -- Data stream control register (PowerISA 2.06+) + * FSCR -- Facility Status and Control Register (PowerISA 2.07+) + */ +static void +cleanup_power_extras(struct thread *td) +{ + uint32_t pcb_flags; + + if (td != curthread) + return; + + pcb_flags = td->td_pcb->pcb_flags; + /* Clean up registers not managed by MSR. */ + if (pcb_flags & PCB_CFSCR) + mtspr(SPR_FSCR, 0); + if (pcb_flags & PCB_CDSCR) + mtspr(SPR_DSCRP, 0); +} + +/* * Set set up registers on exec. */ void @@ -549,6 +575,7 @@ exec_setregs(struct thread *td, struct image_params *i tf->fixreg[12] = imgp->entry_addr; #endif tf->srr1 = psl_userset | PSL_FE_DFLT; + cleanup_power_extras(td); td->td_pcb->pcb_flags = 0; } @@ -574,6 +601,7 @@ ppc32_setregs(struct thread *td, struct image_params * tf->srr0 = imgp->entry_addr; tf->srr1 = psl_userset32 | PSL_FE_DFLT; + cleanup_power_extras(td); td->td_pcb->pcb_flags = 0; } #endif @@ -912,6 +940,7 @@ cpu_set_syscall_retval(struct thread *td, int error) void cpu_thread_exit(struct thread *td) { + cleanup_power_extras(td); } void @@ -1052,10 +1081,10 @@ emulate_mfspr(int spr, int reg, struct trapframe *fram td = curthread; - if (spr == SPR_DSCR) { + if (spr == SPR_DSCR || spr == SPR_DSCRP) { // If DSCR was never set, get the default DSCR if ((td->td_pcb->pcb_flags & PCB_CDSCR) == 0) - td->td_pcb->pcb_dscr = mfspr(SPR_DSCR); + td->td_pcb->pcb_dscr = mfspr(SPR_DSCRP); frame->fixreg[reg] = td->td_pcb->pcb_dscr; frame->srr0 += 4; @@ -1070,9 +1099,10 @@ emulate_mtspr(int spr, int reg, struct trapframe *fram td = curthread; - if (spr == SPR_DSCR) { + if (spr == SPR_DSCR || spr == SPR_DSCRP) { td->td_pcb->pcb_flags |= PCB_CDSCR; td->td_pcb->pcb_dscr = frame->fixreg[reg]; + mtspr(SPR_DSCRP, frame->fixreg[reg]); frame->srr0 += 4; return 0; } else Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/powerpc/genassym.c Sat Apr 27 16:28:34 2019 (r346790) @@ -196,6 +196,7 @@ ASSYM(CF_SIZE, sizeof(struct callframe)); ASSYM(PCB_CONTEXT, offsetof(struct pcb, pcb_context)); ASSYM(PCB_CR, offsetof(struct pcb, pcb_cr)); ASSYM(PCB_DSCR, offsetof(struct pcb, pcb_dscr)); +ASSYM(PCB_FSCR, offsetof(struct pcb, pcb_fscr)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TOC, offsetof(struct pcb, pcb_toc)); ASSYM(PCB_LR, offsetof(struct pcb, pcb_lr)); @@ -204,6 +205,7 @@ ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_FPU, PCB_FPU); ASSYM(PCB_VEC, PCB_VEC); ASSYM(PCB_CDSCR, PCB_CDSCR); +ASSYM(PCB_CFSCR, PCB_CFSCR); ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.aim.usr_vsid)); ASSYM(PCB_BOOKE_DBCR0, offsetof(struct pcb, pcb_cpu.booke.dbcr0)); Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/powerpc/swtch64.S Sat Apr 27 16:28:34 2019 (r346790) @@ -87,6 +87,10 @@ ENTRY(cpu_throw) * struct mutex *mtx); * * Switch to a new thread saving the current state in the old thread. + * + * Internally clobbers (not visible outside of this file): + * r18 - old thread pcb_flags + * r19 - new thread pcb_flags */ ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ @@ -126,11 +130,15 @@ ENTRY(cpu_switch) stdu %r1,-48(%r1) lwz %r18, PCB_FLAGS(%r17) + andi. %r7, %r18, PCB_CFSCR + beq 1f + mfspr %r6, SPR_FSCR + std %r6, PCB_FSCR(%r17) +1: andi. %r7, %r18, PCB_CDSCR beq .L0 - /* Custom DSCR was set. Reseting it to enter kernel */ - li %r6, 0x0 - mtspr SPR_DSCR, %r6 + mfspr %r6, SPR_DSCRP + std %r6, PCB_DSCR(%r17) .L0: /* Save FPU context if needed */ @@ -201,11 +209,20 @@ blocked_loop: nop .L31: - /* Restore Custom DSCR if needed */ - andi. %r6, %r19, PCB_CDSCR - beq .L4 + /* Load custom DSCR on PowerISA 2.06+ CPUs. */ + /* Load changed FSCR on PowerISA 2.07+ CPUs. */ + or %r18,%r18,%r19 + /* Restore Custom DSCR if needed (zeroes if in old but not new) */ + andi. %r6, %r18, PCB_CDSCR + beq .L32 ld %r7, PCB_DSCR(%r17) /* Load the DSCR register*/ - mtspr SPR_DSCR, %r7 + mtspr SPR_DSCRP, %r7 +.L32: + /* Restore FSCR if needed (zeroes if in old but not new) */ + andi. %r6, %r18, PCB_CFSCR + beq .L4 + ld %r7, PCB_FSCR(%r17) /* Load the FSCR register*/ + mtspr SPR_FSCR, %r7 /* thread to restore is in r3 */ .L4: Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sat Apr 27 14:59:08 2019 (r346789) +++ head/sys/powerpc/powerpc/trap.c Sat Apr 27 16:28:34 2019 (r346790) @@ -307,6 +307,12 @@ trap(struct trapframe *frame) fscr = mfspr(SPR_FSCR); if ((fscr & FSCR_IC_MASK) == FSCR_IC_HTM) { CTR0(KTR_TRAP, "Hardware Transactional Memory subsystem disabled"); + } else if ((fscr & FSCR_IC_MASK) == FSCR_IC_DSCR) { + td->td_pcb->pcb_flags |= PCB_CFSCR | PCB_CDSCR; + fscr &= ~FSCR_IC_MASK; + mtspr(SPR_FSCR, fscr | FSCR_DSCR); + mtspr(SPR_DSCR, 0); + break; } sig = SIGILL; ucode = ILL_ILLOPC; From owner-svn-src-head@freebsd.org Sat Apr 27 19:32:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C156D159AAC3; Sat, 27 Apr 2019 19:32:34 +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 629206BB1E; Sat, 27 Apr 2019 19:32:34 +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 356E3279A2; Sat, 27 Apr 2019 19:32:34 +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 x3RJWYRO048609; Sat, 27 Apr 2019 19:32:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3RJWYje048608; Sat, 27 Apr 2019 19:32:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904271932.x3RJWYje048608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Apr 2019 19:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346791 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 346791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 629206BB1E 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.997,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 19:32:35 -0000 Author: jhibbits Date: Sat Apr 27 19:32:33 2019 New Revision: 346791 URL: https://svnweb.freebsd.org/changeset/base/346791 Log: powerpc: Add SPR definitions for additional POWER8/POWER9 facilities This only adds the new SPR definitions and the associated FSCR bits. The facilities themselves will be added in separate commits. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Apr 27 16:28:34 2019 (r346790) +++ head/sys/powerpc/include/spr.h Sat Apr 27 19:32:33 2019 (r346791) @@ -136,7 +136,13 @@ #define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ #define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ #define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ +#define FSCR_SCV 0x0000000000001000ULL /* scv instruction available */ +#define FSCR_LM 0x0000000000000800ULL /* Load monitored facilities available */ +#define FSCR_MSGP 0x0000000000000400ULL /* msgsndp and SPRs available */ +#define FSCR_TAR 0x0000000000000100ULL /* TAR register available */ +#define FSCR_EBB 0x0000000000000080ULL /* Event-based branch available */ #define FSCR_DSCR 0x0000000000000004ULL /* DSCR available in PR state */ +#define SPR_DPDES 0x0b0 /* .6. Directed Privileged Doorbell Exception State Register */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ @@ -248,6 +254,7 @@ #define SPR_HMER 0x150 /* Hypervisor Maintenance Exception Register */ #define SPR_HMEER 0x151 /* Hypervisor Maintenance Exception Enable Register */ +#define SPR_TIR 0x1be /* .6. Thread Identification Register */ #define SPR_PTCR 0x1d0 /* Partition Table Control Register */ #define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ #define SPEFSCR_SOVH 0x80000000 @@ -408,6 +415,16 @@ #define SPR_MD_TWC 0x31d /* ..8 DMMU tablewalk control */ #define SPR_MD_RPN 0x31e /* ..8 DMMU real (phys) page number */ #define SPR_MD_TW 0x31f /* ..8 MMU tablewalk scratch */ +#define SPR_BESCRS 0x320 /* .6. Branch Event Status and Control Set Register */ +#define SPR_BESCRSU 0x321 /* .6. Branch Event Status and Control Set Register (upper 32-bit) */ +#define SPR_BESCRR 0x322 /* .6. Branch Event Status and Control Reset Register */ +#define SPR_BESCRRU 0x323 /* .6. Branch Event Status and Control Register (upper 32-bit) */ +#define SPR_EBBHR 0x324 /* .6. Event-based Branch Handler Register */ +#define SPR_EBBRR 0x325 /* .6. Event-based Branch Return Register */ +#define SPR_BESCR 0x326 /* .6. Branch Event Status and Control Register */ +#define SPR_LMRR 0x32d /* .6. Load Monitored Region Register */ +#define SPR_LMSER 0x32e /* .6. Load Monitored Section Enable Register */ +#define SPR_TAR 0x32f /* .6. Branch Target Address Register */ #define SPR_MI_CAM 0x330 /* ..8 IMMU CAM entry read */ #define SPR_MI_RAM0 0x331 /* ..8 IMMU RAM entry read reg 0 */ #define SPR_MI_RAM1 0x332 /* ..8 IMMU RAM entry read reg 1 */ From owner-svn-src-head@freebsd.org Sat Apr 27 22:30:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F9E159EFE0; Sat, 27 Apr 2019 22:30:24 +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 5D7D770E56; Sat, 27 Apr 2019 22:30:24 +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 3952D1764; Sat, 27 Apr 2019 22:30:24 +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 x3RMUOsx039247; Sat, 27 Apr 2019 22:30:24 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3RMUNL8039239; Sat, 27 Apr 2019 22:30:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904272230.x3RMUNL8039239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 27 Apr 2019 22:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346796 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 346796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D7D770E56 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.997,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Apr 2019 22:30:25 -0000 Author: jhibbits Date: Sat Apr 27 22:30:22 2019 New Revision: 346796 URL: https://svnweb.freebsd.org/changeset/base/346796 Log: powerpc: Add support for additional FSCR-managed facilities Add support to enable, save, and restore the following facilities: * Target Address Register (bctar) -- seemingly just another register to branch to. * Event-based branching -- an interrupt-like userspace event handler subsystem. * Load-monitored facility -- A facility that allows monitoring a range of physical memory, and triggering an event on access. Targeted to garbage collection software features. Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/swtch64.S head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Sat Apr 27 21:00:23 2019 (r346795) +++ head/sys/powerpc/include/pcb.h Sat Apr 27 22:30:22 2019 (r346796) @@ -48,6 +48,7 @@ struct pcb { register_t pcb_lr; /* link register */ register_t pcb_dscr; /* dscr value */ register_t pcb_fscr; + register_t pcb_tar; struct pmap *pcb_pm; /* pmap of our vmspace */ jmp_buf *pcb_onfault; /* For use during copyin/copyout */ @@ -81,6 +82,17 @@ struct pcb { uint64_t texasr; uint64_t tfiar; } pcb_htm; + + struct ebb { + uint64_t ebbhr; + uint64_t ebbrr; + uint64_t bescr; + } pcb_ebb; + + struct lmon { + uint64_t lmrr; + uint64_t lmser; + } pcb_lm; union { struct { Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Apr 27 21:00:23 2019 (r346795) +++ head/sys/powerpc/include/spr.h Sat Apr 27 22:30:22 2019 (r346796) @@ -135,13 +135,14 @@ #define FSCR_IC_TAR 0x0800000000000000ULL /* Access to Target Address Register */ #define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ #define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ +#define FSCR_IC_LM 0x0A00000000000000ULL /* Access to load monitored facility */ #define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ -#define FSCR_SCV 0x0000000000001000ULL /* scv instruction available */ -#define FSCR_LM 0x0000000000000800ULL /* Load monitored facilities available */ -#define FSCR_MSGP 0x0000000000000400ULL /* msgsndp and SPRs available */ -#define FSCR_TAR 0x0000000000000100ULL /* TAR register available */ -#define FSCR_EBB 0x0000000000000080ULL /* Event-based branch available */ -#define FSCR_DSCR 0x0000000000000004ULL /* DSCR available in PR state */ +#define FSCR_SCV 0x0000000000001000 /* scv instruction available */ +#define FSCR_LM 0x0000000000000800 /* Load monitored facilities available */ +#define FSCR_MSGP 0x0000000000000400 /* msgsndp and SPRs available */ +#define FSCR_TAR 0x0000000000000100 /* TAR register available */ +#define FSCR_EBB 0x0000000000000080 /* Event-based branch available */ +#define FSCR_DSCR 0x0000000000000004 /* DSCR available in PR state */ #define SPR_DPDES 0x0b0 /* .6. Directed Privileged Doorbell Exception State Register */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Apr 27 21:00:23 2019 (r346795) +++ head/sys/powerpc/powerpc/genassym.c Sat Apr 27 22:30:22 2019 (r346796) @@ -197,6 +197,7 @@ ASSYM(PCB_CONTEXT, offsetof(struct pcb, pcb_context)); ASSYM(PCB_CR, offsetof(struct pcb, pcb_cr)); ASSYM(PCB_DSCR, offsetof(struct pcb, pcb_dscr)); ASSYM(PCB_FSCR, offsetof(struct pcb, pcb_fscr)); +ASSYM(PCB_TAR, offsetof(struct pcb, pcb_tar)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TOC, offsetof(struct pcb, pcb_toc)); ASSYM(PCB_LR, offsetof(struct pcb, pcb_lr)); @@ -211,6 +212,13 @@ ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.a ASSYM(PCB_BOOKE_DBCR0, offsetof(struct pcb, pcb_cpu.booke.dbcr0)); ASSYM(PCB_VSCR, offsetof(struct pcb, pcb_vec.vscr)); + +ASSYM(PCB_EBB_EBBHR, offsetof(struct pcb, pcb_ebb.ebbhr)); +ASSYM(PCB_EBB_EBBRR, offsetof(struct pcb, pcb_ebb.ebbrr)); +ASSYM(PCB_EBB_BESCR, offsetof(struct pcb, pcb_ebb.bescr)); + +ASSYM(PCB_LMON_LMRR, offsetof(struct pcb, pcb_lm.lmrr)); +ASSYM(PCB_LMON_LMSER, offsetof(struct pcb, pcb_lm.lmser)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Sat Apr 27 21:00:23 2019 (r346795) +++ head/sys/powerpc/powerpc/swtch64.S Sat Apr 27 22:30:22 2019 (r346796) @@ -134,6 +134,27 @@ ENTRY(cpu_switch) beq 1f mfspr %r6, SPR_FSCR std %r6, PCB_FSCR(%r17) +save_ebb: + andi. %r0, %r6, FSCR_EBB + beq save_lm + mfspr %r7, SPR_EBBHR + std %r7, PCB_EBB_EBBHR(%r17) + mfspr %r7, SPR_EBBRR + std %r7, PCB_EBB_EBBRR(%r17) + mfspr %r7, SPR_BESCR + std %r7, PCB_EBB_BESCR(%r17) +save_lm: + andi. %r0, %r6, FSCR_LM + beq save_tar + mfspr %r7, SPR_LMRR + std %r7, PCB_LMON_LMRR(%r17) + mfspr %r7, SPR_LMSER + std %r7, PCB_LMON_LMSER(%r17) +save_tar: + andi. %r0, %r6, FSCR_TAR + beq 1f + mfspr %r7, SPR_TAR + std %r7, PCB_TAR(%r17) 1: andi. %r7, %r18, PCB_CDSCR beq .L0 @@ -223,6 +244,27 @@ blocked_loop: beq .L4 ld %r7, PCB_FSCR(%r17) /* Load the FSCR register*/ mtspr SPR_FSCR, %r7 +restore_ebb: + andi. %r0, %r7, FSCR_EBB + beq restore_lm + ld %r6, PCB_EBB_EBBHR(%r17) + mtspr SPR_EBBHR, %r6 + ld %r6, PCB_EBB_EBBRR(%r17) + mtspr SPR_EBBRR, %r6 + ld %r6, PCB_EBB_BESCR(%r17) + mtspr SPR_BESCR, %r6 +restore_lm: + andi. %r0, %r7, FSCR_LM + beq restore_tar + ld %r6, PCB_LMON_LMRR(%r17) + mtspr SPR_LMRR, %r6 + ld %r6, PCB_LMON_LMSER(%r17) + mtspr SPR_LMSER, %r6 +restore_tar: + andi. %r0, %r7, FSCR_TAR + beq .L4 + ld %r6, PCB_TAR(%r17) + mtspr SPR_TAR, %r6 /* thread to restore is in r3 */ .L4: Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sat Apr 27 21:00:23 2019 (r346795) +++ head/sys/powerpc/powerpc/trap.c Sat Apr 27 22:30:22 2019 (r346796) @@ -305,17 +305,41 @@ trap(struct trapframe *frame) case EXC_FAC: fscr = mfspr(SPR_FSCR); - if ((fscr & FSCR_IC_MASK) == FSCR_IC_HTM) { - CTR0(KTR_TRAP, "Hardware Transactional Memory subsystem disabled"); - } else if ((fscr & FSCR_IC_MASK) == FSCR_IC_DSCR) { + switch (fscr & FSCR_IC_MASK) { + case FSCR_IC_HTM: + CTR0(KTR_TRAP, + "Hardware Transactional Memory subsystem disabled"); + sig = SIGILL; + ucode = ILL_ILLOPC; + break; + case FSCR_IC_DSCR: td->td_pcb->pcb_flags |= PCB_CFSCR | PCB_CDSCR; - fscr &= ~FSCR_IC_MASK; - mtspr(SPR_FSCR, fscr | FSCR_DSCR); + fscr |= FSCR_DSCR; mtspr(SPR_DSCR, 0); break; + case FSCR_IC_EBB: + td->td_pcb->pcb_flags |= PCB_CFSCR; + fscr |= FSCR_EBB; + mtspr(SPR_EBBHR, 0); + mtspr(SPR_EBBRR, 0); + mtspr(SPR_BESCR, 0); + break; + case FSCR_IC_TAR: + td->td_pcb->pcb_flags |= PCB_CFSCR; + fscr |= FSCR_TAR; + mtspr(SPR_TAR, 0); + break; + case FSCR_IC_LM: + td->td_pcb->pcb_flags |= PCB_CFSCR; + fscr |= FSCR_LM; + mtspr(SPR_LMRR, 0); + mtspr(SPR_LMSER, 0); + break; + default: + sig = SIGILL; + ucode = ILL_ILLOPC; } - sig = SIGILL; - ucode = ILL_ILLOPC; + mtspr(SPR_FSCR, fscr & ~FSCR_IC_MASK); break; case EXC_HEA: sig = SIGILL;