From owner-svn-src-head@freebsd.org Sun Sep 3 05:38:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6545BE1C54D for ; Sun, 3 Sep 2017 05:38:43 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (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 26ED78348D for ; Sun, 3 Sep 2017 05:38:42 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (124-18-21-125.dz.commufa.jp [124.18.21.125]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id v835ccA5098784; Sun, 3 Sep 2017 14:38:39 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sun, 3 Sep 2017 14:38:38 +0900 From: Tomoaki AOKI To: svn-src-head@freebsd.org Cc: Warner Losh Subject: Re: svn commit: r322941 - head/sys/boot/efi/boot1 Message-Id: <20170903143838.16882954a0ce6d8a29e76333@dec.sakura.ne.jp> In-Reply-To: References: <20170902164311.eb7e5d2fa0e40f3b4e5e6142@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 03 Sep 2017 05:38:43 -0000 On Sat, 2 Sep 2017 11:26:50 -0600 Warner Losh wrote: > On Sat, Sep 2, 2017 at 11:25 AM, Warner Losh wrote: > > > > > > > On Sat, Sep 2, 2017 at 1:43 AM, Tomoaki AOKI > > wrote: > > > >> Hi. > >> > >> This broke boot drive selection functionality by smh@ at r295320 on > >> Feb.5, 2016. [1] > >> Now, even if I forcibly select 2nd HDD via UEFI firmware, boot1.efi > >> (as bootx64.efi) selects /boot/loader.efi on 1st HDD. Each boot > >> partition are ZFS pools. Confirmed previous rev was OK. > >> > >> Attached is the boot log (with EFI_DEBUG). Pool zsysS02 should be > >> selected there instead of zsysS01. As I have no serial console, there > >> can be some typos. (Took video and hand-typed.) > >> > >> The boot order should be as below (what smh@ implemented). > >> > >> 1. ZFS pool on which drive boot1.efi is read from. > >> 2. UFS partition on which drive boot1.efi is read from. > >> 3. If both 1 and 2 are missed, try from UEFI 1st drive and later. > >> > >> P.S. Another possibility (not tested yet): > >> Not forcibly prefer 1st drive, but reversed selection. > >> (If boot1.efi is on 1st drive, loader.efi on 2nd drive is read.) > >> > >> [1] > >> https://lists.freebsd.org/pipermail/svn-src-head/2016-Februa > >> ry/082215.html > > > > > > Looks like the matching function that I replaced this stuff with wasn't > > quite the same. Will fix. I hadn't thought I'd broken it, honestly, since > > the setup I have still worked. The intent was to keep things as they were, > > which clearly didn't happen in at least your case. I'll take a look at the > > logs to see if I can spot the differences between the two setups. The > > intent was to keep functionality, for now, the same. > > > > In the long term, though, this guessing and matching is going to end up > > first as deprecated and then as removed. To be replaced by a boot1.efi that > > follows the EFI Boot Manager protocol where exactly what to load is > > contained in EFI env variables. That's what all my changes to boot1 have > > been working towards. > > > > Warner > > Confirmed fixed (on both 1st [stable/11] and 2nd [head] HDD) on r323131. Thanks for your quick response! But one thing to mention. There could be problematic UEFI firmware and functions like this could be kept on required for workaround. (Like LenovoFix on gpart / geom.) > P.S. This is the doc I put together for discussion. I'm keeping it updated > as each stage is implemented. > > https://docs.google.com/document/d/1aK9IqF-60JPEbUeSAUAkYjF2W_8EnmczFs6RqCT90Jg/edit > > Lemme know if you have any comments. > > Warner Thanks for the info. Not yet, but I'll read it later and let you know if some comments looks needed. Thanks again! > > > > Author: imp > >> > Date: Sun Aug 27 03:10:16 2017 > >> > New Revision: 322941 > >> > URL: https://svnweb.freebsd.org/changeset/base/322941 > >> > > >> > Log: > >> > Eliminate redunant device path matching. > >> > > >> > Use efi_devpath_match instead of device_paths_match. They are > >> > functionally the same. Remove device_paths_match from boot1.c and call > >> > efi_devpath_match instead. > >> > > >> > Sponsored by: Netflix > >> > > >> > Modified: > >> > head/sys/boot/efi/boot1/boot1.c > >> > > >> > Modified: head/sys/boot/efi/boot1/boot1.c > >> > ============================================================ > >> ================== > >> > --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 23:13:18 2017 > >> (r322940) > >> > +++ head/sys/boot/efi/boot1/boot1.c Sun Aug 27 03:10:16 2017 > >> (r322941) > >> > @@ -76,53 +76,6 @@ Free(void *buf, const char *file __unused, int line > >> __ } > >> > > >> > /* > >> > - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes > >> match, > >> > - * FALSE otherwise. > >> > - */ > >> > -static BOOLEAN > >> > -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) > >> > -{ > >> > - size_t len; > >> > - > >> > - if (imgpath == NULL || imgpath->Type != devpath->Type || > >> > - imgpath->SubType != devpath->SubType) > >> > - return (FALSE); > >> > - > >> > - len = DevicePathNodeLength(imgpath); > >> > - if (len != DevicePathNodeLength(devpath)) > >> > - return (FALSE); > >> > - > >> > - return (memcmp(imgpath, devpath, (size_t)len) == 0); > >> > -} > >> > - > >> > -/* > >> > - * device_paths_match returns TRUE if the imgpath isn't NULL and all > >> nodes > >> > - * in imgpath and devpath match up to their respective occurrences of a > >> > - * media node, FALSE otherwise. > >> > - */ > >> > -static BOOLEAN > >> > -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) > >> > -{ > >> > - > >> > - if (imgpath == NULL) > >> > - return (FALSE); > >> > - > >> > - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) > >> { > >> > - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && > >> > - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) > >> > - return (TRUE); > >> > - > >> > - if (!nodes_match(imgpath, devpath)) > >> > - return (FALSE); > >> > - > >> > - imgpath = NextDevicePathNode(imgpath); > >> > - devpath = NextDevicePathNode(devpath); > >> > - } > >> > - > >> > - return (FALSE); > >> > -} > >> > - > >> > -/* > >> > * devpath_last returns the last non-path end node in devpath. > >> > */ > >> > static EFI_DEVICE_PATH * > >> > @@ -318,7 +271,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH > >> *imgpath, B > >> > if (!blkio->Media->LogicalPartition) > >> > return (EFI_UNSUPPORTED); > >> > > >> > - *preferred = device_paths_match(imgpath, devpath); > >> > + *preferred = efi_devpath_match(imgpath, devpath); > >> > > >> > /* Run through each module, see if it can load this partition > >> */ > >> > for (i = 0; i < NUM_BOOT_MODULES; i++) { > >> > >> -- > >> Tomoaki AOKI > >> > > > > -- $B@DLZ(B $BCNL@(B [Tomoaki AOKI] From owner-svn-src-head@freebsd.org Sun Sep 3 08:32:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C451E21AB4; Sun, 3 Sep 2017 08:32:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 36E3A2DB9; Sun, 3 Sep 2017 08:32:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v838WXdT080472; Sun, 3 Sep 2017 08:32:33 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v838WXth080470; Sun, 3 Sep 2017 08:32:33 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709030832.v838WXth080470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 3 Sep 2017 08:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323138 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 323138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 03 Sep 2017 08:32:34 -0000 Author: mw Date: Sun Sep 3 08:32:33 2017 New Revision: 323138 URL: https://svnweb.freebsd.org/changeset/base/323138 Log: Add ARM Cortex A72 to CPU list This change is required to properly detect CPUs on Marvell Armada 80x0/70x0 SoC family. Submitted by: Rafal Kozik Reviewed by: andrew, cognet (mentor) Approved by: cognet (mentor) Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12184 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Sun Sep 3 06:43:08 2017 (r323137) +++ head/sys/arm64/arm64/identcpu.c Sun Sep 3 08:32:33 2017 (r323138) @@ -122,6 +122,7 @@ static const struct cpu_parts cpu_parts_arm[] = { { CPU_PART_FOUNDATION, "Foundation-Model" }, { CPU_PART_CORTEX_A53, "Cortex-A53" }, { CPU_PART_CORTEX_A57, "Cortex-A57" }, + { CPU_PART_CORTEX_A72, "Cortex-A72" }, CPU_PART_NONE, }; /* Cavium */ Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Sun Sep 3 06:43:08 2017 (r323137) +++ head/sys/arm64/include/cpu.h Sun Sep 3 08:32:33 2017 (r323138) @@ -82,6 +82,7 @@ #define CPU_PART_FOUNDATION 0xD00 #define CPU_PART_CORTEX_A53 0xD03 #define CPU_PART_CORTEX_A57 0xD07 +#define CPU_PART_CORTEX_A72 0xD08 #define CPU_REV_THUNDER_1_0 0x00 #define CPU_REV_THUNDER_1_1 0x01 From owner-svn-src-head@freebsd.org Sun Sep 3 09:41:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B18F0E028BE; Sun, 3 Sep 2017 09:41:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8173065299; Sun, 3 Sep 2017 09:41:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v839fekK010841; Sun, 3 Sep 2017 09:41:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v839feew010840; Sun, 3 Sep 2017 09:41:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709030941.v839feew010840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 3 Sep 2017 09:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323147 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 323147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 03 Sep 2017 09:41:41 -0000 Author: andrew Date: Sun Sep 3 09:41:40 2017 New Revision: 323147 URL: https://svnweb.freebsd.org/changeset/base/323147 Log: Disable the ARM generic timers before interrupts are enabled. Some Raspberry Pi firmware images leave them enabled causing an interrupt storm. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Sep 3 09:18:39 2017 (r323146) +++ head/sys/arm/arm/generic_timer.c Sun Sep 3 09:41:40 2017 (r323147) @@ -249,18 +249,24 @@ arm_tmr_start(struct eventtimer *et, sbintime_t first, } +static void +arm_tmr_disable(bool physical) +{ + int ctrl; + + ctrl = get_ctrl(physical); + ctrl &= ~GT_CTRL_ENABLE; + set_ctrl(ctrl, physical); +} + static int arm_tmr_stop(struct eventtimer *et) { struct arm_tmr_softc *sc; - int ctrl; sc = (struct arm_tmr_softc *)et->et_priv; + arm_tmr_disable(sc->physical); - ctrl = get_ctrl(sc->physical); - ctrl &= ~GT_CTRL_ENABLE; - set_ctrl(ctrl, sc->physical); - return (0); } @@ -411,6 +417,13 @@ arm_tmr_attach(device_t dev) return (ENXIO); } } + + /* Disable the virtual timer until we are ready */ + if (sc->res[2] != NULL) + arm_tmr_disable(false); + /* And the physical */ + if (sc->physical) + arm_tmr_disable(true); arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); From owner-svn-src-head@freebsd.org Mon Sep 4 03:18:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F5DE0D768; Mon, 4 Sep 2017 03:18:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8EE2B05; Mon, 4 Sep 2017 03:18:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id y128so15530154lfd.4; Sun, 03 Sep 2017 20:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8EVeU4XElRkyHgnn5/UXTSkvSgIPP45WrXg7Ry2TXEU=; b=o1ZVfcgLgUSjNAIKn3R/y+goeUtglt3rToF3VaAuUgGlkPxhCXH/B6ytVT2kNYSedT nuRpOnF0gOVncPIBIe8TvwMmUGrqy6Oeix0jEpf56fF/7NeXxjq4cikHYWK/VnwQ2CJc rZSdKlaAv9+xw9kiuLj3k1n4uwpVIIOh6f+CllaW8FHvDo/9FW/oGZmxN7kwYDeB0w7Y 4+l4J9Z1c0u7qyX0buTDvhm+CnEY9mN3yM1eTkGU/ClfSKVtgmGrS5N9N9AbRr5OwklC 7xXbnY1d+4uB+Bf85yFeOpHkVqrDJcOtqSjujFjXLhMHBQQLiggWBViUIgvJXdRJiE5j JYgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8EVeU4XElRkyHgnn5/UXTSkvSgIPP45WrXg7Ry2TXEU=; b=YHzr9CTDiup78mINa2lwUOTt8jyQeT71zF4lYamed7zlW5hM3107iobbdyXeI66MJu 9Gm6JBOQncFmbPBASATGsSoKUvfw50YI/nFoLXOzLjbtDdZcBuuDhelrtmOcmwcvg2BE vehIyIHsq/forkrwwU42oOrGl7g5NAtXNl3mJMVVxyPoEIi1obRIhI8g9Ce9Q3IEdRYa eqRIjVHopqO93M3/4iTs5JlWZHlgGV9c6A550Xceg4/GedfiB5sCceOWKXyJr3cJJhCD 7ZE2cHBlQrcfb01pXMINTMmElZcCUiSdOZy3MD6/lKvUKrd7eimrOFNwapku35Rs5CbH Au3A== X-Gm-Message-State: AHPjjUiojXM7Sc5f7pN4xm2SM+d1Oz9IzK3fRh2G4sX5r16ntsxlH8/l /idzuwZK4uKRKKckYNEBiKMEElDPdVBl X-Google-Smtp-Source: ADKCNb7jhXsAnGhwRu/RNg3J0mxc/isUymLrYrCmaoTIcwHgDg250oZDtNiHOFTzB+WYH/fU1wptQESJqGk9Vb0JE10= X-Received: by 10.25.87.144 with SMTP id l138mr3027256lfb.193.1504495120614; Sun, 03 Sep 2017 20:18:40 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.26.6 with HTTP; Sun, 3 Sep 2017 20:18:39 -0700 (PDT) In-Reply-To: <201701161746.v0GHkcPX071529@repo.freebsd.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> From: Alan Somers Date: Sun, 3 Sep 2017 21:18:39 -0600 X-Google-Sender-Auth: kRtmg3FMd1TbSTGgYwvFdYj6MsQ Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Maxim Sobolev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 03:18:45 -0000 On Mon, Jan 16, 2017 at 10:46 AM, Maxim Sobolev wrote: > Author: sobomax > Date: Mon Jan 16 17:46:38 2017 > New Revision: 312296 > URL: https://svnweb.freebsd.org/changeset/base/312296 > > Log: > Add a new socket option SO_TS_CLOCK to pick from several different clock > sources to return timestamps when SO_TIMESTAMP is enabled. Two additional > clock sources are: > > o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); > o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC). > > In addition to this, this option provides unified interface to get bintime > (equivalent of using SO_BINTIME), except it also supported with IPv6 where > SO_BINTIME has never been supported. The long term plan is to depreciate > SO_BINTIME and move everything to using SO_TS_CLOCK. > > Idea for this enhancement has been briefly discussed on the Net session > during dev summit in Ottawa last June and the general input was positive. > > This change is believed to benefit network benchmarks/profiling as well > as other scenarios where precise time of arrival measurement is necessary. > > There are two regression test cases as part of this commit: one extends unix > domain test code (unix_cmsg) to test new SCM_XXX types and another one > implementis totally new test case which exchanges UDP packets between two > processes using both conventional methods (i.e. calling clock_gettime(2) > before recv(2) and after send(2)), as well as using setsockopt()+recv() in > receive path. The resulting delays are checked for sanity for all supported > clock types. > > Reviewed by: adrian, gnn > Differential Revision: https://reviews.freebsd.org/D9171 While the new SCM_TIMESTAMP code works fine on both amd64 and i386, it doesn't work on amd64 under 32-bit emulation. That is, programs that use SCM_TIMESTAMP built for i386 will fail when run on an amd64 machine. I don't know whether this commit introduced that bug; on stable-10 SCM_TIMESTAMP doesn't appear to work at all on i386. But sobomax, since you're obviously familiar with this code, would you mind taking a look? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 -Alan From owner-svn-src-head@freebsd.org Mon Sep 4 05:34:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A21EE15433; Mon, 4 Sep 2017 05:34: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 mx1.freebsd.org (Postfix) with ESMTPS id 5DB1F65E56; Mon, 4 Sep 2017 05:34: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 v845YbNf095494; Mon, 4 Sep 2017 05:34:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v845Yaxs095486; Mon, 4 Sep 2017 05:34:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709040534.v845Yaxs095486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 Sep 2017 05:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323151 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Commit-Revision: 323151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 05:34:38 -0000 Author: jhb Date: Mon Sep 4 05:34:36 2017 New Revision: 323151 URL: https://svnweb.freebsd.org/changeset/base/323151 Log: Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode. Move tables that were previously in truss over to libsysdecode. truss output is unchanged, but kdump has been updated to decode these fields. In addition, sysdecode_sysarch_number() should support all platforms whereas the old table in truss only supported x86. Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_enum.3 head/lib/libsysdecode/sysdecode_mask.3 head/usr.bin/kdump/kdump.c head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/Makefile Mon Sep 4 05:34:36 2017 (r323151) @@ -42,6 +42,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_minherit_flags.3 \ sysdecode_enum.3 sysdecode_msgctl_cmd.3 \ sysdecode_enum.3 sysdecode_nfssvc_flags.3 \ + sysdecode_enum.3 sysdecode_pathconf_name.3 \ sysdecode_enum.3 sysdecode_prio_which.3 \ sysdecode_enum.3 sysdecode_procctl_cmd.3 \ sysdecode_enum.3 sysdecode_ptrace_request.3 \ @@ -63,11 +64,13 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_socketdomain.3 \ sysdecode_enum.3 sysdecode_sockettype.3 \ sysdecode_enum.3 sysdecode_sockopt_level.3 \ + sysdecode_enum.3 sysdecode_sysarch_number.3 \ sysdecode_enum.3 sysdecode_umtx_op.3 \ sysdecode_enum.3 sysdecode_vmresult.3 \ sysdecode_enum.3 sysdecode_whence.3 MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ + sysdecode_mask.3 sysdecode_atflags.3 \ sysdecode_mask.3 sysdecode_capfcntlrights.3 \ sysdecode_mask.3 sysdecode_fcntl_fileflags.3 \ sysdecode_mask.3 sysdecode_fileflags.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/flags.c Mon Sep 4 05:34:36 2017 (r323151) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -250,6 +251,13 @@ sysdecode_atfd(int fd) return (NULL); } +bool +sysdecode_atflags(FILE *fp, int flag, int *rem) +{ + + return (print_mask_int(fp, atflags, flag, rem)); +} + static struct name_table semctlops[] = { X(GETNCNT) X(GETPID) X(GETVAL) X(GETALL) X(GETZCNT) X(SETVAL) X(SETALL) X(IPC_RMID) X(IPC_SET) X(IPC_STAT) XEND @@ -948,6 +956,13 @@ sysdecode_mmap_flags(FILE *fp, int flags, int *rem) } const char * +sysdecode_pathconf_name(int name) +{ + + return (lookup_value(pathconfname, name)); +} + +const char * sysdecode_rtprio_function(int function) { @@ -986,6 +1001,13 @@ sysdecode_sigcode(int sig, int si_code) default: return (NULL); } +} + +const char * +sysdecode_sysarch_number(int number) +{ + + return (lookup_value(sysarchnum, number)); } bool Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/mktables Mon Sep 4 05:34:36 2017 (r323151) @@ -91,6 +91,7 @@ _EOF_ gen_table "accessmode" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" gen_table "acltype" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +gen_table "atflags" "AT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" gen_table "capfcntl" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h" gen_table "extattrns" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" gen_table "fadvisebehav" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" @@ -109,6 +110,7 @@ gen_table "filemode" "S_[A-Z]+[[:space:]]+[0-6] gen_table "mountflags" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h" gen_table "msyncflags" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h" +gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" @@ -153,6 +155,11 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" +if [ -e "${include_dir}/x86/sysarch.h" ]; then + gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" +else + gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h" +fi # Generate a .depend file for our output file if [ -n "$output_file" ]; then Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/sysdecode.h Mon Sep 4 05:34:36 2017 (r323151) @@ -42,6 +42,7 @@ int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi bool sysdecode_access_mode(FILE *_fp, int _mode, int *_rem); const char *sysdecode_acltype(int _type); const char *sysdecode_atfd(int _fd); +bool sysdecode_atflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); const char *sysdecode_extattrnamespace(int _namespace); @@ -73,6 +74,7 @@ bool sysdecode_msg_flags(FILE *_fp, int _flags, int *_ bool sysdecode_msync_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_nfssvc_flags(int _flags); bool sysdecode_open_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_pathconf_name(int _name); bool sysdecode_pipe2_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_prio_which(int _which); const char *sysdecode_procctl_cmd(int _cmd); @@ -105,6 +107,7 @@ bool sysdecode_socket_type(FILE *_fp, int _type, int * const char *sysdecode_sockopt_level(int _level); const char *sysdecode_sockopt_name(int _level, int _optname); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); +const char *sysdecode_sysarch_number(int _number); bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); const char *sysdecode_umtx_op(int _op); Modified: head/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_enum.3 Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/sysdecode_enum.3 Mon Sep 4 05:34:36 2017 (r323151) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2017 +.Dd September 3, 2017 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -46,6 +46,7 @@ .Nm sysdecode_minherit_flags , .Nm sysdecode_msgctl_cmd , .Nm sysdecode_nfssvc_flags , +.Nm sysdecode_pathconf_name , .Nm sysdecode_prio_which , .Nm sysdecode_procctl_cmd , .Nm sysdecode_ptrace_request , @@ -67,6 +68,7 @@ .Nm sysdecode_socketdomain , .Nm sysdecode_sockettype , .Nm sysdecode_sockopt_level , +.Nm sysdecode_sysarch_number , .Nm sysdecode_umtx_op , .Nm sysdecode_vmresult , .Nm sysdecode_whence @@ -110,6 +112,8 @@ .Ft const char * .Fn sysdecode_nfssvc_flags "int flags" .Ft const char * +.Fn sysdecode_pathconf_name "int name" +.Ft const char * .Fn sysdecode_prio_which "int which" .Ft const char * .Fn sysdecode_procctl_cmd "int cmd" @@ -152,6 +156,8 @@ .Ft const char * .Fn sysdecode_sockopt_level "int level" .Ft const char * +.Fn sysdecode_sysarch_number "int number" +.Ft const char * .Fn sysdecode_umtx_op "int op" .Ft const char * .Fn sysdecode_vmresult "int result" @@ -186,6 +192,7 @@ Most of these functions decode an argument passed to a .It Fn sysdecode_minherit_inherit Ta Xr minherit 2 Ta Fa inherit .It Fn sysdecode_msgctl_cmd Ta Xr msgctl 2 Ta Fa cmd .It Fn sysdecode_nfssvc_flags Ta Xr nfssvc 2 Ta Fa flags +.It Fn sysdecode_pathconf_name Ta Xr pathconf 2 Ta Fa name .It Fn sysdecode_prio_which Ta Xr getpriority 2 Ta Fa which .It Fn sysdecode_procctl_cmd Ta Xr procctl 2 Ta Fa cmd .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request @@ -198,6 +205,7 @@ Most of these functions decode an argument passed to a .It Fn sysdecode_shutdown_how Ta Xr shutdown 2 Ta Fa how .It Fn sysdecode_sigprocmask_how Ta Xr sigprocmask 2 Ta Fa how .It Fn sysdecode_sockopt_level Ta Xr getsockopt 2 Ta Fa level +.It Fn sysdecode_sysarch_number Ta Xr sysarch 2 Ta Fa number .It Fn sysdecode_umtx_op Ta Xr _umtx_op 2 Ta Fa op .It Fn sysdecode_whence Ta Xr lseek 2 Ta Fa whence .El Modified: head/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Sun Sep 3 22:02:59 2017 (r323150) +++ head/lib/libsysdecode/sysdecode_mask.3 Mon Sep 4 05:34:36 2017 (r323151) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd September 3, 2017 .Dt sysdecode_mask 3 .Os .Sh NAME .Nm sysdecode_mask , .Nm sysdecode_accessmode , +.Nm sysdecode_atflags , .Nm sysdecode_capfcntlrights , .Nm sysdecode_fcntl_fileflags , .Nm sysdecode_fileflags , @@ -66,6 +67,8 @@ .Ft bool .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem" .Ft bool +.Fn sysdecode_atflags "FILE *fp" "int flags" "int *rem" +.Ft bool .Fn sysdecode_cap_fcntlrights "FILE *fp" "uint32_t rights" "uint32_t *rem" .Ft bool .Fn sysdecode_fcntl_fileflags "FILE *fp" "int flags" "int *rem" @@ -148,6 +151,7 @@ Most of these functions decode an argument passed to a .Bl -column "Fn sysdecode_flock_operation" "Xr cap_fcntls_limit 2" .It Sy Function Ta Sy System Call Ta Sy Argument .It Fn sysdecode_access_mode Ta Xr access 2 Ta Fa mode +.It Fn sysdecode_atflags Ta Xr chflagsat 2 , Xr fstatat 2 Ta Fa atflag , Fa flag .It Fn sysdecode_cap_fcntlrights Ta Xr cap_fcntls_limit 2 Ta Fa fcntlrights .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun Sep 3 22:02:59 2017 (r323150) +++ head/usr.bin/kdump/kdump.c Mon Sep 4 05:34:36 2017 (r323151) @@ -1060,6 +1060,15 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) ip++; narg--; break; + case SYS_pathconf: + case SYS_lpathconf: + case SYS_fpathconf: + print_number(ip, narg, c); + putchar(','); + print_integer_arg(sysdecode_pathconf_name, *ip); + ip++; + narg--; + break; case SYS_getpriority: case SYS_setpriority: putchar('('); @@ -1419,6 +1428,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) print_integer_arg_valid(sysdecode_atfd, *ip); ip++; narg--; + print_number(ip, narg, c); break; case SYS_cap_fcntls_limit: print_number(ip, narg, c); @@ -1476,6 +1486,41 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) case SYS_truncate: print_number(ip, narg, c); print_number64(first, ip, narg, c); + break; + case SYS_fchownat: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_fstatat: + case SYS_utimensat: + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_unlinkat: + print_number(ip, narg, c); + break; + case SYS_sysarch: + putchar('('); + print_integer_arg(sysdecode_sysarch_number, *ip); + ip++; + narg--; + c = ','; + break; + } + switch (ktr->ktr_code) { + case SYS_chflagsat: + case SYS_fchownat: + case SYS_faccessat: + case SYS_fchmodat: + case SYS_fstatat: + case SYS_linkat: + case SYS_unlinkat: + case SYS_utimensat: + putchar(','); + print_mask_arg0(sysdecode_atflags, *ip); + ip++; + narg--; break; } } Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sun Sep 3 22:02:59 2017 (r323150) +++ head/usr.bin/truss/syscalls.c Mon Sep 4 05:34:36 2017 (r323151) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -697,35 +696,6 @@ static struct xlat sigaction_flags[] = { X(SA_NODEFER) X(SA_NOCLDWAIT) X(SA_SIGINFO) XEND }; -static struct xlat pathconf_arg[] = { - X(_PC_LINK_MAX) X(_PC_MAX_CANON) X(_PC_MAX_INPUT) - X(_PC_NAME_MAX) X(_PC_PATH_MAX) X(_PC_PIPE_BUF) - X(_PC_CHOWN_RESTRICTED) X(_PC_NO_TRUNC) X(_PC_VDISABLE) - X(_PC_ASYNC_IO) X(_PC_PRIO_IO) X(_PC_SYNC_IO) - X(_PC_ALLOC_SIZE_MIN) X(_PC_FILESIZEBITS) - X(_PC_REC_INCR_XFER_SIZE) X(_PC_REC_MAX_XFER_SIZE) - X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN) - X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX) - X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT) - X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND -}; - -static struct xlat at_flags[] = { - X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW) - X(AT_REMOVEDIR) XEND -}; - -static struct xlat sysarch_ops[] = { -#if defined(__i386__) || defined(__amd64__) - X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM) - X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE) - X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE) - X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE) - X(AMD64_GET_XFPUSTATE) -#endif - XEND -}; - static struct xlat linux_socketcall_ops[] = { X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN) X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME) @@ -1689,7 +1659,7 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_getrusage_who, fp, args[sc->offset]); break; case Pathconf: - fputs(xlookup(pathconf_arg, args[sc->offset]), fp); + print_integer_arg(sysdecode_pathconf_name, fp, args[sc->offset]); break; case Rforkflags: print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); @@ -1955,13 +1925,14 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_atfd, fp, args[sc->offset]); break; case Atflags: - fputs(xlookup_bits(at_flags, args[sc->offset]), fp); + print_mask_arg(sysdecode_atflags, fp, args[sc->offset]); break; case Accessmode: print_mask_arg(sysdecode_access_mode, fp, args[sc->offset]); break; case Sysarch: - fputs(xlookup(sysarch_ops, args[sc->offset]), fp); + print_integer_arg(sysdecode_sysarch_number, fp, + args[sc->offset]); break; case PipeFds: /* From owner-svn-src-head@freebsd.org Mon Sep 4 10:08:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB086E1FE9E; Mon, 4 Sep 2017 10:08:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 982F96D8F4; Mon, 4 Sep 2017 10:08:43 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84A8gmZ004410; Mon, 4 Sep 2017 10:08:42 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84A8gGt004409; Mon, 4 Sep 2017 10:08:42 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201709041008.v84A8gGt004409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 4 Sep 2017 10:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323154 - head/sys/x86/acpica X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/x86/acpica X-SVN-Commit-Revision: 323154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 10:08:43 -0000 Author: royger Date: Mon Sep 4 10:08:42 2017 New Revision: 323154 URL: https://svnweb.freebsd.org/changeset/base/323154 Log: acpi/srat: zero the SRAT cpu array Fix from fallout introduced in r322348 that moved the cpus array to a dynamic allocation without zeroing the area. Reported by: mjg MFC with: r322348 Reviewed by: mjg Differential revision: https://reviews.freebsd.org/D12220 Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Mon Sep 4 08:41:51 2017 (r323153) +++ head/sys/x86/acpica/srat.c Mon Sep 4 10:08:42 2017 (r323154) @@ -449,6 +449,7 @@ parse_srat(void) * the default memory attribute (WB), and the DMAP when available. */ cpus = (struct cpu_info *)pmap_mapbios(addr, size); + bzero(cpus, size); /* * Make a pass over the table to populate the cpus[] and From owner-svn-src-head@freebsd.org Mon Sep 4 18:59:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 544B0E17B49; Mon, 4 Sep 2017 18:59:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E69F81A73; Mon, 4 Sep 2017 18:59:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84IxjEY018614; Mon, 4 Sep 2017 18:59:45 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84Ixjxe018613; Mon, 4 Sep 2017 18:59:45 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201709041859.v84Ixjxe018613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 4 Sep 2017 18:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323155 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 323155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 18:59:46 -0000 Author: rlibby Date: Mon Sep 4 18:59:44 2017 New Revision: 323155 URL: https://svnweb.freebsd.org/changeset/base/323155 Log: libefivar: -fno-strict-aliasing Avoid dealing with some code that uses type-punned pointers. See D12210 and D12211 for more background. Reviewed by: imp Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12219 Modified: head/lib/libefivar/Makefile Modified: head/lib/libefivar/Makefile ============================================================================== --- head/lib/libefivar/Makefile Mon Sep 4 10:08:42 2017 (r323154) +++ head/lib/libefivar/Makefile Mon Sep 4 18:59:44 2017 (r323155) @@ -64,4 +64,4 @@ WARNS?= 9 .include -CFLAGS+= -Wno-cast-align -Wno-unused-parameter +CFLAGS+= -fno-strict-aliasing -Wno-cast-align -Wno-unused-parameter From owner-svn-src-head@freebsd.org Mon Sep 4 20:10:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FFCBE1B4BA; Mon, 4 Sep 2017 20:10:35 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3DDF983C0F; Mon, 4 Sep 2017 20:10:35 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84KAYNI047608; Mon, 4 Sep 2017 20:10:34 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84KAYgp047607; Mon, 4 Sep 2017 20:10:34 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201709042010.v84KAYgp047607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 4 Sep 2017 20:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323156 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 323156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 20:10:35 -0000 Author: lidl Date: Mon Sep 4 20:10:34 2017 New Revision: 323156 URL: https://svnweb.freebsd.org/changeset/base/323156 Log: Fix whitespace on "options" to be , no functional change Modified: head/sys/mips/conf/ERL Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Mon Sep 4 18:59:44 2017 (r323155) +++ head/sys/mips/conf/ERL Mon Sep 4 20:10:34 2017 (r323156) @@ -39,7 +39,7 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug #options OCTEON_VENDOR_LANNER # Support for Lanner boards. #options OCTEON_VENDOR_RADISYS # Support for Radisys boards. options OCTEON_VENDOR_UBIQUITI # Support for Ubiquiti boards. -#options OCTEON_VENDOR_GEFES # Support for GE LANIC boards +#options OCTEON_VENDOR_GEFES # Support for GE LANIC boards #options OCTEON_BOARD_CAPK_0100ND # Support for CAPK-0100nd. # Compile for a specified Octeon model. If not specified, support for @@ -89,7 +89,7 @@ options MAC # TrustedBSD MAC Framework #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel -options TMPFS # Temporary file system +options TMPFS # Temporary file system # Debugging for use in -current #options KDB # Enable kernel debugger support. From owner-svn-src-head@freebsd.org Mon Sep 4 20:19:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F490E1BC68; Mon, 4 Sep 2017 20:19:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08B0026F; Mon, 4 Sep 2017 20:19:37 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84KJbXL051481; Mon, 4 Sep 2017 20:19:37 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84KJbEq051478; Mon, 4 Sep 2017 20:19:37 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201709042019.v84KJbEq051478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 4 Sep 2017 20:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323157 - in head: sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Commit-Revision: 323157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 20:19:38 -0000 Author: mckusick Date: Mon Sep 4 20:19:36 2017 New Revision: 323157 URL: https://svnweb.freebsd.org/changeset/base/323157 Log: The new fsck recovery information to enable it to find backup superblocks created in revision 322297 only works on disks with sector sizes up to 4K. This update allows the recovery information to be created by newfs and used by fsck on disks with sector sizes up to 64K. Note that FFS currently limits filesystem to be mounted from disks with up to 8K sectors. Expanding this limitation will be the subject of another commit. Reported by: Peter Holm Reviewed with: kib Modified: head/sbin/fsck_ffs/setup.c head/sbin/newfs/mkfs.c head/sys/ufs/ffs/fs.h Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Mon Sep 4 20:10:34 2017 (r323156) +++ head/sbin/fsck_ffs/setup.c Mon Sep 4 20:19:36 2017 (r323157) @@ -36,6 +36,7 @@ static const char sccsid[] = "@(#)setup.c 8.10 (Berkel __FBSDID("$FreeBSD$"); #include +#include #include #define FSTYPENAMES #include @@ -465,7 +466,9 @@ sblock_init(void) static int calcsb(char *dev, int devfd, struct fs *fs) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; /* * We need fragments-per-group and the partition-size. @@ -475,32 +478,62 @@ calcsb(char *dev, int devfd, struct fs *fs) * overwritten by a boot block, we fail. But usually they are * there and we can use them. */ - if (blread(devfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) || - fsr.fsr_magic != FS_UFS2_MAGIC) + if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1) return (0); + fsrbuf = Malloc(secsize); + if (fsrbuf == NULL) + errx(EEXIT, "calcsb: cannot allocate recovery buffer"); + if (blread(devfd, fsrbuf, + (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) + return (0); + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + if (fsr->fsr_magic != FS_UFS2_MAGIC) + return (0); memset(fs, 0, sizeof(struct fs)); - fs->fs_fpg = fsr.fsr_fpg; - fs->fs_fsbtodb = fsr.fsr_fsbtodb; - fs->fs_sblkno = fsr.fsr_sblkno; - fs->fs_magic = fsr.fsr_magic; - fs->fs_ncg = fsr.fsr_ncg; + fs->fs_fpg = fsr->fsr_fpg; + fs->fs_fsbtodb = fsr->fsr_fsbtodb; + fs->fs_sblkno = fsr->fsr_sblkno; + fs->fs_magic = fsr->fsr_magic; + fs->fs_ncg = fsr->fsr_ncg; + free(fsrbuf); return (1); } /* * Check to see if recovery information exists. + * Return 1 if it exists or cannot be created. + * Return 0 if it does not exist and can be created. */ static int chkrecovery(int devfd) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; - if (blread(devfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) || - fsr.fsr_magic != FS_UFS2_MAGIC) - return (0); - return (1); + /* + * Could not determine if backup material exists, so do not + * offer to create it. + */ + if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1 || + (fsrbuf = Malloc(secsize)) == NULL || + blread(devfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, + secsize) != 0) + return (1); + /* + * Recovery material has already been created, so do not + * need to create it again. + */ + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + if (fsr->fsr_magic == FS_UFS2_MAGIC) { + free(fsrbuf); + return (1); + } + /* + * Recovery material has not been created and can be if desired. + */ + free(fsrbuf); + return (0); } /* @@ -511,17 +544,24 @@ chkrecovery(int devfd) static void saverecovery(int readfd, int writefd) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; if (sblock.fs_magic != FS_UFS2_MAGIC || - blread(readfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr))) + ioctl(readfd, DIOCGSECTORSIZE, &secsize) == -1 || + (fsrbuf = Malloc(secsize)) == NULL || + blread(readfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, + secsize) != 0) { + printf("RECOVERY DATA COULD NOT BE CREATED\n"); return; - fsr.fsr_magic = sblock.fs_magic; - fsr.fsr_fpg = sblock.fs_fpg; - fsr.fsr_fsbtodb = sblock.fs_fsbtodb; - fsr.fsr_sblkno = sblock.fs_sblkno; - fsr.fsr_ncg = sblock.fs_ncg; - blwrite(writefd, (char *)&fsr, (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, - sizeof(fsr)); + } + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + fsr->fsr_magic = sblock.fs_magic; + fsr->fsr_fpg = sblock.fs_fpg; + fsr->fsr_fsbtodb = sblock.fs_fsbtodb; + fsr->fsr_sblkno = sblock.fs_sblkno; + fsr->fsr_ncg = sblock.fs_ncg; + blwrite(writefd, fsrbuf, (SBLOCK_UFS2 - secsize) / secsize, secsize); + free(fsrbuf); } Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Mon Sep 4 20:10:34 2017 (r323156) +++ head/sbin/newfs/mkfs.c Mon Sep 4 20:19:36 2017 (r323157) @@ -121,7 +121,8 @@ mkfs(struct partition *pp, char *fsys) ino_t maxinum; int minfragsperinode; /* minimum ratio of frags to inodes */ char tmpbuf[100]; /* XXX this will break in about 2,500 years */ - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; union { struct fs fdummy; char cdummy[SBLOCKSIZE]; @@ -442,6 +443,8 @@ restart: sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs)); if (sblock.fs_sbsize > SBLOCKSIZE) sblock.fs_sbsize = SBLOCKSIZE; + if (sblock.fs_sbsize < realsectorsize) + sblock.fs_sbsize = realsectorsize; sblock.fs_minfree = minfree; if (metaspace > 0 && metaspace < sblock.fs_fpg / 2) sblock.fs_metaspace = blknum(&sblock, metaspace); @@ -514,7 +517,7 @@ restart: /* * Wipe out old UFS1 superblock(s) if necessary. */ - if (!Nflag && Oflag != 1) { + if (!Nflag && Oflag != 1 && realsectorsize <= SBLOCK_UFS1) { i = bread(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); if (i == -1) err(1, "can't read old UFS1 superblock: %s", disk.d_error); @@ -623,18 +626,20 @@ restart: * The recovery information only works for UFS2 filesystems. */ if (sblock.fs_magic == FS_UFS2_MAGIC) { - i = bread(&disk, - part_ofs + (SBLOCK_UFS2 - sizeof(fsr)) / disk.d_bsize, - (char *)&fsr, sizeof(fsr)); - if (i == -1) + if ((fsrbuf = malloc(realsectorsize)) == NULL || bread(&disk, + part_ofs + (SBLOCK_UFS2 - realsectorsize) / disk.d_bsize, + fsrbuf, realsectorsize) == -1) err(1, "can't read recovery area: %s", disk.d_error); - fsr.fsr_magic = sblock.fs_magic; - fsr.fsr_fpg = sblock.fs_fpg; - fsr.fsr_fsbtodb = sblock.fs_fsbtodb; - fsr.fsr_sblkno = sblock.fs_sblkno; - fsr.fsr_ncg = sblock.fs_ncg; - wtfs((SBLOCK_UFS2 - sizeof(fsr)) / disk.d_bsize, sizeof(fsr), - (char *)&fsr); + fsr = + (struct fsrecovery *)&fsrbuf[realsectorsize - sizeof *fsr]; + fsr->fsr_magic = sblock.fs_magic; + fsr->fsr_fpg = sblock.fs_fpg; + fsr->fsr_fsbtodb = sblock.fs_fsbtodb; + fsr->fsr_sblkno = sblock.fs_sblkno; + fsr->fsr_ncg = sblock.fs_ncg; + wtfs((SBLOCK_UFS2 - realsectorsize) / disk.d_bsize, + realsectorsize, fsrbuf); + free(fsrbuf); } /* * Update information about this partition in pack Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Mon Sep 4 20:10:34 2017 (r323156) +++ head/sys/ufs/ffs/fs.h Mon Sep 4 20:19:36 2017 (r323157) @@ -237,9 +237,7 @@ struct fsck_cmd { * A recovery structure placed at the end of the boot block area by newfs * that can be used by fsck to search for alternate superblocks. */ -#define RESID (4096 - 20) /* disk sector size minus recovery area size */ struct fsrecovery { - char block[RESID]; /* unused part of sector */ int32_t fsr_magic; /* magic number */ int32_t fsr_fsbtodb; /* fsbtodb and dbtofsb shift constant */ int32_t fsr_sblkno; /* offset of super-block in filesys */ From owner-svn-src-head@freebsd.org Mon Sep 4 20:41:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9F5E1CD61; Mon, 4 Sep 2017 20:41:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20A6A12DB; Mon, 4 Sep 2017 20:41:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84KfYDu062817; Mon, 4 Sep 2017 20:41:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84KfYON062816; Mon, 4 Sep 2017 20:41:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201709042041.v84KfYON062816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 Sep 2017 20:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323160 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 323160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 20:41:35 -0000 Author: bapt Date: Mon Sep 4 20:41:34 2017 New Revision: 323160 URL: https://svnweb.freebsd.org/changeset/base/323160 Log: Update pci_vendors to 2017-09-01 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Mon Sep 4 20:27:12 2017 (r323159) +++ head/share/misc/pci_vendors Mon Sep 4 20:41:34 2017 (r323160) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.07.27 -# Date: 2017-07-27 03:15:02 +# Version: 2017.09.01 +# Date: 2017-09-01 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -41,7 +41,8 @@ 0680 Ultra ATA/133 IDE RAID CONTROLLER CARD # Wrong ID used in subsystem ID of the TELES.S0/PCI 2.x ISDN adapter 00a7 Teles AG (Wrong ID) -0100 Ncipher Corp Ltd +# nee nCipher +0100 Thales e-Security 0123 General Dynamics # 018a is not LevelOne but there is a board misprogrammed 018a LevelOne @@ -327,6 +328,7 @@ 1033 8336 SAS1068 0056 SAS1064ET PCI-Express Fusion-MPT SAS 1014 03bb ServeRAID BR10il SAS/SATA Controller v2 + 8086 34dc AXX4SASMOD RAID Controller 0057 M1064E MegaRAID SAS 8086 346c Embedded Software RAID Technology II (ESTRII) 0058 SAS1068E PCI-Express Fusion-MPT SAS @@ -369,7 +371,16 @@ 1028 1f38 PERC H710 Mini (for monolithics) 15d9 0690 LSI MegaRAID ROMB 8086 3510 RMS25PB080 RAID Controller + 8086 3511 RMS25PB040 RAID Controller + 8086 3512 RMT3PB080 RAID Controller 8086 3513 RMS25CB080 RAID Controller + 8086 3514 RMS25CB040 RAID Controller + 8086 351c RMS25PB080N RAID Controller + 8086 351d RMS25CB080N RAID Controller + 8086 9265 RS25DB080 RAID Controller + 8086 9268 RS25AB080 RAID Controller + 8086 9285 RS25NB008 RAID Controller + 8086 9288 RS25SB008 RAID Controller 005c SAS1064A PCI-X Fusion-MPT SAS 005d MegaRAID SAS-3 3108 [Invader] 1000 9361 MegaRAID SAS 9361-8i @@ -389,6 +400,12 @@ 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter + 8086 351e RMS3CC080 RAID Controller + 8086 351f RMS3CC040 RAID Controller + 8086 9360 RS3DC080 RAID Controller + 8086 9362 RS3DC040 RAID Controller + 8086 9380 RS3SC008 RAID Controller + 8086 9381 RS3MC044 RAID Controller 005e SAS1066 PCI-X Fusion-MPT SAS 005f MegaRAID SAS-3 3008 [Fury] 1028 1f44 PERC H330 Adapter @@ -444,6 +461,7 @@ 1028 1f20 PERC H200 Embedded 1028 1f22 Internal Tape Adapter 8086 350f RMS2LL040 RAID Controller + 8086 3700 SSD 910 Series 0073 MegaRAID SAS 2008 [Falcon] 1000 9240 MegaRAID SAS 9240-8i 1000 9241 MegaRAID SAS 9240-4i @@ -499,12 +517,18 @@ 1043 8480 PIKE-2108 16PD 1734 1176 RAID Ctrl SAS 6G 5/6 512MB (D2616) 1734 1177 RAID Ctrl SAS 6G 0/1 (D2607) - 8086 9256 MegaRAID SAS 9260DE-8i + 8086 350b RMS2MH080 RAID Controller + 8086 9256 MegaRAID SAS 9260DE-8i RS2BL080DE 8086 9260 RAID Controller RS2BL040 8086 9261 RAID Controller RS2BL080 - 8086 9264 Warm Beach (Caster Lite) + 8086 9264 RAID Controller RT3WB080 Warm Beach (Caster Lite) 8086 9267 RAID Controller RS2VB040 8086 9268 RAID Controller RS2VB080 + 8086 9275 RAID Controller RS2PI008DE + 8086 9276 RAID Controller RS2WG160 + 8086 9280 RAID Controller RS2PI008 + 8086 9282 RAID Controller RS2MB044 + 8086 9290 RAID Controller RS2SG244 007c MegaRAID SAS 1078DE 1014 0395 ServeRAID-AR10is SAS/SATA Controller 007e SSS6200 PCI-Express Flash SSD @@ -535,6 +559,14 @@ 1000 3040 9207-8e SAS2.1 HBA 1000 3050 SAS9217-8i 1590 0044 H220i + 8086 3000 RS25GB008 RAID Controller + 8086 3060 RS25FB044 RAID Controller + 8086 3516 RMS25JB080 RAID Controller + 8086 3517 RMS25JB040 RAID Controller + 8086 3518 RMS25KB080 RAID Controller + 8086 3519 RMS25KB040 RAID Controller + 8086 351a RMS25LB040 RAID Controller + 8086 351b RMS25LB080 RAID Controller 008f 53c875J 1092 8000 FirePort 40 SCSI Controller 1092 8760 FirePort 40 Dual SCSI Host Adapter @@ -2267,6 +2299,7 @@ 1462 3050 R9 270 Gaming OC 148c 2016 Trinidad PRO [Radeon R9 370 OEM] 1682 2015 Trinidad PRO [Radeon R7 370] + 174b 2015 NITRO Radeon R7 370 174b 2016 Trinidad PRO [Radeon R9 370 OEM] 1787 2016 Trinidad PRO [Radeon R9 370 OEM] 6816 Pitcairn @@ -2437,7 +2470,7 @@ 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] - 687f Vega [Radeon RX Vega] + 687f Vega 10 XT [Radeon RX Vega 64] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P @@ -3427,6 +3460,7 @@ aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio aae8 Fiji HDMI/DP Audio [Radeon R9 Nano / FURY/FURY X] + aaf0 Ellesmere [Radeon RX 580] ac00 Theater 600 Pro ac02 TV Wonder HD 600 PCIe ac12 Theater HD T507 (DVB-T) TV tuner/capture device @@ -5964,7 +5998,10 @@ 0074 U4 HT Bridge # should be 14e4:1645 1645 Broadcom NetXtreme BCM5701 Gigabit Ethernet - 2001 PCI Express SSD + 2001 S1X NVMe Controller + 2002 S3ELab NVMe Controller + 2003 S3X NVMe Controller + 2005 ANS2 NVMe Controller 106c Hynix Semiconductor 8139 8139c 100BaseTX Ethernet Controller 8801 Dual Pentium ISA/PCI Motherboard @@ -6034,10 +6071,10 @@ 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter - 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) + 165c FastLinQ QL45000 Series 10/25/40/50GbE Controller (FCoE) 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter - 165e FastLinQ QL45000 Series 40GbE Controller (iSCSI) + 165e FastLinQ QL45000 Series 10/25/40/50GbE Controller (iSCSI) 1077 e4f1 FastLinQ QL45462H 40GbE iSCSI Adapter 1077 e4f2 FastLinQ QL45461H 40GbE iSCSI Adapter 1664 FastLinQ QL45000 Series Gigabit Ethernet Controller (SR-IOV VF) @@ -7612,6 +7649,7 @@ 1885 0701 Tsunami FPGA PMC with Altera Stratix S30 9733 PEX 9733 33-lane, 9-port PCI Express Gen 3 (8.0 GT/s) Switch 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter + 1d49 0002 ThinkSystem 810-4P NVMe Switch Adapter 9749 PEX 9749 49-lane, 13-port PCI Express Gen 3 (8.0 GT/s) Switch a100 Blackmagic Design DeckLink bb04 B&B 3PCIOSD1A Isolated PCI Serial @@ -10753,6 +10791,7 @@ 1b82 GP104 1b83 GP104 1b84 GP104 [GeForce GTX 1060 3GB] + 1b87 GP104 [P104-100] 1ba0 GP104M [GeForce GTX 1080 Mobile] 1ba1 GP104M [GeForce GTX 1070 Mobile] 1bb0 GP104GL [Quadro P5000] @@ -10768,6 +10807,8 @@ 1c01 GP106 1c02 GP106 [GeForce GTX 1060 3GB] 1c03 GP106 [GeForce GTX 1060 6GB] + 1c07 GP106 [P106-100] + 1c09 GP106 [P106-090] 1c20 GP106M [GeForce GTX 1060 Mobile] 1c30 GP106GL [Quadro P2000] 1c35 GP106 @@ -10788,7 +10829,7 @@ 1cb2 GP107GL [Quadro P600] 1cb3 GP107GL [Quadro P400] 1d01 GP108 [GeForce GT 1030] - 1d10 GP108 [GeForce MX150] + 1d10 GP108M [GeForce MX150] 1d81 GV100 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) @@ -10962,6 +11003,7 @@ 1025 0813 Aspire R7-571 103c 194e ProBook 455 G1 Notebook 103c 1985 Pavilion 17-e163sg Notebook PC + 17aa 3832 Yoga 520 522a RTS522A PCI Express Card Reader 5249 RTS5249 PCI Express Card Reader 103c 1909 ZBook 15 @@ -13048,6 +13090,7 @@ 1179 Toshiba America Info Systems 0102 Extended IDE Controller 0103 EX-IDE Type-B + 010f NVMe Controller 0404 DVD Decoder card 0406 Tecra Video Capture device 0407 DVD Decoder card (Version 2) @@ -16574,6 +16617,7 @@ a822 NVMe SSD Controller 172Xa 1014 0621 PCIe3 1.6TB NVMe Flash Adapter II x8 1014 0622 PCIe3 3.2TB NVMe Flash Adapter II x8 + 1014 0629 PCIe3 6.4TB NVMe Flash Adapter II x8 1028 1fd9 Express Flash PM1725a 800GB SFF 1028 1fda Express Flash PM1725a 1.6TB SFF 1028 1fdb Express Flash PM1725a 3.2TB SFF @@ -16988,6 +17032,7 @@ 1655 NetXtreme BCM5717 Gigabit Ethernet PCIe 1656 NetXtreme BCM5718 Gigabit Ethernet PCIe 1657 NetXtreme BCM5719 Gigabit Ethernet PCIe + 1014 0420 FC 5260/5899 4-port 1 GbE Adapter for Power 103c 169d Ethernet 1Gb 4-port 331FLR Adapter 103c 22be Ethernet 1Gb 4-port 331i Adapter 103c 3383 Ethernet 1Gb 4-port 331T Adapter @@ -18253,6 +18298,7 @@ 1012 MT27600 Family [Connect-IB Virtual Function] 1013 MT27700 Family [ConnectX-4] 15b3 0006 MCX416A-BCAT, ConnectX-4 EN, 40/56GbE 2P, PCIe3.0 x16 + 15b3 0008 ConnectX-4 Stand-up dual-port 100GbE MCX416A-CCAT 15b3 0033 ConnectX-4 VPI IB EDR/100 GbE Single Port QSFP28 Adapter 15b3 0034 ConnectX-4 VPI IB EDR/100 GbE Dual Port QSFP28 Adapter 15b3 0050 ConnectX-4 100 GbE Dual Port QSFP28 Adapter @@ -18349,6 +18395,7 @@ 0014 RamSan Flash SSD 0015 ZBox 15b7 Sandisk Corp + 2001 Skyhawk Series NVME SSD 15b8 ADDI-DATA GmbH 1001 APCI1516 SP controller (16 digi outputs) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) @@ -19099,6 +19146,10 @@ 177d 0005 CN2360 [LiquidIO II] 2-port 10GbE Intelligent adapter 177d 0006 CN2360 [LiquidIO II] 2-port 25GbE Intelligent adapter 177d 0007 CN2350 [LiquidIO II] 2-port 25GbE Intelligent adapter + 177d 0008 CN2350 [LiquidIO II] 2-port 10GbE SFP+ Intelligent adapter + 177d 0009 CN2360 [LiquidIO II] 2-port 10GbE SFP+ Intelligent adapter + 177d 000a CN2350 [LiquidIO II] 2-port 10GBASE-T Intelligent adapter + 177d 000b CN2360 [LiquidIO II] 2-port 10GBASE-T Intelligent adapter 9703 CN23XX [LiquidIO II] NVMe Controller 9712 CN23XX [LiquidIO II] SRIOV Virtual Function 177d 0003 CN2350 [LiquidIO II] 2-port 10GbE SRIOV Virtual Function @@ -19360,6 +19411,7 @@ 1a07 KintexUS PCIe Darklite Design [DNPCIe_40G_KU_LL] 1a08 KintexUS PCIe Darklite Design [DNPCIe_40G_KU_LL_QSFP] 1a09 Arria10 PCIe Darklite Design [DNPCIe_80G_A10_LL] + 1a0a VirtexUS PCIe Darklite Design [DNVUF2_HPC_PCIe] 17e4 Sectra AB 0001 KK671 Cardbus encryption board 0002 KK672 Cardbus encryption board @@ -19370,8 +19422,8 @@ 0021 EN2210 [c.Link] MoCA Network Controller (Coax) 0025 EN2510 [c.Link] MoCA Network Controller (Coax, PCIe interface) 0027 EN2710 [c.Link] MoCA 2.0 Network Controller (Coax, PCIe interface) - 3706 MoCA 2.0 Network Controller (Coax, PCIe interface) - 3711 MoCA 2.5 Network Controller (Coax, PCIe interface) + 3700 MoCA 2.0 Network Controller (Coax, PCIe interface) + 3710 MoCA 2.5 Network Controller (Coax, PCIe interface) 17ee Connect Components Ltd 17f2 Albatron Corp. 17f3 RDC Semiconductor, Inc. @@ -20570,6 +20622,7 @@ 0003 Ultrastar SN100 Series NVMe SSD 1014 04f5 PCIe3 1.6TB NVMe Flash Adapter 1014 04f6 PCIe3 3.2TB NVMe Flash Adapter + 0023 Ultrastar SN200 Series NVMe SSD 1c5f Beijing Memblaze Technology Co. Ltd. 0540 PBlaze4 NVMe SSD # http://www.nicevt.ru/ (in Russian) @@ -20608,6 +20661,65 @@ 0007 ExaNIC X40 1cf7 Subspace Dynamics 1d00 Pure Storage +1d0f Amazon.com, Inc. + cd01 NVMe SSD Controller + ec20 Elastic Network Adapter (ENA) +1d17 Zhaoxin + 070f ZX-100 PCI Express Root Port + 0710 ZX-100/ZX-200 PCI Express Root Port + 0711 ZX-100/ZX-200 PCI Express Root Port + 0712 ZX-100/ZX-200 PCI Express Root Port + 0713 ZX-100/ZX-200 PCI Express Root Port + 0714 ZX-100/ZX-200 PCI Express Root Port + 0715 ZX-100/ZX-200 PCI Express Root Port + 0716 ZX-D PCI Express Root Port + 0717 ZX-D PCI Express Root Port + 0718 ZX-D PCI Express Root Port + 0719 ZX-D PCI Express Root Port + 071a ZX-D PCI Express Root Port + 071b ZX-D PCI Express Root Port + 071c ZX-D PCI Express Root Port + 071d ZX-D PCI Express Root Port + 071e ZX-D PCI Express Root Port + 071f ZX-200 Upstream Port of PCI Express Switch + 0720 ZX-200 PCIE RC6 controller + 0721 ZX-200 Downstream Port of PCI Express Switch + 0722 ZX-200 PCIE P2C bridge + 1000 ZX-D Standard Host Bridge + 1001 ZX-D Miscellaneous Bus + 3001 ZX-100 Standard Host Bridge + 300a ZX-100 Miscellaneous Bus + 3038 ZX-100/ZX-200 Standard Universal PCI to USB Host Controller + 3104 ZX-100/ZX-200 Standard Enhanced PCI to USB Host Controller + 31b0 ZX-100/ZX-D Standard Host Bridge + 31b1 ZX-100/ZX-D Standard Host Bridge + 31b2 ZX-100/ZX-D DRAM Controller + 31b3 ZX-100/ZX-D Power Management Controller + 31b4 ZX-100/ZX-D I/O APIC + 31b5 ZX-100/ZX-D Scratch Device + 31b7 ZX-100/ZX-D Standard Host Bridge + 31b8 ZX-100/ZX-D PCI to PCI Bridge + 3288 ZX-100/ZX-D High Definition Audio Controller + 345b ZX-100/ZX-D Miscellaneous Bus + 3a02 ZX-100 C-320 GPU + 3a03 ZX-D C-860 GPU + 9002 ZX-100/ZX-200 EIDE Controller + 9003 ZX-100 EIDE Controller + 9045 ZX-100/ZX-D RAID Accelerator + 9046 ZX-D RAID Accelerator + 9083 ZX-100/ZX-200 StorX AHCI Controller + 9084 ZX-100 StorX AHCI Controller + 9100 ZX-200 Cross bus + 9101 ZX-200 Traffic Controller + 9141 ZX-100 High Definition Audio Controller + 9142 ZX-D High Definition Audio Controller + 9180 ZX-200 Networking Gigabit Ethernet Adapter + 9202 ZX-100 USB eXtensible Host Controller + 9203 ZX-200 USB eXtensible Host Controller + 9286 ZX-D eMMC Host Controller + 9300 ZX-D eSPI Host Controller + 95d0 ZX-100 Universal SD Host Controller + f410 ZX-100/ZX-D PCI Com Port 1d18 RME 0001 Fireface UFX+ 1d1d CNEX Labs @@ -20630,6 +20742,8 @@ 1d62 Nebbiolo Technologies 1d65 Imagine Communications Corp. 04de Taurus/McKinley +1d6a Aquantia Corp. + d107 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 1d6c Atomic Rules LLC 1001 A5PL-E1 1002 A5PL-E7 @@ -21305,6 +21419,8 @@ 6178 DVB-S2 4 Tuner PCIe Card 544d 6904 TBS6904 DVB-S2 Quad Tuner PCIe Card 544d 6905 TBS6905 DVB-S2 Quad Tuner PCIe Card + 6205 0001 TBS6205 DVB-T2/T/C Quad TV Tuner PCIe Card + 6209 0001 TBS6209 DVB-T2/C2/T/C/ISDB-T OctaTV Tuner 5452 SCANLAB AG 3443 RTC4 5455 Technische University Berlin @@ -21336,6 +21452,8 @@ c147 Virtualized Graphics Device 5854 GoTView 5ace Beholder International Ltd. +6205 TBS Technologies (wrong ID) +6209 TBS Technologies (wrong ID) 631c SmartInfra Ltd 1652 PXI-1652 Signal Generator 2504 PXI-2504 Signal Interrogator @@ -23211,6 +23329,7 @@ 17aa 0000 ThinkServer X710 AnyFabric for 10GbE SFP+ 17aa 4001 ThinkServer X710-4 AnyFabric for 10GbE SFP+ 17aa 4002 ThinkServer X710-2 AnyFabric for 10GbE SFP+ + 19e5 d11c Ethernet 2-port X710 10Gb SFP+ Adapter SP330 8086 0000 Ethernet Converged Network Adapter X710 8086 0001 Ethernet Converged Network Adapter X710-4 8086 0002 Ethernet Converged Network Adapter X710-4 @@ -24639,8 +24758,11 @@ 1590 00e8 100Gb 1-port OP101 QSFP28 x16 PCIe Gen3 with Intel Omni-Path Adapter 1590 021c Apollo 100Gb 1-port Intel Omni-Path Architecture 860z Mezzanine FIO Adapter 15d9 0934 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, SIOM Module + 15d9 099b Omni-path HFI Mezz AOC, 1 Port, PCIe x16. 1cb8 0001 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, TC4600 QSFP28 1cb8 0002 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, TC6600 Fixed Port + 1cb8 0003 Omni-Path HFI Adapter 100 Series, 2 Port, 2 PCIe x16, Earth Simulation QSFP28 + 1cb8 0004 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, TC4600E QSFP28 8086 2628 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16 8086 2629 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x8 8086 262a Omni-Path HFI Adapter 100 Series, 2 Ports, Split PCIe x16 @@ -27363,6 +27485,8 @@ 5912 HD Graphics 630 5916 HD Graphics 620 17aa 224f ThinkPad X1 Carbon 5th Gen + 591d HD Graphics P630 + 591f Intel Kaby Lake Host Bridge 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster @@ -28049,6 +28173,7 @@ 9d17 Sunrise Point-LP PCI Express Root Port #8 9d18 Sunrise Point-LP PCI Express Root Port #9 17aa 382a B51-80 Laptop + 9d19 Sunrise Point-LP PCI Express Root Port #10 9d21 Sunrise Point-LP PMC 1028 06f3 Latitude 3570 17aa 224f ThinkPad X1 Carbon 5th Gen @@ -28069,6 +28194,7 @@ 1028 06f3 Latitude 3570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop + 9d35 Sunrise Point-LP Integrated Sensor Hub 9d3a Sunrise Point-LP CSME HECI #1 1028 06f3 Latitude 3570 17aa 224f ThinkPad X1 Carbon 5th Gen @@ -28077,6 +28203,7 @@ 17aa 382a B51-80 Laptop 9d48 Sunrise Point-LP LPC Controller 1028 06f3 Latitude 3570 + 9d56 Sunrise Point-LP LPC Controller 9d58 Sunrise Point-LP LPC Controller 17aa 224f ThinkPad X1 Carbon 5th Gen 9d60 Sunrise Point-LP Serial IO I2C Controller #0 @@ -28091,6 +28218,7 @@ 9d70 Sunrise Point-LP HD Audio 1028 06f3 Latitude 3570 17aa 382a B51-80 Laptop + 9d71 Sunrise Point-LP HD Audio a000 Atom Processor D4xx/D5xx/N4xx/N5xx DMI Bridge 1458 5000 GA-D525TUD 8086 4f4d DeskTop Board D510MO @@ -28190,6 +28318,7 @@ a169 Sunrise Point-H PCI Root Port #19 a16a Sunrise Point-H PCI Root Port #20 a170 Sunrise Point-H HD Audio + a171 CM238 HD Audio Controller a182 Lewisburg SATA Controller [AHCI mode] a186 Lewisburg SATA Controller [RAID mode] a190 Lewisburg PCI Express Root Port #1 From owner-svn-src-head@freebsd.org Mon Sep 4 20:57:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D63E1DEF8; Mon, 4 Sep 2017 20:57:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 30C4B1FCE; Mon, 4 Sep 2017 20:57:39 +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 v84KvcU7067812; Mon, 4 Sep 2017 20:57:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84KvcmF067811; Mon, 4 Sep 2017 20:57:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201709042057.v84KvcmF067811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Sep 2017 20:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323161 - head/usr.sbin/binmiscctl X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.sbin/binmiscctl X-SVN-Commit-Revision: 323161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 20:57:39 -0000 Author: jhibbits Date: Mon Sep 4 20:57:38 2017 New Revision: 323161 URL: https://svnweb.freebsd.org/changeset/base/323161 Log: Correct the binmiscctl(8) man page for powerpc64 Magic for powerpc64 erroneously specified ELFCLASS32 instead of ELFCLASS64. Submitted by: luca.pizzamiglio _AT_ gmail DOT com MFC after: 3 days Modified: head/usr.sbin/binmiscctl/binmiscctl.8 Modified: head/usr.sbin/binmiscctl/binmiscctl.8 ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.8 Mon Sep 4 20:41:34 2017 (r323160) +++ head/usr.sbin/binmiscctl/binmiscctl.8 Mon Sep 4 20:57:38 2017 (r323161) @@ -250,7 +250,7 @@ Add QEMU bsd-user program as an image activator for Po .Bd -literal -offset indent # binmiscctl add powerpc64 \e --interpreter "/usr/local/bin/qemu-ppc64-static" \e - --magic "\ex7f\ex45\ex4c\ex46\ex01\ex02\ex01\ex00\ex00\ex00\e + --magic "\ex7f\ex45\ex4c\ex46\ex02\ex02\ex01\ex00\ex00\ex00\e \ex00\ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\ex15" \e --mask "\exff\exff\exff\exff\exff\exff\exff\ex00\exff\exff\e \exff\exff\exff\exff\exff\exff\exff\exfe\exff\exff" \e From owner-svn-src-head@freebsd.org Mon Sep 4 20:58:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B77AE1DFE8; Mon, 4 Sep 2017 20:58:45 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C521F216F; Mon, 4 Sep 2017 20:58:44 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x22b.google.com with SMTP id d17so5045306lfe.2; Mon, 04 Sep 2017 13:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=QCYqQ3a0dB8rRr0VnRSoeM4cJwm9h0gO4+Y2v0Ibo4Q=; b=n7z9M0nAFLnZ36LOx9lcOsn2/KNPkrS8s2KaQxSuU4acPORqnjJcEZu5RhZTQKAkcF tm4Z3Bodt4PE+PXjWK49q0L+RULa6VLvGVogA6y5/fWYYAdIqhjB/3PPtcxqijKGo6pX OzmhzGYOi13HcunYa18JLheyHvA/QU42uyM1PwCG6bE0nIFWB5wMB+q1eYVy7GyjtthH FU7PkzfOQcbECd2AxaH/M3bae0H4qezHURjlnG0LAM2uhGGYlfdLyJ5Q6/A+Y6yimy6F cTqmCwq5zW1AZaqquQvVhNfs0Moe3g+pgR5OPHLsjo7LJ91xQd84fqcs9Q4PhgeOlwHs +2lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=QCYqQ3a0dB8rRr0VnRSoeM4cJwm9h0gO4+Y2v0Ibo4Q=; b=PEMYxpZW7qEkh02rUg5qIOV0lVbGVz2o17lyIqmoBlj06irRIf+A3m4D+pjZPu4DpP iPhfE60Bb3DeB/t3gCEyVKkj3XsPR18/vnAY98INXkSRO5NLCUVrv/M4muctcnW9E4fU dQ1zsXhAv8noNK4fMGJUy8+4vVDh8tc/Wecm2wDao+7CCGqEXPpMl6/2h1DW4fdtIx1V Ilubv6FuU+R8yqYjy30ymH+9tBLrPHRtzCRxrlVsMBgxvBRWpL5ZG8APmkV1V+/NdPGV XzFj4qHgwXjAXgyq+m/M7EjtXhxtCieTkkW1RcnkVZfHso2xX+zjgpdMZReaa7PqGn7m cHWw== X-Gm-Message-State: AHPjjUg6dhxNucp0/dDH2242LtM6f2PyqAvSSzzrevRruAR5i+rWcDL/ x9IBT9523ywTAQ4m3QCXFiOaLcPE1g== X-Google-Smtp-Source: ADKCNb4+IhDHtIMeSQlCyPMcuD01uHevBCQrLOqZ42m+EgZD5sqCZHPi0zrEb8hlc/bwiUMEYGYByDru/gwi0IMZZ+k= X-Received: by 10.46.2.85 with SMTP id 82mr623356ljc.190.1504558722870; Mon, 04 Sep 2017 13:58:42 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.87.73 with HTTP; Mon, 4 Sep 2017 13:58:42 -0700 (PDT) In-Reply-To: <201709042057.v84KvcmF067811@repo.freebsd.org> References: <201709042057.v84KvcmF067811@repo.freebsd.org> From: Justin Hibbits Date: Mon, 4 Sep 2017 15:58:42 -0500 X-Google-Sender-Auth: B6kCmFsterKWFS6VUmgPO4kO_QY Message-ID: Subject: Re: svn commit: r323161 - head/usr.sbin/binmiscctl To: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 20:58:45 -0000 On Mon, Sep 4, 2017 at 3:57 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Mon Sep 4 20:57:38 2017 > New Revision: 323161 > URL: https://svnweb.freebsd.org/changeset/base/323161 > > Log: > Correct the binmiscctl(8) man page for powerpc64 > > Magic for powerpc64 erroneously specified ELFCLASS32 instead of ELFCLASS64. > > Submitted by: luca.pizzamiglio _AT_ gmail DOT com > MFC after: 3 days PR: 215999 > > Modified: > head/usr.sbin/binmiscctl/binmiscctl.8 > > Modified: head/usr.sbin/binmiscctl/binmiscctl.8 > ============================================================================== > --- head/usr.sbin/binmiscctl/binmiscctl.8 Mon Sep 4 20:41:34 2017 (r323160) > +++ head/usr.sbin/binmiscctl/binmiscctl.8 Mon Sep 4 20:57:38 2017 (r323161) > @@ -250,7 +250,7 @@ Add QEMU bsd-user program as an image activator for Po > .Bd -literal -offset indent > # binmiscctl add powerpc64 \e > --interpreter "/usr/local/bin/qemu-ppc64-static" \e > - --magic "\ex7f\ex45\ex4c\ex46\ex01\ex02\ex01\ex00\ex00\ex00\e > + --magic "\ex7f\ex45\ex4c\ex46\ex02\ex02\ex01\ex00\ex00\ex00\e > \ex00\ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\ex15" \e > --mask "\exff\exff\exff\exff\exff\exff\exff\ex00\exff\exff\e > \exff\exff\exff\exff\exff\exff\exff\exfe\exff\exff" \e > From owner-svn-src-head@freebsd.org Mon Sep 4 22:37:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6C14E2290B; Mon, 4 Sep 2017 22:37:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id A66D26481B; Mon, 4 Sep 2017 22:37:29 +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 v84MbSUG008566; Mon, 4 Sep 2017 22:37:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84MbS4W008562; Mon, 4 Sep 2017 22:37:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201709042237.v84MbS4W008562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Sep 2017 22:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323165 - in head/release: amd64 i386 powerpc sparc64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/release: amd64 i386 powerpc sparc64 X-SVN-Commit-Revision: 323165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Sep 2017 22:37:30 -0000 Author: emaste Date: Mon Sep 4 22:37:28 2017 New Revision: 323165 URL: https://svnweb.freebsd.org/changeset/base/323165 Log: mkisoimages.sh: remove obsolete x$var convention Ancient shells had trouble with empty variables but this has not been relevant for FreeBSD for a very long time (decades?). Modified: head/release/amd64/mkisoimages.sh head/release/i386/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/sparc64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Mon Sep 4 21:58:35 2017 (r323164) +++ head/release/amd64/mkisoimages.sh Mon Sep 4 22:37:28 2017 (r323165) @@ -23,7 +23,7 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -if [ "x$1" = "x-b" ]; then +if [ "$1" = "-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Mon Sep 4 21:58:35 2017 (r323164) +++ head/release/i386/mkisoimages.sh Mon Sep 4 22:37:28 2017 (r323165) @@ -23,7 +23,7 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -if [ "x$1" = "x-b" ]; then +if [ "$1" = "-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" shift Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Mon Sep 4 21:58:35 2017 (r323164) +++ head/release/powerpc/mkisoimages.sh Mon Sep 4 22:37:28 2017 (r323165) @@ -23,7 +23,7 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -if [ "x$1" = "x-b" ]; then +if [ "$1" = "-b" ]; then # Apple boot code uudecode -o /tmp/hfs-boot-block.bz2 "`dirname "$0"`/hfs-boot.bz2.uu" bzip2 -d /tmp/hfs-boot-block.bz2 Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Mon Sep 4 21:58:35 2017 (r323164) +++ head/release/sparc64/mkisoimages.sh Mon Sep 4 22:37:28 2017 (r323165) @@ -40,7 +40,7 @@ echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBIT makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME.tmp" "$@" rm -f "$BASEBITSDIR/etc/fstab" -if [ "x$BOPT" != "x-b" ]; then +if [ "$BOPT" != "-b" ]; then mv "$NAME.tmp" "$NAME" exit 0 fi From owner-svn-src-head@freebsd.org Tue Sep 5 00:11:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DBD9E03A31; Tue, 5 Sep 2017 00:11:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6C96B66F80; Tue, 5 Sep 2017 00:11:07 +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 v850B6nq045071; Tue, 5 Sep 2017 00:11:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v850B6Aa045070; Tue, 5 Sep 2017 00:11:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709050011.v850B6Aa045070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 5 Sep 2017 00:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323166 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 323166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 00:11:07 -0000 Author: markj Date: Tue Sep 5 00:11:06 2017 New Revision: 323166 URL: https://svnweb.freebsd.org/changeset/base/323166 Log: Use O_CLOEXEC when opening persistent handles in libdtrace. PR: 199810 Submitted by: jau@iki.fi MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Mon Sep 4 22:37:28 2017 (r323165) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Sep 5 00:11:06 2017 (r323166) @@ -963,7 +963,7 @@ dt_provmod_open(dt_provmod_t **provmod, dt_fdlist_t *d (void) snprintf(path, sizeof (path), "/dev/dtrace/%s", p1); - if ((fd = open(path, O_RDONLY)) == -1) + if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) continue; /* failed to open driver; just skip it */ if (((prov = malloc(sizeof (dt_provmod_t))) == NULL) || @@ -1100,7 +1100,7 @@ dt_vopen(int version, int flags, int *errp, */ dt_provmod_open(&provmod, &df); - dtfd = open("/dev/dtrace/dtrace", O_RDWR); + dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC); err = errno; /* save errno from opening dtfd */ #if defined(__FreeBSD__) /* @@ -1116,7 +1116,7 @@ dt_vopen(int version, int flags, int *errp, #ifdef illumos ftfd = open("/dev/dtrace/provider/fasttrap", O_RDWR); #else - ftfd = open("/dev/dtrace/fasttrap", O_RDWR); + ftfd = open("/dev/dtrace/fasttrap", O_RDWR | O_CLOEXEC); #endif fterr = ftfd == -1 ? errno : 0; /* save errno from open ftfd */ @@ -1145,9 +1145,6 @@ dt_vopen(int version, int flags, int *errp, } return (set_open_errno(dtp, errp, err)); } - - (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC); - (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC); alloc: if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL) { From owner-svn-src-head@freebsd.org Tue Sep 5 02:09:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B65FBE0CE01 for ; Tue, 5 Sep 2017 02:09:05 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-vk0-x22a.google.com (mail-vk0-x22a.google.com [IPv6:2607:f8b0:400c:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66DF46C0D1 for ; Tue, 5 Sep 2017 02:09:05 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-vk0-x22a.google.com with SMTP id x85so4343145vkx.5 for ; Mon, 04 Sep 2017 19:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PZlbbSXyg5FXFyMjDVbgcafz0NebEsQDtHiptOcWxEI=; b=I7EO6XT6HNpp3fkkJ84DikGANJyI0KPrNgxc685zZpa+uOICUf59m1Cr9Nt+P9SSb7 PKp6FS2igDNvvFoR+2t/t+ON56S+vHI7MH4N7YOaPVt6iqk+TmrSwo4pTVPo+vfhuDOI dhwO7gFZ0nA9XOMT7GMnCUcY4IUljzMiyAQwjK5+L2qJidA00abI0NWYFk598aYjwh9T hWuFHphETwu8J70Bq/tqQ3zf+rwP2B67C2nruQ65Cs3ewgVdHL4U37xxKhznZi8dgjpI aLyGhOWR6bRF5CwP+c+fW+x3v8A3Lna2O+aa65wpv1KU5v0eCAife9G8TCPOrVnTbxWD Cwnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PZlbbSXyg5FXFyMjDVbgcafz0NebEsQDtHiptOcWxEI=; b=AitDreS5ys1BUDaNAfjkL/Hly4HuZAFOyHLKj6mrZtJD8yNCZc/erhuBhRBCgNJNQe EpzrZRJRPtXYQ2A9SjrjW5Ssy8wlJLJ4UQiwOtW8317rnDeGDw5GD88+CkgOIKNxYXB2 F7k8p7zMpg2LrGW/JFJAF/+jez+poCnvbvY8ur3Y5l86HMfpwW3g4HoCLHw4s3fTaG8l j07eFHZGcpYRJAIIfO3ig2UklpGxu/B5L8ng5WUdgrLOdFLStEhLbCYrk1bp1civ4nZE mHvDbLLPzFz5HONo1JRB/eK1XlDlzVOePeYlNQUWauWJJXJy/7jlLyWFPdWAaFaZGx2o YH7Q== X-Gm-Message-State: AHPjjUjjNkHPVVs1cfcpE5oDKx5z0GlRD2ct1aYuNyCjixf4GStodUVG cbAPVczItdMz2k0IUkw2snEBQ4sGxoV4 X-Google-Smtp-Source: ADKCNb4fr0AlitIyFGgkuoHzcO+1JEpW9u69KdOKquLIQT66PWO3L0cqA6lDzGzBOcCy5E4oBXPq4cK4t14nYobxA6A= X-Received: by 10.31.178.78 with SMTP id b75mr1395107vkf.30.1504577344264; Mon, 04 Sep 2017 19:09:04 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.176.6.137 with HTTP; Mon, 4 Sep 2017 19:09:03 -0700 (PDT) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> From: Maxim Sobolev Date: Mon, 4 Sep 2017 19:09:03 -0700 X-Google-Sender-Auth: DJPcAdL4BWXF8PJiAzKGtUxOAOw Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 02:09:05 -0000 Sure, I'll check that out. Thanks for heads up. -Max On Sun, Sep 3, 2017 at 8:18 PM, Alan Somers wrote: > On Mon, Jan 16, 2017 at 10:46 AM, Maxim Sobolev > wrote: > > Author: sobomax > > Date: Mon Jan 16 17:46:38 2017 > > New Revision: 312296 > > URL: https://svnweb.freebsd.org/changeset/base/312296 > > > > Log: > > Add a new socket option SO_TS_CLOCK to pick from several different > clock > > sources to return timestamps when SO_TIMESTAMP is enabled. Two > additional > > clock sources are: > > > > o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); > > o nanosecond resolution monotonic clock (equivalent of > CLOCK_MONOTONIC). > > > > In addition to this, this option provides unified interface to get > bintime > > (equivalent of using SO_BINTIME), except it also supported with IPv6 > where > > SO_BINTIME has never been supported. The long term plan is to > depreciate > > SO_BINTIME and move everything to using SO_TS_CLOCK. > > > > Idea for this enhancement has been briefly discussed on the Net session > > during dev summit in Ottawa last June and the general input was > positive. > > > > This change is believed to benefit network benchmarks/profiling as well > > as other scenarios where precise time of arrival measurement is > necessary. > > > > There are two regression test cases as part of this commit: one > extends unix > > domain test code (unix_cmsg) to test new SCM_XXX types and another one > > implementis totally new test case which exchanges UDP packets between > two > > processes using both conventional methods (i.e. calling > clock_gettime(2) > > before recv(2) and after send(2)), as well as using > setsockopt()+recv() in > > receive path. The resulting delays are checked for sanity for all > supported > > clock types. > > > > Reviewed by: adrian, gnn > > Differential Revision: https://reviews.freebsd.org/D9171 > > While the new SCM_TIMESTAMP code works fine on both amd64 and i386, it > doesn't work on amd64 under 32-bit emulation. That is, programs that > use SCM_TIMESTAMP built for i386 will fail when run on an amd64 > machine. I don't know whether this commit introduced that bug; on > stable-10 SCM_TIMESTAMP doesn't appear to work at all on i386. But > sobomax, since you're obviously familiar with this code, would you > mind taking a look? > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 > > -Alan > > From owner-svn-src-head@freebsd.org Tue Sep 5 05:28:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB22E1A6B1; Tue, 5 Sep 2017 05:28:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 585C0752C3; Tue, 5 Sep 2017 05:28:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v855Sq2X075100; Tue, 5 Sep 2017 05:28:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v855Sqdb075097; Tue, 5 Sep 2017 05:28:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709050528.v855Sqdb075097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 5 Sep 2017 05:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323170 - in head/sys: net sys X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in head/sys: net sys X-SVN-Commit-Revision: 323170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:28:53 -0000 Author: sephe Date: Tue Sep 5 05:28:52 2017 New Revision: 323170 URL: https://svnweb.freebsd.org/changeset/base/323170 Log: if: Add ioctls to get RSS key and hash type/function. It will be needed by hn(4) to configure its RSS key and hash type/function in the transparent VF mode in order to match VF's RSS settings. The description of the transparent VF mode and the RSS hash value issue are here: https://svnweb.freebsd.org/base?view=revision&revision=322299 https://svnweb.freebsd.org/base?view=revision&revision=322485 These are generic enough to promise two independent IOCs instead of abusing SIOCGDRVSPEC. Setting RSS key and hash type/function is a different story, which probably requires more discussion. Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch in the review request; these hash types are standardized now. Reviewed by: gallatin MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12174 Modified: head/sys/net/if.c head/sys/net/if.h head/sys/sys/sockio.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Sep 5 01:40:53 2017 (r323169) +++ head/sys/net/if.c Tue Sep 5 05:28:52 2017 (r323170) @@ -2661,6 +2661,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, case SIOCGIFMEDIA: case SIOCGIFXMEDIA: case SIOCGIFGENERIC: + case SIOCGIFRSSKEY: + case SIOCGIFRSSHASH: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Sep 5 01:40:53 2017 (r323169) +++ head/sys/net/if.h Tue Sep 5 05:28:52 2017 (r323170) @@ -526,6 +526,42 @@ struct ifi2creq { uint8_t data[8]; /* read buffer */ }; +/* + * RSS hash. + */ + +#define RSS_FUNC_NONE 0 /* RSS disabled */ +#define RSS_FUNC_PRIVATE 1 /* non-standard */ +#define RSS_FUNC_TOEPLITZ 2 + +#define RSS_TYPE_IPV4 0x00000001 +#define RSS_TYPE_TCP_IPV4 0x00000002 +#define RSS_TYPE_IPV6 0x00000004 +#define RSS_TYPE_IPV6_EX 0x00000008 +#define RSS_TYPE_TCP_IPV6 0x00000010 +#define RSS_TYPE_TCP_IPV6_EX 0x00000020 +#define RSS_TYPE_UDP_IPV4 0x00000040 +#define RSS_TYPE_UDP_IPV6 0x00000080 +#define RSS_TYPE_UDP_IPV6_EX 0x00000100 + +#define RSS_KEYLEN 128 + +struct ifrsskey { + char ifrk_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrk_func; /* RSS_FUNC_ */ + uint8_t ifrk_spare0; + uint16_t ifrk_keylen; + uint8_t ifrk_key[RSS_KEYLEN]; +}; + +struct ifrsshash { + char ifrh_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + uint8_t ifrh_func; /* RSS_FUNC_ */ + uint8_t ifrh_spare0; + uint16_t ifrh_spare1; + uint32_t ifrh_types; /* RSS_TYPE_ */ +}; + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Tue Sep 5 01:40:53 2017 (r323169) +++ head/sys/sys/sockio.h Tue Sep 5 05:28:52 2017 (r323170) @@ -134,4 +134,8 @@ #define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */ #define SIOCGIFXMEDIA _IOWR('i', 139, struct ifmediareq) /* get net xmedia */ +#define SIOCGIFRSSKEY _IOWR('i', 150, struct ifrsskey)/* get RSS key */ +#define SIOCGIFRSSHASH _IOWR('i', 151, struct ifrsshash)/* get the current RSS + type/func settings */ + #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-head@freebsd.org Tue Sep 5 05:42:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE11E1B318; Tue, 5 Sep 2017 05:42:38 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6AFB176091; Tue, 5 Sep 2017 05:42:38 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v855gbGw083258; Tue, 5 Sep 2017 05:42:37 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v855gb2n083255; Tue, 5 Sep 2017 05:42:37 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709050542.v855gb2n083255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 5 Sep 2017 05:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323171 - in head/sys/arm: conf mv/armada38x X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm: conf mv/armada38x X-SVN-Commit-Revision: 323171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:42:38 -0000 Author: mw Date: Tue Sep 5 05:42:37 2017 New Revision: 323171 URL: https://svnweb.freebsd.org/changeset/base/323171 Log: Change name of Marvell Armada38x RTC driver Two modules with the same name cannot be loaded, so Marvell specific drivers cannot have the same name as generic drivers. Files with the same name, even in different folder overlaps their .o files. Change armada38x/rtc.c to armada38x/armada38x_rtc.c fix it. Preparation for adding this driver to GENERIC config for ARMv7 Marvell platforms. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12185 Added: head/sys/arm/mv/armada38x/armada38x_rtc.c - copied, changed from r323170, head/sys/arm/mv/armada38x/rtc.c Deleted: head/sys/arm/mv/armada38x/rtc.c Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/mv/armada38x/files.armada38x Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue Sep 5 05:28:52 2017 (r323170) +++ head/sys/arm/conf/ARMADA38X Tue Sep 5 05:42:37 2017 (r323171) @@ -48,6 +48,9 @@ device neta # PCI device pci +# RTC +device mv_rtc + # Interrupt controllers device gic options INTRNG Copied and modified: head/sys/arm/mv/armada38x/armada38x_rtc.c (from r323170, head/sys/arm/mv/armada38x/rtc.c) ============================================================================== --- head/sys/arm/mv/armada38x/rtc.c Tue Sep 5 05:28:52 2017 (r323170, copy source) +++ head/sys/arm/mv/armada38x/armada38x_rtc.c Tue Sep 5 05:42:37 2017 (r323171) @@ -128,7 +128,7 @@ static driver_t mv_rtc_driver = { static devclass_t mv_rtc_devclass; -DRIVER_MODULE(mv_rtc, simplebus, mv_rtc_driver, mv_rtc_devclass, 0, 0); +DRIVER_MODULE(a38x_rtc, simplebus, mv_rtc_driver, mv_rtc_devclass, 0, 0); static void mv_rtc_reset(device_t dev) Modified: head/sys/arm/mv/armada38x/files.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/files.armada38x Tue Sep 5 05:28:52 2017 (r323170) +++ head/sys/arm/mv/armada38x/files.armada38x Tue Sep 5 05:42:37 2017 (r323171) @@ -7,6 +7,6 @@ arm/mv/armada/wdt.c optional fdt arm/mv/armada38x/armada38x.c standard arm/mv/armada38x/armada38x_mp.c optional smp arm/mv/armada38x/pmsu.c standard -arm/mv/armada38x/rtc.c standard +arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt arm/mv/armada38x/armada38x_pl310.c optional pl310 dev/sdhci/sdhci_fdt.c optional sdhci From owner-svn-src-head@freebsd.org Tue Sep 5 05:45:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 111A2E1B52A; Tue, 5 Sep 2017 05:45:59 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D543B764A6; Tue, 5 Sep 2017 05:45:58 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v855jwUb083603; Tue, 5 Sep 2017 05:45:58 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v855jwL4083602; Tue, 5 Sep 2017 05:45:58 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709050545.v855jwL4083602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 5 Sep 2017 05:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323172 - head/sys/arm/mv/armada38x X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv/armada38x X-SVN-Commit-Revision: 323172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:45:59 -0000 Author: mw Date: Tue Sep 5 05:45:57 2017 New Revision: 323172 URL: https://svnweb.freebsd.org/changeset/base/323172 Log: Add Armada 80x0/70x0 compatible to 38x RTC driver Marvell Armada 80x0/70x0 SoC family uses same RTC IP as Armada 38x. This patch adds Armada 8k compatible to Marvell RTC driver. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12186 Modified: head/sys/arm/mv/armada38x/armada38x_rtc.c Modified: head/sys/arm/mv/armada38x/armada38x_rtc.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_rtc.c Tue Sep 5 05:42:37 2017 (r323171) +++ head/sys/arm/mv/armada38x/armada38x_rtc.c Tue Sep 5 05:45:57 2017 (r323172) @@ -126,6 +126,12 @@ static driver_t mv_rtc_driver = { sizeof(struct mv_rtc_softc), }; +static struct ofw_compat_data mv_rtc_compat[] = { + {"marvell,armada-380-rtc", true}, + {"marvell,armada-8k-rtc", true}, + {NULL, false}, +}; + static devclass_t mv_rtc_devclass; DRIVER_MODULE(a38x_rtc, simplebus, mv_rtc_driver, mv_rtc_devclass, 0, 0); @@ -174,7 +180,7 @@ mv_rtc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "marvell,armada-380-rtc")) + if (!ofw_bus_search_compatible(dev, mv_rtc_compat)->ocd_data) return (ENXIO); device_set_desc(dev, "Marvell Integrated RTC"); From owner-svn-src-head@freebsd.org Tue Sep 5 05:50:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D48E1B772; Tue, 5 Sep 2017 05:50:02 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4751176956; Tue, 5 Sep 2017 05:50:02 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v855o1hF083958; Tue, 5 Sep 2017 05:50:01 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v855o16x083956; Tue, 5 Sep 2017 05:50:01 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709050550.v855o16x083956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 5 Sep 2017 05:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323173 - in head/sys: arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm64/conf conf X-SVN-Commit-Revision: 323173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:50:02 -0000 Author: mw Date: Tue Sep 5 05:50:01 2017 New Revision: 323173 URL: https://svnweb.freebsd.org/changeset/base/323173 Log: Add Marvell RTC driver to arm64 GENERIC config Marvell Armada 80x0/70x0 SoC family uses same RTC IP as Armada 38x. This patch adds necessary files and enable driver in GENERIC config. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12200 Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Sep 5 05:45:57 2017 (r323172) +++ head/sys/arm64/conf/GENERIC Tue Sep 5 05:50:01 2017 (r323173) @@ -188,6 +188,7 @@ device aw_nmi # Allwinner NMI support # Real-time clock support device aw_rtc # Allwinner Real-time Clock +device mv_rtc # Marvell Real-time Clock # Watchdog controllers device aw_wdog # Allwinner Watchdog Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 5 05:45:57 2017 (r323172) +++ head/sys/conf/files.arm64 Tue Sep 5 05:50:01 2017 (r323173) @@ -73,6 +73,7 @@ arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 +arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt arm64/acpica/acpi_machdep.c optional acpi arm64/acpica/OsdEnvironment.c optional acpi arm64/acpica/acpi_wakeup.c optional acpi From owner-svn-src-head@freebsd.org Tue Sep 5 05:51:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84921E1BA2E for ; Tue, 5 Sep 2017 05:51:51 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: from mail-ua0-x230.google.com (mail-ua0-x230.google.com [IPv6:2607:f8b0:400c:c08::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37FA576CAC; Tue, 5 Sep 2017 05:51:51 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: by mail-ua0-x230.google.com with SMTP id l24so5956623uaa.5; Mon, 04 Sep 2017 22:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OON2XWmpfXKGwWkq/741zg6lgyEyHBpOcyrDouzGLsk=; b=lcGIaIus5S+qbdgwfW1eJJuoTGQpLCPkNfmJzkcZ5ahMVfwjpZxGD3nm5IQSAo8+Yl Q6+sezxMWdLz/4bB9ORQDb/PCUZouB/Ia4WnoHZl2m9p6N5OI+/wylptpZMDfRYo7BXB y6Ji7WqewMCCQ0BkSFIqMMucppe3lOW/+Cr9j3D6SMJOj2rg9bpfs4FogJV/2oK4KPsz UhKv+FGGtXttBUVFduh3Qoz8sSL6xFWgEe/CWGmvFWSUOlB5yUvocEmZi5e6UdwIg6Eo pSZgCxEhba25kQUVjU7lyuPmOSKAKPq78UcxWRbeS3FgwvmVS51GrYpBwcm8/KzQlI61 bHMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OON2XWmpfXKGwWkq/741zg6lgyEyHBpOcyrDouzGLsk=; b=T7D16ScO6rQUkq0fNYi8tFkjG7o+9oYpwbhvoLi8TK9CViiKnPWjdbSAc1orh0/9XB jYPWXW/vbTNegOyG29/pN+CqxzS/VpecDvi+GIs7xYSoKxxKYhy903+tGRvBXvyoaLuf WPJzRq5cqvaOZpmfhVHgQW84dV1vZ831TWbuNWXSJWL+elscXmMJOXkRTjBuim36/tAz PRk+h+o3O5y+cvXjJu37pJaC4RNRbBM3+ZQTZi5EnzwPqQ/CqeI7XlN/7PWlfOLZGsBX hUDsvjrh7ivVzhm0T8TGRcBihk0g9VY2tir9VsV8QFW2UPKF/kOq0nZCLbgxhytZTHev P16A== X-Gm-Message-State: AHPjjUgbPbiofAEiXnbG/q7cFdfahf9nUG9A48mv1I1hGTN/+1GT8EXE FrhW07PKXHX/xTYY7bc88PGhYBja93R4 X-Google-Smtp-Source: ADKCNb7y3R7QMpoyUq2QnpuY0I8gKoZ2pbcC22wSBfehL1AtLWP5cnCr4aEDyc1D3y1HfF99XIzLbx7NupJM+sC1qTY= X-Received: by 10.176.83.24 with SMTP id x24mr1886332uax.107.1504590709734; Mon, 04 Sep 2017 22:51:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.68.87 with HTTP; Mon, 4 Sep 2017 22:51:19 -0700 (PDT) In-Reply-To: <201708311732.v7VHWEvs037245@repo.freebsd.org> References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Jia-Shiun Li Date: Tue, 5 Sep 2017 13:51:19 +0800 Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Warner Losh Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:51:51 -0000 Seems to cause armv6 crossbuild to fail. But did armv6 use efi anyway? jsli@jsli-e5:/tmp/src # uname -a FreeBSD jsli-e5 12.0-CURRENT FreeBSD 12.0-CURRENT #59 r323150: Mon Sep 4 11:30:09 CST 2017 jsli@jsli-e5:/usr/obj/usr/src/sys/GENERIC-NODEBUG amd64 jsli@jsli-e5:/tmp/src # svnversion 323170 jsli@jsli-e5:/tmp/src # time nice +20 env MAKEOBJDIRPREFIX=/tmp/obj make -sj12 TARGET_ARCH=armv6 KERNCONF=RPI2 -DNO_CLEAN buildworld buildkernel ... ... ... /tmp/src/sys/boot/efi/boot1/boot1.c:474:32: error: format specifies type 'wchar_t *' (aka 'unsigned int *') but the argume nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] printf(" Load Path: %S\n", text); ~~ ^~~~ /tmp/src/sys/boot/efi/boot1/boot1.c:485:35: error: format specifies type 'wchar_t *' (aka 'unsigned int *') but the argume nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] printf(" Load Device: %S\n", text); ~~ ^~~~ 2 errors generated. --- boot1.o --- *** [boot1.o] Error code 1 make[6]: stopped in /tmp/src/sys/boot/efi/boot1 1 error make[6]: stopped in /tmp/src/sys/boot/efi/boot1 --- all_subdir_sys/boot/efi/boot1 --- *** [all_subdir_sys/boot/efi/boot1] Error code 2 make[5]: stopped in /tmp/src/sys/boot/efi 1 error make[5]: stopped in /tmp/src/sys/boot/efi --- all_subdir_sys/boot/efi --- *** [all_subdir_sys/boot/efi] Error code 2 make[4]: stopped in /tmp/src/sys/boot 1 error make[4]: stopped in /tmp/src/sys/boot -Jia-Shiun On Fri, Sep 1, 2017 at 1:32 AM, Warner Losh wrote: > Author: imp > Date: Thu Aug 31 17:32:14 2017 > New Revision: 323063 > URL: https://svnweb.freebsd.org/changeset/base/323063 > > Log: > boot1.efi: print more info about where boot1.efi is loaded from > > Print the device that boot1.efi was loaded from. Print the path as > well (since it isn't included in DeviceHandle). Move block where we do > this earlier so all the block handle code is now together. > > Sponsored by: Netflix > > Modified: > head/sys/boot/efi/boot1/boot1.c > > Modified: head/sys/boot/efi/boot1/boot1.c > ============================================================ > ================== > --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 > (r323062) > +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 > (r323063) > @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; > SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; > UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; > + CHAR16 *text; > > /* Basic initialization*/ > ST = Xsystab; > @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > } > putchar('\n'); > > + /* Determine the devpath of our image so we can prefer it. */ > + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > + imgpath = NULL; > + if (status == EFI_SUCCESS) { > + text = efi_devpath_name(img->FilePath); > + printf(" Load Path: %S\n", text); > + efi_free_devpath_name(text); > + > + status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > + (void **)&imgpath); > + if (status != EFI_SUCCESS) { > + DPRINTF("Failed to get image DevicePath (%lu)\n", > + EFI_ERROR_CODE(status)); > + } else { > + text = efi_devpath_name(imgpath); > + printf(" Load Device: %S\n", text); > + efi_free_devpath_name(text); > + } > + > + } > + > /* Get all the device handles */ > hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); > if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void > **)&handles)) > @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > nhandles = hsize / sizeof(*handles); > printf(" Probing %zu block devices...", nhandles); > DPRINTF("\n"); > - > - /* Determine the devpath of our image so we can prefer it. */ > - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > - imgpath = NULL; > - if (status == EFI_SUCCESS) { > - status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > - (void **)&imgpath); > - if (status != EFI_SUCCESS) > - DPRINTF("Failed to get image DevicePath (%lu)\n", > - EFI_ERROR_CODE(status)); > -#ifdef EFI_DEBUG > - { > - CHAR16 *text = efi_devpath_name(imgpath); > - DPRINTF("boot1 imagepath: %S\n", text); > - efi_free_devpath_name(text); > - } > -#endif > - } > > for (i = 0; i < nhandles; i++) > probe_handle_status(handles[i], imgpath); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Sep 5 05:53:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BD99E1BB3F; Tue, 5 Sep 2017 05:53:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 CD81A76F72; Tue, 5 Sep 2017 05:53:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v855rhIQ087631; Tue, 5 Sep 2017 05:53:43 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v855rhYU087630; Tue, 5 Sep 2017 05:53:43 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709050553.v855rhYU087630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 5 Sep 2017 05:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323174 - head/sys/boot/efi/loader X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/boot/efi/loader X-SVN-Commit-Revision: 323174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 05:53:45 -0000 Author: mw Date: Tue Sep 5 05:53:43 2017 New Revision: 323174 URL: https://svnweb.freebsd.org/changeset/base/323174 Log: Fix loader bug causing too many pages allocation when bootloader is U-Boot FreeBSD loader expects to have mmsz variable set by bootloader. U-Boot behaviour is that if buffer size is not big enough to keep whole memory map, assign the smallest correct buffer size to sz and return error. In other words U-Boot assumes that nobody will need mmsz value when buffer is not filled with memory map, which is not true, so calculated pages value was too big to allocate. Solution: Simply assign default value to mmsz. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12194 Modified: head/sys/boot/efi/loader/bootinfo.c Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Tue Sep 5 05:50:01 2017 (r323173) +++ head/sys/boot/efi/loader/bootinfo.c Tue Sep 5 05:53:43 2017 (r323174) @@ -268,6 +268,13 @@ bi_load_efi_data(struct preloaded_file *kfp) efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* + * Assgin size of EFI_MEMORY_DESCRIPTOR to keep compatible with + * u-boot which doesn't fill this value when buffer for memory + * descriptors is too small (eg. 0 to obtain memory map size) + */ + mmsz = sizeof(EFI_MEMORY_DESCRIPTOR); + + /* * It is possible that the first call to ExitBootServices may change * the map key. Fetch a new map key and retry ExitBootServices in that * case. From owner-svn-src-head@freebsd.org Tue Sep 5 06:05:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A83E1C109; Tue, 5 Sep 2017 06:05:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5FDB477CC3; Tue, 5 Sep 2017 06:05:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8565mHU091751; Tue, 5 Sep 2017 06:05:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8565me7091749; Tue, 5 Sep 2017 06:05:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709050605.v8565me7091749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 5 Sep 2017 06:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323175 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 323175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 06:05:49 -0000 Author: sephe Date: Tue Sep 5 06:05:48 2017 New Revision: 323175 URL: https://svnweb.freebsd.org/changeset/base/323175 Log: hyperv/hn: Implement SIOCGIFRSS{KEY,HASH}. The conditional compiling in the review request is removed, since these IOCTLs will be available in stable/10 and stable/11. Reviewed by: gallatin MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12175 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 5 05:53:43 2017 (r323174) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 5 06:05:48 2017 (r323175) @@ -3316,6 +3316,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr = (struct ifreq *)data, ifr_vf; struct ifnet *vf_ifp; int mask, error = 0; + struct ifrsskey *ifrk; + struct ifrsshash *ifrh; switch (cmd) { case SIOCSIFMTU: @@ -3571,6 +3573,56 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } HN_UNLOCK(sc); error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); + break; + + case SIOCGIFRSSHASH: + ifrh = (struct ifrsshash *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrh->ifrh_func = RSS_FUNC_NONE; + ifrh->ifrh_types = 0; + break; + } + + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; + else + ifrh->ifrh_func = RSS_FUNC_PRIVATE; + + ifrh->ifrh_types = 0; + if (sc->hn_rss_hash & NDIS_HASH_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + HN_UNLOCK(sc); + break; + + case SIOCGIFRSSKEY: + ifrk = (struct ifrsskey *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrk->ifrk_func = RSS_FUNC_NONE; + ifrk->ifrk_keylen = 0; + break; + } + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; + else + ifrk->ifrk_func = RSS_FUNC_PRIVATE; + ifrk->ifrk_keylen = NDIS_HASH_KEYSIZE_TOEPLITZ; + memcpy(ifrk->ifrk_key, sc->hn_rss.rss_key, + NDIS_HASH_KEYSIZE_TOEPLITZ); + HN_UNLOCK(sc); break; default: From owner-svn-src-head@freebsd.org Tue Sep 5 06:20:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E6CE1C82D; Tue, 5 Sep 2017 06:20:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B022E7CC8A; Tue, 5 Sep 2017 06:20:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v856K2St096122; Tue, 5 Sep 2017 06:20:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v856K2kH096121; Tue, 5 Sep 2017 06:20:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709050620.v856K2kH096121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 5 Sep 2017 06:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323176 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 323176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 06:20:04 -0000 Author: sephe Date: Tue Sep 5 06:20:02 2017 New Revision: 323176 URL: https://svnweb.freebsd.org/changeset/base/323176 Log: hyperv/hn: Log RSS capabilities mask. This helps to detect when UDP hash types can be supported. MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12177 Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 5 06:05:48 2017 (r323175) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 5 06:20:02 2017 (r323176) @@ -497,6 +497,8 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c caps.ndis_caps); return (EOPNOTSUPP); } + if (bootverbose) + if_printf(sc->hn_ifp, "RSS caps %#x\n", caps.ndis_caps); /* Commit! */ sc->hn_rss_ind_size = indsz; From owner-svn-src-head@freebsd.org Tue Sep 5 07:46:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CAC9E1F64D; Tue, 5 Sep 2017 07:46:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB3FF832DB; Tue, 5 Sep 2017 07:46:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v857kkw7032216; Tue, 5 Sep 2017 07:46:46 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v857kjX9032212; Tue, 5 Sep 2017 07:46:45 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201709050746.v857kjX9032212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 5 Sep 2017 07:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323177 - in head: sys/compat/cloudabi sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: sys/compat/cloudabi sys/contrib/cloudabi usr.bin/truss X-SVN-Commit-Revision: 323177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 07:46:47 -0000 Author: ed Date: Tue Sep 5 07:46:45 2017 New Revision: 323177 URL: https://svnweb.freebsd.org/changeset/base/323177 Log: Merge pipes and socket pairs. Now that CloudABI's sockets API has been changed to be addressless and only connected socket instances are used (e.g., socket pairs), they have become fairly similar to pipes. The only differences on CloudABI is that socket pairs additionally support shutdown(), send() and recv(). To simplify the ABI, we've therefore decided to remove pipes as a separate file descriptor type and just let pipe() return a socket pair of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined identically. Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_file.c head/sys/contrib/cloudabi/cloudabi_types_common.h head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Tue Sep 5 06:20:02 2017 (r323176) +++ head/sys/compat/cloudabi/cloudabi_fd.c Tue Sep 5 07:46:45 2017 (r323177) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); MAPPING(CLOUDABI_RIGHT_FILE_ALLOCATE, CAP_WRITE) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY, CAP_MKDIRAT) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FILE, CAP_CREATE) \ - MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FIFO, CAP_MKFIFOAT) \ MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LINKAT_SOURCE) \ MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT_TARGET) \ MAPPING(CLOUDABI_RIGHT_FILE_OPEN, CAP_LOOKUP) \ @@ -110,34 +109,21 @@ int cloudabi_sys_fd_create2(struct thread *td, struct cloudabi_sys_fd_create2_args *uap) { - struct filecaps fcaps1 = {}, fcaps2 = {}; int fds[2]; - int error; + int error, type; switch (uap->type) { - case CLOUDABI_FILETYPE_FIFO: - /* - * CloudABI pipes are unidirectional. Restrict rights on - * the pipe to simulate this. - */ - cap_rights_init(&fcaps1.fc_rights, CAP_EVENT, CAP_FCNTL, - CAP_FSTAT, CAP_READ); - fcaps1.fc_fcntls = CAP_FCNTL_SETFL; - cap_rights_init(&fcaps2.fc_rights, CAP_EVENT, CAP_FCNTL, - CAP_FSTAT, CAP_WRITE); - fcaps2.fc_fcntls = CAP_FCNTL_SETFL; - error = kern_pipe(td, fds, 0, &fcaps1, &fcaps2); - break; case CLOUDABI_FILETYPE_SOCKET_DGRAM: - error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds); + type = SOCK_DGRAM; break; case CLOUDABI_FILETYPE_SOCKET_STREAM: - error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds); + type = SOCK_STREAM; break; default: return (EINVAL); } + error = kern_socketpair(td, AF_UNIX, type, 0, fds); if (error == 0) { td->td_retval[0] = fds[0]; td->td_retval[1] = fds[1]; @@ -214,11 +200,11 @@ cloudabi_convert_filetype(const struct file *fp) switch (fp->f_type) { case DTYPE_FIFO: - return (CLOUDABI_FILETYPE_FIFO); + return (CLOUDABI_FILETYPE_SOCKET_STREAM); case DTYPE_KQUEUE: return (CLOUDABI_FILETYPE_POLL); case DTYPE_PIPE: - return (CLOUDABI_FILETYPE_FIFO); + return (CLOUDABI_FILETYPE_SOCKET_STREAM); case DTYPE_PROCDESC: return (CLOUDABI_FILETYPE_PROCESS); case DTYPE_SHM: @@ -243,7 +229,7 @@ cloudabi_convert_filetype(const struct file *fp) case VDIR: return (CLOUDABI_FILETYPE_DIRECTORY); case VFIFO: - return (CLOUDABI_FILETYPE_FIFO); + return (CLOUDABI_FILETYPE_SOCKET_STREAM); case VLNK: return (CLOUDABI_FILETYPE_SYMBOLIC_LINK); case VREG: @@ -286,7 +272,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_FD_SYNC | CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY | CLOUDABI_RIGHT_FILE_CREATE_FILE | - CLOUDABI_RIGHT_FILE_CREATE_FIFO | CLOUDABI_RIGHT_FILE_LINK_SOURCE | CLOUDABI_RIGHT_FILE_LINK_TARGET | CLOUDABI_RIGHT_FILE_OPEN | @@ -312,7 +297,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_FILE_ALLOCATE | CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY | CLOUDABI_RIGHT_FILE_CREATE_FILE | - CLOUDABI_RIGHT_FILE_CREATE_FIFO | CLOUDABI_RIGHT_FILE_LINK_SOURCE | CLOUDABI_RIGHT_FILE_LINK_TARGET | CLOUDABI_RIGHT_FILE_OPEN | @@ -331,14 +315,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_MEM_MAP_EXEC | CLOUDABI_RIGHT_POLL_FD_READWRITE | CLOUDABI_RIGHT_PROC_EXEC; - break; - case CLOUDABI_FILETYPE_FIFO: - *base &= CLOUDABI_RIGHT_FD_READ | - CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | - CLOUDABI_RIGHT_FD_WRITE | - CLOUDABI_RIGHT_FILE_STAT_FGET | - CLOUDABI_RIGHT_POLL_FD_READWRITE; - *inheriting = 0; break; case CLOUDABI_FILETYPE_POLL: *base &= ~CLOUDABI_RIGHT_FILE_ADVISE; Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Tue Sep 5 06:20:02 2017 (r323176) +++ head/sys/compat/cloudabi/cloudabi_file.c Tue Sep 5 07:46:45 2017 (r323177) @@ -159,9 +159,6 @@ cloudabi_sys_file_create(struct thread *td, case CLOUDABI_FILETYPE_DIRECTORY: error = kern_mkdirat(td, uap->fd, path, UIO_SYSSPACE, 0777); break; - case CLOUDABI_FILETYPE_FIFO: - error = kern_mkfifoat(td, uap->fd, path, UIO_SYSSPACE, 0666); - break; default: error = EINVAL; break; @@ -346,7 +343,7 @@ write_dirent(struct dirent *bde, cloudabi_dircookie_t cde.d_type = CLOUDABI_FILETYPE_DIRECTORY; break; case DT_FIFO: - cde.d_type = CLOUDABI_FILETYPE_FIFO; + cde.d_type = CLOUDABI_FILETYPE_SOCKET_STREAM; break; case DT_LNK: cde.d_type = CLOUDABI_FILETYPE_SYMBOLIC_LINK; @@ -673,7 +670,7 @@ cloudabi_sys_file_stat_get(struct thread *td, else if (S_ISDIR(sb.st_mode)) csb.st_filetype = CLOUDABI_FILETYPE_DIRECTORY; else if (S_ISFIFO(sb.st_mode)) - csb.st_filetype = CLOUDABI_FILETYPE_FIFO; + csb.st_filetype = CLOUDABI_FILETYPE_SOCKET_STREAM; else if (S_ISREG(sb.st_mode)) csb.st_filetype = CLOUDABI_FILETYPE_REGULAR_FILE; else if (S_ISSOCK(sb.st_mode)) { Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Tue Sep 5 06:20:02 2017 (r323176) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Tue Sep 5 07:46:45 2017 (r323177) @@ -191,7 +191,6 @@ typedef uint8_t cloudabi_filetype_t; #define CLOUDABI_FILETYPE_BLOCK_DEVICE 16 #define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17 #define CLOUDABI_FILETYPE_DIRECTORY 32 -#define CLOUDABI_FILETYPE_FIFO 48 #define CLOUDABI_FILETYPE_POLL 64 #define CLOUDABI_FILETYPE_PROCESS 80 #define CLOUDABI_FILETYPE_REGULAR_FILE 96 @@ -260,7 +259,6 @@ typedef uint64_t cloudabi_rights_t; #define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 #define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 #define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 -#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 #define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 #define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 #define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Sep 5 06:20:02 2017 (r323176) +++ head/usr.bin/truss/syscalls.c Tue Sep 5 07:46:45 2017 (r323177) @@ -734,10 +734,9 @@ static struct xlat cloudabi_fdsflags[] = { static struct xlat cloudabi_filetype[] = { X(FILETYPE_UNKNOWN) X(FILETYPE_BLOCK_DEVICE) X(FILETYPE_CHARACTER_DEVICE) X(FILETYPE_DIRECTORY) - X(FILETYPE_FIFO) X(FILETYPE_POLL) X(FILETYPE_PROCESS) - X(FILETYPE_REGULAR_FILE) X(FILETYPE_SHARED_MEMORY) - X(FILETYPE_SOCKET_DGRAM) X(FILETYPE_SOCKET_STREAM) - X(FILETYPE_SYMBOLIC_LINK) + X(FILETYPE_POLL) X(FILETYPE_PROCESS) X(FILETYPE_REGULAR_FILE) + X(FILETYPE_SHARED_MEMORY) X(FILETYPE_SOCKET_DGRAM) + X(FILETYPE_SOCKET_STREAM) X(FILETYPE_SYMBOLIC_LINK) XEND }; From owner-svn-src-head@freebsd.org Tue Sep 5 12:57:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3F2E07C4B; Tue, 5 Sep 2017 12:57:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id BE10E639E6; Tue, 5 Sep 2017 12:57:46 +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 v85CvjaP058872; Tue, 5 Sep 2017 12:57:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85CvjPM058869; Tue, 5 Sep 2017 12:57:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201709051257.v85CvjPM058869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Sep 2017 12:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323178 - in head/release: amd64 i386 powerpc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/release: amd64 i386 powerpc X-SVN-Commit-Revision: 323178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 12:57:47 -0000 Author: emaste Date: Tue Sep 5 12:57:45 2017 New Revision: 323178 URL: https://svnweb.freebsd.org/changeset/base/323178 Log: make-memstick.sh: use 'set -e' to abort if any step fails Also remove the now-redundant error handling that was only for makefs. This change applies arm64's r308171 to the other make-memstick.sh versions. Reviewed by: gjb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12195 Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh head/release/powerpc/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Tue Sep 5 07:46:45 2017 (r323177) +++ head/release/amd64/make-memstick.sh Tue Sep 5 12:57:45 2017 (r323178) @@ -10,6 +10,8 @@ # $FreeBSD$ # +set -e + PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -31,10 +33,6 @@ fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} -if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 -fi rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Tue Sep 5 07:46:45 2017 (r323177) +++ head/release/i386/make-memstick.sh Tue Sep 5 12:57:45 2017 (r323178) @@ -10,6 +10,8 @@ # $FreeBSD$ # +set -e + PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -31,10 +33,6 @@ fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} -if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 -fi rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Tue Sep 5 07:46:45 2017 (r323177) +++ head/release/powerpc/make-memstick.sh Tue Sep 5 12:57:45 2017 (r323178) @@ -10,6 +10,8 @@ # $FreeBSD$ # +set -e + PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -36,10 +38,6 @@ echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fsta echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local rm -f ${tempfile} makefs -B big ${tempfile} ${1} -if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 -fi rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local From owner-svn-src-head@freebsd.org Tue Sep 5 13:33:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 297E1E09BC5 for ; Tue, 5 Sep 2017 13:33:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D77AD69F62 for ; Tue, 5 Sep 2017 13:33:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id b2so16281687iof.1 for ; Tue, 05 Sep 2017 06:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=MmGDQ+M6hq37lgX41RxPE+wy0p7icX9WjkSinybI0Eo=; b=lIP+RCR3U5KHigWgeXeImC8LDTr+PkL2pWjdvNT0rv5QDCWYTt5kh+y3BYdN4JC+qA wK/cnQM9yTycH0b+9te46c5foy14DfOIrO2IKMUE8JCzzFAmAE3FBwZqPIWsCOF0DY2x S1nTYXQ60Qv1fmvy/CIFq+zcsoyoq/GxwX5C9OnHl6QgAf1jpAdc0eODARTBf/DFlKk1 GDFqGiOSa/RWRMvVcf2EXwaN0jhVzbYGR3VLZWyRc4S8HKcSQR3pDNX/azT2CK62jBQP hfIZkhCoqajw/TtrWb72bO/FZV0bosgkUEEvYdOEHKQdfEx6Judua3mNMzLTYudF/6Ky g7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=MmGDQ+M6hq37lgX41RxPE+wy0p7icX9WjkSinybI0Eo=; b=RHXouOsMPXGM2xKGX1D1JTQMTWJC2hdtt69A/j+pcP/qlPCtstQdP5B9rV8C1c5Wvv WckYFfPB9oQG4y7mNkKzkEtCZEeHT/dWciUDNhgq7P2Xfme7mQUh7fZGaXW6nIgz1ZFv FTbaIBaRIelPd2fwGNsh1woKfO6hoc9qho/R2IBuuR6TFLlSyIIMC59CPk1YkkQAIZx6 YoxyAfW7a6hvJRNFTVpdnNZNGWrDY+civfKIHh6fuFf05PObdjE0tvMNLldDiufcfYna GIrZwnuojYiMFgB7IkFXxIve/jCueWhyDBzu9GVcJOzQpZPHm+KZ5QVbeL3Yv+6SN5p3 jwkw== X-Gm-Message-State: AHPjjUgjoSx4ATMB/39OKcIeuideMZCjXlVgDcpgG8NUoImqTUGqgqOv AfMNKJBIUnVRmZQow24hzOQjPtg9F6J5 X-Google-Smtp-Source: ADKCNb65UIgpvzxk5gTPAU43tqycDhdwiqwc13k+qDGqR16Kcwdm4y0hBvONMzRdNiQHXwMbEiju+3Ud3IA8sPiFCJ0= X-Received: by 10.107.35.208 with SMTP id j199mr4002283ioj.277.1504618406943; Tue, 05 Sep 2017 06:33:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Tue, 5 Sep 2017 06:33:26 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Warner Losh Date: Tue, 5 Sep 2017 07:33:26 -0600 X-Google-Sender-Auth: YwIKEB9GdHRJdROxEu7tlKSAqVo Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Jia-Shiun Li Cc: Warner Losh , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 13:33:28 -0000 On Mon, Sep 4, 2017 at 11:51 PM, Jia-Shiun Li wrote: > Seems to cause armv6 crossbuild to fail. > But did armv6 use efi anyway? > > > jsli@jsli-e5:/tmp/src # uname -a > FreeBSD jsli-e5 12.0-CURRENT FreeBSD 12.0-CURRENT #59 r323150: Mon Sep 4 > 11:30:09 CST 2017 jsli@jsli-e5:/usr/obj/usr/src/sys/GENERIC-NODEBUG > amd64 > jsli@jsli-e5:/tmp/src # svnversion > 323170 > jsli@jsli-e5:/tmp/src # time nice +20 env MAKEOBJDIRPREFIX=/tmp/obj make > -sj12 TARGET_ARCH=armv6 KERNCONF=RPI2 -DNO_CLEAN buildworld buildkernel > ... > ... > ... > /tmp/src/sys/boot/efi/boot1/boot1.c:474:32: error: format specifies type > 'wchar_t *' (aka 'unsigned int *') but the argume > nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] > printf(" Load Path: %S\n", text); > ~~ ^~~~ > /tmp/src/sys/boot/efi/boot1/boot1.c:485:35: error: format specifies type > 'wchar_t *' (aka 'unsigned int *') but the argume > nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat] > printf(" Load Device: %S\n", text); > ~~ ^~~~ > Yea, this is just a command line flag. Will fix. Not sure why x86 doesn't suffer from this, but it's a wchar_t size difference I'm sure. Warner > On Fri, Sep 1, 2017 at 1:32 AM, Warner Losh wrote: > >> Author: imp >> Date: Thu Aug 31 17:32:14 2017 >> New Revision: 323063 >> URL: https://svnweb.freebsd.org/changeset/base/323063 >> >> Log: >> boot1.efi: print more info about where boot1.efi is loaded from >> >> Print the device that boot1.efi was loaded from. Print the path as >> well (since it isn't included in DeviceHandle). Move block where we do >> this earlier so all the block handle code is now together. >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/boot/efi/boot1/boot1.c >> >> Modified: head/sys/boot/efi/boot1/boot1.c >> ============================================================ >> ================== >> --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 >> (r323062) >> +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 >> (r323063) >> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) >> EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; >> SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; >> UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; >> + CHAR16 *text; >> >> /* Basic initialization*/ >> ST = Xsystab; >> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE >> *Xsystab) >> } >> putchar('\n'); >> >> + /* Determine the devpath of our image so we can prefer it. */ >> + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); >> + imgpath = NULL; >> + if (status == EFI_SUCCESS) { >> + text = efi_devpath_name(img->FilePath); >> + printf(" Load Path: %S\n", text); >> + efi_free_devpath_name(text); >> + >> + status = BS->HandleProtocol(img->DeviceHandle, >> &DevicePathGUID, >> + (void **)&imgpath); >> + if (status != EFI_SUCCESS) { >> + DPRINTF("Failed to get image DevicePath (%lu)\n", >> + EFI_ERROR_CODE(status)); >> + } else { >> + text = efi_devpath_name(imgpath); >> + printf(" Load Device: %S\n", text); >> + efi_free_devpath_name(text); >> + } >> + >> + } >> + >> /* Get all the device handles */ >> hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); >> if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void >> **)&handles)) >> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE >> *Xsystab) >> nhandles = hsize / sizeof(*handles); >> printf(" Probing %zu block devices...", nhandles); >> DPRINTF("\n"); >> - >> - /* Determine the devpath of our image so we can prefer it. */ >> - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); >> - imgpath = NULL; >> - if (status == EFI_SUCCESS) { >> - status = BS->HandleProtocol(img->DeviceHandle, >> &DevicePathGUID, >> - (void **)&imgpath); >> - if (status != EFI_SUCCESS) >> - DPRINTF("Failed to get image DevicePath (%lu)\n", >> - EFI_ERROR_CODE(status)); >> -#ifdef EFI_DEBUG >> - { >> - CHAR16 *text = efi_devpath_name(imgpath); >> - DPRINTF("boot1 imagepath: %S\n", text); >> - efi_free_devpath_name(text); >> - } >> -#endif >> - } >> >> for (i = 0; i < nhandles; i++) >> probe_handle_status(handles[i], imgpath); >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > > From owner-svn-src-head@freebsd.org Tue Sep 5 14:32:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D93C5E0C7A7; Tue, 5 Sep 2017 14:32:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EF3374D7A; Tue, 5 Sep 2017 14:32:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85EWuQj099793; Tue, 5 Sep 2017 14:32:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85EWuJn099792; Tue, 5 Sep 2017 14:32:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201709051432.v85EWuJn099792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 5 Sep 2017 14:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323183 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 14:32:58 -0000 Author: trasz Date: Tue Sep 5 14:32:56 2017 New Revision: 323183 URL: https://svnweb.freebsd.org/changeset/base/323183 Log: Make root_mount_rel(9) ignore NULL arguments, like it used to before r313351. It would be better to fix API consumers to not pass NULL there - most of them, such as gmirror, already contain the neccessary checks - but this is easier and much less error-prone. One known user-visible result is that it fixes panic on a failed "graid label". PR: 221846 MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Tue Sep 5 13:55:14 2017 (r323182) +++ head/sys/kern/vfs_mountroot.c Tue Sep 5 14:32:56 2017 (r323183) @@ -183,7 +183,8 @@ void root_mount_rel(struct root_hold_token *h) { - KASSERT(h != NULL, ("%s: NULL token", __func__)); + if (h == NULL) + return; mtx_lock(&root_holds_mtx); LIST_REMOVE(h, list); From owner-svn-src-head@freebsd.org Tue Sep 5 15:13:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FBA9E0DF15; Tue, 5 Sep 2017 15:13:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 46714808FA; Tue, 5 Sep 2017 15:13:43 +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 v85FDg5M016277; Tue, 5 Sep 2017 15:13:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85FDfCN016267; Tue, 5 Sep 2017 15:13:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709051513.v85FDfCN016267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Sep 2017 15:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323184 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/amdsmn sys/modules sys/modules/amdsmn X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/amdsmn sys/modules sys/modules/amdsmn X-SVN-Commit-Revision: 323184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 15:13:43 -0000 Author: cem Date: Tue Sep 5 15:13:41 2017 New Revision: 323184 URL: https://svnweb.freebsd.org/changeset/base/323184 Log: Add smn(4) driver for AMD System Management Network AMD Family 17h CPUs have an internal network used to communicate between the host CPU and the PSP and SMU coprocessors. It exposes a simple 32-bit register space. Reviewed by: avg (no +1), mjoras, truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12217 Added: head/share/man/man4/amdsmn.4 (contents, props changed) head/sys/dev/amdsmn/ head/sys/dev/amdsmn/amdsmn.c (contents, props changed) head/sys/dev/amdsmn/amdsmn.h (contents, props changed) head/sys/modules/amdsmn/ head/sys/modules/amdsmn/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Sep 5 14:32:56 2017 (r323183) +++ head/share/man/man4/Makefile Tue Sep 5 15:13:41 2017 (r323184) @@ -46,6 +46,7 @@ MAN= aac.4 \ amdpm.4 \ ${_amdsbwd.4} \ ${_amdsmb.4} \ + ${_amdsmn.4} \ ${_amdtemp.4} \ ${_bxe.4} \ amr.4 \ @@ -769,6 +770,7 @@ _attimer.4= attimer.4 _aibs.4= aibs.4 _amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 +_amdsmn.4= amdsmn.4 _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 _bxe.4= bxe.4 Added: head/share/man/man4/amdsmn.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/amdsmn.4 Tue Sep 5 15:13:41 2017 (r323184) @@ -0,0 +1,64 @@ +.\"- +.\" Copyright (c) 2017 Conrad Meyer +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd September 5, 2017 +.Dt AMDSMN 4 +.Os +.Sh NAME +.Nm amdsmn +.Nd device driver for +.Tn AMD +processor System Management Network +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device amdsmn" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +amdsmn_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for resources on the System Management Network bus +in +.Tn AMD +Family 17h processors. +.Sh SEE ALSO +.Xr loader 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An Conrad Meyer Aq Mt cem@FreeBSD.org Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Sep 5 14:32:56 2017 (r323183) +++ head/sys/amd64/conf/NOTES Tue Sep 5 15:13:41 2017 (r323184) @@ -589,6 +589,11 @@ device cpuctl options ENABLE_ALART # Control alarm on Intel intpm driver # +# AMD System Management Network (SMN) +# +device amdsmn + +# # Number of initial kernel page table pages used for early bootstrap. # This number should include enough pages to map the kernel and any # modules or other data loaded with the kernel by the loader. Each Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Sep 5 14:32:56 2017 (r323183) +++ head/sys/boot/forth/loader.conf Tue Sep 5 15:13:41 2017 (r323184) @@ -525,6 +525,7 @@ coretemp_load="NO" # Intel Core CPU temperature monit vkbd_load="NO" # Virtual AT keyboard interface vpd_load="NO" # Vital Product Data kernel interface vpo_load="NO" # Parallel to SCSI interface driver +amdsmn_load="NO" # AMD Family 17h System Management Network amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor tpm_load="NO" # Trusted Platform Module wbwd_load="NO" # Winbond watchdog Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Sep 5 14:32:56 2017 (r323183) +++ head/sys/conf/files.amd64 Tue Sep 5 15:13:41 2017 (r323184) @@ -198,6 +198,7 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp dev/amdsbwd/amdsbwd.c optional amdsbwd +dev/amdsmn/amdsmn.c optional amdsmn dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Sep 5 14:32:56 2017 (r323183) +++ head/sys/conf/files.i386 Tue Sep 5 15:13:41 2017 (r323184) @@ -152,6 +152,7 @@ dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/aic/aic_isa.c optional aic isa dev/amdsbwd/amdsbwd.c optional amdsbwd +dev/amdsmn/amdsmn.c optional amdsmn dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Added: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdsmn/amdsmn.c Tue Sep 5 15:13:41 2017 (r323184) @@ -0,0 +1,186 @@ +/*- + * Copyright (c) 2017 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Driver for the AMD Family 17h CPU System Management Network. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#define SMN_ADDR_REG 0x60 +#define SMN_DATA_REG 0x64 + +struct amdsmn_softc { + struct mtx smn_lock; +}; + +static struct pciid { + uint32_t device_id; +} amdsmn_ids[] = { + { 0x14501022 }, +}; + +/* + * Device methods. + */ +static void amdsmn_identify(driver_t *driver, device_t parent); +static int amdsmn_probe(device_t dev); +static int amdsmn_attach(device_t dev); +static int amdsmn_detach(device_t dev); + +static device_method_t amdsmn_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, amdsmn_identify), + DEVMETHOD(device_probe, amdsmn_probe), + DEVMETHOD(device_attach, amdsmn_attach), + DEVMETHOD(device_detach, amdsmn_detach), + DEVMETHOD_END +}; + +static driver_t amdsmn_driver = { + "amdsmn", + amdsmn_methods, + sizeof(struct amdsmn_softc), +}; + +static devclass_t amdsmn_devclass; +DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); +MODULE_VERSION(amdsmn, 1); + +static void +amdsmn_identify(driver_t *driver, device_t parent) +{ + device_t child; + uint32_t devid; + size_t i; + + /* Make sure we're not being doubly invoked. */ + if (device_find_child(parent, "amdsmn", -1) != NULL) + return; + + devid = pci_get_devid(parent); + for (i = 0; i < nitems(amdsmn_ids); i++) + if (amdsmn_ids[i].device_id == devid) + break; + + if (i >= nitems(amdsmn_ids)) + return; + + child = device_add_child(parent, "amdsmn", -1); + if (child == NULL) + device_printf(parent, "add amdsmn child failed\n"); +} + +static int +amdsmn_probe(device_t dev) +{ + uint32_t family; + + if (resource_disabled("amdsmn", 0)) + return (ENXIO); + + family = CPUID_TO_FAMILY(cpu_id); + + switch (family) { + case 0x17: + break; + default: + return (ENXIO); + } + device_set_desc(dev, "AMD Family 17h System Management Network"); + + return (BUS_PROBE_GENERIC); +} + +static int +amdsmn_attach(device_t dev) +{ + struct amdsmn_softc *sc = device_get_softc(dev); + + mtx_init(&sc->smn_lock, "SMN mtx", "SMN", MTX_DEF); + return (0); +} + +int +amdsmn_detach(device_t dev) +{ + struct amdsmn_softc *sc = device_get_softc(dev); + + mtx_destroy(&sc->smn_lock); + return (0); +} + +int +amdsmn_read(device_t dev, uint32_t addr, uint32_t *value) +{ + struct amdsmn_softc *sc = device_get_softc(dev); + device_t parent; + + parent = device_get_parent(dev); + + mtx_lock(&sc->smn_lock); + pci_write_config(parent, SMN_ADDR_REG, addr, 4); + *value = pci_read_config(parent, SMN_DATA_REG, 4); + mtx_unlock(&sc->smn_lock); + + return (0); +} + +int +amdsmn_write(device_t dev, uint32_t addr, uint32_t value) +{ + struct amdsmn_softc *sc = device_get_softc(dev); + device_t parent; + + parent = device_get_parent(dev); + + mtx_lock(&sc->smn_lock); + pci_write_config(parent, SMN_ADDR_REG, addr, 4); + pci_write_config(parent, SMN_DATA_REG, value, 4); + mtx_unlock(&sc->smn_lock); + + return (0); +} Added: head/sys/dev/amdsmn/amdsmn.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdsmn/amdsmn.h Tue Sep 5 15:13:41 2017 (r323184) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2017 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#pragma once + +int amdsmn_read(device_t dev, uint32_t addr, uint32_t *value); +int amdsmn_write(device_t dev, uint32_t addr, uint32_t value); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Sep 5 14:32:56 2017 (r323183) +++ head/sys/modules/Makefile Tue Sep 5 15:13:41 2017 (r323184) @@ -35,6 +35,7 @@ SUBDIR= \ alq \ ${_amd_ecc_inject} \ ${_amdsbwd} \ + ${_amdsmn} \ ${_amdtemp} \ amr \ ${_an} \ @@ -626,6 +627,7 @@ _aesni= aesni .endif _amd_ecc_inject=amd_ecc_inject _amdsbwd= amdsbwd +_amdsmn= amdsmn _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc Added: head/sys/modules/amdsmn/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/amdsmn/Makefile Tue Sep 5 15:13:41 2017 (r323184) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/amdsmn + +KMOD= amdsmn +SRCS= amdsmn.c bus_if.h device_if.h pci_if.h + +.include From owner-svn-src-head@freebsd.org Tue Sep 5 15:19:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E4AE0E2AA; Tue, 5 Sep 2017 15:19:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id AAECE8199B; Tue, 5 Sep 2017 15:19:15 +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 v85FJECQ016673; Tue, 5 Sep 2017 15:19:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85FJE8P016669; Tue, 5 Sep 2017 15:19:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709051519.v85FJE8P016669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Sep 2017 15:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323185 - in head: share/man/man4 sys/conf sys/dev/amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/amdtemp X-SVN-Commit-Revision: 323185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 15:19:16 -0000 Author: cem Date: Tue Sep 5 15:19:14 2017 New Revision: 323185 URL: https://svnweb.freebsd.org/changeset/base/323185 Log: amdtemp(4): Add support for Family 17h temperature sensor The sensor value is formatted similarly to previous models (same bitfield sizes, same units), but must be read off of the internal System Management Network (SMN) from the System Management Unit (SMU) co-processor. PR: 218264 Reported and tested by: Nils Beyer Reviewed by: avg (no +1), mjoras, truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12217 Modified: head/share/man/man4/amdtemp.4 head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/amdtemp/amdtemp.c Modified: head/share/man/man4/amdtemp.4 ============================================================================== --- head/share/man/man4/amdtemp.4 Tue Sep 5 15:13:41 2017 (r323184) +++ head/share/man/man4/amdtemp.4 Tue Sep 5 15:19:14 2017 (r323185) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2017 +.Dd September 5, 2017 .Dt AMDTEMP 4 .Os .Sh NAME @@ -53,7 +53,7 @@ The driver provides support for the on-die digital thermal sensor present in .Tn AMD -Family 0Fh, 10h, 11h, 12h, 14h, 15h, and 16h processors. +Family 0Fh, 10h, 11h, 12h, 14h, 15h, 16h, and 17h processors. .Pp For Family 0Fh processors, the .Nm @@ -64,8 +64,8 @@ The driver also creates in the corresponding CPU device's sysctl tree, displaying the maximum temperature of the two sensors located in each CPU core. .Pp -For Family 10h, 11h, 12h, 14h, 15h, and 16h processors, the driver reports each -package's temperature through a sysctl node, named +For Family 10h, 11h, 12h, 14h, 15h, 16h, and 17h processors, the driver reports +each package's temperature through a sysctl node, named .Va dev.amdtemp.%d.core0.sensor0 . The driver also creates .Va dev.cpu.%d.temperature Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Sep 5 15:13:41 2017 (r323184) +++ head/sys/conf/files.amd64 Tue Sep 5 15:19:14 2017 (r323185) @@ -198,7 +198,7 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp dev/amdsbwd/amdsbwd.c optional amdsbwd -dev/amdsmn/amdsmn.c optional amdsmn +dev/amdsmn/amdsmn.c optional amdsmn | amdtemp dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Sep 5 15:13:41 2017 (r323184) +++ head/sys/conf/files.i386 Tue Sep 5 15:19:14 2017 (r323185) @@ -152,7 +152,7 @@ dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/aic/aic_isa.c optional aic isa dev/amdsbwd/amdsbwd.c optional amdsbwd -dev/amdsmn/amdsmn.c optional amdsmn +dev/amdsmn/amdsmn.c optional amdsmn | amdtemp dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Sep 5 15:13:41 2017 (r323184) +++ head/sys/dev/amdtemp/amdtemp.c Tue Sep 5 15:19:14 2017 (r323185) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + typedef enum { CORE0_SENSOR0, CORE0_SENSOR1, @@ -59,7 +61,6 @@ typedef enum { } amdsensor_t; struct amdtemp_softc { - device_t sc_dev; int sc_ncores; int sc_ntemps; int sc_flags; @@ -70,6 +71,7 @@ struct amdtemp_softc { int32_t (*sc_gettemp)(device_t, amdsensor_t); struct sysctl_oid *sc_sysctl_cpu[MAXCPU]; struct intr_config_hook sc_ich; + device_t sc_smn; }; #define VENDORID_AMD 0x1022 @@ -82,6 +84,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16 0x1533 #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_MISC17 0x141d +#define DEVICEID_AMD_HOSTB17H 0x1450 static struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -96,6 +99,7 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16 }, { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, { VENDORID_AMD, DEVICEID_AMD_MISC17 }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H }, { 0, 0 } }; @@ -105,6 +109,11 @@ static struct amdtemp_product { #define AMDTEMP_REPTMP_CTRL 0xa4 /* + * Reported Temperature, Family 17h + */ +#define AMDTEMP_17H_CUR_TMP 0x59800 + +/* * Thermaltrip Status Register (Family 0Fh only) */ #define AMDTEMP_THERMTP_STAT 0xe4 @@ -133,6 +142,7 @@ static int amdtemp_detach(device_t dev); static int amdtemp_match(device_t dev); static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); +static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -153,6 +163,8 @@ static driver_t amdtemp_driver = { static devclass_t amdtemp_devclass; DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_devclass, NULL, NULL); +MODULE_VERSION(amdtemp, 1); +MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); static int amdtemp_match(device_t dev) @@ -211,6 +223,7 @@ amdtemp_probe(device_t dev) case 0x14: case 0x15: case 0x16: + case 0x17: break; default: return (ENXIO); @@ -240,7 +253,7 @@ amdtemp_attach(device_t dev) cpuid = cpu_id; family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); - if (family != 0x0f || model >= 0x40) { + if ((family != 0x0f || model >= 0x40) && family != 0x17) { cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); family = CPUID_TO_FAMILY(cpuid); model = CPUID_TO_MODEL(cpuid); @@ -342,6 +355,17 @@ amdtemp_attach(device_t dev) sc->sc_gettemp = amdtemp_gettemp; break; + case 0x17: + sc->sc_ntemps = 1; + sc->sc_gettemp = amdtemp_gettemp17h; + sc->sc_smn = device_find_child( + device_get_parent(dev), "amdsmn", -1); + if (sc->sc_smn == NULL) { + if (bootverbose) + device_printf(dev, "No SMN device found\n"); + return (ENXIO); + } + break; } /* Find number of cores per package. */ @@ -552,6 +576,22 @@ amdtemp_gettemp(device_t dev, amdsensor_t sensor) uint32_t temp; temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); + temp = ((temp >> 21) & 0x7ff) * 5 / 4; + temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; + + return (temp); +} + +static int32_t +amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t temp; + int error; + + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &temp); + KASSERT(error == 0, ("amdsmn_read")); + temp = ((temp >> 21) & 0x7ff) * 5 / 4; temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; From owner-svn-src-head@freebsd.org Tue Sep 5 19:04:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD009E19616; Tue, 5 Sep 2017 19:04:09 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5CE6D7A4; Tue, 5 Sep 2017 19:04:09 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85J48Tb013719; Tue, 5 Sep 2017 19:04:08 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85J48P2013715; Tue, 5 Sep 2017 19:04:08 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201709051904.v85J48P2013715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 5 Sep 2017 19:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323192 - head/contrib/binutils/opcodes X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/contrib/binutils/opcodes X-SVN-Commit-Revision: 323192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 19:04:10 -0000 Author: rlibby Date: Tue Sep 5 19:04:07 2017 New Revision: 323192 URL: https://svnweb.freebsd.org/changeset/base/323192 Log: gnu binutils: FSGSBASE assembly/disassembly Enable the in-tree binutils to assemble and disassemble amd64 FSGSBASE instructions (rdfsbase, rdgsbase, wrfsbase, wrgsbase), used in the base system since r322763. This gives one last gasp for in-tree gcc, and provides a small enhancement for in-tree binutils objdump. Reviewed by: dim, kib Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12222 Modified: head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.h head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Tue Sep 5 18:13:11 2017 (r323191) +++ head/contrib/binutils/opcodes/i386-dis.c Tue Sep 5 19:04:07 2017 (r323192) @@ -1302,7 +1302,7 @@ static const unsigned char twobyte_uses_REPZ_prefix[25 /* 70 */ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1, /* 7f */ /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */ /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */ - /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */ + /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, /* af */ /* b0 */ 0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, /* bf */ /* c0 */ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */ /* d0 */ 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, /* df */ @@ -1793,10 +1793,10 @@ static const struct dis386 grps[][8] = { }, /* GRP15 */ { - { "fxsave", { Ev } }, - { "fxrstor", { Ev } }, - { "ldmxcsr", { Ev } }, - { "stmxcsr", { Ev } }, + { "fxsave", { { OP_0fae, v_mode } } }, + { "fxrstor", { { OP_0fae, v_mode } } }, + { "ldmxcsr", { { OP_0fae, v_mode } } }, + { "stmxcsr", { { OP_0fae, v_mode } } }, { "xsave", { Ev } }, { "xrstor", { { OP_0fae, v_mode } } }, { "xsaveopt", { { OP_0fae, v_mode } } }, @@ -5997,19 +5997,34 @@ OP_0fae (int bytemode, int sizeflag) { if (modrm.mod == 3) { - if (modrm.reg == 7) - strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); - else if (modrm.reg == 6) - strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); - else if (modrm.reg == 5) - strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); - - if (modrm.reg < 5 || modrm.rm != 0) + if (modrm.reg >= 5 && modrm.reg <= 7 && modrm.rm == 0) { - BadOp (); /* bad sfence, mfence, or lfence */ + if (modrm.reg == 7) + strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); + else if (modrm.reg == 6) + strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); + else if (modrm.reg == 5) + strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); + bytemode = 0; + } + else if (modrm.reg <= 3 && (prefixes & PREFIX_REPZ) != 0) + { + if (modrm.reg == 0) + strcpy (obuf + strlen (obuf) - sizeof ("fxsave") + 1, "rdfsbase"); + else if (modrm.reg == 1) + strcpy (obuf + strlen (obuf) - sizeof ("fxrstor") + 1, "rdgsbase"); + else if (modrm.reg == 2) + strcpy (obuf + strlen (obuf) - sizeof ("ldmxcsr") + 1, "wrfsbase"); + else if (modrm.reg == 3) + strcpy (obuf + strlen (obuf) - sizeof ("stmxcsr") + 1, "wrgsbase"); + used_prefixes |= PREFIX_REPZ; + bytemode = dq_mode; + } + else + { + BadOp (); return; } - bytemode = 0; } OP_E (bytemode, sizeflag); Modified: head/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.h Tue Sep 5 18:13:11 2017 (r323191) +++ head/contrib/binutils/opcodes/i386-opc.h Tue Sep 5 19:04:07 2017 (r323192) @@ -81,6 +81,7 @@ typedef struct template #define CpuPCLMUL 0x10000000 /* Carry-less Multiplication extensions */ #define CpuRdRnd 0x20000000 /* Intel Random Number Generator extensions */ #define CpuSMAP 0x40000000 /* Intel Supervisor Mode Access Prevention */ +#define CpuFSGSBase 0x80000000 /* Read/write fs/gs segment base registers */ /* SSE4.1/4.2 Instructions required */ #define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) @@ -89,7 +90,8 @@ typedef struct template #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL|CpuRdRnd|CpuSMAP) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL|CpuRdRnd|CpuSMAP \ + |CpuFSGSBase) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Tue Sep 5 18:13:11 2017 (r323191) +++ head/contrib/binutils/opcodes/i386-opc.tbl Tue Sep 5 19:04:07 2017 (r323192) @@ -1525,3 +1525,13 @@ pclmulhqhqdq, 2, 0x660f3a44, 0x11, CpuPCLMUL, Modrm|Ig // Intel Random Number Generator extensions rdrand, 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } rdseed, 1, 0x0fc7, 0x7, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } + +// Intel Supervisor Mode Access Prevention extensions +clac, 0, 0x0f01, 0xca, CpuSMAP, NoSuf|ImmExt, { 0 } +stac, 0, 0x0f01, 0xcb, CpuSMAP, NoSuf|ImmExt, { 0 } + +// Read/write fs/gs segment base registers +rdfsbase, 1, 0xf30fae, 0x0, CpuFSGSBase|Cpu64, Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, { Reg32|Reg64 } +rdgsbase, 1, 0xf30fae, 0x1, CpuFSGSBase|Cpu64, Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, { Reg32|Reg64 } +wrfsbase, 1, 0xf30fae, 0x2, CpuFSGSBase|Cpu64, Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, { Reg32|Reg64 } +wrgsbase, 1, 0xf30fae, 0x3, CpuFSGSBase|Cpu64, Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, { Reg32|Reg64 } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Tue Sep 5 18:13:11 2017 (r323191) +++ head/contrib/binutils/opcodes/i386-tbl.h Tue Sep 5 19:04:07 2017 (r323192) @@ -4400,6 +4400,20 @@ const template i386_optab[] = NoSuf|ImmExt, { 0, 0, 0 } }, {"stac", 0, 0x0f01, 0xcb, CpuSMAP, NoSuf|ImmExt, { 0, 0, 0 } }, + + /* Read/write fs/gs segment base registers */ + {"rdfsbase", 1, 0xf30fae, 0x0, CpuFSGSBase|Cpu64, + Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, + { Reg32|Reg64 } }, + {"rdgsbase", 1, 0xf30fae, 0x1, CpuFSGSBase|Cpu64, + Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, + { Reg32|Reg64 } }, + {"wrfsbase", 1, 0xf30fae, 0x2, CpuFSGSBase|Cpu64, + Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, + { Reg32|Reg64 } }, + {"wrgsbase", 1, 0xf30fae, 0x3, CpuFSGSBase|Cpu64, + Modrm|No_bSuf|No_wSuf|No_sSuf|No_xSuf, + { Reg32|Reg64 } }, { NULL, 0, 0, 0, 0, 0, { 0 } } }; From owner-svn-src-head@freebsd.org Tue Sep 5 19:28:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519CBE1AFF6; Tue, 5 Sep 2017 19:28:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC048730C3; Tue, 5 Sep 2017 19:28:36 +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 v85JSZpG022380; Tue, 5 Sep 2017 19:28:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85JSZ9X022379; Tue, 5 Sep 2017 19:28:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709051928.v85JSZ9X022379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 5 Sep 2017 19:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323193 - head/cddl/compat/opensolaris/misc X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/compat/opensolaris/misc X-SVN-Commit-Revision: 323193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 19:28:37 -0000 Author: asomers Date: Tue Sep 5 19:28:35 2017 New Revision: 323193 URL: https://svnweb.freebsd.org/changeset/base/323193 Log: Honor all options of "zfs mount -o" The existing code in zmount incorrectly parses the comma-delimited option string. The result is that nmount only honors the last option. AFAICT the parsing has been broken ever since ZFS's initial import in change 168404. PR: 222078 Reviewed by: avg MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12232 Modified: head/cddl/compat/opensolaris/misc/zmount.c Modified: head/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- head/cddl/compat/opensolaris/misc/zmount.c Tue Sep 5 19:04:07 2017 (r323192) +++ head/cddl/compat/opensolaris/misc/zmount.c Tue Sep 5 19:28:35 2017 (r323193) @@ -74,7 +74,7 @@ zmount(const char *spec, const char *dir, int mflag, c char *dataptr, int datalen, char *optptr, int optlen) { struct iovec *iov; - char *optstr, *os, *p; + char *optstr, *os, *p, *tofree; int iovlen, rv; assert(spec != NULL); @@ -87,7 +87,7 @@ zmount(const char *spec, const char *dir, int mflag, c assert(optptr != NULL); assert(optlen > 0); - optstr = strdup(optptr); + tofree = optstr = strdup(optptr); assert(optstr != NULL); iov = NULL; @@ -98,11 +98,9 @@ zmount(const char *spec, const char *dir, int mflag, c build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1); - for (p = optstr; p != NULL; strsep(&p, ",/ ")) { - if (*p != '\0') - build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); - } + while ((p = strsep(&optstr, ",/")) != NULL) + build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); rv = nmount(iov, iovlen, 0); - free(optstr); + free(tofree); return (rv); } From owner-svn-src-head@freebsd.org Tue Sep 5 19:40:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F83BE1B781; Tue, 5 Sep 2017 19:40:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7727579E; Tue, 5 Sep 2017 19:40:05 +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 v85Je4bq026371; Tue, 5 Sep 2017 19:40:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85Je4Y1026370; Tue, 5 Sep 2017 19:40:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709051940.v85Je4Y1026370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 5 Sep 2017 19:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323194 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 323194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 19:40:06 -0000 Author: asomers Date: Tue Sep 5 19:40:04 2017 New Revision: 323194 URL: https://svnweb.freebsd.org/changeset/base/323194 Log: Fix remounting ZFS filesystem with "zfs mount" "zfs mount -o" passes a list of mount options directly to nmount(2) after sanity checking them. In particular, zfs(8) will refuse to mount an already existing file system unless "remount" is specified in the option list. However, the "remount" option only exists in Illumos. FreeBSD's equivalent is "update". PR: 221985 Reviewed by: avg MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12233 Modified: head/sys/cddl/compat/opensolaris/sys/mntent.h Modified: head/sys/cddl/compat/opensolaris/sys/mntent.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/mntent.h Tue Sep 5 19:28:35 2017 (r323193) +++ head/sys/cddl/compat/opensolaris/sys/mntent.h Tue Sep 5 19:40:04 2017 (r323194) @@ -46,7 +46,7 @@ #define MNTOPT_NODEVICES "nodevices" /* Device-special disallowed */ #define MNTOPT_SETUID "setuid" /* Set uid allowed */ #define MNTOPT_NOSETUID "nosetuid" /* Set uid not allowed */ -#define MNTOPT_REMOUNT "remount" /* Change mount options */ +#define MNTOPT_REMOUNT "update" /* Change mount options */ #define MNTOPT_ATIME "atime" /* update atime for files */ #define MNTOPT_NOATIME "noatime" /* do not update atime for files */ #define MNTOPT_XATTR "xattr" /* enable extended attributes */ From owner-svn-src-head@freebsd.org Tue Sep 5 20:35:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D14EFE1E0B5; Tue, 5 Sep 2017 20:35:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7A3452020; Tue, 5 Sep 2017 20:35:26 +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 v85KZP6d050577; Tue, 5 Sep 2017 20:35:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85KZPaK050576; Tue, 5 Sep 2017 20:35:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709052035.v85KZPaK050576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Sep 2017 20:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323195 - head/sys/dev/amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/amdtemp X-SVN-Commit-Revision: 323195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 20:35:27 -0000 Author: cem Date: Tue Sep 5 20:35:25 2017 New Revision: 323195 URL: https://svnweb.freebsd.org/changeset/base/323195 Log: amdtemp(4): Do not probe not matching hostbridges Some systems have hostbs that do not match our PCI device id criteria. Detect and ignore these devices in probe. PR: 218264 Sponsored by: Dell EMC Isilon Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Sep 5 19:40:04 2017 (r323194) +++ head/sys/dev/amdtemp/amdtemp.c Tue Sep 5 20:35:25 2017 (r323195) @@ -207,6 +207,8 @@ amdtemp_probe(device_t dev) if (resource_disabled("amdtemp", 0)) return (ENXIO); + if (!amdtemp_match(device_get_parent(dev))) + return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); model = CPUID_TO_MODEL(cpu_id); From owner-svn-src-head@freebsd.org Tue Sep 5 21:00:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10DF5E1F027; Tue, 5 Sep 2017 21:00: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 mx1.freebsd.org (Postfix) with ESMTPS id B083866E55; Tue, 5 Sep 2017 21:00: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 v85L0XgX058737; Tue, 5 Sep 2017 21:00:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85L0XCS058736; Tue, 5 Sep 2017 21:00:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709052100.v85L0XCS058736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Sep 2017 21:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323196 - head/sys/dev/amdsmn X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/amdsmn X-SVN-Commit-Revision: 323196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 21:00:35 -0000 Author: cem Date: Tue Sep 5 21:00:33 2017 New Revision: 323196 URL: https://svnweb.freebsd.org/changeset/base/323196 Log: amdsmn(4): Do not probe not matching hostbridges Similar to r323195, but for amdsmn(4) driver (which borrowed some design). Ignore hostbs that do not match our PCI device id criteria. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/amdsmn/amdsmn.c Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Tue Sep 5 20:35:25 2017 (r323195) +++ head/sys/dev/amdsmn/amdsmn.c Tue Sep 5 21:00:33 2017 (r323196) @@ -90,24 +90,29 @@ static devclass_t amdsmn_devclass; DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); MODULE_VERSION(amdsmn, 1); -static void -amdsmn_identify(driver_t *driver, device_t parent) +static bool +amdsmn_match(device_t parent) { - device_t child; uint32_t devid; size_t i; - /* Make sure we're not being doubly invoked. */ - if (device_find_child(parent, "amdsmn", -1) != NULL) - return; - devid = pci_get_devid(parent); for (i = 0; i < nitems(amdsmn_ids); i++) if (amdsmn_ids[i].device_id == devid) - break; + return (true); + return (false); +} - if (i >= nitems(amdsmn_ids)) +static void +amdsmn_identify(driver_t *driver, device_t parent) +{ + device_t child; + + /* Make sure we're not being doubly invoked. */ + if (device_find_child(parent, "amdsmn", -1) != NULL) return; + if (!amdsmn_match(parent)) + return; child = device_add_child(parent, "amdsmn", -1); if (child == NULL) @@ -120,6 +125,8 @@ amdsmn_probe(device_t dev) uint32_t family; if (resource_disabled("amdsmn", 0)) + return (ENXIO); + if (!amdsmn_match(device_get_parent(dev))) return (ENXIO); family = CPUID_TO_FAMILY(cpu_id); From owner-svn-src-head@freebsd.org Tue Sep 5 21:17:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A2C1E1FA50; Tue, 5 Sep 2017 21:17:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DDB326B2A1; Tue, 5 Sep 2017 21:17:21 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85LHKKm066741; Tue, 5 Sep 2017 21:17:20 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85LHKMJ066740; Tue, 5 Sep 2017 21:17:20 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201709052117.v85LHKMJ066740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Tue, 5 Sep 2017 21:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323197 - head/tools/tools/nanobsd/embedded X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/tools/tools/nanobsd/embedded X-SVN-Commit-Revision: 323197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 21:17:22 -0000 Author: n_hibma Date: Tue Sep 5 21:17:20 2017 New Revision: 323197 URL: https://svnweb.freebsd.org/changeset/base/323197 Log: Bugfix: Don't treat NANO_IMAGES as a direcotory. This was probably accidentally broken in r295377 . Submitted by: Igor Serikov MFC after: 2 weeks Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Sep 5 21:00:33 2017 (r323196) +++ head/tools/tools/nanobsd/embedded/common Tue Sep 5 21:17:20 2017 (r323197) @@ -106,8 +106,6 @@ mkdir -p ${NANO_OBJ} NANO_OBJ=$(realpath ${NANO_OBJ}) mkdir -p ${NANO_LOG} NANO_LOG=$(realpath ${NANO_LOG}) -mkdir -p ${NANO_IMAGES} -NANO_IMAGES=$(realpath ${NANO_IMAGES}) mkdir -p ${NANO_WORLDDIR} NANO_WORLDDIR=$(realpath ${NANO_WORLDDIR}) mkdir -p ${NANO_DISKIMGDIR} From owner-svn-src-head@freebsd.org Tue Sep 5 21:50:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51454E210CA for ; Tue, 5 Sep 2017 21:50:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFD22729B6 for ; Tue, 5 Sep 2017 21:50:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id b142so1393866ioe.1 for ; Tue, 05 Sep 2017 14:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CalRvLDYDNWZwRf9nDiRvb/aFVO700JDG67xD6rInO0=; b=fgWpq0Fb4L8pf3We4QKE/AwZ0TlFYpMrf4DbB/CfvACHdmTs68yorEG5lqmAs3vfFd X7kSa3RKsgu36Jw1PggtxcTbzrHFRd8tfNVJTzE6HNqwEUS7EoBpOju7621mRPlfZYax 6iUeCuDBhf9pPmOsrN3fDhSj1ewS+Llo4Z6FAVzUquhNMI7/MOrTq0WCN0vnQHQtfUz4 N4b3B6hkUsYhV+kKhEc2j1NvZLWbzSwq3V8ust2ArH7eTSX+DtylYMKM7WmW8TDbDWMU yfhSMeaaURBK6o0HcvowuPWXun+XDiYtwguWyaqIfOCXCJbAR5UiNyCsbnnsJYPNNA3A ZA9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CalRvLDYDNWZwRf9nDiRvb/aFVO700JDG67xD6rInO0=; b=qKD12HDRHprU8E8aEcsKrZrXvuoZHf642xPkXxnYTJ7JWPhtpu1BulquZPGpY/Y6ff cxsy7QQ0R/vXAZJvgk7WRCxuTdO0M3Mp60Subxh7eOCxFBB2pwU901qVoDBThh3Vu24f 8A42yihoxk2Wu5nVZaaKFUYMz45TDu+pvbkKhdMbaaYbER72rdIb4KTLk+eWVSiYHfXR obIOWLab6sybs3W1DU5DMAU3JKXeosjpMeLVCNIFh2/y2Sc+UBi1Zml6cWtBVF3Af73i lzo7EGve7EJFrtbeVX1KiYXtXL6mqx3mHz88PoMdrOJ6rJIeG+Gmx5Npt96gdon1lsTm YP0g== X-Gm-Message-State: AHPjjUiGOF1eM712MaGtsJ0Jv+tQBCkL2mMMXP5rYi/LvStINZBY+kPP 0tNepXp0uyNKL3V5zHB51k/PAki943ZU X-Google-Smtp-Source: AOwi7QA2Ie+JdF6DGf0wpWmj2U+HXdhwOZszQqzV/u9AcasDn75+Zl9mJABZB3bPbOSS76hI5A4hKqQriqRdDzaTjuo= X-Received: by 10.107.138.160 with SMTP id c32mr582256ioj.91.1504648239009; Tue, 05 Sep 2017 14:50:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Tue, 5 Sep 2017 14:50:38 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:4058:159c:e075:5a63] In-Reply-To: <201709052117.v85LHKMJ066740@repo.freebsd.org> References: <201709052117.v85LHKMJ066740@repo.freebsd.org> From: Warner Losh Date: Tue, 5 Sep 2017 15:50:38 -0600 X-Google-Sender-Auth: CDWIfgsMsrp_YONzGE5AepjCLn4 Message-ID: Subject: Re: svn commit: r323197 - head/tools/tools/nanobsd/embedded To: Nick Hibma Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Sep 2017 21:50:40 -0000 On Tue, Sep 5, 2017 at 3:17 PM, Nick Hibma wrote: > Author: n_hibma > Date: Tue Sep 5 21:17:20 2017 > New Revision: 323197 > URL: https://svnweb.freebsd.org/changeset/base/323197 > > Log: > Bugfix: Don't treat NANO_IMAGES as a direcotory. > > This was probably accidentally broken in r295377 . > s/probably/definitely/ Pointy Hat to: imp From owner-svn-src-head@freebsd.org Wed Sep 6 01:55:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E93D6E07710; Wed, 6 Sep 2017 01:55:41 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9814466579; Wed, 6 Sep 2017 01:55:41 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v861te40080212; Wed, 6 Sep 2017 01:55:40 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v861teBf080211; Wed, 6 Sep 2017 01:55:40 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201709060155.v861teBf080211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 6 Sep 2017 01:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323200 - head X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 323200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 01:55:42 -0000 Author: rlibby Date: Wed Sep 6 01:55:40 2017 New Revision: 323200 URL: https://svnweb.freebsd.org/changeset/base/323200 Log: Makefile.inc1: bump elf tool chain version check after PR 215350 fix This causes builds to use the in-tree libdwarf with the bug fix instead of the host library. Reviewed by: bdrewery, emaste, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12239 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 6 01:38:01 2017 (r323199) +++ head/Makefile.inc1 Wed Sep 6 01:55:40 2017 (r323200) @@ -1786,7 +1786,8 @@ update: .PHONY # ELF Tool Chain libraries are needed for ELF tools and dtrace tools. # r296685 fix cross-endian objcopy -.if ${BOOTSTRAPPING} < 1100102 +# r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. +.if ${BOOTSTRAPPING} < 1200020 _elftoolchain_libs= lib/libelf lib/libdwarf .endif From owner-svn-src-head@freebsd.org Wed Sep 6 03:19:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E972E0A83F; Wed, 6 Sep 2017 03:19:54 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 84D6D7CE3D; Wed, 6 Sep 2017 03:19:54 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v863JrkV013811; Wed, 6 Sep 2017 03:19:53 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v863JqQL013804; Wed, 6 Sep 2017 03:19:52 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201709060319.v863JqQL013804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 6 Sep 2017 03:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323206 - in head/sys: cddl/dev/dtrace/mips cddl/dev/fbt/mips mips/conf modules/dtrace modules/dtrace/dtraceall X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: in head/sys: cddl/dev/dtrace/mips cddl/dev/fbt/mips mips/conf modules/dtrace modules/dtrace/dtraceall X-SVN-Commit-Revision: 323206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 03:19:55 -0000 Author: lidl Date: Wed Sep 6 03:19:52 2017 New Revision: 323206 URL: https://svnweb.freebsd.org/changeset/base/323206 Log: Enable dtrace support for mips64 and the ERL kernel config Turn on the required options in the ERL config file, and ensure that the fbt module is listed as a dependency for mips in the modules/dtrace/dtraceall/dtraceall.c file. PR: 220346 Reviewed by: gnn, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12227 Modified: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/fbt/mips/fbt_isa.c head/sys/mips/conf/ERL head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_asm.S Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/cddl/dev/dtrace/mips/dtrace_asm.S Wed Sep 6 03:19:52 2017 (r323206) @@ -37,8 +37,6 @@ #include #include -#include "assym.s" - .set noreorder # Noreorder is default style! /* Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Wed Sep 6 03:19:52 2017 (r323206) @@ -50,6 +50,8 @@ extern int (*dtrace_invop_jump_addr)(struct trapframe extern dtrace_id_t dtrace_probeid_error; int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); Modified: head/sys/cddl/dev/fbt/mips/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/mips/fbt_isa.c Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/cddl/dev/fbt/mips/fbt_isa.c Wed Sep 6 03:19:52 2017 (r323206) @@ -82,7 +82,6 @@ fbt_provide_module_function(linker_file_t lf, int symi linker_symval_t *symval, void *opaque) { fbt_probe_t *fbt, *retfbt; - uint32_t *target, *start; uint32_t *instr, *limit; const char *name; char *modname; Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/mips/conf/ERL Wed Sep 6 03:19:52 2017 (r323206) @@ -86,14 +86,15 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -#options KDTRACE_FRAME # Ensure frames are compiled in -#options KDTRACE_HOOKS # Kernel DTrace hooks -options INCLUDE_CONFIG_FILE # Include this file in kernel +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data +options INCLUDE_CONFIG_FILE # Include this file in kernel options TMPFS # Temporary file system # Debugging for use in -current #options KDB # Enable kernel debugger support. -#options DDB # Support DDB. +options DDB # Support DDB. #options GDB # Support remote GDB. #options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/modules/dtrace/Makefile Wed Sep 6 03:19:52 2017 (r323206) @@ -22,11 +22,14 @@ SUBDIR+= systrace_linux32 .if ${MACHINE_CPUARCH} == "powerpc" SUBDIR+= fbt fasttrap .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_ARCH} == "mips64" || \ + ${MACHINE_ARCH} == "powerpc64" SUBDIR+= systrace_freebsd32 .endif .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "mips" || \ ${MACHINE_CPUARCH} == "riscv" SUBDIR+= fbt .endif Modified: head/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- head/sys/modules/dtrace/dtraceall/Makefile Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/modules/dtrace/dtraceall/Makefile Wed Sep 6 03:19:52 2017 (r323206) @@ -8,7 +8,7 @@ SRCS= dtraceall.c opt_compat.h opt_nfs.h CFLAGS+= -I${SYSDIR} .if !defined(KERNBUILDDIR) -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "mips64" opt_compat.h: echo "#define COMPAT_FREEBSD32 1" >> ${.TARGET} .endif Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Wed Sep 6 02:07:44 2017 (r323205) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Wed Sep 6 03:19:52 2017 (r323206) @@ -70,7 +70,8 @@ MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ - defined(__i386__) || defined(__powerpc__) || defined(__riscv) + defined(__i386__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__riscv) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif #if defined(__amd64__) || defined(__i386__) From owner-svn-src-head@freebsd.org Wed Sep 6 04:32:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C90BE0CE83 for ; Wed, 6 Sep 2017 04:32:11 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: from mail-ua0-x22d.google.com (mail-ua0-x22d.google.com [IPv6:2607:f8b0:400c:c08::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A589366FBA; Wed, 6 Sep 2017 04:32:10 +0000 (UTC) (envelope-from jiashiun@gmail.com) Received: by mail-ua0-x22d.google.com with SMTP id l24so11925013uaa.5; Tue, 05 Sep 2017 21:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=h/xINvG3hEVdTCejmDAHDzu+7LbuOMlDEGr665pkYCQ=; b=J3ylCYmL+9Xh5IZSwlZBzsX1Qgj4tJIkk5XY1eDyIDffjCrW97lc9evw55UYohQKQ/ B9Xj8KeVSStJg1C9wJBa27Snop58KKQSsZZjF6B9MmPYxijGe2rzuVLSpITvhNjcvmyK mF7MQj0PjASqrp8wQ/0eHui7yudN2ZnS/hgGVCnyJyU8x0kbmzxAWUgRrYB5J8mZ/Dl5 1mNRAgdtRBcUfn5iTVgzGxoRXdgIAJpV2lbpe+8r9pUnWI9TSvwjmxjUbUw/znTxHebS 5UKzl3gVhZeOW7L2J0Y2uVvVfJCSUPLowVOScfWfHhHsdl4D+d/Giwvp2fbrdxfKE4hH 4/3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=h/xINvG3hEVdTCejmDAHDzu+7LbuOMlDEGr665pkYCQ=; b=bjtY1RVvJhi4j5CGQMa0mNBCaYFnFeDGDWD07oSCixouAQJ41XTGMdZBpQLImiviDN SXlurISQ0uzPPJmf8+xyxN+qVmzBYoOPxdVesr3PG68Sx3SRdEfF5yGZZKuHrAOZkDbS aP4qT+0Co/hJ4c//CI7+g9nGP+Ub04LV4mGGiiGo2ikmvBjS1qYhJA+RGyHTabZ1VFz/ XOe2duD9p+/0HUuvQkwpd7Txw9ztU6H+7QGm9h57N1oYPegD+rd4Hi2F8SdKk+7y7xsB Qpl9xibP7x1318FaZ8JwSVrJPyyJPCPASKJiz9FaKNZ77JcbFnygvlS8sh6qqccNDAlK 0ieQ== X-Gm-Message-State: AHPjjUi7UWDCbgn/DjUoyDjQIgWg8QdDU9Up1B7FXkNVZlrgKtnkyZTh 8eLOwOMl/IIMmvnKBM1oEch49LjhOgaz3l8= X-Google-Smtp-Source: ADKCNb5wCiV07nVy+K3SnTbp2AkeInRMy9nzo9l8MmSQ+cMIkZoOmfk3jXfkdyjhSAGowiANZ4dVXNq1kjsWFg4K3Vw= X-Received: by 10.159.36.168 with SMTP id 37mr969822uar.116.1504672328863; Tue, 05 Sep 2017 21:32:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.68.87 with HTTP; Tue, 5 Sep 2017 21:31:38 -0700 (PDT) In-Reply-To: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Jia-Shiun Li Date: Wed, 6 Sep 2017 12:31:38 +0800 Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Warner Losh Cc: Warner Losh , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 04:32:11 -0000 On Tue, Sep 5, 2017 at 9:33 PM, Warner Losh wrote: > On Mon, Sep 4, 2017 at 11:51 PM, Jia-Shiun Li wrote: > >> Seems to cause armv6 crossbuild to fail. >> But did armv6 use efi anyway? >> > > Yea, this is just a command line flag. Will fix. Not sure why x86 doesn't > suffer from this, but it's a wchar_t size difference I'm sure. > amd64 has -fshort-wchar when compiling boot1.c. aarch64 has it too but armv6 doesn't. Looks it's missing from sys/boot/efi/Makefile.inc. from build log, amd64: --- boot1.o --- cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/personal/freebsd/fbsdsrc/tmp -B/usr/obj/personal/freebsd/fbsdsrc/tmp/usr/bin -O2 -pipe -DSKEIN_LOOP=111 -I. -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include/amd64 -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../contrib/dev/acpica/include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../.. -DEFI_UFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../cddl/boot/zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../crypto/skein -DEFI_ZFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../common -fPIC -ffreestanding -Wformat -mno-mmx -mno-sse -mno-avx -msoft-float -fshort-wchar -mno-red-zone -mno-aes -g -MD -MF.depend.boot1.o -MTboot1.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /personal/freebsd/fbsdsrc/sys/boot/efi/boot1/boot1.c -o boot1.o armv6: --- boot1.o --- cc -target armv6-gnueabihf-freebsd12.0 --sysroot=/usr/obj/arm.armv6/personal/freebsd/fbsdsrc/tmp -B/usr/obj/arm.armv6/personal/freebsd/fbsdsrc/tmp/usr/bin -O -pipe -DSKEIN_LOOP=111 -I. -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include/arm -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../contrib/dev/acpica/include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../.. -DEFI_UFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../cddl/boot/zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../crypto/skein -DEFI_ZFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../common -ffreestanding -Wformat -msoft-float -fPIC -g -MD -MF.depend.boot1.o -MTboot1.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -mno-movt -mfpu=none -Qunused-arguments -c /personal/freebsd/fbsdsrc/sys/boot/efi/boot1/boot1.c -o boot1.o aarch64: --- boot1.o --- cc -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/arm64.aarch64/personal/freebsd/fbsdsrc/tmp -B/usr/obj/arm64.aarch64/personal/freebsd/fbsdsrc/tmp/usr/bin -O2 -pipe -DSKEIN_LOOP=111 -I. -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../include/arm64 -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../contrib/dev/acpica/include -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../.. -DEFI_UFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../cddl/boot/zfs/ -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../../crypto/skein -DEFI_ZFS_BOOT -I/personal/freebsd/fbsdsrc/sys/boot/efi/boot1/../../common -mgeneral-regs-only -ffreestanding -Wformat -fshort-wchar -fPIC -g -MD -MF.depend.boot1.o -MTboot1.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /personal/freebsd/fbsdsrc/sys/boot/efi/boot1/boot1.c -o boot1.o -Jia-Shiun From owner-svn-src-head@freebsd.org Wed Sep 6 09:19:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465B2E1C7C7; Wed, 6 Sep 2017 09:19:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C725A65436; Wed, 6 Sep 2017 09:19:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v869JsEL060603; Wed, 6 Sep 2017 09:19:54 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v869Jsk9060601; Wed, 6 Sep 2017 09:19:54 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709060919.v869Jsk9060601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 6 Sep 2017 09:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323215 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 09:19:56 -0000 Author: scottl Date: Wed Sep 6 09:19:54 2017 New Revision: 323215 URL: https://svnweb.freebsd.org/changeset/base/323215 Log: Checkpoint the next phase in debug message cleanup, this time focusing on error recovery messages. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Wed Sep 6 07:19:22 2017 (r323214) +++ head/sys/dev/mpr/mpr_sas.c Wed Sep 6 09:19:54 2017 (r323215) @@ -1286,33 +1286,39 @@ mprsas_logical_unit_reset_complete(struct mpr_softc *s * task management commands don't have S/G lists. */ if ((tm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) { - mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for LUN reset! " + mpr_dprint(sc, MPR_RECOVERY|MPR_ERROR, + "%s: cm_flags = %#x for LUN reset! " "This should not happen!\n", __func__, tm->cm_flags); mprsas_free_tm(sc, tm); return; } if (reply == NULL) { - mprsas_log_command(tm, MPR_RECOVERY, "NULL reset reply for tm " - "%p\n", tm); + mpr_dprint(sc, MPR_RECOVERY, "NULL reset reply for tm %p\n", + tm); if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mpr_dprint(sc, MPR_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL LUN reset reply\n"); targ->tm = NULL; mprsas_free_tm(sc, tm); } else { /* we should have gotten a reply. */ + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, "NULL reply on " + "LUN reset attempt, resetting controller\n"); mpr_reinit(sc); } return; } - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_RECOVERY, "logical unit reset status 0x%x code 0x%x count %u\n", le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), le32toh(reply->TerminationCount)); - - /* See if there are any outstanding commands for this LUN. + + /* + * See if there are any outstanding commands for this LUN. * This could be made more efficient by using a per-LU data * structure of some sort. */ @@ -1322,34 +1328,36 @@ mprsas_logical_unit_reset_complete(struct mpr_softc *s } if (cm_count == 0) { - mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO, - "logical unit %u finished recovery after reset\n", - tm->cm_lun, tm); + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "Finished recovery after LUN reset for target %u\n", + targ->tid); - mprsas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid, + mprsas_announce_reset(sc, AC_SENT_BDR, targ->tid, tm->cm_lun); - /* we've finished recovery for this logical unit. check and + /* + * We've finished recovery for this logical unit. check and * see if some other logical unit has a timedout command * that needs to be processed. */ cm = TAILQ_FIRST(&targ->timedout_commands); if (cm) { + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "More commands to abort for target %u\n", targ->tid); mprsas_send_abort(sc, tm, cm); - } - else { + } else { targ->tm = NULL; mprsas_free_tm(sc, tm); } - } - else { + } else { /* if we still have commands for this LUN, the reset * effectively failed, regardless of the status reported. * Escalate to a target reset. */ - mprsas_log_command(tm, MPR_RECOVERY, - "logical unit reset complete for tm %p, but still have %u " - "command(s)\n", tm, cm_count); + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "logical unit reset complete for target %u, but still " + "have %u command(s), sending target reset\n", targ->tid, + cm_count); mprsas_send_reset(sc, tm, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET); } @@ -1381,46 +1389,53 @@ mprsas_target_reset_complete(struct mpr_softc *sc, str } if (reply == NULL) { - mprsas_log_command(tm, MPR_RECOVERY, "NULL reset reply for tm " - "%p\n", tm); + mpr_dprint(sc, MPR_RECOVERY, + "NULL target reset reply for tm %p TaskMID %u\n", + tm, le16toh(req->TaskMID)); if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mpr_dprint(sc, MPR_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL target reset reply\n"); targ->tm = NULL; mprsas_free_tm(sc, tm); } else { /* we should have gotten a reply. */ + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, "NULL reply on " + "target reset attempt, resetting controller\n"); mpr_reinit(sc); } return; } - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_RECOVERY, "target reset status 0x%x code 0x%x count %u\n", le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), le32toh(reply->TerminationCount)); if (targ->outstanding == 0) { - /* we've finished recovery for this target and all + /* + * We've finished recovery for this target and all * of its logical units. */ - mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO, - "recovery finished after target reset\n"); + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "Finished reset recovery for target %u\n", targ->tid); mprsas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid, CAM_LUN_WILDCARD); targ->tm = NULL; mprsas_free_tm(sc, tm); - } - else { - /* after a target reset, if this target still has + } else { + /* + * After a target reset, if this target still has * outstanding commands, the reset effectively failed, * regardless of the status reported. escalate. */ - mprsas_log_command(tm, MPR_RECOVERY, - "target reset complete for tm %p, but still have %u " - "command(s)\n", tm, targ->outstanding); + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "Target reset complete for target %u, but still have %u " + "command(s), resetting controller\n", targ->tid, + targ->outstanding); mpr_reinit(sc); } } @@ -1450,20 +1465,20 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com /* XXX Need to handle invalid LUNs */ MPR_SET_LUN(req->LUN, tm->cm_lun); tm->cm_targ->logical_unit_resets++; - mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO, - "sending logical unit reset\n"); + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "Sending logical unit reset to target %u lun %d\n", + target->tid, tm->cm_lun); tm->cm_complete = mprsas_logical_unit_reset_complete; mprsas_prepare_for_tm(sc, tm, target, tm->cm_lun); - } - else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { + } else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { /* * Target reset method = * SAS Hard Link Reset / SATA Link Reset */ req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_targ->target_resets++; - mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO, - "sending target reset\n"); + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "Sending target reset to target %u\n", target->tid); tm->cm_complete = mprsas_target_reset_complete; mprsas_prepare_for_tm(sc, tm, target, CAM_LUN_WILDCARD); } @@ -1472,12 +1487,11 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com return -1; } - mpr_dprint(sc, MPR_INFO, "to target %u handle 0x%04x\n", target->tid, - target->handle); if (target->encl_level_valid) { - mpr_dprint(sc, MPR_INFO, "At enclosure level %d, slot %d, " - "connector name (%4s)\n", target->encl_level, - target->encl_slot, target->connector_name); + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "At enclosure level %d, slot %d, connector name (%4s)\n", + target->encl_level, target->encl_slot, + target->connector_name); } tm->cm_data = NULL; @@ -1490,7 +1504,7 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com err = mpr_map_command(sc, tm); if (err) - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_ERROR|MPR_RECOVERY, "error %d sending reset type %u\n", err, type); return err; @@ -1517,7 +1531,7 @@ mprsas_abort_complete(struct mpr_softc *sc, struct mpr * task management commands don't have S/G lists. */ if ((tm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) { - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_RECOVERY|MPR_ERROR, "cm_flags = %#x for abort %p TaskMID %u!\n", tm->cm_flags, tm, le16toh(req->TaskMID)); mprsas_free_tm(sc, tm); @@ -1525,22 +1539,25 @@ mprsas_abort_complete(struct mpr_softc *sc, struct mpr } if (reply == NULL) { - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_RECOVERY, "NULL abort reply for tm %p TaskMID %u\n", tm, le16toh(req->TaskMID)); if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mpr_dprint(sc, MPR_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL abort reply\n"); targ->tm = NULL; mprsas_free_tm(sc, tm); - } - else { + } else { /* we should have gotten a reply. */ + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, "NULL reply on " + "abort attempt, resetting controller\n"); mpr_reinit(sc); } return; } - mprsas_log_command(tm, MPR_RECOVERY, + mpr_dprint(sc, MPR_RECOVERY, "abort TaskMID %u status 0x%x code 0x%x count %u\n", le16toh(req->TaskMID), le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), @@ -1548,31 +1565,27 @@ mprsas_abort_complete(struct mpr_softc *sc, struct mpr cm = TAILQ_FIRST(&tm->cm_targ->timedout_commands); if (cm == NULL) { - /* if there are no more timedout commands, we're done with + /* + * if there are no more timedout commands, we're done with * error recovery for this target. */ - mprsas_log_command(tm, MPR_RECOVERY, - "finished recovery after aborting TaskMID %u\n", - le16toh(req->TaskMID)); - + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "Finished abort recovery for target %u\n", targ->tid); targ->tm = NULL; mprsas_free_tm(sc, tm); - } - else if (le16toh(req->TaskMID) != cm->cm_desc.Default.SMID) { + } else if (le16toh(req->TaskMID) != cm->cm_desc.Default.SMID) { /* abort success, but we have more timedout commands to abort */ - mprsas_log_command(tm, MPR_RECOVERY, - "continuing recovery after aborting TaskMID %u\n", - le16toh(req->TaskMID)); - + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "Continuing abort recovery for target %u\n", targ->tid); mprsas_send_abort(sc, tm, cm); - } - else { - /* we didn't get a command completion, so the abort + } else { + /* + * we didn't get a command completion, so the abort * failed as far as we're concerned. escalate. */ - mprsas_log_command(tm, MPR_RECOVERY, - "abort failed for TaskMID %u tm %p\n", - le16toh(req->TaskMID), tm); + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "Abort failed for target %u, sending logical unit reset\n", + targ->tid); mprsas_send_reset(sc, tm, MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET); @@ -1591,7 +1604,8 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com targ = cm->cm_targ; if (targ->handle == 0) { - mpr_dprint(sc, MPR_ERROR,"%s null devhandle for target_id %d\n", + mpr_dprint(sc, MPR_ERROR|MPR_RECOVERY, + "%s null devhandle for target_id %d\n", __func__, cm->cm_ccb->ccb_h.target_id); return -1; } @@ -1622,13 +1636,11 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com targ->aborts++; - mpr_dprint(sc, MPR_INFO, "Sending reset from %s for target ID %d\n", - __func__, targ->tid); mprsas_prepare_for_tm(sc, tm, targ, tm->cm_lun); err = mpr_map_command(sc, tm); if (err) - mpr_dprint(sc, MPR_RECOVERY, + mpr_dprint(sc, MPR_ERROR|MPR_RECOVERY, "error %d sending abort for cm %p SMID %u\n", err, cm, req->TaskMID); return err; @@ -1637,17 +1649,21 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com static void mprsas_scsiio_timeout(void *data) { + sbintime_t elapsed, now; + union ccb *ccb; struct mpr_softc *sc; struct mpr_command *cm; struct mprsas_target *targ; cm = (struct mpr_command *)data; sc = cm->cm_sc; + ccb = cm->cm_ccb; + now = sbinuptime(); MPR_FUNCTRACE(sc); mtx_assert(&sc->mpr_mtx, MA_OWNED); - mpr_dprint(sc, MPR_XINFO, "Timeout checking cm %p\n", cm); + mpr_dprint(sc, MPR_XINFO|MPR_RECOVERY, "Timeout checking cm %p\n", cm); /* * Run the interrupt handler to make sure it's not pending. This @@ -1669,13 +1685,15 @@ mprsas_scsiio_timeout(void *data) targ = cm->cm_targ; targ->timeouts++; - mprsas_log_command(cm, MPR_ERROR, "command timeout %d cm %p target " - "%u, handle(0x%04x)\n", cm->cm_ccb->ccb_h.timeout, cm, targ->tid, - targ->handle); + elapsed = now - ccb->ccb_h.qos.sim_data; + mprsas_log_command(cm, MPR_INFO|MPR_RECOVERY, + "Command timeout on target %u(0x%04x), %d set, %d.%d elapsed\n", + targ->tid, targ->handle, ccb->ccb_h.timeout, + sbintime_getsec(elapsed), elapsed & 0xffffffff); if (targ->encl_level_valid) { - mpr_dprint(sc, MPR_ERROR, "At enclosure level %d, slot %d, " - "connector name (%4s)\n", targ->encl_level, targ->encl_slot, - targ->connector_name); + mpr_dprint(sc, MPR_INFO|MPR_RECOVERY, + "At enclosure level %d, slot %d, connector name (%4s)\n", + targ->encl_level, targ->encl_slot, targ->connector_name); } /* XXX first, check the firmware state, to see if it's still @@ -1693,10 +1711,13 @@ mprsas_scsiio_timeout(void *data) "processing by tm %p\n", cm, targ->tm); } else if ((targ->tm = mprsas_alloc_tm(sc)) != NULL) { - mpr_dprint(sc, MPR_RECOVERY, "timedout cm %p allocated tm %p\n", - cm, targ->tm); /* start recovery by aborting the first timedout command */ + mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, + "Sending abort to target %u for SMID %d\n", targ->tid, + cm->cm_desc.Default.SMID); + mpr_dprint(sc, MPR_RECOVERY, "timedout cm %p allocated tm %p\n", + cm, targ->tm); mprsas_send_abort(sc, targ->tm, cm); } else { @@ -1709,8 +1730,8 @@ mprsas_scsiio_timeout(void *data) * more credits than disks in an enclosure, and limit * ourselves to one TM per target for recovery. */ - mpr_dprint(sc, MPR_RECOVERY, "timedout cm %p failed to " - "allocate a tm\n", cm); + mpr_dprint(sc, MPR_ERROR|MPR_RECOVERY, + "timedout cm %p failed to allocate a tm\n", cm); } } @@ -1843,6 +1864,7 @@ mprsas_build_nvme_unmap(struct mpr_softc *sc, struct m cm->cm_desc.Default.RequestFlags = MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED; + csio->ccb_h.qos.sim_data = sbinuptime(); #if __FreeBSD_version >= 1000029 callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, mprsas_scsiio_timeout, cm, 0); @@ -2161,6 +2183,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle); } + csio->ccb_h.qos.sim_data = sbinuptime(); #if __FreeBSD_version >= 1000029 callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, mprsas_scsiio_timeout, cm, 0); @@ -2936,9 +2959,14 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mp * avoiding getting into an infinite retry loop. */ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); - mprsas_log_command(cm, MPR_INFO, - "terminated ioc %x loginfo %x scsi %x state %x xfer %u\n", - le16toh(rep->IOCStatus), le32toh(rep->IOCLogInfo), + mpr_dprint(sc, MPR_INFO, + "Controller reported %s status for target %u SMID %u, " + "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : + "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, + le32toh(rep->IOCLogInfo)); + mpr_dprint(sc, MPR_XINFO, + "SCSIStatus %x SCSIState %x xfercount %u\n", rep->SCSIStatus, rep->SCSIState, le32toh(rep->TransferCount)); break; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Sep 6 07:19:22 2017 (r323214) +++ head/sys/dev/mps/mps_sas.c Wed Sep 6 09:19:54 2017 (r323215) @@ -1227,33 +1227,39 @@ mpssas_logical_unit_reset_complete(struct mps_softc *s * XXXSL So should it be an assertion? */ if ((tm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { - mps_dprint(sc, MPS_ERROR, "%s: cm_flags = %#x for LUN reset! " - "This should not happen!\n", __func__, tm->cm_flags); + mps_dprint(sc, MPS_RECOVERY|MPS_ERROR, + "%s: cm_flags = %#x for LUN reset! " + "This should not happen!\n", __func__, tm->cm_flags); mpssas_free_tm(sc, tm); return; } if (reply == NULL) { - mpssas_log_command(tm, MPS_RECOVERY, - "NULL reset reply for tm %p\n", tm); + mps_dprint(sc, MPS_RECOVERY, "NULL reset reply for tm %p\n", + tm); if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mps_dprint(sc, MPS_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL LUN reset reply\n"); targ->tm = NULL; mpssas_free_tm(sc, tm); } else { /* we should have gotten a reply. */ + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, "NULL reply on " + "LUN reset attempt, resetting controller\n"); mps_reinit(sc); } return; } - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_RECOVERY, "logical unit reset status 0x%x code 0x%x count %u\n", le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), le32toh(reply->TerminationCount)); - /* See if there are any outstanding commands for this LUN. + /* + * See if there are any outstanding commands for this LUN. * This could be made more efficient by using a per-LU data * structure of some sort. */ @@ -1263,34 +1269,37 @@ mpssas_logical_unit_reset_complete(struct mps_softc *s } if (cm_count == 0) { - mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, - "logical unit %u finished recovery after reset\n", - tm->cm_lun, tm); + mps_dprint(sc, MPS_RECOVERY|MPS_INFO, + "Finished recovery after LUN reset for target %u\n", + targ->tid); - mpssas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid, - tm->cm_lun); + mpssas_announce_reset(sc, AC_SENT_BDR, targ->tid, tm->cm_lun); - /* we've finished recovery for this logical unit. check and + /* + * We've finished recovery for this logical unit. check and * see if some other logical unit has a timedout command * that needs to be processed. */ cm = TAILQ_FIRST(&targ->timedout_commands); if (cm) { + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, + "More commands to abort for target %u\n", + targ->tid); mpssas_send_abort(sc, tm, cm); - } - else { + } else { targ->tm = NULL; mpssas_free_tm(sc, tm); } - } - else { - /* if we still have commands for this LUN, the reset + } else { + /* + * If we still have commands for this LUN, the reset * effectively failed, regardless of the status reported. * Escalate to a target reset. */ - mpssas_log_command(tm, MPS_RECOVERY, - "logical unit reset complete for tm %p, but still have %u command(s)\n", - tm, cm_count); + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, + "logical unit reset complete for target %u, but still " + "have %u command(s), sending target reset\n", targ->tid, + cm_count); mpssas_send_reset(sc, tm, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET); } @@ -1322,21 +1331,25 @@ mpssas_target_reset_complete(struct mps_softc *sc, str } if (reply == NULL) { - mpssas_log_command(tm, MPS_RECOVERY, - "NULL reset reply for tm %p\n", tm); + mps_dprint(sc, MPS_RECOVERY, + "NULL target reset reply for tm %pi TaskMID %u\n", + tm, le16toh(req->TaskMID)); if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mps_dprint(sc, MPS_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL target reset reply\n"); targ->tm = NULL; mpssas_free_tm(sc, tm); - } - else { + } else { /* we should have gotten a reply. */ + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, "NULL reply on " + "target reset attempt, resetting controller\n"); mps_reinit(sc); } return; } - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_RECOVERY, "target reset status 0x%x code 0x%x count %u\n", le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), le32toh(reply->TerminationCount)); @@ -1345,23 +1358,24 @@ mpssas_target_reset_complete(struct mps_softc *sc, str /* we've finished recovery for this target and all * of its logical units. */ - mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, - "recovery finished after target reset\n"); + mps_dprint(sc, MPS_RECOVERY|MPS_INFO, + "Finished reset recovery for target %u\n", targ->tid); mpssas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid, CAM_LUN_WILDCARD); targ->tm = NULL; mpssas_free_tm(sc, tm); - } - else { - /* after a target reset, if this target still has + } else { + /* + * After a target reset, if this target still has * outstanding commands, the reset effectively failed, * regardless of the status reported. escalate. */ - mpssas_log_command(tm, MPS_RECOVERY, - "target reset complete for tm %p, but still have %u command(s)\n", - tm, targ->outstanding); + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, + "Target reset complete for target %u, but still have %u " + "command(s), resetting controller\n", targ->tid, + targ->outstanding); mps_reinit(sc); } } @@ -1391,24 +1405,23 @@ mpssas_send_reset(struct mps_softc *sc, struct mps_com /* XXX Need to handle invalid LUNs */ MPS_SET_LUN(req->LUN, tm->cm_lun); tm->cm_targ->logical_unit_resets++; - mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, - "sending logical unit reset\n"); + mps_dprint(sc, MPS_RECOVERY|MPS_INFO, + "Sending logical unit reset to target %u lun %d\n", + target->tid, tm->cm_lun); tm->cm_complete = mpssas_logical_unit_reset_complete; mpssas_prepare_for_tm(sc, tm, target, tm->cm_lun); - } - else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { + } else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { /* * Target reset method = * SAS Hard Link Reset / SATA Link Reset */ req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_targ->target_resets++; - mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO, - "sending target reset\n"); + mps_dprint(sc, MPS_RECOVERY|MPS_INFO, + "Sending target reset to target %u\n", target->tid); tm->cm_complete = mpssas_target_reset_complete; mpssas_prepare_for_tm(sc, tm, target, CAM_LUN_WILDCARD); - } - else { + } else { mps_dprint(sc, MPS_ERROR, "unexpected reset type 0x%x\n", type); return -1; } @@ -1422,7 +1435,7 @@ mpssas_send_reset(struct mps_softc *sc, struct mps_com err = mps_map_command(sc, tm); if (err) - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_ERROR|MPS_RECOVERY, "error %d sending reset type %u\n", err, type); @@ -1450,7 +1463,7 @@ mpssas_abort_complete(struct mps_softc *sc, struct mps * task management commands don't have S/G lists. */ if ((tm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_RECOVERY, "cm_flags = %#x for abort %p TaskMID %u!\n", tm->cm_flags, tm, le16toh(req->TaskMID)); mpssas_free_tm(sc, tm); @@ -1458,22 +1471,25 @@ mpssas_abort_complete(struct mps_softc *sc, struct mps } if (reply == NULL) { - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_RECOVERY, "NULL abort reply for tm %p TaskMID %u\n", tm, le16toh(req->TaskMID)); if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ + mps_dprint(sc, MPS_RECOVERY, "Hardware undergoing " + "reset, ignoring NULL abort reply\n"); targ->tm = NULL; mpssas_free_tm(sc, tm); - } - else { + } else { /* we should have gotten a reply. */ + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, "NULL reply on " + "abort attempt, resetting controller\n"); mps_reinit(sc); } return; } - mpssas_log_command(tm, MPS_RECOVERY, + mps_dprint(sc, MPS_RECOVERY, "abort TaskMID %u status 0x%x code 0x%x count %u\n", le16toh(req->TaskMID), le16toh(reply->IOCStatus), le32toh(reply->ResponseCode), @@ -1481,31 +1497,28 @@ mpssas_abort_complete(struct mps_softc *sc, struct mps cm = TAILQ_FIRST(&tm->cm_targ->timedout_commands); if (cm == NULL) { - /* if there are no more timedout commands, we're done with + /* + * If there are no more timedout commands, we're done with * error recovery for this target. */ - mpssas_log_command(tm, MPS_RECOVERY, - "finished recovery after aborting TaskMID %u\n", - le16toh(req->TaskMID)); + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, + "Finished abort recovery for target %u\n", targ->tid); targ->tm = NULL; mpssas_free_tm(sc, tm); - } - else if (le16toh(req->TaskMID) != cm->cm_desc.Default.SMID) { + } else if (le16toh(req->TaskMID) != cm->cm_desc.Default.SMID) { /* abort success, but we have more timedout commands to abort */ - mpssas_log_command(tm, MPS_RECOVERY, - "continuing recovery after aborting TaskMID %u\n", - le16toh(req->TaskMID)); + mps_dprint(sc, MPS_INFO|MPS_RECOVERY, + "Continuing abort recovery for target %u\n", targ->tid); mpssas_send_abort(sc, tm, cm); - } - else { + } else { /* we didn't get a command completion, so the abort * failed as far as we're concerned. escalate. */ - mpssas_log_command(tm, MPS_RECOVERY, - "abort failed for TaskMID %u tm %p\n", - le16toh(req->TaskMID), tm); + mps_dprint(sc, MPS_RECOVERY, + "Abort failed for target %u, sending logical unit reset\n", + targ->tid); mpssas_send_reset(sc, tm, MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET); @@ -1523,7 +1536,8 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_com targ = cm->cm_targ; if (targ->handle == 0) { - mps_dprint(sc, MPS_ERROR,"%s null devhandle for target_id %d\n", + mps_dprint(sc, MPS_ERROR|MPS_RECOVERY, + "%s null devhandle for target_id %d\n", __func__, cm->cm_ccb->ccb_h.target_id); return -1; } @@ -1553,13 +1567,11 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_com targ->aborts++; - mps_dprint(sc, MPS_INFO, "Sending reset from %s for target ID %d\n", - __func__, targ->tid); mpssas_prepare_for_tm(sc, tm, targ, tm->cm_lun); err = mps_map_command(sc, tm); if (err) - mps_dprint(sc, MPS_RECOVERY, + mps_dprint(sc, MPS_ERROR|MPS_RECOVERY, "error %d sending abort for cm %p SMID %u\n", err, cm, req->TaskMID); return err; @@ -1568,17 +1580,21 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_com static void mpssas_scsiio_timeout(void *data) { + sbintime_t elapsed, now; + union ccb *ccb; struct mps_softc *sc; struct mps_command *cm; struct mpssas_target *targ; cm = (struct mps_command *)data; sc = cm->cm_sc; + ccb = cm->cm_ccb; + now = sbinuptime(); MPS_FUNCTRACE(sc); mtx_assert(&sc->mps_mtx, MA_OWNED); - mps_dprint(sc, MPS_XINFO, "Timeout checking cm %p\n", sc); + mps_dprint(sc, MPS_XINFO|MPS_RECOVERY, "Timeout checking cm %p\n", sc); /* * Run the interrupt handler to make sure it's not pending. This @@ -1600,9 +1616,11 @@ mpssas_scsiio_timeout(void *data) targ = cm->cm_targ; targ->timeouts++; - mpssas_log_command(cm, MPS_ERROR, "command timeout %d cm %p target " - "%u, handle(0x%04x)\n", cm->cm_ccb->ccb_h.timeout, cm, targ->tid, - targ->handle); + elapsed = now - ccb->ccb_h.qos.sim_data; + mpssas_log_command(cm, MPS_INFO|MPS_RECOVERY, + "Command timeout on target %u(0x%04x) %d set, %d.%d elapsed\n", + targ->tid, targ->handle, ccb->ccb_h.timeout, + sbintime_getsec(elapsed), elapsed & 0xffffffff); /* XXX first, check the firmware state, to see if it's still * operational. if not, do a diag reset. @@ -1618,15 +1636,16 @@ mpssas_scsiio_timeout(void *data) mps_dprint(sc, MPS_RECOVERY, "queued timedout cm %p for processing by tm %p\n", cm, targ->tm); - } - else if ((targ->tm = mpssas_alloc_tm(sc)) != NULL) { + } else if ((targ->tm = mpssas_alloc_tm(sc)) != NULL) { + mps_dprint(sc, MPS_RECOVERY|MPS_INFO, + "Sending abort to target %u for SMID %d\n", targ->tid, + cm->cm_desc.Default.SMID); mps_dprint(sc, MPS_RECOVERY, "timedout cm %p allocated tm %p\n", cm, targ->tm); /* start recovery by aborting the first timedout command */ mpssas_send_abort(sc, targ->tm, cm); - } - else { + } else { /* XXX queue this target up for recovery once a TM becomes * available. The firmware only has a limited number of * HighPriority credits for the high priority requests used @@ -1636,7 +1655,7 @@ mpssas_scsiio_timeout(void *data) * more credits than disks in an enclosure, and limit * ourselves to one TM per target for recovery. */ - mps_dprint(sc, MPS_RECOVERY, + mps_dprint(sc, MPS_ERROR|MPS_RECOVERY, "timedout cm %p failed to allocate a tm\n", cm); } @@ -1900,6 +1919,7 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union if (csio->bio != NULL) biotrack(csio->bio, __func__); #endif + csio->ccb_h.qos.sim_data = sbinuptime(); callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, mpssas_scsiio_timeout, cm, 0); @@ -2469,9 +2489,14 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mp * avoiding getting into an infinite retry loop. */ mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); - mpssas_log_command(cm, MPS_INFO, - "terminated ioc %x loginfo %x scsi %x state %x xfer %u\n", - le16toh(rep->IOCStatus), le32toh(rep->IOCLogInfo), + mps_dprint(sc, MPS_INFO, + "Controller reported %s status for target %u SMID %u, " + "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : + "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, + le32toh(rep->IOCLogInfo)); + mps_dprint(sc, MPS_XINFO, + "SCSIStatus %x SCSIState %x xfercount %u\n", rep->SCSIStatus, rep->SCSIState, le32toh(rep->TransferCount)); break; From owner-svn-src-head@freebsd.org Wed Sep 6 11:48:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41128E22E84; Wed, 6 Sep 2017 11:48:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DFD465A3D; Wed, 6 Sep 2017 11:48:00 +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 v86Bm0De022205; Wed, 6 Sep 2017 11:48:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86Bm0cd022204; Wed, 6 Sep 2017 11:48:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709061148.v86Bm0cd022204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 11:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323217 - head/sys/x86/pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/pci X-SVN-Commit-Revision: 323217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 11:48:01 -0000 Author: kib Date: Wed Sep 6 11:47:59 2017 New Revision: 323217 URL: https://svnweb.freebsd.org/changeset/base/323217 Log: Fix typos. Stop claiming that two children are created. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/pci/qpi.c Modified: head/sys/x86/pci/qpi.c ============================================================================== --- head/sys/x86/pci/qpi.c Wed Sep 6 10:21:28 2017 (r323216) +++ head/sys/x86/pci/qpi.c Wed Sep 6 11:47:59 2017 (r323217) @@ -26,9 +26,9 @@ */ /* - * This driver provides a psuedo-bus to enumerate the PCI buses - * present on a sytem using a QPI chipset. It creates a qpi0 bus that - * is a child of nexus0 and then creates two Host-PCI bridges as a + * This driver provides a pseudo-bus to enumerate the PCI buses + * present on a system using a QPI chipset. It creates a qpi0 bus that + * is a child of nexus0 and then creates Host-PCI bridges as a * child of that. */ From owner-svn-src-head@freebsd.org Wed Sep 6 13:56:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB8EE0407A; Wed, 6 Sep 2017 13:56: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 mx1.freebsd.org (Postfix) with ESMTPS id E7CB02585; Wed, 6 Sep 2017 13:56:19 +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 v86DuIXd074935; Wed, 6 Sep 2017 13:56:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86DuIjQ074932; Wed, 6 Sep 2017 13:56:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709061356.v86DuIjQ074932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Sep 2017 13:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323219 - in head/sys: net netinet X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: net netinet X-SVN-Commit-Revision: 323219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 13:56:20 -0000 Author: hselasky Date: Wed Sep 6 13:56:18 2017 New Revision: 323219 URL: https://svnweb.freebsd.org/changeset/base/323219 Log: Add support for generic backpressure indicator for ratelimited transmit queues aswell as non-ratelimited ones. Add the required structure bits in order to support a backpressure indication with ratelimited connections aswell as non-ratelimited ones. The backpressure indicator is a value between zero and 65535 inclusivly, indicating if the destination transmit queue is empty or full respectivly. Applications can use this value as a decision point for when to stop transmitting data to avoid endless ENOBUFS error codes upon transmitting an mbuf. This indicator is also useful to reduce the latency for ratelimited queues. Reviewed by: gallatin, kib, gnn Differential Revision: https://reviews.freebsd.org/D11518 Sponsored by: Mellanox Technologies Modified: head/sys/net/if_var.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Sep 6 13:10:33 2017 (r323218) +++ head/sys/net/if_var.h Wed Sep 6 13:56:18 2017 (r323219) @@ -183,7 +183,8 @@ struct if_encap_req { struct m_snd_tag; #define IF_SND_TAG_TYPE_RATE_LIMIT 0 -#define IF_SND_TAG_TYPE_MAX 1 +#define IF_SND_TAG_TYPE_UNLIMITED 1 +#define IF_SND_TAG_TYPE_MAX 2 struct if_snd_tag_alloc_header { uint32_t type; /* send tag type, see IF_SND_TAG_XXX */ @@ -198,19 +199,26 @@ struct if_snd_tag_alloc_rate_limit { struct if_snd_tag_rate_limit_params { uint64_t max_rate; /* in bytes/s */ + uint32_t queue_level; /* 0 (empty) .. 65535 (full) */ +#define IF_SND_QUEUE_LEVEL_MIN 0 +#define IF_SND_QUEUE_LEVEL_MAX 65535 + uint32_t reserved; /* padding */ }; union if_snd_tag_alloc_params { struct if_snd_tag_alloc_header hdr; struct if_snd_tag_alloc_rate_limit rate_limit; + struct if_snd_tag_alloc_rate_limit unlimited; }; union if_snd_tag_modify_params { struct if_snd_tag_rate_limit_params rate_limit; + struct if_snd_tag_rate_limit_params unlimited; }; union if_snd_tag_query_params { struct if_snd_tag_rate_limit_params rate_limit; + struct if_snd_tag_rate_limit_params unlimited; }; typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Sep 6 13:10:33 2017 (r323218) +++ head/sys/netinet/in_pcb.c Wed Sep 6 13:56:18 2017 (r323219) @@ -2797,6 +2797,35 @@ in_pcbquery_txrtlmt(struct inpcb *inp, uint32_t *p_max } /* + * Query existing TX queue level based on the existing + * "inp->inp_snd_tag", if any. + */ +int +in_pcbquery_txrlevel(struct inpcb *inp, uint32_t *p_txqueue_level) +{ + union if_snd_tag_query_params params = { }; + struct m_snd_tag *mst; + struct ifnet *ifp; + int error; + + mst = inp->inp_snd_tag; + if (mst == NULL) + return (EINVAL); + + ifp = mst->ifp; + if (ifp == NULL) + return (EINVAL); + + if (ifp->if_snd_tag_query == NULL) + return (EOPNOTSUPP); + + error = ifp->if_snd_tag_query(mst, ¶ms); + if (error == 0 && p_txqueue_level != NULL) + *p_txqueue_level = params.rate_limit.queue_level; + return (error); +} + +/* * Allocate a new TX rate limit send tag from the network interface * given by the "ifp" argument and save it in "inp->inp_snd_tag": */ @@ -2805,7 +2834,8 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet * uint32_t flowtype, uint32_t flowid, uint32_t max_pacing_rate) { union if_snd_tag_alloc_params params = { - .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, + .rate_limit.hdr.type = (max_pacing_rate == -1U) ? + IF_SND_TAG_TYPE_UNLIMITED : IF_SND_TAG_TYPE_RATE_LIMIT, .rate_limit.hdr.flowid = flowid, .rate_limit.hdr.flowtype = flowtype, .rate_limit.max_rate = max_pacing_rate, Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Wed Sep 6 13:10:33 2017 (r323218) +++ head/sys/netinet/in_pcb.h Wed Sep 6 13:56:18 2017 (r323219) @@ -761,6 +761,7 @@ int in_pcbattach_txrtlmt(struct inpcb *, struct ifnet void in_pcbdetach_txrtlmt(struct inpcb *); int in_pcbmodify_txrtlmt(struct inpcb *, uint32_t); int in_pcbquery_txrtlmt(struct inpcb *, uint32_t *); +int in_pcbquery_txrlevel(struct inpcb *, uint32_t *); void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *); void in_pcboutput_eagain(struct inpcb *); #endif From owner-svn-src-head@freebsd.org Wed Sep 6 13:59:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD0A2E042A8; Wed, 6 Sep 2017 13:59:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4370532B5; Wed, 6 Sep 2017 13:59:58 +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 v86DxvCk075094; Wed, 6 Sep 2017 13:59:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86DxvDq075092; Wed, 6 Sep 2017 13:59:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709061359.v86DxvDq075092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 6 Sep 2017 13:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323220 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 323220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 13:59:59 -0000 Author: hselasky Date: Wed Sep 6 13:59:57 2017 New Revision: 323220 URL: https://svnweb.freebsd.org/changeset/base/323220 Log: Add new USB quirk. PR: 221775 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 6 13:56:18 2017 (r323219) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 6 13:59:57 2017 (r323220) @@ -508,6 +508,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(ROLAND, SD20, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SD80, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, UA700, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), + USB_QUIRK(ROLAND, PCR300, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(EGO, M4U, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), USB_QUIRK(LOGILINK, U2M, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI), USB_QUIRK(MEDELI, DD305, 0x0000, 0xffff, UQ_SINGLE_CMD_MIDI, UQ_MATCH_VENDOR_ONLY), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Sep 6 13:56:18 2017 (r323219) +++ head/sys/dev/usb/usbdevs Wed Sep 6 13:59:57 2017 (r323220) @@ -3919,6 +3919,7 @@ product ROLAND UM550 0x0023 UM-550 MIDI I/F product ROLAND SD20 0x0027 SD-20 MIDI Synth product ROLAND SD80 0x0029 SD-80 MIDI Synth product ROLAND UA700 0x002b UA-700 Audio I/F +product ROLAND PCR300 0x0033 EDIROL PCR-300 MIDI I/F /* Rockfire products */ product ROCKFIRE GAMEPAD 0x2033 gamepad 203USB From owner-svn-src-head@freebsd.org Wed Sep 6 14:36:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92778E05BAB; Wed, 6 Sep 2017 14:36:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 341236B100; Wed, 6 Sep 2017 14:36:36 +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 v86EaZs5091781; Wed, 6 Sep 2017 14:36:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86EaZEO091780; Wed, 6 Sep 2017 14:36:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <201709061436.v86EaZEO091780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 6 Sep 2017 14:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323221 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 14:36:36 -0000 Author: np Date: Wed Sep 6 14:36:35 2017 New Revision: 323221 URL: https://svnweb.freebsd.org/changeset/base/323221 Log: Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that report extended media types. lacp_aggregator_bandwidth() uses the media to determine the speed of the interface and returns 0 for IFM_OTHER without the bits in the extended range. Reported by: kbowling@ Reviewed by: eugen_grosbein.net, mjoras@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12188 Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Sep 6 13:59:57 2017 (r323220) +++ head/sys/net/ieee8023ad_lacp.c Wed Sep 6 14:36:35 2017 (r323221) @@ -463,7 +463,11 @@ lacp_linkstate(struct lagg_port *lgp) uint16_t old_key; bzero((char *)&ifmr, sizeof(ifmr)); - error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + error = (*ifp->if_ioctl)(ifp, SIOCGIFXMEDIA, (caddr_t)&ifmr); + if (error != 0) { + bzero((char *)&ifmr, sizeof(ifmr)); + error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + } if (error != 0) return; From owner-svn-src-head@freebsd.org Wed Sep 6 15:07:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7E8AE07257; Wed, 6 Sep 2017 15:07:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id EE05A72120; Wed, 6 Sep 2017 15:07:54 +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 v86F7rNu003683; Wed, 6 Sep 2017 15:07:53 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86F7rrp003681; Wed, 6 Sep 2017 15:07:53 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709061507.v86F7rrp003681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 6 Sep 2017 15:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323222 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 323222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 15:07:56 -0000 Author: shurd Date: Wed Sep 6 15:07:53 2017 New Revision: 323222 URL: https://svnweb.freebsd.org/changeset/base/323222 Log: Add myself and mentorship status to committers files I failed to do this when I got my ports bit, so do them both in one commit. Reviewed by: sbruno (mentor) Differential Revision: https://reviews.freebsd.org/D12226 Modified: head/share/misc/committers-ports.dot head/share/misc/committers-src.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Sep 6 14:36:35 2017 (r323221) +++ head/share/misc/committers-ports.dot Wed Sep 6 15:07:53 2017 (r323222) @@ -215,6 +215,7 @@ scheidell [label="Michael Scheidell\nscheidell@FreeBSD sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n2003/10/21"] shaun [label="Shaun Amott\nshaun@FreeBSD.org\n2006/06/19"] +shurd [label="Stephen Hurd\nshurd@FreeBSD.org\n2014/06/14"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2005/01/08"] skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2009/03/25"] sobomax[label="Maxim Sobolev\nsobomax@FreeBSD.org\n2000/05/17"] @@ -338,6 +339,7 @@ culot -> marino culot -> wg db -> tj +db -> shurd decke -> sperber @@ -601,6 +603,7 @@ shaun -> timur shaun -> matthew skreuzer -> gnn +skreuzer -> shurd sobomax -> demon sobomax -> glewis Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Sep 6 14:36:35 2017 (r323221) +++ head/share/misc/committers-src.dot Wed Sep 6 15:07:53 2017 (r323222) @@ -303,6 +303,7 @@ se [label="Stefan Esser\nse@FreeBSD.org\n1994/08/26"] sephe [label="Sepherosa Ziehau\nsephe@FreeBSD.org\n2007/03/28"] sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] sgalabov [label="Stanislav Galabov\nsgalabov@FreeBSD.org\n2016/02/24"] +shurd [label="Stephen Hurd\nshurd@FreeBSD.org\n2017/09/02"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] skra [label="Svatopluk Kraus\nskra@FreeBSD.org\n2015/10/28"] @@ -759,6 +760,7 @@ sam -> sephe sbruno -> hiren sbruno -> jimharris +sbruno -> shurd schweikh -> dds From owner-svn-src-head@freebsd.org Wed Sep 6 16:16:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20090E0A39C; Wed, 6 Sep 2017 16:16:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 795BF10D7; Wed, 6 Sep 2017 16:16:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86GGBsi031949; Wed, 6 Sep 2017 16:16:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86GGB6L031948; Wed, 6 Sep 2017 16:16:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709061616.v86GGB6L031948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 16:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323224 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 323224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 16:16:13 -0000 Author: kib Date: Wed Sep 6 16:16:11 2017 New Revision: 323224 URL: https://svnweb.freebsd.org/changeset/base/323224 Log: In swp_pager_meta_build(), handle a race with other thread allocating swapblk for our index while we dropped the object lock. Noted by: jeff Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Sep 6 15:33:23 2017 (r323223) +++ head/sys/vm/swap_pager.c Wed Sep 6 16:16:11 2017 (r323224) @@ -1726,7 +1726,7 @@ static void swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { static volatile int swblk_zone_exhausted, swpctrie_zone_exhausted; - struct swblk *sb; + struct swblk *sb, *sb1; vm_pindex_t modpi, rdpi; int error, i; @@ -1776,6 +1776,15 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p } else VM_WAIT; VM_OBJECT_WLOCK(object); + sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, + rdpi); + if (sb != NULL) + /* + * Somebody swapped out a nearby page, + * allocating swblk at the rdpi index, + * while we dropped the object lock. + */ + goto allocated; } for (;;) { error = SWAP_PCTRIE_INSERT( @@ -1797,8 +1806,16 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p } else VM_WAIT; VM_OBJECT_WLOCK(object); + sb1 = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, + rdpi); + if (sb1 != NULL) { + uma_zfree(swblk_zone, sb); + sb = sb1; + goto allocated; + } } } +allocated: MPASS(sb->p == rdpi); modpi = pindex % SWAP_META_PAGES; From owner-svn-src-head@freebsd.org Wed Sep 6 16:18:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1808BE0A4CA; Wed, 6 Sep 2017 16:18:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96707183C; Wed, 6 Sep 2017 16:18:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86GI6Lj032058; Wed, 6 Sep 2017 16:18:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86GI6Rc032057; Wed, 6 Sep 2017 16:18:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201709061618.v86GI6Rc032057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 6 Sep 2017 16:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323225 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 323225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 16:18:08 -0000 Author: trasz Date: Wed Sep 6 16:18:06 2017 New Revision: 323225 URL: https://svnweb.freebsd.org/changeset/base/323225 Log: Reflect realtime and idle priorities in ps(1) state flags, same like we do for the usual nice values. It could be argued that they should use another set of indicators, since the underlying mechanism is different, but they match the description in the manual page, and so I think it's ok to not overcomplicate things. PR: 81757 MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/print.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Wed Sep 6 16:16:11 2017 (r323224) +++ head/bin/ps/print.c Wed Sep 6 16:18:06 2017 (r323225) @@ -262,9 +262,9 @@ state(KINFO *k, VARENT *ve __unused) cp++; if (!(flag & P_INMEM)) *cp++ = 'W'; - if (k->ki_p->ki_nice < NZERO) + if (k->ki_p->ki_nice < NZERO || k->ki_p->ki_pri.pri_class == PRI_REALTIME) *cp++ = '<'; - else if (k->ki_p->ki_nice > NZERO) + else if (k->ki_p->ki_nice > NZERO || k->ki_p->ki_pri.pri_class == PRI_IDLE) *cp++ = 'N'; if (flag & P_TRACED) *cp++ = 'X'; From owner-svn-src-head@freebsd.org Wed Sep 6 16:18:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BA7E0A596; Wed, 6 Sep 2017 16:18:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 92F361C1F; Wed, 6 Sep 2017 16:18:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86GIreJ032141; Wed, 6 Sep 2017 16:18:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86GIrTi032140; Wed, 6 Sep 2017 16:18:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709061618.v86GIrTi032140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 16:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323226 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 323226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 16:18:55 -0000 Author: kib Date: Wed Sep 6 16:18:53 2017 New Revision: 323226 URL: https://svnweb.freebsd.org/changeset/base/323226 Log: Do not leak empty swblk. In swp_pager_meta_build(), if the requested operation results in freeing the last swap pointer in the swblk, free the trie node. Other swap pager code does not expect to find completely empty swblk. Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Sep 6 16:18:06 2017 (r323225) +++ head/sys/vm/swap_pager.c Wed Sep 6 16:18:53 2017 (r323226) @@ -1824,6 +1824,21 @@ allocated: swp_pager_freeswapspace(sb->d[modpi], 1); /* Enter block into metadata. */ sb->d[modpi] = swapblk; + + /* + * Free the swblk if we end up with the empty page run. + */ + if (swapblk == SWAPBLK_NONE) { + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + break; + } + if (i == SWAP_META_PAGES) { + SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, + rdpi); + uma_zfree(swblk_zone, sb); + } + } } /* From owner-svn-src-head@freebsd.org Wed Sep 6 16:24:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93291E0AAEB; Wed, 6 Sep 2017 16:24: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 mx1.freebsd.org (Postfix) with ESMTPS id 4E8C53290; Wed, 6 Sep 2017 16:24: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 v86GOYp6036205; Wed, 6 Sep 2017 16:24:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86GOY1H036202; Wed, 6 Sep 2017 16:24:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709061624.v86GOY1H036202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 Sep 2017 16:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323227 - head/lib/libproc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libproc X-SVN-Commit-Revision: 323227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 16:24:35 -0000 Author: markj Date: Wed Sep 6 16:24:34 2017 New Revision: 323227 URL: https://svnweb.freebsd.org/changeset/base/323227 Log: Avoid keeping a dangling pointer when the mappings array is resized. Sponsored by: Dell EMC Isilon Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_rtld.c head/lib/libproc/proc_sym.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Wed Sep 6 16:18:53 2017 (r323226) +++ head/lib/libproc/_libproc.h Wed Sep 6 16:24:34 2017 (r323227) @@ -72,7 +72,7 @@ struct proc_handle { struct map_info *mappings; /* File mappings for proc. */ size_t maparrsz; /* Map array size. */ size_t nmappings; /* Number of mappings. */ - prmap_t *exec_map; /* Executable text mapping. */ + size_t exec_map; /* Executable text mapping index. */ lwpstatus_t lwps; /* Process status. */ struct procstat *procstat; /* libprocstat handle. */ char execpath[PATH_MAX]; /* Path to program executable. */ Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Wed Sep 6 16:18:53 2017 (r323226) +++ head/lib/libproc/proc_rtld.c Wed Sep 6 16:24:34 2017 (r323227) @@ -62,7 +62,7 @@ map_iter(const rd_loadobj_t *lop, void *arg) rdl2prmap(lop, &mapping->map); if (strcmp(lop->rdl_path, phdl->execpath) == 0 && (lop->rdl_prot & RD_RDL_X) != 0) - phdl->exec_map = &mapping->map; + phdl->exec_map = phdl->nmappings; file = NULL; if (lop->rdl_path[0] != '\0') { Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Wed Sep 6 16:18:53 2017 (r323226) +++ head/lib/libproc/proc_sym.c Wed Sep 6 16:24:34 2017 (r323227) @@ -511,7 +511,8 @@ _proc_name2map(struct proc_handle *p, const char *name return (&p->mappings[i]); } if (strcmp(name, "a.out") == 0) - return (_proc_addr2map(p, p->exec_map->pr_vaddr)); + return (_proc_addr2map(p, + p->mappings[p->exec_map].map.pr_vaddr)); return (NULL); } From owner-svn-src-head@freebsd.org Wed Sep 6 16:34:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51A0CE0B1FF; Wed, 6 Sep 2017 16:34:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E078264A7B; Wed, 6 Sep 2017 16:34:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86GYhaX040479; Wed, 6 Sep 2017 16:34:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86GYgfT040477; Wed, 6 Sep 2017 16:34:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201709061634.v86GYgfT040477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 6 Sep 2017 16:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323228 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 323228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 16:34:44 -0000 Author: trasz Date: Wed Sep 6 16:34:42 2017 New Revision: 323228 URL: https://svnweb.freebsd.org/changeset/base/323228 Log: Make ps(1) flag processes in capsicum(4) capability mode with "C". Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Wed Sep 6 16:24:34 2017 (r323227) +++ head/bin/ps/print.c Wed Sep 6 16:34:42 2017 (r323228) @@ -274,6 +274,8 @@ state(KINFO *k, VARENT *ve __unused) *cp++ = 'V'; if ((flag & P_SYSTEM) || k->ki_p->ki_lock > 0) *cp++ = 'L'; + if ((k->ki_p->ki_cr_flags & CRED_FLAG_CAPMODE) != 0) + *cp++ = 'C'; if (k->ki_p->ki_kiflag & KI_SLEADER) *cp++ = 's'; if ((flag & P_CONTROLT) && k->ki_p->ki_pgid == k->ki_p->ki_tpgid) Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Wed Sep 6 16:24:34 2017 (r323227) +++ head/bin/ps/ps.1 Wed Sep 6 16:34:42 2017 (r323228) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 25, 2017 +.Dd September 6, 2017 .Dt PS 1 .Os .Sh NAME @@ -436,6 +436,10 @@ information: The process is in the foreground process group of its control terminal. .It Li < The process has raised CPU scheduling priority. +.It Li C +The process is in +.Xr capsicum 4 +capability mode. .It Li E The process is trying to exit. .It Li J From owner-svn-src-head@freebsd.org Wed Sep 6 17:14:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 511A8E0CF26; Wed, 6 Sep 2017 17:14:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC37C6D906; Wed, 6 Sep 2017 17:14:24 +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 v86HEObi056617; Wed, 6 Sep 2017 17:14:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86HEOx6056616; Wed, 6 Sep 2017 17:14:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709061714.v86HEOx6056616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 17:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323229 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 323229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 17:14:25 -0000 Author: kib Date: Wed Sep 6 17:14:23 2017 New Revision: 323229 URL: https://svnweb.freebsd.org/changeset/base/323229 Log: Minor style changes to make forthcoming code stand out less. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12221 Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Sep 6 16:34:42 2017 (r323228) +++ head/lib/libpmc/libpmc.c Wed Sep 6 17:14:23 2017 (r323229) @@ -1017,20 +1017,20 @@ iap_allocate_pmc(enum pmc_event pe, char *ctrspec, return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL || - cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL_XEON) { + cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL_XEON) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp); } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_BROADWELL || - cpu_info.pm_cputype == PMC_CPU_INTEL_BROADWELL_XEON) { + cpu_info.pm_cputype == PMC_CPU_INTEL_BROADWELL_XEON) { /* Broadwell is defined to use same mask as haswell */ if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp); @@ -3595,7 +3595,8 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype break; case PMC_CPU_INTEL_SKYLAKE: ev = skylake_event_table; - evfence = skylake_event_table + PMC_EVENT_TABLE_SIZE(skylake); + evfence = skylake_event_table + + PMC_EVENT_TABLE_SIZE(skylake); break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; From owner-svn-src-head@freebsd.org Wed Sep 6 17:19:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2972DE0D24F; Wed, 6 Sep 2017 17:19:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 835846EB1B; Wed, 6 Sep 2017 17:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86HJmX4056841; Wed, 6 Sep 2017 17:19:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86HJmpU056838; Wed, 6 Sep 2017 17:19:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709061719.v86HJmpU056838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 17:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323230 - in head: lib/libpmc sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libpmc sys/dev/hwpmc X-SVN-Commit-Revision: 323230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 17:19:50 -0000 Author: kib Date: Wed Sep 6 17:19:48 2017 New Revision: 323230 URL: https://svnweb.freebsd.org/changeset/base/323230 Log: Skylake server core PMC support for hwpmc(4). Reviewed by: emaste Sponsored by: The FreeBSD Foundation Hardware provided by: Intel MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12221 Modified: head/lib/libpmc/libpmc.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Sep 6 17:14:23 2017 (r323229) +++ head/lib/libpmc/libpmc.c Wed Sep 6 17:19:48 2017 (r323230) @@ -232,6 +232,11 @@ static const struct pmc_event_descr skylake_event_tabl __PMC_EV_ALIAS_SKYLAKE() }; +static const struct pmc_event_descr skylake_xeon_event_table[] = +{ + __PMC_EV_ALIAS_SKYLAKE_XEON() +}; + static const struct pmc_event_descr ivybridge_event_table[] = { __PMC_EV_ALIAS_IVYBRIDGE() @@ -328,6 +333,7 @@ PMC_MDEP_TABLE(haswell_xeon, IAP, PMC_CLASS_SOFT, PMC_ PMC_MDEP_TABLE(broadwell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(broadwell_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(skylake, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(skylake_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -383,6 +389,7 @@ PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell_xeon, PMC_CLASS_TABLE_DESC(broadwell, IAP, broadwell, iap); PMC_CLASS_TABLE_DESC(broadwell_xeon, IAP, broadwell_xeon, iap); PMC_CLASS_TABLE_DESC(skylake, IAP, skylake, iap); +PMC_CLASS_TABLE_DESC(skylake_xeon, IAP, skylake_xeon, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); @@ -721,6 +728,8 @@ static struct pmc_event_alias core2_aliases_without_ia #define broadwell_xeon_aliases_without_iaf core2_aliases_without_iaf #define skylake_aliases core2_aliases #define skylake_aliases_without_iaf core2_aliases_without_iaf +#define skylake_xeon_aliases core2_aliases +#define skylake_xeon_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_xeon_aliases core2_aliases @@ -1037,7 +1046,8 @@ iap_allocate_pmc(enum pmc_event pe, char *ctrspec, } else return (-1); - } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SKYLAKE) { + } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SKYLAKE || + cpu_info.pm_cputype == PMC_CPU_INTEL_SKYLAKE_XEON) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_skylake, p, &rsp); } else @@ -3007,6 +3017,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char ev = skylake_event_table; count = PMC_EVENT_TABLE_SIZE(skylake); break; + case PMC_CPU_INTEL_SKYLAKE_XEON: + ev = skylake_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(skylake_xeon); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); @@ -3386,6 +3400,9 @@ pmc_init(void) case PMC_CPU_INTEL_SKYLAKE: PMC_MDEP_INIT_INTEL_V2(skylake); break; + case PMC_CPU_INTEL_SKYLAKE_XEON: + PMC_MDEP_INIT_INTEL_V2(skylake_xeon); + break; case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; @@ -3597,6 +3614,11 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype ev = skylake_event_table; evfence = skylake_event_table + PMC_EVENT_TABLE_SIZE(skylake); + break; + case PMC_CPU_INTEL_SKYLAKE_XEON: + ev = skylake_xeon_event_table; + evfence = skylake_xeon_event_table + + PMC_EVENT_TABLE_SIZE(skylake_xeon); break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Wed Sep 6 17:14:23 2017 (r323229) +++ head/sys/dev/hwpmc/hwpmc_core.c Wed Sep 6 17:19:48 2017 (r323230) @@ -582,6 +582,7 @@ struct iap_event_descr { #define IAP_F_BW (1 << 13) /* CPU: Broadwell */ #define IAP_F_BWX (1 << 14) /* CPU: Broadwell Xeon */ #define IAP_F_SL (1 << 15) /* CPU: Skylake */ +#define IAP_F_SLX (1 << 16) /* CPU: Skylake Xeon AKA scalable */ #define IAP_F_FM (1 << 18) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ @@ -626,12 +627,12 @@ static struct iap_event_descr iap_events[] = { IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | IAP_F_CAS), IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_SBX | IAP_F_CAS | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), @@ -670,7 +671,7 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA), @@ -679,22 +680,24 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(08H_01H, 0x08, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(08H_02H, 0x08, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX), + IAP_F_BW | IAP_F_BWX | IAP_F_SLX), IAPDESCR(08H_04H, 0x08, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX), + IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_SLX), IAPDESCR(08H_05H, 0x08, 0x05, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_06H, 0x08, 0x06, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_07H, 0x08, 0x07, IAP_F_FM | IAP_F_CA), - IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SLX), IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), - IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | - IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | - IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_60H, 0x08, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX), @@ -717,19 +720,21 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), + IAPDESCR(0DH_01H, 0x0D, 0x80, IAP_F_FM | IAP_F_SLX), IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL), + IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | + IAP_F_SLX), IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), @@ -782,7 +787,7 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(14H_00H, 0x14, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(14H_02H, 0x14, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | @@ -824,21 +829,27 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(24H_38H, 0x24, 0x38, IAP_F_FM | IAP_F_SL), - IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAPDESCR(24H_38H, 0x24, 0x38, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | @@ -846,19 +857,20 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_D8H, 0x24, 0xD8, IAP_F_FM | IAP_F_SL), + IAPDESCR(24H_D8H, 0x24, 0xD8, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), - IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), - IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(24H_EFH, 0x24, 0xEF, IAP_F_FM | IAP_F_SL), - IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), + IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | - IAP_F_HWX), + IAP_F_HWX | IAP_F_SLX), IAPDESCR(25H, 0x25, IAP_M_CORE, IAP_F_ALLCPUSCORE2), @@ -900,10 +912,14 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(28H_02H, 0x28, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SBX), IAPDESCR(28H_04H, 0x28, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(28H_07H, 0x28, 0x07, IAP_F_FM | IAP_F_SLX), IAPDESCR(28H_08H, 0x28, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(28H_0FH, 0x28, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(28H_18H, 0x28, 0x18, IAP_F_SLX), + IAPDESCR(28H_20H, 0x28, 0x20, IAP_F_SLX), + IAPDESCR(28H_40H, 0x28, 0x40, IAP_F_SLX), IAPDESCR(29H, 0x29, IAP_M_CORE | IAP_M_MESI, IAP_F_CC), IAPDESCR(29H, 0x29, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, @@ -917,10 +933,10 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), @@ -936,11 +952,14 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_SL), + IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_SL | + IAP_F_SLX), IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -981,24 +1000,27 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(48H_00H, 0x48, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(48H_01H, 0x48, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), + IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_SL | IAP_F_SLX), IAPDESCR(49H_00H, 0x49, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(49H_01H, 0x49, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(49H_02H, 0x49, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), + IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SLX), IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SLX), + IAPDESCR(49H_08H, 0x49, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW | @@ -1012,7 +1034,8 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(4CH_00H, 0x4C, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(4CH_01H, 0x4C, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(4CH_02H, 0x4C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), @@ -1028,11 +1051,12 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(4FH_02H, 0x4F, 0x02, IAP_F_FM | IAP_F_I7O), IAPDESCR(4FH_04H, 0x4F, 0x04, IAP_F_FM | IAP_F_I7O), IAPDESCR(4FH_08H, 0x4F, 0x08, IAP_F_FM | IAP_F_I7O), - IAPDESCR(4FH_10H, 0x4F, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAPDESCR(4FH_10H, 0x4F, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(51H_01H, 0x51, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(51H_02H, 0x51, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(51H_04H, 0x51, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1044,6 +1068,14 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(53H_01H, 0x53, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(54H_01H, 0x54, 0x01, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_02H, 0x54, 0x02, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_04H, 0x54, 0x04, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_08H, 0x54, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_10H, 0x54, 0x10, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_20H, 0x54, 0x20, IAP_F_FM | IAP_F_SLX), + IAPDESCR(54H_40H, 0x54, 0x40, IAP_F_FM | IAP_F_SLX), + IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | @@ -1067,8 +1099,15 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(5CH_02H, 0x5C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), + IAPDESCR(5DH_01H, 0x5d, 0x01, IAP_F_FM | IAP_F_SLX), + IAPDESCR(5DH_02H, 0x5d, 0x02, IAP_F_FM | IAP_F_SLX), + IAPDESCR(5DH_04H, 0x5d, 0x04, IAP_F_FM | IAP_F_SLX), + IAPDESCR(5DH_08H, 0x5d, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(5DH_10H, 0x5d, 0x10, IAP_F_FM | IAP_F_SLX), + IAPDESCR(5EH_01H, 0x5E, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB ), /* IB not in manual */ IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_FM | IAP_F_IBX | IAP_F_IB), @@ -1076,16 +1115,17 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(60H, 0x60, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(60H_01H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(60H_02H, 0x60, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(60H_04H, 0x60, 0x04, IAP_F_FM |IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(60H_08H, 0x60, 0x08, IAP_F_FM |IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(60H_10H, 0x60, 0x10, IAP_F_FM | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(60H_10H, 0x60, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(61H, 0x61, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1145,23 +1185,24 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(79H_02H, 0x79, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(79H_04H, 0x79, 0x04, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(79H_08H, 0x79, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_BW | IAP_F_BWX), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_BW | + IAP_F_BWX | IAP_F_SLX), IAPDESCR(79H_10H, 0x79, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - - IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), + IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(79H_20H, 0x79, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - - IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), + IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(79H_30H, 0x79, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), @@ -1184,7 +1225,8 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(80H_03H, 0x80, 0x03, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | - IAP_F_IBX | IAP_F_SL), /* SL may have a spec bug two with same entry no cmask */ + IAP_F_IBX | IAP_F_SL | IAP_F_SLX), /* SL may have a spec bug two with + same entry no cmask */ IAPDESCR(81H_00H, 0x81, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(81H_01H, 0x81, 0x01, IAP_F_FM | IAP_F_I7O), @@ -1197,23 +1239,29 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(82H_12H, 0x82, 0x12, IAP_F_FM | IAP_F_CC2), IAPDESCR(82H_40H, 0x82, 0x40, IAP_F_FM | IAP_F_CC2), - IAPDESCR(83H_01H, 0x83, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SL), - IAPDESCR(83H_02H, 0x83, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL), + IAPDESCR(83H_01H, 0x83, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SL | IAP_F_SLX), + IAPDESCR(83H_02H, 0x83, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(83H_04H, 0x83, 0x04, IAP_F_FM | IAP_F_SLX), IAPDESCR(85H_00H, 0x85, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(85H_01H, 0x85, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(85H_02H, 0x85, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX), + IAP_F_BW | IAP_F_BWX | IAP_F_SLX), IAPDESCR(85H_04H, 0x85, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | + IAP_F_SLX), + IAPDESCR(85H_08H, 0x85, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(85H_10H, 0x85, 0x10, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(85H_20H, 0x85, 0x20, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(85H_40H, 0x85, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_60H, 0x85, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(85H_80H, 0x85, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7O), @@ -1223,7 +1271,7 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(87H_00H, 0x87, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(87H_01H, 0x87, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(87H_02H, 0x87, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(87H_04H, 0x87, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), @@ -1305,41 +1353,42 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(98H_00H, 0x98, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(A0H_00H, 0xA0, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(A1H_01H, 0xA1, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_02H, 0xA1, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_04H, 0xA1, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_08H, 0xA1, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(A1H_10H, 0xA1, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_20H, 0xA1, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(A1H_30H, 0xA1, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_40H, 0xA1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(A1H_80H, 0xA1, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(A2H_00H, 0xA2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(A2H_01H, 0xA2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A2H_02H, 0xA2, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(A2H_04H, 0xA2, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1347,7 +1396,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_BW | IAP_F_BWX), IAPDESCR(A2H_08H, 0xA2, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(A2H_10H, 0xA2, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), @@ -1358,30 +1407,35 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(A2H_80H, 0xA2, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | - IAP_F_HWX | IAP_F_SL), - IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | - IAP_F_HWX | IAP_F_SL), - IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_SL), - IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(A3H_06H, 0xA3, 0x06, IAP_F_FM | IAP_F_SL), - IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX | - IAP_F_SL), - IAPDESCR(A3H_0CH, 0xA3, 0x0C, IAP_F_FM | IAP_F_HW | IAP_F_HW | IAP_F_SL), - IAPDESCR(A3H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL), - IAPDESCR(A3H_14H, 0xA3, 0x14, IAP_F_FM | IAP_F_SL), + IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | + IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | + IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | + IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(A3H_06H, 0xA3, 0x06, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW | IAP_F_IB | + IAP_F_HWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_0CH, 0xA3, 0x0C, IAP_F_FM | IAP_F_HW | IAP_F_HW | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(A3H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A3H_14H, 0xA3, 0x14, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL), - IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ), + IAPDESCR(A8H_01H, 0xA8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IBX | - IAP_F_IB |IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), + IAP_F_IB |IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(AAH_01H, 0xAA, 0x01, IAP_F_FM | IAP_F_CC2), IAPDESCR(AAH_02H, 0xAA, 0x02, IAP_F_FM | IAP_F_CA), @@ -1391,7 +1445,8 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(ABH_01H, 0xAB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(ABH_02H, 0xAB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | + IAP_F_SLX), IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_SL), IAPDESCR(ACH_08H, 0xAC, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1400,34 +1455,38 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(AEH_01H, 0xAE, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B0H_00H, 0xB0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(B0H_01H, 0xB0, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B0H_02H, 0xB0, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(B0H_04H, 0xB0, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B0H_08H, 0xB0, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), + IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SL | + IAP_F_SLX), IAPDESCR(B0H_20H, 0xB0, 0x20, IAP_F_FM | IAP_F_I7O), IAPDESCR(B0H_40H, 0xB0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O | IAP_F_SL), + IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O | + IAP_F_SL | IAP_F_SLX), IAPDESCR(B1H_00H, 0xB1, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(B1H_01H, 0xB1, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(B1H_02H, 0xB1, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SLX), IAPDESCR(B1H_1FH, 0xB1, 0x1F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_20H, 0xB1, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_3FH, 0xB1, 0x3F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1436,7 +1495,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_WM), IAPDESCR(B2H_01H, 0xB2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_SBX), + IAP_F_SB | IAP_F_SBX | IAP_F_SLX), IAPDESCR(B3H_01H, 0xB3, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_I7O), @@ -1487,18 +1546,19 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(BCH_28H, 0xBC, 0x28, IAP_F_FM | IAP_F_HW | IAP_F_HWX), IAPDESCR(BDH_01H, 0xBD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL), /* spec bug SL? */ + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_SLX), /* spec bug SL? */ IAPDESCR(BDH_20H, 0xBD, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SLX), IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C0H_02H, 0xC0, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_BW | IAP_F_BWX), IAPDESCR(C0H_04H, 0xC0, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1514,7 +1574,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(C1H_20H, 0xC1, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(C1H_3FH, 0xC1, 0x3F, IAP_F_FM | IAP_F_SL), + IAPDESCR(C1H_3FH, 0xC1, 0x3F, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(C1H_80H, 0xC1, 0x80, IAP_F_FM |IAP_F_IB | IAP_F_IBX), IAPDESCR(C1H_FEH, 0xC1, 0xFE, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1522,10 +1582,12 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C2H_01H, 0xC2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C2H_02H, 0xC2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C2H_04H, 0xC2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(C2H_07H, 0xC2, 0x07, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1535,13 +1597,15 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(C3H_00H, 0xC3, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C3H_01H, 0xC3, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C3H_02H, 0xC3, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_FM | IAP_F_CAS), IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O), IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1549,27 +1613,34 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(C4H_00H, 0xC4, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C4H_01H, 0xC4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C4H_02H, 0xC4, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C4H_04H, 0xC4, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C4H_08H, 0xC4, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C4H_0CH, 0xC4, 0x0C, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C4H_0FH, 0xC4, 0x0F, IAP_F_FM | IAP_F_CA), IAPDESCR(C4H_10H, 0xC4, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C4H_20H, 0xC4, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_FM | IAP_F_CAS), IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_FM | IAP_F_CAS), IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_FM | IAP_F_CAS), @@ -1581,18 +1652,20 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SLX), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL), IAPDESCR(C5H_10H, 0xC5, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_FM | IAP_F_CAS), IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_FM | IAP_F_CAS), IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_FM | IAP_F_CAS), @@ -1604,27 +1677,45 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(C6H_00H, 0xC6, 0x00, IAP_F_FM | IAP_F_CC), /* For SL C6_01 needs EV_SEL? 0x11, 0x12, 0x13, 0x14, 0x15? */ - IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL), + IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL | + IAP_F_SLX), IAPDESCR(C6H_02H, 0xC6, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C7H_00H, 0xC7, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C7H_01H, 0xC7, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C7H_02H, 0xC7, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C7H_04H, 0xC7, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C7H_08H, 0xC7, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C7H_10H, 0xC7, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), IAPDESCR(C7H_1FH, 0xC7, 0x1F, IAP_F_FM | IAP_F_CA | IAP_F_CC2), - IAPDESCR(C7H_20H, 0xC7, 0x20, IAP_F_FM | IAP_F_SL), + IAPDESCR(C7H_20H, 0xC7, 0x20, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(C7H_40H, 0xc7, 0x40, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C7H_80H, 0xc7, 0x80, IAP_F_FM | IAP_F_SLX), IAPDESCR(C8H_00H, 0xC8, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(C8H_20H, 0xC8, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(C8H_01H, 0xC8, 0x01, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_02H, 0xC8, 0x02, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_04H, 0xC8, 0x04, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_08H, 0xC8, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_10H, 0xC8, 0x10, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_20H, 0xC8, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SLX), + IAPDESCR(C8H_40H, 0xC8, 0x40, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C8H_80H, 0xC8, 0x80, IAP_F_FM | IAP_F_SLX), IAPDESCR(C9H_00H, 0xC9, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), + IAPDESCR(C9H_01H, 0xC9, 0x01, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_02H, 0xC9, 0x02, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_04H, 0xC9, 0x04, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_08H, 0xC9, 0x08, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_10H, 0xC9, 0x10, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_20H, 0xC9, 0x20, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_40H, 0xC9, 0x40, IAP_F_FM | IAP_F_SLX), + IAPDESCR(C9H_80H, 0xC9, 0x80, IAP_F_FM | IAP_F_SLX), IAPDESCR(CAH_00H, 0xCA, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), @@ -1640,13 +1731,14 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(CAH_10H, 0xCA, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_FM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX), IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_FM | IAP_F_CAS), IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_FM | IAP_F_CAS), IAPDESCR(CBH_01H, 0xCB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_SL), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_SL | IAP_F_SLX), IAPDESCR(CBH_02H, 0xCB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_04H, 0xCB, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1666,12 +1758,13 @@ static struct iap_event_descr iap_events[] = { IAP_F_I7 | IAP_F_WM), IAPDESCR(CCH_03H, 0xCC, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(CCH_20H, 0xCC, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SLX), IAPDESCR(CDH_00H, 0xCD, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), @@ -1682,50 +1775,62 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(D0H_00H, 0xD0, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(D0H_01H, 0xD0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(D0H_11H, 0xD0, 0x11, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D0H_12H, 0xD0, 0x12, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_BW | IAP_F_BWX | - IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), + IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_BW | + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D1H_01H, 0xD1, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | - IAP_F_BWX | IAP_F_SL), + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D1H_02H, 0xD1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D1H_04H, 0xD1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D1H_08H, 0xD1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D1H_10H, 0xD1, 0x10, IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D1H_20H, 0xD1, 0x20, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | - IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(D1H_40H, 0xD1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | + IAP_F_SL | IAP_F_SLX), IAPDESCR(D2H_01H, 0xD2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D2H_02H, 0xD2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D2H_04H, 0xD2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), IAPDESCR(D2H_08H, 0xD2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), + IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL | + IAP_F_SLX), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Sep 6 20:14:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2C55E14D2A; Wed, 6 Sep 2017 20:14:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 66043748CB; Wed, 6 Sep 2017 20:14:36 +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 v86KEZcQ033496; Wed, 6 Sep 2017 20:14:35 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KEY5P033492; Wed, 6 Sep 2017 20:14:34 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709062014.v86KEY5P033492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 6 Sep 2017 20:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323232 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 323232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 20:14:37 -0000 Author: shurd Date: Wed Sep 6 20:14:34 2017 New Revision: 323232 URL: https://svnweb.freebsd.org/changeset/base/323232 Log: bnxt: Use correct firmware call for number of queues supported 1) Based on the suggestion from firmware team, derive scctx->isc_ntxqsets_max & scctx->isc_nrxqsets_max based on FUNC_QCFG (instead of FUNC_QCAPS). 2) Bump-up driver version to "1.0.0.2". Submitted by: Bhargava Chenna Marreddy Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12128 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Wed Sep 6 20:01:19 2017 (r323231) +++ head/sys/dev/bnxt/bnxt.h Wed Sep 6 20:14:34 2017 (r323232) @@ -519,6 +519,13 @@ struct bnxt_nvram_info { struct sysctl_oid *nvm_oid; }; +struct bnxt_func_qcfg { + uint16_t alloc_completion_rings; + uint16_t alloc_tx_rings; + uint16_t alloc_rx_rings; + uint16_t alloc_vnics; +}; + struct bnxt_softc { device_t dev; if_ctx_t ctx; @@ -535,6 +542,7 @@ struct bnxt_softc { uint32_t total_msix; struct bnxt_func_info func; + struct bnxt_func_qcfg fn_qcfg; struct bnxt_pf_info pf; struct bnxt_vf_info vf; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Wed Sep 6 20:01:19 2017 (r323231) +++ head/sys/dev/bnxt/bnxt_hwrm.c Wed Sep 6 20:14:34 2017 (r323232) @@ -438,6 +438,31 @@ fail: return rc; } +int +bnxt_hwrm_func_qcfg(struct bnxt_softc *softc) +{ + struct hwrm_func_qcfg_input req = {0}; + struct hwrm_func_qcfg_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct bnxt_func_qcfg *fn_qcfg = &softc->fn_qcfg; + int rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_QCFG); + req.fid = htole16(0xffff); + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto fail; + + fn_qcfg->alloc_completion_rings = le16toh(resp->alloc_cmpl_rings); + fn_qcfg->alloc_tx_rings = le16toh(resp->alloc_tx_rings); + fn_qcfg->alloc_rx_rings = le16toh(resp->alloc_rx_rings); + fn_qcfg->alloc_vnics = le16toh(resp->alloc_vnics); +fail: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + int bnxt_hwrm_func_reset(struct bnxt_softc *softc) { Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Wed Sep 6 20:01:19 2017 (r323231) +++ head/sys/dev/bnxt/bnxt_hwrm.h Wed Sep 6 20:14:34 2017 (r323232) @@ -43,6 +43,7 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc) int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc); int bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown); int bnxt_hwrm_func_qcaps(struct bnxt_softc *softc); +int bnxt_hwrm_func_qcfg(struct bnxt_softc *softc); int bnxt_hwrm_func_reset(struct bnxt_softc *softc); int bnxt_hwrm_set_link_setting(struct bnxt_softc *, bool set_pause, bool set_eee); Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Wed Sep 6 20:01:19 2017 (r323231) +++ head/sys/dev/bnxt/if_bnxt.c Wed Sep 6 20:14:34 2017 (r323232) @@ -287,7 +287,7 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -#define BNXT_DRIVER_VERSION "1.0.0.1" +#define BNXT_DRIVER_VERSION "1.0.0.2" char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { @@ -702,6 +702,13 @@ bnxt_attach_pre(if_ctx_t ctx) if (rc) goto failed; + /* Get the current configuration of this function */ + rc = bnxt_hwrm_func_qcfg(softc); + if (rc) { + device_printf(softc->dev, "attach: hwrm func qcfg failed\n"); + goto failed; + } + iflib_set_mac(ctx, softc->func.mac_addr); scctx->isc_txrx = &bnxt_txrx; @@ -761,12 +768,16 @@ bnxt_attach_pre(if_ctx_t ctx) scctx->isc_nrxd[1]; scctx->isc_rxqsizes[2] = sizeof(struct rx_prod_pkt_bd) * scctx->isc_nrxd[2]; + scctx->isc_nrxqsets_max = min(pci_msix_count(softc->dev)-1, - softc->func.max_cp_rings - 1); + softc->fn_qcfg.alloc_completion_rings - 1); scctx->isc_nrxqsets_max = min(scctx->isc_nrxqsets_max, - softc->func.max_rx_rings); - scctx->isc_ntxqsets_max = min(softc->func.max_rx_rings, - softc->func.max_cp_rings - scctx->isc_nrxqsets_max - 1); + softc->fn_qcfg.alloc_rx_rings); + scctx->isc_nrxqsets_max = min(scctx->isc_nrxqsets_max, + softc->fn_qcfg.alloc_vnics); + scctx->isc_ntxqsets_max = min(softc->fn_qcfg.alloc_tx_rings, + softc->fn_qcfg.alloc_completion_rings - scctx->isc_nrxqsets_max - 1); + scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE; scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; From owner-svn-src-head@freebsd.org Wed Sep 6 20:19:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F04CE15084; Wed, 6 Sep 2017 20:19:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9BD7D75989; Wed, 6 Sep 2017 20:19:31 +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 v86KJUu3033763; Wed, 6 Sep 2017 20:19:30 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KJUi5033760; Wed, 6 Sep 2017 20:19:30 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709062019.v86KJUi5033760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 6 Sep 2017 20:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323233 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 323233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 20:19:32 -0000 Author: shurd Date: Wed Sep 6 20:19:30 2017 New Revision: 323233 URL: https://svnweb.freebsd.org/changeset/base/323233 Log: bnxt: Update firmware header file with the latest one hsi_struct_def.h file contains all firmware (HWRM) data struct's, updated that with the latest one which was released on 30'th Aug. After this upgrade, HWRM version will be 1.8.1.5 (earlier it was 1.4.0). Submitted by: Bhargava Chenna Marreddy Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12203 Modified: head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/hsi_struct_def.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Wed Sep 6 20:14:34 2017 (r323232) +++ head/sys/dev/bnxt/bnxt_hwrm.c Wed Sep 6 20:19:30 2017 (r323233) @@ -1478,12 +1478,12 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) goto exit; link_info->phy_link_status = resp->link; - link_info->duplex = resp->duplex; + link_info->duplex = resp->duplex_cfg; link_info->pause = resp->pause; link_info->auto_mode = resp->auto_mode; link_info->auto_pause = resp->auto_pause; link_info->force_pause = resp->force_pause; - link_info->duplex_setting = resp->duplex; + link_info->duplex_setting = resp->duplex_cfg; if (link_info->phy_link_status == HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK) link_info->link_speed = le16toh(resp->link_speed); else Modified: head/sys/dev/bnxt/hsi_struct_def.h ============================================================================== --- head/sys/dev/bnxt/hsi_struct_def.h Wed Sep 6 20:14:34 2017 (r323232) +++ head/sys/dev/bnxt/hsi_struct_def.h Wed Sep 6 20:19:30 2017 (r323233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); * * Description: Definition of HSI data structures * - * Date: 07/26/16 21:30:37 + * Date: 08/31/17 17:55:46 * * Note: This file is scripted generated by hsi_decode.py. * DO NOT modify this file manually !!!! @@ -42,35 +42,45 @@ __FBSDID("$FreeBSD$"); ****************************************************************************/ #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_ #define _HSI_STRUCT_DEF_EXTERNAL_H_ +/* HSI and HWRM Specification 1.8.1 */ +#define HWRM_VERSION_MAJOR 1 +#define HWRM_VERSION_MINOR 8 +#define HWRM_VERSION_UPDATE 1 +#define HWRM_VERSION_RSVD 7 + +#define HWRM_VERSION_STR "1.8.1.7" /* - * per-context HW statistics -- chip view - * Reference to stat_ctx_stat_xxx for + * Following is the signature for HWRM message field that indicates not + * applicable (All F's). Need to cast it the size of the field if needed. */ +#define HWRM_NA_SIGNATURE ((uint32_t)(-1)) +#define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */ +#define HWRM_MAX_RESP_LEN (272) /* hwrm_selftest_qlist */ +#define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */ +#define HW_HASH_KEY_SIZE 40 +#define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */ +#define ROCE_SP_HSI_VERSION_MAJOR 1 +#define ROCE_SP_HSI_VERSION_MINOR 8 +#define ROCE_SP_HSI_VERSION_UPDATE 1 -struct ctx_hw_stats { - uint64_t rx_ucast_pkts; - uint64_t rx_mcast_pkts; - uint64_t rx_bcast_pkts; - uint64_t rx_discard_pkts; - uint64_t rx_drop_pkts; - uint64_t rx_ucast_bytes; - uint64_t rx_mcast_bytes; - uint64_t rx_bcast_bytes; - uint64_t tx_ucast_pkts; - uint64_t tx_mcast_pkts; - uint64_t tx_bcast_pkts; - uint64_t tx_discard_pkts; - uint64_t tx_drop_pkts; - uint64_t tx_ucast_bytes; - uint64_t tx_mcast_bytes; - uint64_t tx_bcast_bytes; - uint64_t tpa_pkts; - uint64_t tpa_bytes; - uint64_t tpa_events; - uint64_t tpa_aborts; -} __attribute__((packed)); - +#define ROCE_SP_HSI_VERSION_STR "1.8.1" +/* + * Following is the signature for ROCE_SP_HSI message field that indicates not + * applicable (All F's). Need to cast it the size of the field if needed. + */ +#define ROCE_SP_HSI_NA_SIGNATURE ((uint32_t)(-1)) +/* + * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM) + * specification describes the data structures used in Ethernet packet or RDMA + * message data transfers as well as an abstract interface for managing Ethernet + * NIC hardware resources. + */ +/* Ethernet Data path Host Structures */ +/* + * Description: The following three sections document the host structures used + * between device and software drivers for communicating Ethernet packets. + */ /* BD Ring Structures */ /* * Description: This structure is used to inform the NIC of a location for and @@ -845,6 +855,7 @@ struct rx_pkt_cmpl { /* This bit is '1' if the RSS field in this completion is valid. */ #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) /* unused is 1 b */ + #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800) /* * This value indicates what the inner packet determined for the packet * was. @@ -931,7 +942,27 @@ struct rx_pkt_cmpl { uint8_t rss_hash_type; /* * This is the RSS hash type for the packet. The value is packed - * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. + * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. The + * value of tuple_extrac_op provides the information about what fields + * the hash was computed on. * 0: The RSS hash was computed over source + * IP address, destination IP address, source port, and destination port + * of inner IP and TCP or UDP headers. Note: For non-tunneled packets, + * the packet headers are considered inner packet headers for the RSS + * hash computation purpose. * 1: The RSS hash was computed over source + * IP address and destination IP address of inner IP header. Note: For + * non-tunneled packets, the packet headers are considered inner packet + * headers for the RSS hash computation purpose. * 2: The RSS hash was + * computed over source IP address, destination IP address, source port, + * and destination port of IP and TCP or UDP headers of outer tunnel + * headers. Note: For non-tunneled packets, this value is not + * applicable. * 3: The RSS hash was computed over source IP address and + * destination IP address of IP header of outer tunnel headers. Note: + * For non-tunneled packets, this value is not applicable. Note that + * 4-tuples values listed above are applicable for layer 4 protocols + * supported and enabled for RSS in the hardware, HWRM firmware, and + * drivers. For example, if RSS hash is supported and enabled for TCP + * traffic only, then the values of tuple_extract_op corresponding to + * 4-tuples are only valid for TCP traffic. */ uint8_t payload_offset; /* @@ -1234,6 +1265,7 @@ struct rx_tpa_start_cmpl { /* This bit is '1' if the RSS field in this completion is valid. */ #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) /* unused is 1 b */ + #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800) /* * This value indicates what the inner packet determined for the packet * was. @@ -1267,7 +1299,27 @@ struct rx_tpa_start_cmpl { uint8_t rss_hash_type; /* * This is the RSS hash type for the packet. The value is packed - * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. + * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. The + * value of tuple_extrac_op provides the information about what fields + * the hash was computed on. * 0: The RSS hash was computed over source + * IP address, destination IP address, source port, and destination port + * of inner IP and TCP or UDP headers. Note: For non-tunneled packets, + * the packet headers are considered inner packet headers for the RSS + * hash computation purpose. * 1: The RSS hash was computed over source + * IP address and destination IP address of inner IP header. Note: For + * non-tunneled packets, the packet headers are considered inner packet + * headers for the RSS hash computation purpose. * 2: The RSS hash was + * computed over source IP address, destination IP address, source port, + * and destination port of IP and TCP or UDP headers of outer tunnel + * headers. Note: For non-tunneled packets, this value is not + * applicable. * 3: The RSS hash was computed over source IP address and + * destination IP address of IP header of outer tunnel headers. Note: + * For non-tunneled packets, this value is not applicable. Note that + * 4-tuples values listed above are applicable for layer 4 protocols + * supported and enabled for RSS in the hardware, HWRM firmware, and + * drivers. For example, if RSS hash is supported and enabled for TCP + * traffic only, then the values of tuple_extract_op corresponding to + * 4-tuples are only valid for TCP traffic. */ uint16_t agg_id; /* @@ -1456,6 +1508,8 @@ struct rx_tpa_end_cmpl { #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7) #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS /* unused is 2 b */ + #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00) + #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10 /* * This value indicates what the inner packet determined for the packet * was. - 2 TCP Packet Indicates that the packet was IP and TCP. This @@ -1794,6 +1848,7 @@ struct hwrm_fwd_resp_cmpl { ((x) == 0x33 ? "VF_CFG_CHANGE": \ ((x) == 0x11 ? "FUNC_DRVR_LOAD": \ ((x) == 0x31 ? "VF_MAC_ADDR_CHANGE": \ + ((x) == 0x34 ? "LLFC_PFC_CHANGE": \ ((x) == 0x4 ? "PORT_CONN_NOT_ALLOWED": \ ((x) == 0x5 ? "LINK_SPEED_CFG_NOT_ALLOWED": \ ((x) == 0x6 ? "LINK_SPEED_CFG_CHANGE": \ @@ -1804,7 +1859,7 @@ struct hwrm_fwd_resp_cmpl { ((x) == 0x3 ? "DCB_CONFIG_CHANGE": \ ((x) == 0x12 ? "FUNC_FLR_PROC_CMPLT": \ ((x) == 0x21 ? "PF_DRVR_LOAD": \ - "Unknown event_id")))))))))))))))))) + "Unknown event_id"))))))))))))))))))) /* HWRM Asynchronous Event Completion Record (16 bytes) */ @@ -1857,6 +1912,8 @@ struct hwrm_async_event_cmpl { #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32) /* VF Configuration Change */ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33) + /* LLFC/PFC Configuration Change */ + #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34) /* HWRM Error */ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR UINT32_C(0xff) uint32_t event_data2; @@ -2075,6 +2132,12 @@ struct hwrm_async_event_cmpl_dcb_config_change { #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3) uint32_t event_data2; /* Event specific data */ + /* ETS configuration change */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS UINT32_C(0x1) + /* PFC configuration change */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC UINT32_C(0x2) + /* APP configuration change */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP UINT32_C(0x4) uint8_t opaque_v; /* opaque is 7 b */ /* @@ -2095,6 +2158,18 @@ struct hwrm_async_event_cmpl_dcb_config_change { /* PORT ID */ #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff) #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0 + /* Priority recommended for RoCE traffic */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK UINT32_C(0xff0000) + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT 16 + /* none is 255 */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE (UINT32_C(0xff) << 16) + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE + /* Priority recommended for L2 traffic */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK UINT32_C(0xff000000) + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT 24 + /* none is 255 */ + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE (UINT32_C(0xff) << 24) + #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE } __attribute__((packed)); /* HWRM Asynchronous Event Completion Record for port connection not allowed (16 bytes) */ @@ -2733,6 +2808,60 @@ struct hwrm_async_event_cmpl_vf_cfg_change { #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE UINT32_C(0x8) } __attribute__((packed)); +/* HWRM Asynchronous Event Completion Record for llfc pfc status change (16 bytes) */ + +struct hwrm_async_event_cmpl_llfc_pfc_change { + uint16_t type; + /* unused1 is 10 b */ + /* + * This field indicates the exact type of the completion. By convention, + * the LSB identifies the length of the record in 16B units. Even values + * indicate 16B records. Odd values indicate 32B records. + */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) + /* unused1 is 10 b */ + uint16_t event_id; + /* Identifiers of events. */ + /* LLFC/PFC Configuration Change */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34) + uint32_t event_data2; + /* Event specific data */ + uint8_t opaque_v; + /* opaque is 7 b */ + /* + * This value is written by the NIC such that it will be different for + * each pass through the completion queue. The even passes will write 1. + * The odd passes will write 0. + */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1 + uint8_t timestamp_lo; + /* 8-lsb timestamp from POR (100-msec resolution) */ + uint16_t timestamp_hi; + /* 16-lsb timestamp from POR (100-msec resolution) */ + uint32_t event_data1; + /* Event specific data */ + /* Indicates llfc pfc status change */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK UINT32_C(0x3) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT 0 + /* If this field set to 1, then it indicates that llfc is enabled. */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC (UINT32_C(0x1) << 0) + /* If this field is set to 2, then it indicates that pfc is enabled. */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC (UINT32_C(0x2) << 0) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC + /* Indicates the physical port this llfc pfc change occur */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK UINT32_C(0x1c) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT 2 + /* PORT ID */ + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0x1fffe0) + #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT 5 +} __attribute__((packed)); + /* HWRM Asynchronous Event Completion Record for HWRM Error (16 bytes) */ struct hwrm_async_event_cmpl_hwrm_error { @@ -3205,758 +3334,2126 @@ struct push32_doorbell { */ } __attribute__((packed)); -/* HW Resource Manager Specification 1.4.0 */ -#define HWRM_VERSION_MAJOR 1 -#define HWRM_VERSION_MINOR 4 -#define HWRM_VERSION_UPDATE 0 - -#define HWRM_VERSION_STR "1.4.0" +/* Doorbell Structures */ /* - * Following is the signature for HWRM message field that indicates not - * applicable (All F's). Need to cast it the size of the field if needed. + * Description: This is the RoCE 32b Doorbell format. The host writes this + * message format directly to byte offset 8 of the appropriate doorbell page. */ -#define HWRM_NA_SIGNATURE ((uint32_t)(-1)) -#define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */ -#define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */ -#define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */ -#define HW_HASH_KEY_SIZE 40 -#define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */ +/* 64b Doorbell Format (8 bytes) */ + +struct dbr_dbr { + uint32_t index; + /* + * This value is the index being written. For SQ, RQ, SRQ, this is the + * producer index and should be the queue index of the last WQE written + * plus 1. For CQ, this is the consumer index and should be the index of + * the last CQE processed plus 1. + */ + #define DBR_DBR_INDEX_MASK UINT32_C(0xfffff) + #define DBR_DBR_INDEX_SFT 0 + #define DBR_DBR_RESERVED12_MASK UINT32_C(0xfff00000) + #define DBR_DBR_RESERVED12_SFT 20 + uint32_t type_xid; + /* This value identifies the type of doorbell being written. */ + /* + * This value identifies the resource that the doorbell is intended to + * notify. For SQ and RQ, this is the QPID. For SRQ, this is the SID. + * For CQ, this is the CID. Bits [19:16] of this values must be zero for + * a SID value. + */ + #define DBR_DBR_XID_MASK UINT32_C(0xfffff) + #define DBR_DBR_XID_SFT 0 + #define DBR_DBR_RESERVED8_MASK UINT32_C(0xff00000) + #define DBR_DBR_RESERVED8_SFT 20 + /* This value identifies the type of doorbell being written. */ + #define DBR_DBR_TYPE_MASK UINT32_C(0xf0000000) + #define DBR_DBR_TYPE_SFT 28 + /* + * This is a SQ producer index update. It indicates one or more + * new entries have been written to the SQ for the QPID + * indicated on the xID field. + */ + #define DBR_DBR_TYPE_SQ (UINT32_C(0x0) << 28) + /* + * This is a RQ producer index update. It indicates one or more + * new entries have been written to the RQ for the QPID + * indicated on the xID field. + */ + #define DBR_DBR_TYPE_RQ (UINT32_C(0x1) << 28) + /* + * This is a SRQ producer index update. It indicates one or more + * new entries have been written to the SRQ for the SID + * indicated on the xID field. + */ + #define DBR_DBR_TYPE_SRQ (UINT32_C(0x2) << 28) + /* + * This doorbell command arms the SRQ async event. The xID field + * must identify the SID that is begin armed. The index field is + * will set the arm threshold such that a notification will be + * generated if less than that number or SRQ entries are posted. + */ + #define DBR_DBR_TYPE_SRQ_ARM (UINT32_C(0x3) << 28) + /* + * This is a CQ consumer index update. It indicates one or more + * entries have been processed off the CQ indicated on the xID + * field. + */ + #define DBR_DBR_TYPE_CQ (UINT32_C(0x4) << 28) + /* + * this is a CQ consumer index update that also arms the CQ for + * solicited events. + */ + #define DBR_DBR_TYPE_CQ_ARMSE (UINT32_C(0x5) << 28) + /* + * This is a CQ consumer index update that also arms the CQ for + * any new CQE. + */ + #define DBR_DBR_TYPE_CQ_ARMALL (UINT32_C(0x6) << 28) + /* + * This is a CQ arm enable message. This message must be sent + * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL + * message will be accepted. This doorbell can only be sent from + * the privileged (first) doorbell page of a function. + */ + #define DBR_DBR_TYPE_CQ_ARMENA (UINT32_C(0x7) << 28) + /* + * This doorbell command enables the SRQ async event to be + * armed. This message must be setn from the privileged driver + * before a new SRQ_ARM message will be accepted. The xID field + * must identify the SID that is begin enabled for arm. This + * doorbell can only be sent from the privileged (first) + * doorbell page of a function. + */ + #define DBR_DBR_TYPE_SRQ_ARMENA (UINT32_C(0x8) << 28) + /* + * This doorbell command indicates that the cutoff CQE has been + * processed and the driver is now processing completions from + * the new CQ. The index field for this doorbell type must be + * zero. + */ + #define DBR_DBR_TYPE_CQ_CUTOFF_ACK (UINT32_C(0x9) << 28) + /* + * This doorbell command is used during doorbell moderation to + * consume system BW and help prevent doorbell FIFO overflow. + * All other fields should be zero for NULL doorbell. + */ + #define DBR_DBR_TYPE_NULL (UINT32_C(0xf) << 28) +} __attribute__((packed)); + +/* 32b Doorbell Format (4 bytes) */ + +struct dbr_dbr32 { + uint32_t type_abs_incr_xid; + /* This value identifies the type of doorbell being written. */ + /* + * This value identifies the resource that the doorbell is intended to + * notify. For SQ and RQ, this is the QPID. For SRQ, this is the SID. + * For CQ, this is the CID. Bits [19:16] of this values must be zero for + * a SID value. + */ + #define DBR_DBR32_XID_MASK UINT32_C(0xfffff) + #define DBR_DBR32_XID_SFT 0 + #define DBR_DBR32_RESERVED4_MASK UINT32_C(0xf00000) + #define DBR_DBR32_RESERVED4_SFT 20 + /* + * When abs=0, this value is the value to add to the appropriate index + * value. When abs=1, this value is the new value for the index. + * Absolute value is used when the queue is being wrapped. When abs=1, + * the incr value follows the same rules as the index value in the 64b + * doorbell. + */ + #define DBR_DBR32_INCR_MASK UINT32_C(0xf000000) + #define DBR_DBR32_INCR_SFT 24 + /* This value defines how the incr value will be interpreted. */ + #define DBR_DBR32_ABS UINT32_C(0x10000000) + /* This value identifies the type of doorbell being written. */ + #define DBR_DBR32_TYPE_MASK UINT32_C(0xe0000000) + #define DBR_DBR32_TYPE_SFT 29 + /* + * This is a SQ producer index update. It indicates one or more + * new entries have been written to the SQ for the QPID + * indicated on the xID field. + */ + #define DBR_DBR32_TYPE_SQ (UINT32_C(0x0) << 29) +} __attribute__((packed)); + +/* SQ WQE Structures */ /* - * Description: Port Rx Statistics Formats. The HWRM shall return any - * unsupported counter with a value of 0xFFFFFFFF for 32-bit counters and - * 0xFFFFFFFFFFFFFFFF for 64-bit counters. + * Description: This is the Bind WQE structure. This WQE can perform either: * + * type1 "bind memory window", if mw_type==Type1 * type2 "post send bind memory + * window", if mw_type==Type2 */ -/* - * Note: The Hardware Resource Manager (HWRM) manages various hardware resources - * inside the chip. The HWRM is implemented in firmware, and runs on embedded - * processors inside the chip. This firmware service is vital part of the chip. - * The chip can not be used by a driver or HWRM client without the HWRM. - */ -/* Input (16 bytes) */ +/* Base SQ WQE (8 bytes) */ -struct input { - uint16_t req_type; +struct sq_base { + uint8_t wqe_type; + /* This field defines the type of SQ WQE. */ + /* Send */ + #define SQ_BASE_WQE_TYPE_SEND UINT32_C(0x0) /* - * This value indicates what type of request this is. The format for the - * rest of the command is determined by this field. + * Send with Immediate Allowed only on reliable connection (RC) + * and unreliable datagram (UD) SQ's. */ - uint16_t cmpl_ring; + #define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD UINT32_C(0x1) /* - * This value indicates the what completion ring the request will be - * optionally completed on. If the value is -1, then no CR completion - * will be generated. Any other value must be a valid CR ring_id value - * for this function. + * Send with Invalidate. Allowed only on reliable connection + * (RC) SQ's. */ - uint16_t seq_id; - /* This value indicates the command sequence number. */ - uint16_t target_id; + #define SQ_BASE_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2) + /* RDMA Write. Allowed only on reliable connection (RC) SQ's. */ + #define SQ_BASE_WQE_TYPE_WRITE_WQE UINT32_C(0x4) /* - * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids - * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM + * RDMA Write with Immediate. Allowed only on reliable + * connection (RC) SQ's. */ - uint64_t resp_addr; + #define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5) + /* RDMA Read. Allowed only on reliable connection (RC) SQ's. */ + #define SQ_BASE_WQE_TYPE_READ_WQE UINT32_C(0x6) /* - * This is the host address where the response will be written when the - * request is complete. This area must be 16B aligned and must be - * cleared to zero before the request is made. + * Atomic Compare/Swap. Allowed only on reliable connection (RC) + * SQ's. */ + #define SQ_BASE_WQE_TYPE_ATOMIC_CS UINT32_C(0x8) + /* Atomic Fetch/Add. Allowed only on reliable connection (RC) SQ's. */ + #define SQ_BASE_WQE_TYPE_ATOMIC_FA UINT32_C(0xb) + /* Local Invalidate. Allowed only on reliable connection (RC) SQ's. */ + #define SQ_BASE_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc) + /* + * FR-PMR (Fast Register Physical Memory Region) Allowed only on + * reliable connection (RC) SQ's. + */ + #define SQ_BASE_WQE_TYPE_FR_PMR UINT32_C(0xd) + /* Memory Bind Allowed only on reliable connection (RC) SQ's. */ + #define SQ_BASE_WQE_TYPE_BIND UINT32_C(0xe) + uint8_t unused_0[7]; } __attribute__((packed)); -/* Output (8 bytes) */ +/* WQE SGE (16 bytes) */ -struct output { - uint16_t error_code; +struct sq_sge { + uint64_t va_or_pa; /* - * Pass/Fail or error type Note: receiver to verify the in parameters, - * and fail the call with an error when appropriate + * The virtual address in local memory or a physical address when l_key + * value is a reserved value of a physical address. Driver configures + * this value in the chip and the chip compares l_key in SGEs with that + * reserved value, if equal it access the physical address specified. + * The chip however MUST verify that the QP allows the use reserved key. */ - uint16_t req_type; - /* This field returns the type of original request. */ - uint16_t seq_id; - /* This field provides original sequence number of the command. */ - uint16_t resp_len; + uint32_t l_key; /* - * This field is the length of the response in bytes. The last byte of - * the response is a valid flag that will read as '1' when the command - * has been completely written to memory. + * Local Key associated with this registered MR; The 24 msb of the key + * used to index the MRW Table and the 8 lsb are compared with the 8 + * bits key part stored in the MRWC. The PBL in the MRW Context is used + * to translate the above VA to physical address. */ + uint32_t size; + /* + * Size of SGE in bytes; Based on page size of the system the chip knows + * how many entries are in the PBL + */ } __attribute__((packed)); -#define GET_HWRM_REQ_TYPE(x) \ - ((x) == 0x98 ? "HWRM_CFA_ENCAP_RECORD_FREE": \ - ((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \ - ((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \ - ((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \ - ((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \ - ((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \ - ((x) == 0x94 ? "RESERVED3": \ - ((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \ - ((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \ - ((x) == 0x97 ? "HWRM_CFA_ENCAP_RECORD_ALLOC": \ - ((x) == 0x10 ? "RESERVED1": \ - ((x) == 0x11 ? "HWRM_FUNC_RESET": \ - ((x) == 0x12 ? "HWRM_FUNC_GETFID": \ - ((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \ - ((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \ - ((x) == 0x15 ? "HWRM_FUNC_QCAPS": \ - ((x) == 0x16 ? "HWRM_FUNC_QCFG": \ - ((x) == 0x17 ? "HWRM_FUNC_CFG": \ - ((x) == 0x18 ? "HWRM_FUNC_QSTATS": \ - ((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \ - ((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \ - ((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \ - ((x) == 0xd2 ? "HWRM_FWD_RESP": \ - ((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \ - ((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \ - ((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \ - ((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \ - ((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \ - ((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \ - ((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \ - ((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \ - ((x) == 0x9c ? "HWRM_CFA_EM_FLOW_ALLOC": \ - ((x) == 0x9d ? "HWRM_CFA_EM_FLOW_FREE": \ - ((x) == 0x9e ? "HWRM_CFA_EM_FLOW_CFG": \ - ((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \ - ((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \ - ((x) == 0xc8 ? "HWRM_FW_SET_TIME": \ - ((x) == 0xc9 ? "HWRM_FW_GET_TIME": \ - ((x) == 0xc0 ? "HWRM_FW_RESET": \ - ((x) == 0xc1 ? "HWRM_FW_QSTATUS": \ - ((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \ - ((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \ - ((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \ - ((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \ - ((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \ - ((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \ - ((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \ - ((x) == 0x61 ? "HWRM_RING_GRP_FREE": \ - ((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \ - ((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \ - ((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \ - ((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \ - ((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \ - ((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \ - ((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \ - ((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \ - ((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \ - ((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \ - ((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \ - ((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \ - ((x) == 0xf ? "HWRM_FUNC_VF_CFG": \ - ((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \ - ((x) == 0xfffe ? "HWRM_NVM_WRITE": \ - ((x) == 0xfffd ? "HWRM_NVM_READ": \ - ((x) == 0x50 ? "HWRM_RING_ALLOC": \ - ((x) == 0x51 ? "HWRM_RING_FREE": \ - ((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \ - ((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \ - ((x) == 0x4a ? "HWRM_VNIC_QCAPS": \ - ((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \ - ((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \ - ((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \ - ((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \ - ((x) == 0x45 ? "HWRM_VNIC_TPA_QCFG": \ - ((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \ - ((x) == 0x43 ? "HWRM_VNIC_QCFG": \ - ((x) == 0x42 ? "HWRM_VNIC_CFG": \ - ((x) == 0x41 ? "HWRM_VNIC_FREE": \ - ((x) == 0x40 ? "HWRM_VNIC_ALLOC": \ - ((x) == 0x0 ? "HWRM_VER_GET": \ - ((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \ - ((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \ - ((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \ - ((x) == 0x5e ? "HWRM_RING_RESET": \ - ((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \ - ((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \ - ((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \ - ((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \ - ((x) == 0x2c ? "HWRM_PORT_PHY_I2C_READ": \ - ((x) == 0x2b ? "HWRM_PORT_PHY_I2C_WRITE": \ - ((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \ - ((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \ - ((x) == 0x32 ? "HWRM_QUEUE_CFG": \ - ((x) == 0x33 ? "HWRM_QUEUE_BUFFERS_QCFG": \ - ((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \ - ((x) == 0x31 ? "HWRM_QUEUE_QCFG": \ - ((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \ - ((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \ - ((x) == 0x34 ? "HWRM_QUEUE_BUFFERS_CFG": \ - ((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \ - ((x) == 0xff14 ? "HWRM_DBG_DUMP": \ - ((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \ - ((x) == 0xff13 ? "HWRM_DBG_WRITE_INDIRECT": \ - ((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \ - ((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \ - ((x) == 0x25 ? "HWRM_PORT_CLR_STATS": \ - ((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \ - ((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \ - ((x) == 0x26 ? "HWRM_PORT_LPBK_CLR_STATS": \ - ((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \ - ((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \ - ((x) == 0x23 ? "HWRM_PORT_QSTATS": \ - ((x) == 0x22 ? "HWRM_PORT_TS_QUERY": \ - ((x) == 0x29 ? "HWRM_PORT_BLINK_LED": \ - ((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \ - ((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \ - "Unknown req_type")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +/* PSN Search Structure (8 bytes) */ -/* Command numbering (8 bytes) */ +struct sq_psn_search { + uint32_t opcode_start_psn; + /* The opcodes are software defined. */ + /* Start PSN. */ + #define SQ_PSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff) + #define SQ_PSN_SEARCH_START_PSN_SFT 0 + /* The opcodes are software defined. */ + #define SQ_PSN_SEARCH_OPCODE_MASK UINT32_C(0xff000000) + #define SQ_PSN_SEARCH_OPCODE_SFT 24 + uint32_t flags_next_psn; + /* Opcode specific flags. */ + /* Next PSN. Equal to the start PSN of the next WQE. */ + #define SQ_PSN_SEARCH_NEXT_PSN_MASK UINT32_C(0xffffff) + #define SQ_PSN_SEARCH_NEXT_PSN_SFT 0 + /* Opcode specific flags. */ + #define SQ_PSN_SEARCH_FLAGS_MASK UINT32_C(0xff000000) + #define SQ_PSN_SEARCH_FLAGS_SFT 24 +} __attribute__((packed)); -struct cmd_nums { - uint16_t req_type; +/* Send SQ WQE (40 bytes) */ + +struct sq_send { + uint8_t wqe_type; + /* This field defines the type of SQ WQE. */ + /* Send */ + #define SQ_SEND_WQE_TYPE_SEND UINT32_C(0x0) /* - * This version of the specification defines the commands listed in the - * table below. The following are general implementation requirements - * for these commands: # All commands listed below that are marked - * neither reserved nor experimental shall be implemented by the HWRM. # - * A HWRM client compliant to this specification should not use commands - * outside of the list below. # A HWRM client compliant to this - * specification should not use command numbers marked reserved below. # - * A command marked experimental below may not be implemented by the - * HWRM. # A command marked experimental may change in the future - * version of the HWRM specification. # A command not listed below may - * be implemented by the HWRM. The behavior of commands that are not - * listed below is outside the scope of this specification. + * Send with Immediate Allowed only on reliable connection (RC) + * and unreliable datagram (UD) SQ's. */ - #define HWRM_VER_GET (UINT32_C(0x0)) - #define HWRM_FUNC_BUF_UNRGTR (UINT32_C(0xe)) - /* Experimental */ - #define HWRM_FUNC_VF_CFG (UINT32_C(0xf)) - /* Reserved for future use */ - #define RESERVED1 (UINT32_C(0x10)) - #define HWRM_FUNC_RESET (UINT32_C(0x11)) - #define HWRM_FUNC_GETFID (UINT32_C(0x12)) - #define HWRM_FUNC_VF_ALLOC (UINT32_C(0x13)) - #define HWRM_FUNC_VF_FREE (UINT32_C(0x14)) - #define HWRM_FUNC_QCAPS (UINT32_C(0x15)) - #define HWRM_FUNC_QCFG (UINT32_C(0x16)) - #define HWRM_FUNC_CFG (UINT32_C(0x17)) - #define HWRM_FUNC_QSTATS (UINT32_C(0x18)) - #define HWRM_FUNC_CLR_STATS (UINT32_C(0x19)) - #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a)) - #define HWRM_FUNC_VF_RESC_FREE (UINT32_C(0x1b)) - #define HWRM_FUNC_VF_VNIC_IDS_QUERY (UINT32_C(0x1c)) - #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d)) - #define HWRM_FUNC_DRV_QVER (UINT32_C(0x1e)) - #define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f)) - #define HWRM_PORT_PHY_CFG (UINT32_C(0x20)) - #define HWRM_PORT_MAC_CFG (UINT32_C(0x21)) - /* Experimental */ - #define HWRM_PORT_TS_QUERY (UINT32_C(0x22)) - #define HWRM_PORT_QSTATS (UINT32_C(0x23)) - #define HWRM_PORT_LPBK_QSTATS (UINT32_C(0x24)) - /* Experimental */ - #define HWRM_PORT_CLR_STATS (UINT32_C(0x25)) - /* Experimental */ - #define HWRM_PORT_LPBK_CLR_STATS (UINT32_C(0x26)) - #define HWRM_PORT_PHY_QCFG (UINT32_C(0x27)) - /* Experimental */ - #define HWRM_PORT_MAC_QCFG (UINT32_C(0x28)) - /* Experimental */ - #define HWRM_PORT_BLINK_LED (UINT32_C(0x29)) - /* Experimental */ - #define HWRM_PORT_PHY_QCAPS (UINT32_C(0x2a)) - /* Experimental */ - #define HWRM_PORT_PHY_I2C_WRITE (UINT32_C(0x2b)) - /* Experimental */ - #define HWRM_PORT_PHY_I2C_READ (UINT32_C(0x2c)) - #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30)) - #define HWRM_QUEUE_QCFG (UINT32_C(0x31)) - #define HWRM_QUEUE_CFG (UINT32_C(0x32)) - #define HWRM_QUEUE_BUFFERS_QCFG (UINT32_C(0x33)) - #define HWRM_QUEUE_BUFFERS_CFG (UINT32_C(0x34)) - /* Experimental */ - #define HWRM_QUEUE_PFCENABLE_QCFG (UINT32_C(0x35)) - /* Experimental */ - #define HWRM_QUEUE_PFCENABLE_CFG (UINT32_C(0x36)) - /* Experimental */ - #define HWRM_QUEUE_PRI2COS_QCFG (UINT32_C(0x37)) - /* Experimental */ - #define HWRM_QUEUE_PRI2COS_CFG (UINT32_C(0x38)) - /* Experimental */ - #define HWRM_QUEUE_COS2BW_QCFG (UINT32_C(0x39)) - /* Experimental */ - #define HWRM_QUEUE_COS2BW_CFG (UINT32_C(0x3a)) - #define HWRM_VNIC_ALLOC (UINT32_C(0x40)) - #define HWRM_VNIC_FREE (UINT32_C(0x41)) - #define HWRM_VNIC_CFG (UINT32_C(0x42)) - /* Experimental */ - #define HWRM_VNIC_QCFG (UINT32_C(0x43)) - #define HWRM_VNIC_TPA_CFG (UINT32_C(0x44)) - /* Experimental */ - #define HWRM_VNIC_TPA_QCFG (UINT32_C(0x45)) - #define HWRM_VNIC_RSS_CFG (UINT32_C(0x46)) - #define HWRM_VNIC_RSS_QCFG (UINT32_C(0x47)) - #define HWRM_VNIC_PLCMODES_CFG (UINT32_C(0x48)) - #define HWRM_VNIC_PLCMODES_QCFG (UINT32_C(0x49)) - /* Experimental */ - #define HWRM_VNIC_QCAPS (UINT32_C(0x4a)) - #define HWRM_RING_ALLOC (UINT32_C(0x50)) - #define HWRM_RING_FREE (UINT32_C(0x51)) - #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS (UINT32_C(0x52)) - #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS (UINT32_C(0x53)) - #define HWRM_RING_RESET (UINT32_C(0x5e)) - #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60)) - #define HWRM_RING_GRP_FREE (UINT32_C(0x61)) - #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70)) - #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (UINT32_C(0x71)) - #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90)) - #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91)) - #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92)) - #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93)) - /* Reserved for future use */ - #define RESERVED3 (UINT32_C(0x94)) - #define HWRM_CFA_TUNNEL_FILTER_ALLOC (UINT32_C(0x95)) - #define HWRM_CFA_TUNNEL_FILTER_FREE (UINT32_C(0x96)) - /* Experimental */ - #define HWRM_CFA_ENCAP_RECORD_ALLOC (UINT32_C(0x97)) - /* Experimental */ - #define HWRM_CFA_ENCAP_RECORD_FREE (UINT32_C(0x98)) - #define HWRM_CFA_NTUPLE_FILTER_ALLOC (UINT32_C(0x99)) - #define HWRM_CFA_NTUPLE_FILTER_FREE (UINT32_C(0x9a)) - #define HWRM_CFA_NTUPLE_FILTER_CFG (UINT32_C(0x9b)) - /* Experimental */ - #define HWRM_CFA_EM_FLOW_ALLOC (UINT32_C(0x9c)) - /* Experimental */ - #define HWRM_CFA_EM_FLOW_FREE (UINT32_C(0x9d)) - /* Experimental */ - #define HWRM_CFA_EM_FLOW_CFG (UINT32_C(0x9e)) - #define HWRM_TUNNEL_DST_PORT_QUERY (UINT32_C(0xa0)) - #define HWRM_TUNNEL_DST_PORT_ALLOC (UINT32_C(0xa1)) - #define HWRM_TUNNEL_DST_PORT_FREE (UINT32_C(0xa2)) - #define HWRM_STAT_CTX_ALLOC (UINT32_C(0xb0)) - #define HWRM_STAT_CTX_FREE (UINT32_C(0xb1)) - #define HWRM_STAT_CTX_QUERY (UINT32_C(0xb2)) - #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3)) - #define HWRM_FW_RESET (UINT32_C(0xc0)) - #define HWRM_FW_QSTATUS (UINT32_C(0xc1)) - /* Experimental */ - #define HWRM_FW_SET_TIME (UINT32_C(0xc8)) - /* Experimental */ - #define HWRM_FW_GET_TIME (UINT32_C(0xc9)) - #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0)) - #define HWRM_REJECT_FWD_RESP (UINT32_C(0xd1)) - #define HWRM_FWD_RESP (UINT32_C(0xd2)) - #define HWRM_FWD_ASYNC_EVENT_CMPL (UINT32_C(0xd3)) - #define HWRM_TEMP_MONITOR_QUERY (UINT32_C(0xe0)) - /* Experimental */ - #define HWRM_WOL_FILTER_ALLOC (UINT32_C(0xf0)) - /* Experimental */ - #define HWRM_WOL_FILTER_FREE (UINT32_C(0xf1)) - /* Experimental */ - #define HWRM_WOL_FILTER_QCFG (UINT32_C(0xf2)) - /* Experimental */ - #define HWRM_WOL_REASON_QCFG (UINT32_C(0xf3)) - /* Experimental */ - #define HWRM_DBG_READ_DIRECT (UINT32_C(0xff10)) - /* Experimental */ - #define HWRM_DBG_READ_INDIRECT (UINT32_C(0xff11)) - /* Experimental */ - #define HWRM_DBG_WRITE_DIRECT (UINT32_C(0xff12)) - /* Experimental */ - #define HWRM_DBG_WRITE_INDIRECT (UINT32_C(0xff13)) - #define HWRM_DBG_DUMP (UINT32_C(0xff14)) - #define HWRM_NVM_INSTALL_UPDATE (UINT32_C(0xfff3)) - #define HWRM_NVM_MODIFY (UINT32_C(0xfff4)) - #define HWRM_NVM_VERIFY_UPDATE (UINT32_C(0xfff5)) - #define HWRM_NVM_GET_DEV_INFO (UINT32_C(0xfff6)) - #define HWRM_NVM_ERASE_DIR_ENTRY (UINT32_C(0xfff7)) - #define HWRM_NVM_MOD_DIR_ENTRY (UINT32_C(0xfff8)) - #define HWRM_NVM_FIND_DIR_ENTRY (UINT32_C(0xfff9)) - #define HWRM_NVM_GET_DIR_ENTRIES (UINT32_C(0xfffa)) - #define HWRM_NVM_GET_DIR_INFO (UINT32_C(0xfffb)) - #define HWRM_NVM_RAW_DUMP (UINT32_C(0xfffc)) - #define HWRM_NVM_READ (UINT32_C(0xfffd)) - #define HWRM_NVM_WRITE (UINT32_C(0xfffe)) - #define HWRM_NVM_RAW_WRITE_BLK (UINT32_C(0xffff)) - uint16_t unused_0[3]; + #define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD UINT32_C(0x1) + /* + * Send with Invalidate. Allowed only on reliable connection + * (RC) SQ's. + */ + #define SQ_SEND_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2) + uint8_t flags; + /* + * Set if completion signaling is requested. If this bit is 0, and the + * SQ is configured to support Unsignaled completion the controller + * should not generate a CQE unless there was an error. This refers to + * the CQE on the sender side. (The se flag refers to the receiver + * side). + */ + #define SQ_SEND_FLAGS_SIGNAL_COMP UINT32_C(0x1) + /* + * Indication to complete all previous RDMA Read or Atomic WQEs on the + * SQ before executing this WQE. This flag must be zero for a UD send. + */ + #define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE UINT32_C(0x2) + /* + * For local invalidate request. Indicate to complete all previous SQ's + * WQEs before executing this WQE. This flag must be zero for a UD send. + */ + #define SQ_SEND_FLAGS_UC_FENCE UINT32_C(0x4) + /* + * Solicit event flag. Indication sent in BTH header to the receiver to + * generate a Completion Event Notification, i.e. CNQE. This bit should + * be set only in the last (or only) packet of the message. + */ + #define SQ_SEND_FLAGS_SE UINT32_C(0x8) + /* + * Indicate that inline data is posted to the SQ in the data area of + * this WQE. + */ + #define SQ_SEND_FLAGS_INLINE UINT32_C(0x10) + uint8_t wqe_size; + /* + * The number of 16 bytes chunks of data including this first word of + * the request that are a valid part of the request. The valid 16 bytes + * units other than the WQE structure can be SGEs (Scatter Gather + * Elements) OR inline data. While this field defines the valid WQE + * size. The actual total WQE size is always 128B. + */ + uint8_t reserved8_1; + uint32_t inv_key_or_imm_data; + /* + * Either invalidate key (R_Key of the remote host) that will be send + * with IETH (Invalidate ETH) if wqe_type is of Send with Invalidate, or + * immediate value that will be sent with ImmDt header if wqe_type is + * Send with Immediate. + */ + uint32_t length; + /* This field represents a 32-bit total data length, in bytes. */ + uint32_t q_key; + /* + * When in the SQ of a UD QP, indicates the q_key to be used in the + * transmitted packet. However, if the most significant bit of this + * field is set, then the q_key will be taken from QP context, rather + * than from this field. When in the SQ of a non-UD QP, this field is + * reserved and should be filled with zeros. + */ + uint32_t dst_qp; + /* + * When in the SQ of a UD QP, indicates the destination QP to be used in + * the transmitted packet. When in the SQ of a non-UD QP, this field is + * reserved and should be filled with zeros. + */ + #define SQ_SEND_DST_QP_MASK UINT32_C(0xffffff) + #define SQ_SEND_DST_QP_SFT 0 + #define SQ_SEND_RESERVED8_2_MASK UINT32_C(0xff000000) + #define SQ_SEND_RESERVED8_2_SFT 24 + uint32_t avid; + /* This field is reserved for future expansion of the AVID. */ + /* + * If the serv_type is 'UD', then this field supplies the AVID (Address + * Vector ID). + */ + #define SQ_SEND_AVID_MASK UINT32_C(0xfffff) + #define SQ_SEND_AVID_SFT 0 + /* This field is reserved for future expansion of the AVID. */ + #define SQ_SEND_RESERVED_AVID_MASK UINT32_C(0xfff00000) + #define SQ_SEND_RESERVED_AVID_SFT 20 + uint64_t reserved64; + uint32_t data[24]; + /* + * When inline=0, then this area is filled with from 1 to 6 SGEs based + * on the wqe_size field. When inline=1, this area is filled with + * payload data for the send based on the length_or_AVID field. Bits + * [7:0] of word 0 hold the first byte to go out on the wire. + */ } __attribute__((packed)); -#define GET_HWRM_ERROR_CODE(x) \ - ((x) == 0xf ? "HWRM_ERROR": \ - ((x) == 0xffff ? "CMD_NOT_SUPPORTED": \ - ((x) == 0xfffe ? "UNKNOWN_ERR": \ - ((x) == 0x4 ? "RESOURCE_ALLOC_ERROR": \ - ((x) == 0x5 ? "INVALID_FLAGS": \ - ((x) == 0x6 ? "INVALID_ENABLES": \ - ((x) == 0x0 ? "SUCCESS": \ - ((x) == 0x1 ? "FAIL": \ - ((x) == 0x2 ? "INVALID_PARAMS": \ - ((x) == 0x3 ? "RESOURCE_ACCESS_DENIED": \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Sep 6 20:28:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A28C7E15697; Wed, 6 Sep 2017 20:28:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 49565778A2; Wed, 6 Sep 2017 20:28:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86KSJWS037852; Wed, 6 Sep 2017 20:28:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KSISh037847; Wed, 6 Sep 2017 20:28:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709062028.v86KSISh037847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Sep 2017 20:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323234 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 323234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 20:28:21 -0000 Author: mjg Date: Wed Sep 6 20:28:18 2017 New Revision: 323234 URL: https://svnweb.freebsd.org/changeset/base/323234 Log: Start annotating global _padalign locks with __exclusive_cache_line While these locks are guarnteed to not share their respective cache lines, their current placement leaves unnecessary holes in lines which preceeded them. For instance the annotation of vm_page_queue_free_mtx allows 2 neighbour cachelines (previously separate by the lock) to be collapsed into 1. The annotation is only effective on architectures which have it implemented in their linker script (currently only amd64). Thus locks are not converted to their not-padaligned variants as to not affect the rest. MFC after: 1 week Modified: head/sys/kern/subr_vmem.c head/sys/kern/vfs_bio.c head/sys/vm/uma_core.c head/sys/vm/vm_page.c head/sys/vm/vm_pager.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Sep 6 20:19:30 2017 (r323233) +++ head/sys/kern/subr_vmem.c Wed Sep 6 20:28:18 2017 (r323234) @@ -181,7 +181,7 @@ static struct callout vmem_periodic_ch; static int vmem_periodic_interval; static struct task vmem_periodic_wk; -static struct mtx_padalign vmem_list_lock; +static struct mtx_padalign __exclusive_cache_line vmem_list_lock; static LIST_HEAD(, vmem) vmem_list = LIST_HEAD_INITIALIZER(vmem_list); /* ---- misc */ @@ -580,7 +580,7 @@ qc_drain(vmem_t *vm) #ifndef UMA_MD_SMALL_ALLOC -static struct mtx_padalign vmem_bt_lock; +static struct mtx_padalign __exclusive_cache_line vmem_bt_lock; /* * vmem_bt_alloc: Allocate a new page of boundary tags. Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Sep 6 20:19:30 2017 (r323233) +++ head/sys/kern/vfs_bio.c Wed Sep 6 20:28:18 2017 (r323234) @@ -253,23 +253,23 @@ SYSCTL_INT(_vfs, OID_AUTO, maxbcachebuf, CTLFLAG_RDTUN /* * This lock synchronizes access to bd_request. */ -static struct mtx_padalign bdlock; +static struct mtx_padalign __exclusive_cache_line bdlock; /* * This lock protects the runningbufreq and synchronizes runningbufwakeup and * waitrunningbufspace(). */ -static struct mtx_padalign rbreqlock; +static struct mtx_padalign __exclusive_cache_line rbreqlock; /* * Lock that protects needsbuffer and the sleeps/wakeups surrounding it. */ -static struct rwlock_padalign nblock; +static struct rwlock_padalign __exclusive_cache_line nblock; /* * Lock that protects bdirtywait. */ -static struct mtx_padalign bdirtylock; +static struct mtx_padalign __exclusive_cache_line bdirtylock; /* * Wakeup point for bufdaemon, as well as indicator of whether it is already @@ -339,7 +339,7 @@ static int bq_len[BUFFER_QUEUES]; /* * Lock for each bufqueue */ -static struct mtx_padalign bqlocks[BUFFER_QUEUES]; +static struct mtx_padalign __exclusive_cache_line bqlocks[BUFFER_QUEUES]; /* * per-cpu empty buffer cache. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Sep 6 20:19:30 2017 (r323233) +++ head/sys/vm/uma_core.c Wed Sep 6 20:28:18 2017 (r323234) @@ -131,7 +131,7 @@ static LIST_HEAD(,uma_zone) uma_cachezones = LIST_HEAD_INITIALIZER(uma_cachezones); /* This RW lock protects the keg list */ -static struct rwlock_padalign uma_rwlock; +static struct rwlock_padalign __exclusive_cache_line uma_rwlock; /* * Pointer and counter to pool of pages, that is preallocated at Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Sep 6 20:19:30 2017 (r323233) +++ head/sys/vm/vm_page.c Wed Sep 6 20:28:18 2017 (r323234) @@ -127,9 +127,9 @@ __FBSDID("$FreeBSD$"); */ struct vm_domain vm_dom[MAXMEMDOM]; -struct mtx_padalign vm_page_queue_free_mtx; +struct mtx_padalign __exclusive_cache_line vm_page_queue_free_mtx; -struct mtx_padalign pa_lock[PA_LOCK_COUNT]; +struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; /* * bogus page -- for I/O to/from partially complete buffers, Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Wed Sep 6 20:19:30 2017 (r323233) +++ head/sys/vm/vm_pager.c Wed Sep 6 20:28:18 2017 (r323234) @@ -165,7 +165,7 @@ struct pagerops *pagertab[] = { * cleaning requests (NPENDINGIO == 64) * the maximum swap cluster size * (MAXPHYS == 64k) if you want to get the most efficiency. */ -struct mtx_padalign pbuf_mtx; +struct mtx_padalign __exclusive_cache_line pbuf_mtx; static TAILQ_HEAD(swqueue, buf) bswlist; static int bswneeded; vm_offset_t swapbkva; /* swap buffers kva */ From owner-svn-src-head@freebsd.org Wed Sep 6 20:32:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E26E15B14; Wed, 6 Sep 2017 20:32:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0A5E17CB80; Wed, 6 Sep 2017 20:32:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86KWo67041819; Wed, 6 Sep 2017 20:32:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KWngu041817; Wed, 6 Sep 2017 20:32:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709062032.v86KWngu041817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Sep 2017 20:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323235 - in head/sys: conf sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: conf sys X-SVN-Commit-Revision: 323235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 20:32:52 -0000 Author: mjg Date: Wed Sep 6 20:32:49 2017 New Revision: 323235 URL: https://svnweb.freebsd.org/changeset/base/323235 Log: Introduce __read_frequently While __read_mostly groups variables together, their placement is not specified. In particular 2 frequently used variables can end up in different lines. This annotation is only expected to be used for variables read all the time, e.g. on each syscall entry. MFC after: 1 week Modified: head/sys/conf/ldscript.amd64 head/sys/sys/systm.h Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/conf/ldscript.amd64 Wed Sep 6 20:32:49 2017 (r323235) @@ -146,6 +146,10 @@ SECTIONS . = DATA_SEGMENT_RELRO_END (24, .); .got.plt : { *(.got.plt) } . = ALIGN(64); + .data.read_frequently : + { + *(.data.read_frequently) + } .data.read_mostly : { *(.data.read_mostly) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/sys/systm.h Wed Sep 6 20:32:49 2017 (r323235) @@ -138,6 +138,7 @@ void kassert_panic(const char *fmt, ...) __printflike * Align variables. */ #define __read_mostly __section(".data.read_mostly") +#define __read_frequently __section(".data.read_frequently") #define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \ __section(".data.exclusive_cache_line") /* From owner-svn-src-head@freebsd.org Wed Sep 6 20:33:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F75E15C09; Wed, 6 Sep 2017 20:33:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 121837CE8D; Wed, 6 Sep 2017 20:33:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86KXYPO041937; Wed, 6 Sep 2017 20:33:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KXXso041931; Wed, 6 Sep 2017 20:33:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709062033.v86KXXso041931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Sep 2017 20:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323236 - in head/sys: kern security/audit X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern security/audit X-SVN-Commit-Revision: 323236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 20:33:35 -0000 Author: mjg Date: Wed Sep 6 20:33:33 2017 New Revision: 323236 URL: https://svnweb.freebsd.org/changeset/base/323236 Log: Sprinkle __read_frequently on few obvious places. Note that some of annotated variables should probably change their types to something smaller, preferably bit-sized. Modified: head/sys/kern/kern_dtrace.c head/sys/kern/kern_lockstat.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/security/audit/audit.c Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/kern/kern_dtrace.c Wed Sep 6 20:33:33 2017 (r323236) @@ -54,7 +54,7 @@ dtrace_doubletrap_func_t dtrace_doubletrap_func; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; -systrace_probe_func_t systrace_probe_func; +systrace_probe_func_t __read_frequently systrace_probe_func; /* Return the DTrace process data size compiled in the kernel hooks. */ size_t Modified: head/sys/kern/kern_lockstat.c ============================================================================== --- head/sys/kern/kern_lockstat.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/kern/kern_lockstat.c Wed Sep 6 20:33:33 2017 (r323236) @@ -62,7 +62,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t"); -volatile int __read_mostly lockstat_enabled; +volatile int __read_frequently lockstat_enabled; uint64_t lockstat_nsecs(struct lock_object *lo) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/kern/kern_mutex.c Wed Sep 6 20:33:33 2017 (r323236) @@ -140,7 +140,7 @@ struct lock_class lock_class_mtx_spin = { #ifdef ADAPTIVE_MUTEXES static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging"); -static struct lock_delay_config __read_mostly mtx_delay; +static struct lock_delay_config __read_frequently mtx_delay; SYSCTL_INT(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base, 0, ""); @@ -153,7 +153,7 @@ LOCK_DELAY_SYSINIT_DEFAULT(mtx_delay); static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL, "mtx spin debugging"); -static struct lock_delay_config __read_mostly mtx_spin_delay; +static struct lock_delay_config __read_frequently mtx_spin_delay; SYSCTL_INT(_debug_mtx_spin, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_spin_delay.base, 0, ""); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/kern/kern_rwlock.c Wed Sep 6 20:33:33 2017 (r323236) @@ -93,14 +93,14 @@ struct lock_class lock_class_rw = { }; #ifdef ADAPTIVE_RWLOCKS -static int rowner_retries = 10; -static int rowner_loops = 10000; +static int __read_frequently rowner_retries = 10; +static int __read_frequently rowner_loops = 10000; static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, "rwlock debugging"); SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); -static struct lock_delay_config __read_mostly rw_delay; +static struct lock_delay_config __read_frequently rw_delay; SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base, 0, ""); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/kern/kern_sx.c Wed Sep 6 20:33:33 2017 (r323236) @@ -142,13 +142,13 @@ struct lock_class lock_class_sx = { #endif #ifdef ADAPTIVE_SX -static u_int asx_retries = 10; -static u_int asx_loops = 10000; +static __read_frequently u_int asx_retries = 10; +static __read_frequently u_int asx_loops = 10000; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); -static struct lock_delay_config __read_mostly sx_delay; +static struct lock_delay_config __read_frequently sx_delay; SYSCTL_INT(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base, 0, ""); Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Wed Sep 6 20:32:49 2017 (r323235) +++ head/sys/security/audit/audit.c Wed Sep 6 20:33:33 2017 (r323236) @@ -96,7 +96,7 @@ static SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG * * Define the audit control flags. */ -int audit_enabled; +int __read_frequently audit_enabled; int audit_suspended; /* From owner-svn-src-head@freebsd.org Wed Sep 6 21:15:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E70AAE17A20 for ; Wed, 6 Sep 2017 21:15:15 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE2C1761 for ; Wed, 6 Sep 2017 21:15:15 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-vk0-x235.google.com with SMTP id t10so13848973vke.0 for ; Wed, 06 Sep 2017 14:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1u73Vczt9peff0fbC7V0cHH4SavGeHSSwefXlY/4XB8=; b=qs/Vtji/ejt+qCJhsALI+QrO2wj5BdBhhFmtArgrbRiAaYpFLiXYl1N6Pg5BLKYITj c6eG5zTG8LoRbrSWnsdyqTt0ODsplwn7ZRyHTeBJG1ckCW8GB8LtK8Gb68m0arlJmqLe EtJ5b/1FyGL5lhWWOzkP5ES+WKkptXJDgYCjDibCERZSHJhicP1C+u9kHXpDDeANbBsi PHrC/XaxscIECZpU0+VUUvHyMtFt7YL6fw+ibtxZ+sr7CKbmhoGk0n4vdVV+x9UWdGwu QKpQm6fVLMbBPJQsLbj7XPla+I18O6RF54rXr+ufLH15nCNYM9AvXfSypcRNqm+ruIhh f5/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1u73Vczt9peff0fbC7V0cHH4SavGeHSSwefXlY/4XB8=; b=aFPHst5Ut4a24rJoCVYtTDTuY1bXpA1uKUHNxHyqPZxFa0jZDzBz0WNGAyLH7NtsXo 7bwRccBQkgo8hSOcJ7tFJJlmRBGx+aNNGq+R0igxEugN9e/5iFhWbtN+LS4kMtk1rzXo Qzf+X8sRo3vAM1/iSRB3nmm4dnjQzqwR5jdMcgeI9CUbqHoyTsysaO4OYDPCt/ZVTTFS WOdTkrfuKHlciTdz5NSV6EatzQfWn9oW1U7/2d0e9/lGqlJU7YxDZ37wk0CETelEcoU6 BBb9mXGNaumLZ/L+9qqOMF63gkYvYzdEsUrl2tY9gMn6rvy8ljNBJgP3l0hj4WFRdhvJ SX+Q== X-Gm-Message-State: AHPjjUj9aayPGXrVMahTJ2DuZ3hy1M4D0K3whTkHkeqNzt0Jc0+HoVia 2CrpoyzalPkGvKusaLBZ9xhlwZOTITto X-Google-Smtp-Source: ADKCNb55os/jd6I50Ef5zcipX4nzBw+lGs193t0L9tQqV9WkPd3SlmhgNCfjNYCs7chr5GGYig9cyqont3IFgY8vuMw= X-Received: by 10.31.181.208 with SMTP id e199mr290927vkf.55.1504732514143; Wed, 06 Sep 2017 14:15:14 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.176.6.137 with HTTP; Wed, 6 Sep 2017 14:15:13 -0700 (PDT) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> From: Maxim Sobolev Date: Wed, 6 Sep 2017 14:15:13 -0700 X-Google-Sender-Auth: lsBmAbyqkMbxSTg-cQF888vIecI Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 21:15:16 -0000 Alan, I doubt SO_BINTIME / SO_TIMESTAMP ever worked in that scenario. The reason for that is size/layout of the bintime (and other structs) is different on amd64 as compared to i386 and I don't see any conversion going on in the freebsd32_recvmsg(). i386 x86_64 sizeof(timeval) 8 16 sizeof(bintime) 12 16 sizeof(timespec) 8 16 Thereby, first the buffer supplied by the i386 app is not going to be sufficient (causing MSG_CTRUNC). Or even if the app on the receiving end overcommits for whatever reason, it's not going to be able parse the returned structures correctly. This is actually the case with the udp_pingpong, that is also not working properly in emulation mode: [tools/regression/sockets/udp_pingpong]$ ./udp_pingpong Testing send()/recv() via IPv4: OK Testing send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1) via IPv4: udp_pingpong: A2B trip time is not positive Therefore, the i386 emulation code needs to be extended to actually parse into cmghdr structure(s) and to do a proper type conversion between 32 and 64 bit versions of the struct timeval, struct bintime and struct timespec. I have a patch in works to get it fixed, stay tuned. -Max On Mon, Sep 4, 2017 at 7:09 PM, Maxim Sobolev wrote: > Sure, I'll check that out. Thanks for heads up. > > -Max > > On Sun, Sep 3, 2017 at 8:18 PM, Alan Somers wrote: > >> On Mon, Jan 16, 2017 at 10:46 AM, Maxim Sobolev >> wrote: >> > Author: sobomax >> > Date: Mon Jan 16 17:46:38 2017 >> > New Revision: 312296 >> > URL: https://svnweb.freebsd.org/changeset/base/312296 >> > >> > Log: >> > Add a new socket option SO_TS_CLOCK to pick from several different >> clock >> > sources to return timestamps when SO_TIMESTAMP is enabled. Two >> additional >> > clock sources are: >> > >> > o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); >> > o nanosecond resolution monotonic clock (equivalent of >> CLOCK_MONOTONIC). >> > >> > In addition to this, this option provides unified interface to get >> bintime >> > (equivalent of using SO_BINTIME), except it also supported with IPv6 >> where >> > SO_BINTIME has never been supported. The long term plan is to >> depreciate >> > SO_BINTIME and move everything to using SO_TS_CLOCK. >> > >> > Idea for this enhancement has been briefly discussed on the Net >> session >> > during dev summit in Ottawa last June and the general input was >> positive. >> > >> > This change is believed to benefit network benchmarks/profiling as >> well >> > as other scenarios where precise time of arrival measurement is >> necessary. >> > >> > There are two regression test cases as part of this commit: one >> extends unix >> > domain test code (unix_cmsg) to test new SCM_XXX types and another one >> > implementis totally new test case which exchanges UDP packets between >> two >> > processes using both conventional methods (i.e. calling >> clock_gettime(2) >> > before recv(2) and after send(2)), as well as using >> setsockopt()+recv() in >> > receive path. The resulting delays are checked for sanity for all >> supported >> > clock types. >> > >> > Reviewed by: adrian, gnn >> > Differential Revision: https://reviews.freebsd.org/D9171 >> >> While the new SCM_TIMESTAMP code works fine on both amd64 and i386, it >> doesn't work on amd64 under 32-bit emulation. That is, programs that >> use SCM_TIMESTAMP built for i386 will fail when run on an amd64 >> machine. I don't know whether this commit introduced that bug; on >> stable-10 SCM_TIMESTAMP doesn't appear to work at all on i386. But >> sobomax, since you're obviously familiar with this code, would you >> mind taking a look? >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 >> >> -Alan >> >> > From owner-svn-src-head@freebsd.org Wed Sep 6 21:21:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B597DE17E53; Wed, 6 Sep 2017 21:21:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 173412EFF; Wed, 6 Sep 2017 21:21:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86LLEbu059107; Wed, 6 Sep 2017 21:21:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86LLDjn059101; Wed, 6 Sep 2017 21:21:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201709062121.v86LLDjn059101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 Sep 2017 21:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323245 - in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang/include/clang/Basic lib/clang/include/lld/Config lib/clang/include/llvm/Support X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang/include/clang/Basic lib/clang/include/lld/Config lib/clang/include/llvm/Support X-SVN-Commit-Revision: 323245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 21:21:15 -0000 Author: dim Date: Wed Sep 6 21:21:13 2017 New Revision: 323245 URL: https://svnweb.freebsd.org/changeset/base/323245 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 5.0.0 release (upstream r312559). Release notes for llvm, clang and lld will be available here soon: Relnotes: yes MFC after: 1 month X-MFC-with: r321369 Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Config/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Wed Sep 6 20:57:44 2017 (r323244) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Wed Sep 6 21:21:13 2017 (r323245) @@ -30942,11 +30942,40 @@ static bool checkBoolTestAndOrSetCCCombine(SDValue Con return true; } +// When legalizing carry, we create carries via add X, -1 +// If that comes from an actual carry, via setcc, we use the +// carry directly. +static SDValue combineCarryThroughADD(SDValue EFLAGS) { + if (EFLAGS.getOpcode() == X86ISD::ADD) { + if (isAllOnesConstant(EFLAGS.getOperand(1))) { + SDValue Carry = EFLAGS.getOperand(0); + while (Carry.getOpcode() == ISD::TRUNCATE || + Carry.getOpcode() == ISD::ZERO_EXTEND || + Carry.getOpcode() == ISD::SIGN_EXTEND || + Carry.getOpcode() == ISD::ANY_EXTEND || + (Carry.getOpcode() == ISD::AND && + isOneConstant(Carry.getOperand(1)))) + Carry = Carry.getOperand(0); + if (Carry.getOpcode() == X86ISD::SETCC || + Carry.getOpcode() == X86ISD::SETCC_CARRY) { + if (Carry.getConstantOperandVal(0) == X86::COND_B) + return Carry.getOperand(1); + } + } + } + + return SDValue(); +} + /// Optimize an EFLAGS definition used according to the condition code \p CC /// into a simpler EFLAGS value, potentially returning a new \p CC and replacing /// uses of chain values. static SDValue combineSetCCEFLAGS(SDValue EFLAGS, X86::CondCode &CC, SelectionDAG &DAG) { + if (CC == X86::COND_B) + if (SDValue Flags = combineCarryThroughADD(EFLAGS)) + return Flags; + if (SDValue R = checkBoolTestSetCCCombine(EFLAGS, CC)) return R; return combineSetCCAtomicArith(EFLAGS, CC, DAG); @@ -34989,27 +35018,13 @@ static SDValue combineSIntToFP(SDNode *N, SelectionDAG return SDValue(); } -// Optimize RES, EFLAGS = X86ISD::ADD LHS, RHS -static SDValue combineX86ADD(SDNode *N, SelectionDAG &DAG, - X86TargetLowering::DAGCombinerInfo &DCI) { - // When legalizing carry, we create carries via add X, -1 - // If that comes from an actual carry, via setcc, we use the - // carry directly. - if (isAllOnesConstant(N->getOperand(1)) && N->hasAnyUseOfValue(1)) { - SDValue Carry = N->getOperand(0); - while (Carry.getOpcode() == ISD::TRUNCATE || - Carry.getOpcode() == ISD::ZERO_EXTEND || - Carry.getOpcode() == ISD::SIGN_EXTEND || - Carry.getOpcode() == ISD::ANY_EXTEND || - (Carry.getOpcode() == ISD::AND && - isOneConstant(Carry.getOperand(1)))) - Carry = Carry.getOperand(0); - - if (Carry.getOpcode() == X86ISD::SETCC || - Carry.getOpcode() == X86ISD::SETCC_CARRY) { - if (Carry.getConstantOperandVal(0) == X86::COND_B) - return DCI.CombineTo(N, SDValue(N, 0), Carry.getOperand(1)); - } +static SDValue combineSBB(SDNode *N, SelectionDAG &DAG) { + if (SDValue Flags = combineCarryThroughADD(N->getOperand(2))) { + MVT VT = N->getSimpleValueType(0); + SDVTList VTs = DAG.getVTList(VT, MVT::i32); + return DAG.getNode(X86ISD::SBB, SDLoc(N), VTs, + N->getOperand(0), N->getOperand(1), + Flags); } return SDValue(); @@ -35038,6 +35053,14 @@ static SDValue combineADC(SDNode *N, SelectionDAG &DAG return DCI.CombineTo(N, Res1, CarryOut); } + if (SDValue Flags = combineCarryThroughADD(N->getOperand(2))) { + MVT VT = N->getSimpleValueType(0); + SDVTList VTs = DAG.getVTList(VT, MVT::i32); + return DAG.getNode(X86ISD::ADC, SDLoc(N), VTs, + N->getOperand(0), N->getOperand(1), + Flags); + } + return SDValue(); } @@ -35677,7 +35700,7 @@ SDValue X86TargetLowering::PerformDAGCombine(SDNode *N case X86ISD::CMOV: return combineCMov(N, DAG, DCI, Subtarget); case ISD::ADD: return combineAdd(N, DAG, Subtarget); case ISD::SUB: return combineSub(N, DAG, Subtarget); - case X86ISD::ADD: return combineX86ADD(N, DAG, DCI); + case X86ISD::SBB: return combineSBB(N, DAG); case X86ISD::ADC: return combineADC(N, DAG, DCI); case ISD::MUL: return combineMul(N, DAG, DCI, Subtarget); case ISD::SHL: Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Wed Sep 6 20:57:44 2017 (r323244) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Wed Sep 6 21:21:13 2017 (r323245) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_50/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Wed Sep 6 20:57:44 2017 (r323244) +++ head/lib/clang/include/clang/Basic/Version.inc Wed Sep 6 21:21:13 2017 (r323245) @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "312293" +#define SVN_REVISION "312559" Modified: head/lib/clang/include/lld/Config/Version.inc ============================================================================== --- head/lib/clang/include/lld/Config/Version.inc Wed Sep 6 20:57:44 2017 (r323244) +++ head/lib/clang/include/lld/Config/Version.inc Wed Sep 6 21:21:13 2017 (r323245) @@ -4,5 +4,5 @@ #define LLD_VERSION_STRING "5.0.0" #define LLD_VERSION_MAJOR 5 #define LLD_VERSION_MINOR 0 -#define LLD_REVISION_STRING "312293" +#define LLD_REVISION_STRING "312559" #define LLD_REPOSITORY_STRING "FreeBSD" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Wed Sep 6 20:57:44 2017 (r323244) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Wed Sep 6 21:21:13 2017 (r323245) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "svn-r312293" +#define LLVM_REVISION "svn-r312559" From owner-svn-src-head@freebsd.org Wed Sep 6 21:31:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBCE8E18416; Wed, 6 Sep 2017 21:31:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC02646B3; Wed, 6 Sep 2017 21:31:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id q132so20485221lfe.5; Wed, 06 Sep 2017 14:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2U2wrIGFf5SBiktKwR9PRuXmRHkEtDa2oTyN2F+opJo=; b=MBb5R4Gzp8AcENDY3E3xEWMV+M0OkYLHQER9Gm1J6rqWNNJEAY1msK39gnjUMKdTsn +5b7b+Hc0NUZiclPLbXUwPK59x3Y5oAq4FYeFQHKbp0JkHghdElJ08Scy66l2k8oX76F C/Tp6v3zBhJbHZNeldWkiQbyF/cO2gqGA+zfRfQR9GejoPqcfmrW8X5vVOtowIXCpCjf pqHGocDpyFj93Zr/fCRKsfFZCEBb5fbZ9U33oNkv1yAQpHLo0wxRYxX9hoc38bObxWs0 szOTp4UVImSGBK+lWZXTwoOURJdbbg3Kv3t29mGd3ZyMuhPFRvoTyDk/6j6LQ5DBgvDi Myzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2U2wrIGFf5SBiktKwR9PRuXmRHkEtDa2oTyN2F+opJo=; b=EPrVbECkAkJAlFhxADX8FP9ulf35DlOszWM59f6bvF5aBSLZUB1mTH9Idntz6+c5mz N+OG1T/6ZV0Xc8OQaz57HKpoUP50WZHb5xm42/OvCpPpQiTQfPfTT9DLQo3cO7ld1v+B QSLR4E3SckEdooAU69E4ol75JncyzicPT0kCRn6VtWfVop5dw/b1xF5y3mDx2BXNaco4 PjV8Mz5CDiItjiW08moJTWzYBWDcQu/iA+8KU+UEiDy/hvOPJMYGScCCR6DsH2oHSVAp 99BgTNCYCx00afE9xiqWd8+/lId/Lvq6NkPKjsTqysokx0FSTptfDR4yK8RWC4lxpq/R pZ8A== X-Gm-Message-State: AHPjjUjUGHI94aUI1atxi3zKny615V7uIxe2JPZ+EWzwkElQaqu7Y9bN RANlFWnmqjEYX0yMisNZqkdhsCN1fw== X-Google-Smtp-Source: ADKCNb7EwPv8/5tWqcCI3BfrK65qfzYFfKmyLEt5HvZn4L/DbuzGe6R5zpZ7dMuttpw1bzknkLXWAvGUGRV8U64/LrQ= X-Received: by 10.46.88.27 with SMTP id m27mr163571ljb.15.1504733495313; Wed, 06 Sep 2017 14:31:35 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.26.6 with HTTP; Wed, 6 Sep 2017 14:31:34 -0700 (PDT) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> From: Alan Somers Date: Wed, 6 Sep 2017 15:31:34 -0600 X-Google-Sender-Auth: AJcbEGkHZR7UXly6RyyIROtzCqw Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Maxim Sobolev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 21:31:39 -0000 Cool. Thanks for looking into it. On Wed, Sep 6, 2017 at 3:15 PM, Maxim Sobolev wrote: > Alan, I doubt SO_BINTIME / SO_TIMESTAMP ever worked in that scenario. The > reason for that is size/layout of the bintime (and other structs) is > different on amd64 as compared to i386 and I don't see any conversion going > on in the freebsd32_recvmsg(). > > i386 x86_64 > sizeof(timeval) 8 16 > sizeof(bintime) 12 16 > sizeof(timespec) 8 16 > > Thereby, first the buffer supplied by the i386 app is not going to be > sufficient (causing MSG_CTRUNC). Or even if the app on the receiving end > overcommits for whatever reason, it's not going to be able parse the > returned structures correctly. This is actually the case with the > udp_pingpong, that is also not working properly in emulation mode: > > [tools/regression/sockets/udp_pingpong]$ ./udp_pingpong > Testing send()/recv() via IPv4: OK > Testing send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1) via IPv4: > udp_pingpong: A2B trip time is not positive > > Therefore, the i386 emulation code needs to be extended to actually parse > into cmghdr structure(s) and to do a proper type conversion between 32 and > 64 bit versions of the struct timeval, struct bintime and struct timespec. > > I have a patch in works to get it fixed, stay tuned. > > -Max > > On Mon, Sep 4, 2017 at 7:09 PM, Maxim Sobolev wrote: >> >> Sure, I'll check that out. Thanks for heads up. >> >> -Max >> >> On Sun, Sep 3, 2017 at 8:18 PM, Alan Somers wrote: >>> >>> On Mon, Jan 16, 2017 at 10:46 AM, Maxim Sobolev >>> wrote: >>> > Author: sobomax >>> > Date: Mon Jan 16 17:46:38 2017 >>> > New Revision: 312296 >>> > URL: https://svnweb.freebsd.org/changeset/base/312296 >>> > >>> > Log: >>> > Add a new socket option SO_TS_CLOCK to pick from several different >>> > clock >>> > sources to return timestamps when SO_TIMESTAMP is enabled. Two >>> > additional >>> > clock sources are: >>> > >>> > o nanosecond resolution realtime clock (equivalent of >>> > CLOCK_REALTIME); >>> > o nanosecond resolution monotonic clock (equivalent of >>> > CLOCK_MONOTONIC). >>> > >>> > In addition to this, this option provides unified interface to get >>> > bintime >>> > (equivalent of using SO_BINTIME), except it also supported with IPv6 >>> > where >>> > SO_BINTIME has never been supported. The long term plan is to >>> > depreciate >>> > SO_BINTIME and move everything to using SO_TS_CLOCK. >>> > >>> > Idea for this enhancement has been briefly discussed on the Net >>> > session >>> > during dev summit in Ottawa last June and the general input was >>> > positive. >>> > >>> > This change is believed to benefit network benchmarks/profiling as >>> > well >>> > as other scenarios where precise time of arrival measurement is >>> > necessary. >>> > >>> > There are two regression test cases as part of this commit: one >>> > extends unix >>> > domain test code (unix_cmsg) to test new SCM_XXX types and another >>> > one >>> > implementis totally new test case which exchanges UDP packets between >>> > two >>> > processes using both conventional methods (i.e. calling >>> > clock_gettime(2) >>> > before recv(2) and after send(2)), as well as using >>> > setsockopt()+recv() in >>> > receive path. The resulting delays are checked for sanity for all >>> > supported >>> > clock types. >>> > >>> > Reviewed by: adrian, gnn >>> > Differential Revision: https://reviews.freebsd.org/D9171 >>> >>> While the new SCM_TIMESTAMP code works fine on both amd64 and i386, it >>> doesn't work on amd64 under 32-bit emulation. That is, programs that >>> use SCM_TIMESTAMP built for i386 will fail when run on an amd64 >>> machine. I don't know whether this commit introduced that bug; on >>> stable-10 SCM_TIMESTAMP doesn't appear to work at all on i386. But >>> sobomax, since you're obviously familiar with this code, would you >>> mind taking a look? >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 >>> >>> -Alan >>> >> > From owner-svn-src-head@freebsd.org Wed Sep 6 21:38:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A945E1876B; Wed, 6 Sep 2017 21:38:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0021465D8E; Wed, 6 Sep 2017 21:38:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86Lc7ji067103; Wed, 6 Sep 2017 21:38:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86Lc7s7067102; Wed, 6 Sep 2017 21:38:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709062138.v86Lc7s7067102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Sep 2017 21:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323246 - head/sys/dev/vxge/vxgehal X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/dev/vxge/vxgehal X-SVN-Commit-Revision: 323246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 21:38:09 -0000 Author: mjg Date: Wed Sep 6 21:38:07 2017 New Revision: 323246 URL: https://svnweb.freebsd.org/changeset/base/323246 Log: vxge: plug void casts from memcpy/memzero calls Most of places using them did not have the cast in the first place. No functional changes. MFC after: 1 week Modified: head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Modified: head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c ============================================================================== --- head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Wed Sep 6 21:21:13 2017 (r323245) +++ head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c Wed Sep 6 21:38:07 2017 (r323246) @@ -5654,10 +5654,10 @@ __hal_mrpcim_get_vpd_data(__hal_device_t *hldev) if ((vpd_data[count] == 'S') && (vpd_data[count + 1] == 'N') && (vpd_data[count + 2] < VXGE_HAL_VPD_LENGTH)) { - (void) vxge_os_memzero( + vxge_os_memzero( hldev->mrpcim->vpd_data.serial_num, VXGE_HAL_VPD_LENGTH); - (void) vxge_os_memcpy( + vxge_os_memcpy( hldev->mrpcim->vpd_data.serial_num, &vpd_data[count + 3], vpd_data[count + 2]); @@ -5666,9 +5666,9 @@ __hal_mrpcim_get_vpd_data(__hal_device_t *hldev) } if (vpd_data[1] < VXGE_HAL_VPD_LENGTH) { - (void) vxge_os_memzero( + vxge_os_memzero( hldev->mrpcim->vpd_data.product_name, vpd_data[1]); - (void) vxge_os_memcpy(hldev->mrpcim->vpd_data.product_name, + vxge_os_memcpy(hldev->mrpcim->vpd_data.product_name, &vpd_data[3], vpd_data[1]); } } From owner-svn-src-head@freebsd.org Wed Sep 6 22:29:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6312EE1ACCE for ; Wed, 6 Sep 2017 22:29:35 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-ua0-x235.google.com (mail-ua0-x235.google.com [IPv6:2607:f8b0:400c:c08::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6D4771969 for ; Wed, 6 Sep 2017 22:29:34 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-ua0-x235.google.com with SMTP id c27so16258321uah.2 for ; Wed, 06 Sep 2017 15:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=C8yabytOP9KyzPdk6UOEiT78FoENII4gAv6OgtKuwQg=; b=conJlv+2ZD2Q0amnaVyY3v9Ug6KNcpbcEh6X+X6zrTjQRp50mO4tyFM7zTNaqjihFm c9IPE7NfWTYbrw21d06tFx5oBxj+cmIHFmHxykS2yV1hlrSla51Hc/uj7VmCMHqXKvl7 5xy46RyCMrOOEAPk8f+9vBFCUiKt3PYiw6FDmdR9cNUK0v/ZzhiDIFMWDknZugUMr9qy Nz35E9x4D/hMIcu0ANrbNrayOe229g8eRRnQ9Dj6qeYkIfAiuxLlYXYLA5cdK6qCh4kk 2ZWu5VbA6HVIDTPXpoHEa4IAJPnmVOw5S62DoPnah9QNHiT+d7vGa2DNRjMpCtfu6u9a BKaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=C8yabytOP9KyzPdk6UOEiT78FoENII4gAv6OgtKuwQg=; b=AUJCsO1coXsXdLFpjc7DhnLTVez0aN+92Kf/R/GoXjB+iFBxMW0HOmVdijATCzSjKm OAbd0FpDGEB+tQ1aUBO7PwD2Ie/nnqbZ76dT6mYq/otikakO9b2lvjUoLNhLXYQFphe+ VTgkydu13gmq/+PxdJrWkFLrLuai5o+QjUffbEsD1An10TcpSEAq6POu2NvUBDXkaUYg wwXPwiuEjYYzfJ6XSPQym0qlfPZWruboPdJJi0tDb3ZrH0gEyHenf/EDRb4uuiXRBg2y yKI5NAx3W6JmxV0jWqWae5OV/36KZoC9syi1mEu+gjIbmAvkKKeOKWIevJCbi7djC+ao ErJA== X-Gm-Message-State: AHPjjUiFYRFi4jp+h/ce7nYkARY0rJewz667eGx4ta32eE/wvD8jf6hG 7lDtJsC/KhWISi44UYVKTQrY5DSVYJF3 X-Google-Smtp-Source: ADKCNb4L1oa5Sgr7AQb0IOPjK4ahRsNBl/83mlHTP3osylfkXahpZ36JM010RH2bJY45bfyXS9Fl8oSvWXO/zCKvKkc= X-Received: by 10.176.20.103 with SMTP id c36mr390816uae.137.1504736973755; Wed, 06 Sep 2017 15:29:33 -0700 (PDT) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.176.6.137 with HTTP; Wed, 6 Sep 2017 15:29:33 -0700 (PDT) Received: by 10.176.6.137 with HTTP; Wed, 6 Sep 2017 15:29:33 -0700 (PDT) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> From: Maxim Sobolev Date: Wed, 6 Sep 2017 15:29:33 -0700 X-Google-Sender-Auth: Iec_oeXJCD4NUzuXQcPbnkpFspw Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 22:29:35 -0000 No problem, it also suggests somebody seriously interested in the 32-bit emulation might find entertaining running regression tests both natively and in the i386->amd64 mode comparing results, it could bring some interesting corner cases and pitfalls of the compat/freebsd32 to light. I've also made some generic improvements into the udp_pingpong to catch anomality in returned data length as well as to handle MSG_CTRUNC and premature departure of the other side more gracefully. -Max On Wed, Sep 6, 2017 at 2:31 PM, Alan Somers wrote: > Cool. Thanks for looking into it. > > On Wed, Sep 6, 2017 at 3:15 PM, Maxim Sobolev wrote: > > Alan, I doubt SO_BINTIME / SO_TIMESTAMP ever worked in that scenario. The > > reason for that is size/layout of the bintime (and other structs) is > > different on amd64 as compared to i386 and I don't see any conversion > going > > on in the freebsd32_recvmsg(). > > > > i386 x86_64 > > sizeof(timeval) 8 16 > > sizeof(bintime) 12 16 > > sizeof(timespec) 8 16 > > > > Thereby, first the buffer supplied by the i386 app is not going to be > > sufficient (causing MSG_CTRUNC). Or even if the app on the receiving end > > overcommits for whatever reason, it's not going to be able parse the > > returned structures correctly. This is actually the case with the > > udp_pingpong, that is also not working properly in emulation mode: > > > > [tools/regression/sockets/udp_pingpong]$ ./udp_pingpong > > Testing send()/recv() via IPv4: OK > > Testing send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1) via IPv4: > > udp_pingpong: A2B trip time is not positive > > > > Therefore, the i386 emulation code needs to be extended to actually parse > > into cmghdr structure(s) and to do a proper type conversion between 32 > and > > 64 bit versions of the struct timeval, struct bintime and struct > timespec. > > > > I have a patch in works to get it fixed, stay tuned. > > > > -Max > > > > On Mon, Sep 4, 2017 at 7:09 PM, Maxim Sobolev > wrote: > >> > >> Sure, I'll check that out. Thanks for heads up. > >> > >> -Max > >> > >> On Sun, Sep 3, 2017 at 8:18 PM, Alan Somers > wrote: > >>> > >>> On Mon, Jan 16, 2017 at 10:46 AM, Maxim Sobolev > >>> wrote: > >>> > Author: sobomax > >>> > Date: Mon Jan 16 17:46:38 2017 > >>> > New Revision: 312296 > >>> > URL: https://svnweb.freebsd.org/changeset/base/312296 > >>> > > >>> > Log: > >>> > Add a new socket option SO_TS_CLOCK to pick from several different > >>> > clock > >>> > sources to return timestamps when SO_TIMESTAMP is enabled. Two > >>> > additional > >>> > clock sources are: > >>> > > >>> > o nanosecond resolution realtime clock (equivalent of > >>> > CLOCK_REALTIME); > >>> > o nanosecond resolution monotonic clock (equivalent of > >>> > CLOCK_MONOTONIC). > >>> > > >>> > In addition to this, this option provides unified interface to get > >>> > bintime > >>> > (equivalent of using SO_BINTIME), except it also supported with > IPv6 > >>> > where > >>> > SO_BINTIME has never been supported. The long term plan is to > >>> > depreciate > >>> > SO_BINTIME and move everything to using SO_TS_CLOCK. > >>> > > >>> > Idea for this enhancement has been briefly discussed on the Net > >>> > session > >>> > during dev summit in Ottawa last June and the general input was > >>> > positive. > >>> > > >>> > This change is believed to benefit network benchmarks/profiling as > >>> > well > >>> > as other scenarios where precise time of arrival measurement is > >>> > necessary. > >>> > > >>> > There are two regression test cases as part of this commit: one > >>> > extends unix > >>> > domain test code (unix_cmsg) to test new SCM_XXX types and another > >>> > one > >>> > implementis totally new test case which exchanges UDP packets > between > >>> > two > >>> > processes using both conventional methods (i.e. calling > >>> > clock_gettime(2) > >>> > before recv(2) and after send(2)), as well as using > >>> > setsockopt()+recv() in > >>> > receive path. The resulting delays are checked for sanity for all > >>> > supported > >>> > clock types. > >>> > > >>> > Reviewed by: adrian, gnn > >>> > Differential Revision: https://reviews.freebsd.org/D9171 > >>> > >>> While the new SCM_TIMESTAMP code works fine on both amd64 and i386, it > >>> doesn't work on amd64 under 32-bit emulation. That is, programs that > >>> use SCM_TIMESTAMP built for i386 will fail when run on an amd64 > >>> machine. I don't know whether this commit introduced that bug; on > >>> stable-10 SCM_TIMESTAMP doesn't appear to work at all on i386. But > >>> sobomax, since you're obviously familiar with this code, would you > >>> mind taking a look? > >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039 > >>> > >>> -Alan > >>> > >> > > > > From owner-svn-src-head@freebsd.org Wed Sep 6 23:43:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB39E1DB60; Wed, 6 Sep 2017 23:43:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 C61F8244C; Wed, 6 Sep 2017 23:43:21 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86NhKaM020269; Wed, 6 Sep 2017 23:43:20 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86NhK8Z020268; Wed, 6 Sep 2017 23:43:20 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201709062343.v86NhK8Z020268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 6 Sep 2017 23:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323251 - head/sys/dev/bhnd/cores/usb X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/usb X-SVN-Commit-Revision: 323251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 06 Sep 2017 23:43:22 -0000 Author: landonf Date: Wed Sep 6 23:43:20 2017 New Revision: 323251 URL: https://svnweb.freebsd.org/changeset/base/323251 Log: bhnd: Remove unsupported USB core IDs from the bhnd_usb device table. This resolves a SoC reset triggered by attempting to attach to the BCM5365's USB 1.1 controller. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/cores/usb/bhnd_usb.c Modified: head/sys/dev/bhnd/cores/usb/bhnd_usb.c ============================================================================== --- head/sys/dev/bhnd/cores/usb/bhnd_usb.c Wed Sep 6 23:12:34 2017 (r323250) +++ head/sys/dev/bhnd/cores/usb/bhnd_usb.c Wed Sep 6 23:43:20 2017 (r323251) @@ -51,11 +51,7 @@ __FBSDID("$FreeBSD$"); /****************************** Variables ************************************/ static const struct bhnd_device bhnd_usb_devs[] = { - BHND_DEVICE(BCM, USB, "USB1.1 Host/Device core", NULL), BHND_DEVICE(BCM, USB20H, "USB2.0 Host core", NULL), - BHND_DEVICE(BCM, USB20D, "USB2.0 Device core", NULL), - BHND_DEVICE(BCM, USB11H, "USB1.1 Host core", NULL), - BHND_DEVICE(BCM, USB11D, "USB1.1 Device core", NULL), BHND_DEVICE_END }; From owner-svn-src-head@freebsd.org Thu Sep 7 00:20:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B81E1F3AE; Thu, 7 Sep 2017 00:20:19 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D300669BCE; Thu, 7 Sep 2017 00:20:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v870KHM8032440; Thu, 7 Sep 2017 00:20:17 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v870KHpO032436; Thu, 7 Sep 2017 00:20:17 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201709070020.v870KHpO032436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 7 Sep 2017 00:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323252 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 323252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 00:20:19 -0000 Author: dab Date: Thu Sep 7 00:20:17 2017 New Revision: 323252 URL: https://svnweb.freebsd.org/changeset/base/323252 Log: Add a new getty/gettytab capability to generate an initial message dynamically. This modification adds a new gettytab(5) option (iM) to specify a program to run that will generate the initial (banner) message that is displayed before the login prompt. Such a capability is useful when dynamic information is needed in the banner message that cannot be supplied by the set of % substitution sequences available in the "im" option. Reviewed by: vangyzen, wblock, manpages Approved by: vangyzen (mentor) MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D12108 Modified: head/libexec/getty/gettytab.5 head/libexec/getty/gettytab.h head/libexec/getty/init.c head/libexec/getty/main.c Modified: head/libexec/getty/gettytab.5 ============================================================================== --- head/libexec/getty/gettytab.5 Wed Sep 6 23:43:20 2017 (r323251) +++ head/libexec/getty/gettytab.5 Thu Sep 7 00:20:17 2017 (r323252) @@ -28,7 +28,7 @@ .\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" " -.Dd February 2, 2017 +.Dd August 23, 2017 .Dt GETTYTAB 5 .Os .Sh NAME @@ -130,6 +130,8 @@ hangup line on last close .It "ig bool false ignore garbage characters in login name" .It "im str" Ta Dv NULL .Ta No "initial (banner) message" +.It "iM str" Ta Dv NULL +.Ta No "execute named file to generate initial (banner) message" .It "in str" Ta So Li ^C .Sc Ta No "interrupt character" .It "is num unused input speed" @@ -146,7 +148,7 @@ hangup line on last close .It "mb bool false do flow control based on carrier" .It "nc bool false terminal does not supply carrier (set clocal)" .It "nl bool false terminal has (or might have) a newline character" -.It "np bool false terminal uses no parity (i.e. 8-bit characters)" +.It "np bool false terminal uses no parity (i.e., 8-bit characters)" .It "nx str default next table (for auto speed selection)" .It "o0 num unused tty output flags to write messages" .It "o1 num unused tty output flags to read login name" Modified: head/libexec/getty/gettytab.h ============================================================================== --- head/libexec/getty/gettytab.h Wed Sep 6 23:43:20 2017 (r323251) +++ head/libexec/getty/gettytab.h Thu Sep 7 00:20:17 2017 (r323252) @@ -88,6 +88,7 @@ struct gettyflags { #define AC gettystrs[28].value #define AL gettystrs[29].value #define DF gettystrs[30].value +#define IMP gettystrs[31].value /* * Numeric definitions. Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Wed Sep 6 23:43:20 2017 (r323251) +++ head/libexec/getty/init.c Thu Sep 7 00:20:17 2017 (r323252) @@ -82,6 +82,7 @@ struct gettystrs gettystrs[] = { { "ac" }, /* modem answer-chat */ { "al" }, /* user to auto-login */ { "df", datefmt}, /* format for strftime() */ + { "iM" }, /* initial message program */ { 0 } }; Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Wed Sep 6 23:43:20 2017 (r323251) +++ head/libexec/getty/main.c Thu Sep 7 00:20:17 2017 (r323252) @@ -324,6 +324,8 @@ main(int argc, char *argv[]) } first_time = 0; + if (IMP && *IMP && !(PL && PP)) + system(IMP); if (IM && *IM && !(PL && PP)) putf(IM); if (setjmp(timeout)) { From owner-svn-src-head@freebsd.org Thu Sep 7 03:05:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FA9E012DF; Thu, 7 Sep 2017 03:05:18 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D95606C7CB; Thu, 7 Sep 2017 03:05:17 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8735GBk001539; Thu, 7 Sep 2017 03:05:16 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8735GBc001537; Thu, 7 Sep 2017 03:05:16 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201709070305.v8735GBc001537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 7 Sep 2017 03:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323253 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 323253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 03:05:18 -0000 Author: gnn Date: Thu Sep 7 03:05:16 2017 New Revision: 323253 URL: https://svnweb.freebsd.org/changeset/base/323253 Log: Add D definitions for the named values in socket.h Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12241 Added: head/cddl/lib/libdtrace/socket.d (contents, props changed) Modified: head/cddl/lib/libdtrace/Makefile Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Thu Sep 7 00:20:17 2017 (r323252) +++ head/cddl/lib/libdtrace/Makefile Thu Sep 7 03:05:16 2017 (r323253) @@ -54,6 +54,7 @@ DSRCS= errno.d \ siftr.d \ signal.d \ tcp.d \ + socket.d \ udp.d \ unistd.d Added: head/cddl/lib/libdtrace/socket.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libdtrace/socket.d Thu Sep 7 03:05:16 2017 (r323253) @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2017 George V. Neville-Neil + * 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. + * + * $FreeBSD$ + * + * Translators and flags for the socket structure. FreeBSD specific code. + */ + +#pragma D depends_on module kernel + +/* + * Option flags per-socket. + */ +#pragma D binding "1.13" SO_DEBUG +inline int SO_DEBUG = 0x0001; /* turn on debugging info recording */ +#pragma D binding "1.13" SO_ACCEPTCONN +inline int SO_ACCEPTCONN = 0x0002; /* socket has had listen() */ +#pragma D binding "1.13" SO_REUSEADDR +inline int SO_REUSEADDR = 0x0004; /* allow local address reuse */ +#pragma D binding "1.13" SO_KEEPALIVE +inline int SO_KEEPALIVE = 0x0008; /* keep connections alive */ +#pragma D binding "1.13" SO_DONTROUTE +inline int SO_DONTROUTE = 0x0010; /* just use interface addresses */ +#pragma D binding "1.13" SO_BROADCAST +inline int SO_BROADCAST = 0x0020; /* permit sending of broadcast msgs */ +#pragma D binding "1.13" SO_USELOOPBACK +inline int SO_USELOOPBACK = 0x0040; /* bypass hardware when possible */ +#pragma D binding "1.13" SO_LINGER +inline int SO_LINGER = 0x0080; /* linger on close if data present */ +#pragma D binding "1.13" SO_OOBINLINE +inline int SO_OOBINLINE = 0x0100; /* leave received OOB data in line */ +#pragma D binding "1.13" SO_REUSEPORT +inline int SO_REUSEPORT = 0x0200; /* allow local address & port reuse */ +#pragma D binding "1.13" SO_TIMESTAMP +inline int SO_TIMESTAMP = 0x0400; /* timestamp received dgram traffic */ +#pragma D binding "1.13" SO_NOSIGPIPE +inline int SO_NOSIGPIPE = 0x0800; /* no SIGPIPE from EPIPE */ +#pragma D binding "1.13" SO_ACCEPTFILTER +inline int SO_ACCEPTFILTER = 0x1000; /* there is an accept filter */ +#pragma D binding "1.13" SO_BINTIME +inline int SO_BINTIME = 0x2000; /* timestamp received dgram traffic */ +#pragma D binding "1.13" SO_NO_OFFLOAD +inline int SO_NO_OFFLOAD = 0x4000; /* socket cannot be offloaded */ +#pragma D binding "1.13" SO_NO_DDP +inline int SO_NO_DDP = 0x8000; /* disable direct data placement */ + +/* + * Additional options, not kept in so_options. + */ +#pragma D binding "1.13" SO_SNDBUF +inline int SO_SNDBUF = 0x1001; /* send buffer size */ +#pragma D binding "1.13" SO_RCVBUF +inline int SO_RCVBUF = 0x1002; /* receive buffer size */ +#pragma D binding "1.13" SO_SNDLOWAT +inline int SO_SNDLOWAT = 0x1003; /* send low-water mark */ +#pragma D binding "1.13" SO_RCVLOWAT +inline int SO_RCVLOWAT = 0x1004; /* receive low-water mark */ +#pragma D binding "1.13" SO_SNDTIMEO +inline int SO_SNDTIMEO = 0x1005; /* send timeout */ +#pragma D binding "1.13" SO_RCVTIMEO +inline int SO_RCVTIMEO = 0x1006; /* receive timeout */ +#pragma D binding "1.13" SO_ERROR +inline int SO_ERROR = 0x1007; /* get error status and clear */ +#pragma D binding "1.13" SO_TYPE +inline int SO_TYPE = 0x1008; /* get socket type */ +#pragma D binding "1.13" SO_LABEL +inline int SO_LABEL = 0x1009; /* socket's MAC label */ +#pragma D binding "1.13" SO_PEERLABEL +inline int SO_PEERLABEL = 0x1010; /* socket's peer's MAC label */ +#pragma D binding "1.13" SO_LISTENQLIMIT +inline int SO_LISTENQLIMIT = 0x1011; /* socket's backlog limit */ +#pragma D binding "1.13" SO_LISTENQLEN +inline int SO_LISTENQLEN = 0x1012; /* socket's complete queue length */ +#pragma D binding "1.13" SO_LISTENINCQLEN +inline int SO_LISTENINCQLEN = 0x1013; /* socket's incomplete queue length */ +#pragma D binding "1.13" SO_SETFIB +inline int SO_SETFIB = 0x1014; /* use this FIB to route */ +#pragma D binding "1.13" SO_USER_COOKIE +inline int SO_USER_COOKIE = 0x1015; /* user cookie (dummynet etc.) */ +#pragma D binding "1.13" SO_PROTOCOL +inline int SO_PROTOCOL = 0x1016; /* get socket protocol (Linux name) */ +#pragma D binding "1.13" SO_PROTOTYPE +inline int SO_PROTOTYPE = SO_PROTOCOL; /* alias for SO_PROTOCOL (SunOS name) */ +#pragma D binding "1.13" SO_TS_CLOCK +inline int SO_TS_CLOCK = 0x1017; /* clock type used for SO_TIMESTAMP */ +#pragma D binding "1.13" SO_MAX_PACING_RATE +inline int SO_MAX_PACING_RATE = 0x1018; /* socket's max TX pacing rate (Linux name) */ + +#pragma D binding "1.13" SO_TS_REALTIME_MICRO +inline int SO_TS_REALTIME_MICRO = 0; /* microsecond resolution, realtime */ +#pragma D binding "1.13" SO_TS_BINTIME +inline int SO_TS_BINTIME = 1; /* sub-nanosecond resolution, realtime */ +#pragma D binding "1.13" SO_TS_REALTIME +inline int SO_TS_REALTIME = 2; /* nanosecond resolution, realtime */ +#pragma D binding "1.13" SO_TS_MONOTONIC +inline int SO_TS_MONOTONIC = 3; /* nanosecond resolution, monotonic */ +#pragma D binding "1.13" SO_TS_DEFAULT +inline int SO_TS_DEFAULT = SO_TS_REALTIME_MICRO; +#pragma D binding "1.13" SO_TS_CLOCK_MAX +inline int SO_TS_CLOCK_MAX = SO_TS_MONOTONIC; + +#pragma D binding "1.13" AF_UNSPEC +inline int AF_UNSPEC = 0; /* unspecified */ +#pragma D binding "1.13" AF_UNIX +inline int AF_UNIX = 1; /* standardized name for AF_LOCAL */ +#pragma D binding "1.13" AF_LOCAL +inline int AF_LOCAL = AF_UNIX; /* local to host (pipes, portals) */ +#pragma D binding "1.13" AF_INET +inline int AF_INET = 2; /* internetwork: UDP, TCP, etc. */ +#pragma D binding "1.13" AF_IMPLINK +inline int AF_IMPLINK = 3; /* arpanet imp addresses */ +#pragma D binding "1.13" AF_PUP +inline int AF_PUP = 4; /* pup protocols: e.g. BSP */ +#pragma D binding "1.13" AF_CHAOS +inline int AF_CHAOS = 5; /* mit CHAOS protocols */ +#pragma D binding "1.13" AF_NETBIOS +inline int AF_NETBIOS = 6; /* SMB protocols */ +#pragma D binding "1.13" AF_ISO +inline int AF_ISO = 7; /* ISO protocols */ +#pragma D binding "1.13" AF_OSI +inline int AF_OSI = AF_ISO; +#pragma D binding "1.13" AF_ECMA +inline int AF_ECMA = 8; /* European computer manufacturers */ +#pragma D binding "1.13" AF_DATAKIT +inline int AF_DATAKIT = 9; /* datakit protocols */ +#pragma D binding "1.13" AF_CCITT +inline int AF_CCITT = 10; /* CCITT protocols, X.25 etc */ +#pragma D binding "1.13" AF_SNA +inline int AF_SNA = 11; /* IBM SNA */ +#pragma D binding "1.13" AF_DECnet +inline int AF_DECnet = 12; /* DECnet */ +#pragma D binding "1.13" AF_DLI +inline int AF_DLI = 13; /* DEC Direct data link interface */ +#pragma D binding "1.13" AF_LAT +inline int AF_LAT = 14; /* LAT */ +#pragma D binding "1.13" AF_HYLINK +inline int AF_HYLINK = 15; /* NSC Hyperchannel */ +#pragma D binding "1.13" AF_APPLETALK +inline int AF_APPLETALK = 16; /* Apple Talk */ +#pragma D binding "1.13" AF_ROUTE +inline int AF_ROUTE = 17; /* Internal Routing Protocol */ +#pragma D binding "1.13" AF_LINK +inline int AF_LINK = 18; /* Link layer interface */ +#pragma D binding "1.13" pseudo_AF_XTP +inline int pseudo_AF_XTP = 19; /* eXpress Transfer Protocol (no AF) */ +#pragma D binding "1.13" AF_COIP +inline int AF_COIP = 20; /* connection-oriented IP, aka ST II */ +#pragma D binding "1.13" AF_CNT +inline int AF_CNT = 21; /* Computer Network Technology */ +#pragma D binding "1.13" pseudo_AF_RTIP +inline int pseudo_AF_RTIP = 22; /* Help Identify RTIP packets */ +#pragma D binding "1.13" AF_IPX +inline int AF_IPX = 23; /* Novell Internet Protocol */ +#pragma D binding "1.13" AF_SIP +inline int AF_SIP = 24; /* Simple Internet Protocol */ +#pragma D binding "1.13" pseudo_AF_PIP +inline int pseudo_AF_PIP = 25; /* Help Identify PIP packets */ +#pragma D binding "1.13" AF_ISDN +inline int AF_ISDN = 26; /* Integrated Services Digital Network*/ +#pragma D binding "1.13" AF_E164 +inline int AF_E164 = AF_ISDN; /* CCITT E.164 recommendation */ +#pragma D binding "1.13" pseudo_AF_KEY +inline int pseudo_AF_KEY = 27; /* Internal key-management function */ +#pragma D binding "1.13" AF_INET6 +inline int AF_INET6 = 28; /* IPv6 */ +#pragma D binding "1.13" AF_NATM +inline int AF_NATM = 29; /* native ATM access */ +#pragma D binding "1.13" AF_ATM +inline int AF_ATM = 30; /* ATM */ +#pragma D binding "1.13" pseudo_AF_HDRCMPLT +inline int pseudo_AF_HDRCMPLT = 31; /* Used by BPF to not rewrite headers + * in interface output routine + */ +#pragma D binding "1.13" AF_NETGRAPH +inline int AF_NETGRAPH = 32; /* Netgraph sockets */ +#pragma D binding "1.13" AF_SLOW +inline int AF_SLOW = 33; /* 802.3ad slow protocol */ +#pragma D binding "1.13" AF_SCLUSTER +inline int AF_SCLUSTER = 34; /* Sitara cluster protocol */ +#pragma D binding "1.13" AF_ARP +inline int AF_ARP = 35; /* Address Resolution Protocol */ +#pragma D binding "1.13" AF_BLUETOOTH +inline int AF_BLUETOOTH = 36; /* Bluetooth sockets */ +#pragma D binding "1.13" AF_IEEE80211 +inline int AF_IEEE80211 = 37; /* IEEE 802.11 protocol */ +#pragma D binding "1.13" AF_INET_SDP +inline int AF_INET_SDP = 40; /* OFED Socket Direct Protocol ipv4 */ +#pragma D binding "1.13" AF_INET6_SDP +inline int AF_INET6_SDP = 42; /* OFED Socket Direct Protocol ipv6 */ +#pragma D binding "1.13" AF_MAX +inline int AF_MAX = 42; + +/* + * Protocol families, same as address families for now. + */ +#pragma D binding "1.13" PF_UNSPEC +inline int PF_UNSPEC = AF_UNSPEC; +#pragma D binding "1.13" PF_LOCAL +inline int PF_LOCAL = AF_LOCAL; +#pragma D binding "1.13" PF_UNIX +inline int PF_UNIX = PF_LOCAL; /* backward compatibility */ +#pragma D binding "1.13" PF_INET +inline int PF_INET = AF_INET; +#pragma D binding "1.13" PF_IMPLINK +inline int PF_IMPLINK = AF_IMPLINK; +#pragma D binding "1.13" PF_PUP +inline int PF_PUP = AF_PUP; +#pragma D binding "1.13" PF_CHAOS +inline int PF_CHAOS = AF_CHAOS; +#pragma D binding "1.13" PF_NETBIOS +inline int PF_NETBIOS = AF_NETBIOS; +#pragma D binding "1.13" PF_ISO +inline int PF_ISO = AF_ISO; +#pragma D binding "1.13" PF_OSI +inline int PF_OSI = AF_ISO; +#pragma D binding "1.13" PF_ECMA +inline int PF_ECMA = AF_ECMA; +#pragma D binding "1.13" PF_DATAKIT +inline int PF_DATAKIT = AF_DATAKIT; +#pragma D binding "1.13" PF_CCITT +inline int PF_CCITT = AF_CCITT; +#pragma D binding "1.13" PF_SNA +inline int PF_SNA = AF_SNA; +#pragma D binding "1.13" PF_DECnet +inline int PF_DECnet = AF_DECnet; +#pragma D binding "1.13" PF_DLI +inline int PF_DLI = AF_DLI; +#pragma D binding "1.13" PF_LAT +inline int PF_LAT = AF_LAT; +#pragma D binding "1.13" PF_HYLINK +inline int PF_HYLINK = AF_HYLINK; +#pragma D binding "1.13" PF_APPLETALK +inline int PF_APPLETALK = AF_APPLETALK; +#pragma D binding "1.13" PF_ROUTE +inline int PF_ROUTE = AF_ROUTE; +#pragma D binding "1.13" PF_LINK +inline int PF_LINK = AF_LINK; +#pragma D binding "1.13" PF_XTP +inline int PF_XTP = pseudo_AF_XTP; /* really just proto family, no AF */ +#pragma D binding "1.13" PF_COIP +inline int PF_COIP = AF_COIP; +#pragma D binding "1.13" PF_CNT +inline int PF_CNT = AF_CNT; +#pragma D binding "1.13" PF_SIP +inline int PF_SIP = AF_SIP; +#pragma D binding "1.13" PF_IPX +inline int PF_IPX = AF_IPX; +#pragma D binding "1.13" PF_RTIP +inline int PF_RTIP = pseudo_AF_RTIP; /* same format as AF_INET */ +#pragma D binding "1.13" PF_PIP +inline int PF_PIP = pseudo_AF_PIP; +#pragma D binding "1.13" PF_ISDN +inline int PF_ISDN = AF_ISDN; +#pragma D binding "1.13" PF_KEY +inline int PF_KEY = pseudo_AF_KEY; +#pragma D binding "1.13" PF_INET6 +inline int PF_INET6 = AF_INET6; +#pragma D binding "1.13" PF_NATM +inline int PF_NATM = AF_NATM; +#pragma D binding "1.13" PF_ATM +inline int PF_ATM = AF_ATM; +#pragma D binding "1.13" PF_NETGRAPH +inline int PF_NETGRAPH = AF_NETGRAPH; +#pragma D binding "1.13" PF_SLOW +inline int PF_SLOW = AF_SLOW; +#pragma D binding "1.13" PF_SCLUSTER +inline int PF_SCLUSTER = AF_SCLUSTER; +#pragma D binding "1.13" PF_ARP +inline int PF_ARP = AF_ARP; +#pragma D binding "1.13" PF_BLUETOOTH +inline int PF_BLUETOOTH = AF_BLUETOOTH; +#pragma D binding "1.13" PF_IEEE80211 +inline int PF_IEEE80211 = AF_IEEE80211; +#pragma D binding "1.13" PF_INET_SDP +inline int PF_INET_SDP= AF_INET_SDP; +#pragma D binding "1.13" PF_INET6_SDP +inline int PF_INET6_SDP= AF_INET6_SDP; +#pragma D binding "1.13" PF_MAX +inline int PF_MAX = AF_MAX; From owner-svn-src-head@freebsd.org Thu Sep 7 04:29:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B35FE0503B; Thu, 7 Sep 2017 04:29:58 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7175E8258A; Thu, 7 Sep 2017 04:29:58 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v874Tv1w033962; Thu, 7 Sep 2017 04:29:57 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v874Tvom033960; Thu, 7 Sep 2017 04:29:57 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201709070429.v874Tvom033960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Thu, 7 Sep 2017 04:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323254 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 323254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 04:29:59 -0000 Author: sobomax Date: Thu Sep 7 04:29:57 2017 New Revision: 323254 URL: https://svnweb.freebsd.org/changeset/base/323254 Log: In the recvmsg32() system call iterate over returned structure(s) and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit representation. Otherwise we either run out of user-supplied buffer to copy those out resulting in the MSG_CTRUNC or simply return values that the userland 32-bit code is not going to parse correctly. This fixes at least two regression tests failing to function properly in 32-bit compat mode: tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg PR: kern/222039 MFC after: 30 days Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Thu Sep 7 03:05:16 2017 (r323253) +++ head/sys/compat/freebsd32/freebsd32.h Thu Sep 7 04:29:57 2017 (r323254) @@ -78,6 +78,15 @@ struct itimerspec32 { TS_CP((src), (dst), it_value); \ } while (0) +struct bintime32 { + uint32_t sec; + uint32_t frac[2]; +}; +#define BT_CP(src, dst, fld) do { \ + CP((src).fld, (dst).fld, sec); \ + *(uint64_t *)&(dst).fld.frac[0] = (src).fld.frac; \ +} while (0) + struct rusage32 { struct timeval32 ru_utime; struct timeval32 ru_stime; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Sep 7 03:05:16 2017 (r323253) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Sep 7 04:29:57 2017 (r323254) @@ -113,6 +113,7 @@ FEATURE(compat_freebsd_32bit, "Compatible with 32-bit CTASSERT(sizeof(struct timeval32) == 8); CTASSERT(sizeof(struct timespec32) == 8); CTASSERT(sizeof(struct itimerval32) == 16); +CTASSERT(sizeof(struct bintime32) == 12); #endif CTASSERT(sizeof(struct statfs32) == 256); #ifdef __amd64__ @@ -1035,12 +1036,67 @@ freebsd32_copyoutmsghdr(struct msghdr *msg, struct msg #define FREEBSD32_CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ FREEBSD32_ALIGN(sizeof(struct cmsghdr))) + +static size_t +freebsd32_cmsg_convert(struct cmsghdr *cm, void *data, socklen_t datalen) +{ + size_t copylen; + union { + struct timespec32 ts; + struct timeval32 tv; + struct bintime32 bt; + } tmp32; + + union { + struct timespec ts; + struct timeval tv; + struct bintime bt; + } *in; + + in = data; + copylen = 0; + switch (cm->cmsg_level) { + case SOL_SOCKET: + switch (cm->cmsg_type) { + case SCM_TIMESTAMP: + TV_CP(*in, tmp32, tv); + copylen = sizeof(tmp32.tv); + break; + + case SCM_BINTIME: + BT_CP(*in, tmp32, bt); + copylen = sizeof(tmp32.bt); + break; + + case SCM_REALTIME: + case SCM_MONOTONIC: + TS_CP(*in, tmp32, ts); + copylen = sizeof(tmp32.ts); + break; + + default: + break; + } + + default: + break; + } + + if (copylen == 0) + return (datalen); + + KASSERT((datalen >= copylen), ("corrupted cmsghdr")); + + bcopy(&tmp32, data, copylen); + return (copylen); +} + static int freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf *control) { struct cmsghdr *cm; void *data; - socklen_t clen, datalen; + socklen_t clen, datalen, datalen_out; int error; caddr_t ctlbuf; int len, maxlen, copylen; @@ -1064,16 +1120,16 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf cm->cmsg_len > clen) { error = EINVAL; break; - } + } data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + datalen_out = freebsd32_cmsg_convert(cm, data, datalen); /* Adjust message length */ cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + - datalen; + datalen_out; - /* Copy cmsghdr */ copylen = sizeof(struct cmsghdr); if (len < copylen) { @@ -1081,7 +1137,7 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf copylen = len; } - error = copyout(cm,ctlbuf,copylen); + error = copyout(cm, ctlbuf, copylen); if (error) goto exit; @@ -1092,13 +1148,13 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf break; /* Copy data */ - copylen = datalen; + copylen = datalen_out; if (len < copylen) { msg->msg_flags |= MSG_CTRUNC; copylen = len; } - error = copyout(data,ctlbuf,copylen); + error = copyout(data, ctlbuf, copylen); if (error) goto exit; From owner-svn-src-head@freebsd.org Thu Sep 7 07:30:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0249E0DAFD; Thu, 7 Sep 2017 07:30:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5D2EC6351B; Thu, 7 Sep 2017 07:30:16 +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 v877UFra006970; Thu, 7 Sep 2017 07:30:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877UFxI006968; Thu, 7 Sep 2017 07:30:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709070730.v877UFxI006968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 07:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323259 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 323259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:30:17 -0000 Author: imp Date: Thu Sep 7 07:30:14 2017 New Revision: 323259 URL: https://svnweb.freebsd.org/changeset/base/323259 Log: Implement efidp_size efidp_size will return the size, in bytes, of a EFI device path structure. This is a convenience wrapper in the same style as the other linux routines. It's implemented by GetDevicePathSize from EDK2 we already needed for other things. Sponsored by: Netflix Modified: head/lib/libefivar/efivar-dp-format.c head/lib/libefivar/efivar-dp.h Modified: head/lib/libefivar/efivar-dp-format.c ============================================================================== --- head/lib/libefivar/efivar-dp-format.c Thu Sep 7 07:30:05 2017 (r323258) +++ head/lib/libefivar/efivar-dp-format.c Thu Sep 7 07:30:14 2017 (r323259) @@ -2430,3 +2430,9 @@ efidp_format_device_path(char *buf, size_t len, const_ return retval; } + +size_t +efidp_size(const_efidp dp) +{ + return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp)); +} Modified: head/lib/libefivar/efivar-dp.h ============================================================================== --- head/lib/libefivar/efivar-dp.h Thu Sep 7 07:30:05 2017 (r323258) +++ head/lib/libefivar/efivar-dp.h Thu Sep 7 07:30:14 2017 (r323259) @@ -62,4 +62,6 @@ ssize_t efidp_format_device_path(char *buf, size_t len ssize_t max); ssize_t efidp_parse_device_path(char *path, efidp out, size_t max); +size_t efidp_size(const_efidp); + #endif /* _EFIVAR_DP_H_ */ From owner-svn-src-head@freebsd.org Thu Sep 7 06:52:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC8B6E0B9FA; Thu, 7 Sep 2017 06:52:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7AE7F7CD; Thu, 7 Sep 2017 06:52:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f181.google.com with SMTP id w204so27796831ywg.3; Wed, 06 Sep 2017 23:52:05 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=uhi2JO4AjaRPyWRTq7cUI7ZL82yaqq4A/eKFQ5uM0VE=; b=YDLhoeRLhGSQRv+2oMok4AWOWwyZz6jaEKDOENV+7dSbdOISlOiRdI4DV70Biys5+I Wxqbyr3r7DkkqIyQzvKWFEyQJUIT6JWPjbCalaOH4NUpwheuUTo7bIdIDRo+LL0D6nZZ zplu/G6usglFQnw1oHKjLCJvcrYQW4qlnDYPEUBM71zKko9dQD+vSExNZNODOjPC+Uke a8zeoHZtYybnRyxtkOEEDFzWX2OPS3gfVqnWeKQaLdBHYUXJ5ItVeadBpn4higOOZQPx oGKCx5183qXNKdhjmsCp4hq0x1o7OKZBvev0pHlz0kb9vzVh/xf1xFM2my/E9zCGXycj Y43A== X-Gm-Message-State: AHPjjUgAXfqPg3csTBOCLxLxeKR3u/7jMvvb/xubqLKWAJU+rGNKy2ET hBAGzYCvHDBOtHFZdnI= X-Received: by 10.37.165.5 with SMTP id h5mr1279075ybi.68.1504765503336; Wed, 06 Sep 2017 23:25:03 -0700 (PDT) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com. [209.85.214.51]) by smtp.gmail.com with ESMTPSA id v11sm610567ywa.46.2017.09.06.23.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 23:25:02 -0700 (PDT) Received: by mail-it0-f51.google.com with SMTP id f199so16259152ita.1; Wed, 06 Sep 2017 23:25:02 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6QIJh1V/2lNFd49dV1E4rzEfHD4CMsQKoR7swVijE9luXGMNJVX3N7Cph5hJpoGQkOB6KuNAIu+/0AVKiDDkY= X-Received: by 10.36.141.67 with SMTP id w64mr2604421itd.8.1504765501835; Wed, 06 Sep 2017 23:25:01 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Wed, 6 Sep 2017 23:25:01 -0700 (PDT) In-Reply-To: <201708311732.v7VHWEvs037245@repo.freebsd.org> References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Conrad Meyer Date: Wed, 6 Sep 2017 23:25:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 06:52:08 -0000 This seems to break world on ARM due to the size difference CHAR16 vs ARM wchat_t (currently 32-bit in loader, apparently). Best, Conrad On Thu, Aug 31, 2017 at 10:32 AM, Warner Losh wrote: > Author: imp > Date: Thu Aug 31 17:32:14 2017 > New Revision: 323063 > URL: https://svnweb.freebsd.org/changeset/base/323063 > > Log: > boot1.efi: print more info about where boot1.efi is loaded from > > Print the device that boot1.efi was loaded from. Print the path as > well (since it isn't included in DeviceHandle). Move block where we do > this earlier so all the block handle code is now together. > > Sponsored by: Netflix > > Modified: > head/sys/boot/efi/boot1/boot1.c > > Modified: head/sys/boot/efi/boot1/boot1.c > ============================================================================== > --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 (r323062) > +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 (r323063) > @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; > SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; > UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; > + CHAR16 *text; > > /* Basic initialization*/ > ST = Xsystab; > @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > } > putchar('\n'); > > + /* Determine the devpath of our image so we can prefer it. */ > + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > + imgpath = NULL; > + if (status == EFI_SUCCESS) { > + text = efi_devpath_name(img->FilePath); > + printf(" Load Path: %S\n", text); > + efi_free_devpath_name(text); > + > + status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, > + (void **)&imgpath); > + if (status != EFI_SUCCESS) { > + DPRINTF("Failed to get image DevicePath (%lu)\n", > + EFI_ERROR_CODE(status)); > + } else { > + text = efi_devpath_name(imgpath); > + printf(" Load Device: %S\n", text); > + efi_free_devpath_name(text); > + } > + > + } > + > /* Get all the device handles */ > hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); > if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) > @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > nhandles = hsize / sizeof(*handles); > printf(" Probing %zu block devices...", nhandles); > DPRINTF("\n"); > - > - /* Determine the devpath of our image so we can prefer it. */ > - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > - imgpath = NULL; > - if (status == EFI_SUCCESS) { > - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, > - (void **)&imgpath); > - if (status != EFI_SUCCESS) > - DPRINTF("Failed to get image DevicePath (%lu)\n", > - EFI_ERROR_CODE(status)); > -#ifdef EFI_DEBUG > - { > - CHAR16 *text = efi_devpath_name(imgpath); > - DPRINTF("boot1 imagepath: %S\n", text); > - efi_free_devpath_name(text); > - } > -#endif > - } > > for (i = 0; i < nhandles; i++) > probe_handle_status(handles[i], imgpath); > From owner-svn-src-head@freebsd.org Thu Sep 7 07:30:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743C2E0DB4B; Thu, 7 Sep 2017 07:30:26 +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 mx1.freebsd.org (Postfix) with ESMTPS id 176F763598; Thu, 7 Sep 2017 07:30: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 v877UOHO007078; Thu, 7 Sep 2017 07:30:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877UO9q007077; Thu, 7 Sep 2017 07:30:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709070730.v877UO9q007077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 07:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323261 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 323261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:30:26 -0000 Author: imp Date: Thu Sep 7 07:30:24 2017 New Revision: 323261 URL: https://svnweb.freebsd.org/changeset/base/323261 Log: Fix armv6 build We need to extend the -Wno-format hack to yet another Makefile to cope with %S meaning (CHAR16 *) not (wchar_t *) in the context of the EFI boot loaders. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Sep 7 07:30:19 2017 (r323260) +++ head/sys/boot/efi/boot1/Makefile Thu Sep 7 07:30:24 2017 (r323261) @@ -10,6 +10,13 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 +# We implement a slightly non-standard %S in that it always takes a +# CHAR16 that's common in UEFI-land instead of a wchar_t. This only +# seems to matter on arm64 where wchar_t defaults to an int instead +# of a short. There's no good cast to use here so just ignore the +# warnings for now. +CWARNFLAGS.boot1.c+= -Wno-format + # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs_module.c += -Wno-array-bounds CWARNFLAGS.zfs_module.c += -Wno-cast-align From owner-svn-src-head@freebsd.org Thu Sep 7 07:17:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74320E0D22A for ; Thu, 7 Sep 2017 07:17:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1ABE14E2 for ; Thu, 7 Sep 2017 07:17:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id p6so2992506itb.1 for ; Thu, 07 Sep 2017 00:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hPgimyARU+u1x2x9dGdXeyXAl/ohOabs7yt/N3TXrJ0=; b=VKm1bFN69rLwH8CXJnQd5UDGqYcQcY7TSxS1QWZzAvcMQTljLFHj0/UhkRJ0mlTlR7 uu4HqJBHW+UzRoCVYl5oTV2GxKcxokUt8RePj4aQvjGC+LtGJb1OzjdYHGZhWvR+2rXm 4koj4L4DDhVpelpxyD9Gm9VMte0aOCLKjXUyVruNp0kAnjJUHCu8CABWA7bj5lcy/0AA 4uz110H3Lq6FbqFfZMHLWgKPuXS8K0hrmA4l8XPeIf8T8AYUXQBWd0TmkfBMNoU9VYX3 lKke6p1KePP+TEV5sFvpfBriYdPW0QsIOtQ1Q7yIKpsFm9eFZgfUMV/78em6RPl0FOMl yPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hPgimyARU+u1x2x9dGdXeyXAl/ohOabs7yt/N3TXrJ0=; b=A+630H3g8at0Ca3Z1eBlLur+IcqbqAuGnArXPjsedhw0hSZ7yWsEvd633NSyuqfe4b hIy0sl/Yzg6MoIgTC26ld5OYklmZcmwq4Sk08Zj9mguWF8XY3VIwy/fMDpAod+jyFOyK oPZf934P16UnpAibuzP/bT9BgIuHwx5Jv+X73ZYEjtJ7BCZPcBDUNoI00swo+yQDoCN7 Okdgx1E3wprgvxJUnO9g6xQ8GcnVIL3jXw5xivND4qHTbRJCuuEud/xGkfQHQxe0lbn4 AbFf+qSYBmrgl5Qc8pjmMLD51LGpML7KrmDySx0dreuu/J2zW82RCEXbAnWjaiVYAcBb ZD0Q== X-Gm-Message-State: AHPjjUi9JRrOkRUnwuohaclwqdKf3/Cz20gdYgGdc35aJHQQSrOFBjeG AvkxkTLZOvxB3opeKIVY/wfRSKfTfXmf X-Google-Smtp-Source: ADKCNb6hXvMt42qr3VzZErd5ACeX+UhohG/qmeVjtVA7ZyXx5ZP9c7+CpIPT58TtgpmxO9WauEcpZ105+lb4nQmJzy4= X-Received: by 10.36.40.138 with SMTP id h132mr2586797ith.26.1504768658179; Thu, 07 Sep 2017 00:17:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Thu, 7 Sep 2017 00:17:37 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:db2:4927:5bc2:25d6] In-Reply-To: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Warner Losh Date: Thu, 7 Sep 2017 01:17:37 -0600 X-Google-Sender-Auth: 6QYSmvm1pnaxadb94wieTK59HkA Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Andrew Turner Cc: "Conrad E. Meyer" , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:17:39 -0000 Yup. I have those patches in my tree, pending testing after a day or so of fires at work. They are a hack and I wanted to stop duplicating so much Makefile code between sys/boot and lib/libstand before I pushed them in. I think there's no issues with other versions of the loader. We can also lie and cast the strings, but that has other issues. So I'll fix this shortly. Warner On Thu, Sep 7, 2017 at 1:04 AM, Andrew Turner wrote: > And we need a constant wchar_t between loader and libstand as ld.bfd > checks the attributes across these when linking. > > There are a few options, the simplest is probably to make sys/boot and > libstand all build with 16bit wchar_t, but it would need someone to check > on wchar_t usage in other loader versions. > > Andrew > > On 7 Sep 2017, at 07:25, Conrad Meyer wrote: > > > > This seems to break world on ARM due to the size difference CHAR16 vs > > ARM wchat_t (currently 32-bit in loader, apparently). > > > > Best, > > Conrad > > > > On Thu, Aug 31, 2017 at 10:32 AM, Warner Losh wrote: > >> Author: imp > >> Date: Thu Aug 31 17:32:14 2017 > >> New Revision: 323063 > >> URL: https://svnweb.freebsd.org/changeset/base/323063 > >> > >> Log: > >> boot1.efi: print more info about where boot1.efi is loaded from > >> > >> Print the device that boot1.efi was loaded from. Print the path as > >> well (since it isn't included in DeviceHandle). Move block where we do > >> this earlier so all the block handle code is now together. > >> > >> Sponsored by: Netflix > >> > >> Modified: > >> head/sys/boot/efi/boot1/boot1.c > >> > >> Modified: head/sys/boot/efi/boot1/boot1.c > >> ============================================================ > ================== > >> --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 > (r323062) > >> +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 > (r323063) > >> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; > >> SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; > >> UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; > >> + CHAR16 *text; > >> > >> /* Basic initialization*/ > >> ST = Xsystab; > >> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> } > >> putchar('\n'); > >> > >> + /* Determine the devpath of our image so we can prefer it. */ > >> + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > >> + imgpath = NULL; > >> + if (status == EFI_SUCCESS) { > >> + text = efi_devpath_name(img->FilePath); > >> + printf(" Load Path: %S\n", text); > >> + efi_free_devpath_name(text); > >> + > >> + status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > >> + (void **)&imgpath); > >> + if (status != EFI_SUCCESS) { > >> + DPRINTF("Failed to get image DevicePath > (%lu)\n", > >> + EFI_ERROR_CODE(status)); > >> + } else { > >> + text = efi_devpath_name(imgpath); > >> + printf(" Load Device: %S\n", text); > >> + efi_free_devpath_name(text); > >> + } > >> + > >> + } > >> + > >> /* Get all the device handles */ > >> hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); > >> if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void > **)&handles)) > >> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> nhandles = hsize / sizeof(*handles); > >> printf(" Probing %zu block devices...", nhandles); > >> DPRINTF("\n"); > >> - > >> - /* Determine the devpath of our image so we can prefer it. */ > >> - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > >> - imgpath = NULL; > >> - if (status == EFI_SUCCESS) { > >> - status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > >> - (void **)&imgpath); > >> - if (status != EFI_SUCCESS) > >> - DPRINTF("Failed to get image DevicePath > (%lu)\n", > >> - EFI_ERROR_CODE(status)); > >> -#ifdef EFI_DEBUG > >> - { > >> - CHAR16 *text = efi_devpath_name(imgpath); > >> - DPRINTF("boot1 imagepath: %S\n", text); > >> - efi_free_devpath_name(text); > >> - } > >> -#endif > >> - } > >> > >> for (i = 0; i < nhandles; i++) > >> probe_handle_status(handles[i], imgpath); > >> > > > > From owner-svn-src-head@freebsd.org Thu Sep 7 07:04:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA2DE0C512; Thu, 7 Sep 2017 07:04:51 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 569C08239B; Thu, 7 Sep 2017 07:04:49 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:752d:6057:337:54d8] (unknown [IPv6:2a02:c7f:1e13:cf00:752d:6057:337:54d8]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C9CE34E63F; Thu, 7 Sep 2017 07:04:12 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 From: Andrew Turner In-Reply-To: Date: Thu, 7 Sep 2017 08:04:09 +0100 Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:04:51 -0000 And we need a constant wchar_t between loader and libstand as ld.bfd = checks the attributes across these when linking. There are a few options, the simplest is probably to make sys/boot and = libstand all build with 16bit wchar_t, but it would need someone to = check on wchar_t usage in other loader versions. Andrew > On 7 Sep 2017, at 07:25, Conrad Meyer wrote: >=20 > This seems to break world on ARM due to the size difference CHAR16 vs > ARM wchat_t (currently 32-bit in loader, apparently). >=20 > Best, > Conrad >=20 > On Thu, Aug 31, 2017 at 10:32 AM, Warner Losh wrote: >> Author: imp >> Date: Thu Aug 31 17:32:14 2017 >> New Revision: 323063 >> URL: https://svnweb.freebsd.org/changeset/base/323063 >>=20 >> Log: >> boot1.efi: print more info about where boot1.efi is loaded from >>=20 >> Print the device that boot1.efi was loaded from. Print the path as >> well (since it isn't included in DeviceHandle). Move block where we = do >> this earlier so all the block handle code is now together. >>=20 >> Sponsored by: Netflix >>=20 >> Modified: >> head/sys/boot/efi/boot1/boot1.c >>=20 >> Modified: head/sys/boot/efi/boot1/boot1.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/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 = (r323062) >> +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 = (r323063) >> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl =3D NULL; >> SIMPLE_TEXT_OUTPUT_INTERFACE *conout =3D NULL; >> UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; >> + CHAR16 *text; >>=20 >> /* Basic initialization*/ >> ST =3D Xsystab; >> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> } >> putchar('\n'); >>=20 >> + /* Determine the devpath of our image so we can prefer it. */ >> + status =3D BS->HandleProtocol(IH, &LoadedImageGUID, = (VOID**)&img); >> + imgpath =3D NULL; >> + if (status =3D=3D EFI_SUCCESS) { >> + text =3D efi_devpath_name(img->FilePath); >> + printf(" Load Path: %S\n", text); >> + efi_free_devpath_name(text); >> + >> + status =3D BS->HandleProtocol(img->DeviceHandle, = &DevicePathGUID, >> + (void **)&imgpath); >> + if (status !=3D EFI_SUCCESS) { >> + DPRINTF("Failed to get image DevicePath = (%lu)\n", >> + EFI_ERROR_CODE(status)); >> + } else { >> + text =3D efi_devpath_name(imgpath); >> + printf(" Load Device: %S\n", text); >> + efi_free_devpath_name(text); >> + } >> + >> + } >> + >> /* Get all the device handles */ >> hsize =3D (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); >> if ((status =3D BS->AllocatePool(EfiLoaderData, hsize, (void = **)&handles)) >> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> nhandles =3D hsize / sizeof(*handles); >> printf(" Probing %zu block devices...", nhandles); >> DPRINTF("\n"); >> - >> - /* Determine the devpath of our image so we can prefer it. */ >> - status =3D BS->HandleProtocol(IH, &LoadedImageGUID, = (VOID**)&img); >> - imgpath =3D NULL; >> - if (status =3D=3D EFI_SUCCESS) { >> - status =3D BS->HandleProtocol(img->DeviceHandle, = &DevicePathGUID, >> - (void **)&imgpath); >> - if (status !=3D EFI_SUCCESS) >> - DPRINTF("Failed to get image DevicePath = (%lu)\n", >> - EFI_ERROR_CODE(status)); >> -#ifdef EFI_DEBUG >> - { >> - CHAR16 *text =3D efi_devpath_name(imgpath); >> - DPRINTF("boot1 imagepath: %S\n", text); >> - efi_free_devpath_name(text); >> - } >> -#endif >> - } >>=20 >> for (i =3D 0; i < nhandles; i++) >> probe_handle_status(handles[i], imgpath); >>=20 >=20 From owner-svn-src-head@freebsd.org Thu Sep 7 07:24:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A04EE0D7C9; Thu, 7 Sep 2017 07:24:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 756012E1B; Thu, 7 Sep 2017 07: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 v877OMuY006676; Thu, 7 Sep 2017 07:24:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877OM9W006675; Thu, 7 Sep 2017 07:24:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709070724.v877OM9W006675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 7 Sep 2017 07:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323257 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 323257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:24:24 -0000 Author: cem Date: Thu Sep 7 07:24:22 2017 New Revision: 323257 URL: https://svnweb.freebsd.org/changeset/base/323257 Log: cam(4): Fix some warnings When bcopy is treated as memcpy/memmove, Clang produces warnings that the size argument doesn't match the type of the source. This is true, it doesn't match; we're aliasing the source. Explicitly cast the source pointer to the expected type to remove the warning. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Sep 7 05:41:13 2017 (r323256) +++ head/sys/cam/scsi/scsi_all.c Thu Sep 7 07:24:22 2017 (r323257) @@ -5100,8 +5100,8 @@ scsi_sense_sbuf(struct cam_device *device, struct ccb_ * errors on finicky architectures. We don't * ensure that the sense data is pointer aligned. */ - bcopy(&csio->sense_data, &sense, - sizeof(struct scsi_sense_data *)); + bcopy((struct scsi_sense_data **)&csio->sense_data, + &sense, sizeof(struct scsi_sense_data *)); } } else { /* @@ -5225,8 +5225,8 @@ scsi_extract_sense_ccb(union ccb *ccb, return (0); if (ccb->ccb_h.flags & CAM_SENSE_PTR) - bcopy(&ccb->csio.sense_data, &sense_data, - sizeof(struct scsi_sense_data *)); + bcopy((struct scsi_sense_data **)&ccb->csio.sense_data, + &sense_data, sizeof(struct scsi_sense_data *)); else sense_data = &ccb->csio.sense_data; scsi_extract_sense_len(sense_data, From owner-svn-src-head@freebsd.org Thu Sep 7 07:30:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB30E0DB07; Thu, 7 Sep 2017 07:30:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5633463557; Thu, 7 Sep 2017 07:30:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v877UKXl007027; Thu, 7 Sep 2017 07:30:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877UKdr007023; Thu, 7 Sep 2017 07:30:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709070730.v877UKdr007023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 07:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323260 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 323260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:30:22 -0000 Author: imp Date: Thu Sep 7 07:30:19 2017 New Revision: 323260 URL: https://svnweb.freebsd.org/changeset/base/323260 Log: Create efi utility printing routines Split out asciidump, utf8dump, bindump, and hexdump into a separate file efiutil.c. Implement new efi_print_load_option for printing out the EFI_LOADER_OPTION data structure used to specify different options to the UEFI boot manager. Sponsored by: Netflix Added: head/usr.sbin/efivar/efiutil.c (contents, props changed) head/usr.sbin/efivar/efiutil.h (contents, props changed) Modified: head/usr.sbin/efivar/Makefile head/usr.sbin/efivar/efivar.c Modified: head/usr.sbin/efivar/Makefile ============================================================================== --- head/usr.sbin/efivar/Makefile Thu Sep 7 07:30:14 2017 (r323259) +++ head/usr.sbin/efivar/Makefile Thu Sep 7 07:30:19 2017 (r323260) @@ -5,6 +5,8 @@ MAN= efivar.8 LIBADD= efivar +SRCS= efivar.c efiutil.c + EFIBOOT=${SRCTOP}/sys/boot/efi CFLAGS+= -I${EFIBOOT}/include Added: head/usr.sbin/efivar/efiutil.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/efivar/efiutil.c Thu Sep 7 07:30:19 2017 (r323260) @@ -0,0 +1,179 @@ +/*- + * Copyright (c) 2017 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "efiutil.h" +#include "efichar.h" +#include + +/* + * Dump the data as ASCII data, which is a pretty + * printed form + */ +void +asciidump(uint8_t *data, size_t datalen) +{ + size_t i; + int len; + + len = 0; + for (i = 0; i < datalen; i++) { + if (isprint(data[i])) { + len++; + if (len > 80) { + len = 0; + printf("\n"); + } + printf("%c", data[i]); + } else { + len +=3; + if (len > 80) { + len = 0; + printf("\n"); + } + printf("%%%02x", data[i]); + } + } + printf("\n"); +} + +void +utf8dump(uint8_t *data, size_t datalen) +{ + char *utf8 = NULL; + efi_char *ucs2; + + /* + * NUL terminate the string. Not all strings need it, but some + * do and an extra NUL won't change what's printed. + */ + ucs2 = malloc(datalen + sizeof(efi_char)); + memcpy(ucs2, data, datalen); + ucs2[datalen / sizeof(efi_char)] = 0; + ucs2_to_utf8(ucs2, &utf8); + printf("%s\n", utf8); + free(utf8); + free(ucs2); +} + +void +hexdump(uint8_t *data, size_t datalen) +{ + size_t i; + + for (i = 0; i < datalen; i++) { + if (i % 16 == 0) { + if (i != 0) + printf("\n"); + printf("%04x: ", (int)i); + } + printf("%02x ", data[i]); + } + printf("\n"); +} + +void +bindump(uint8_t *data, size_t datalen) +{ + write(1, data, datalen); +} + +#define LOAD_OPTION_ACTIVE 1 + +void +efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) +{ + uint8_t *ep = data + datalen; + uint8_t *walker = data; + uint32_t attr; + uint16_t fplen; + efi_char *descr; + efidp dp, edp; + char *str; + char buf[1024]; + int len; + void *opt; + int optlen; + + if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) + return; + // First 4 bytes are attribute flags + attr = le32dec(walker); + walker += sizeof(attr); + // Next two bytes are length of the file paths + fplen = le16dec(walker); + walker += sizeof(fplen); + // Next we have a 0 terminated UCS2 string that we know to be aligned + descr = (efi_char *)(intptr_t)(void *)walker; + len = ucs2len(descr); // XXX need to sanity check that len < (datalen - (ep - walker) / 2) + walker += (len + 1) * sizeof(efi_char); + if (walker > ep) + return; + // Now we have fplen bytes worth of file path stuff + dp = (efidp)walker; + walker += fplen; + if (walker > ep) + return; + edp = (efidp)walker; + // Everything left is the binary option args + opt = walker; + optlen = ep - walker; + // We got to here, everything is good + printf("%c ", attr & LOAD_OPTION_ACTIVE ? '*' : ' '); + ucs2_to_utf8(descr, &str); + printf("%s", str); + free(str); + while (dp < edp) { + efidp_format_device_path(buf, sizeof(buf), dp, + (intptr_t)(void *)edp - (intptr_t)(void *)dp); + dp = (efidp)((char *)dp + efidp_size(dp)); + printf(" %s\n", buf); + } + if (optlen == 0) + return; + printf("Options: "); + if (Aflag) + asciidump(opt, optlen); + else if (bflag) + bindump(opt, optlen); + else if (uflag) + utf8dump(opt, optlen); + else + hexdump(opt, optlen); +} Added: head/usr.sbin/efivar/efiutil.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/efivar/efiutil.h Thu Sep 7 07:30:19 2017 (r323260) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2017 Netflix, Inc. + * 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. + * + * $FreeBSD$ + */ + +/* + * differnt routines to dump data. + */ + +void asciidump(uint8_t *data, size_t datalen); +void bindump(uint8_t *data, size_t datalen); +void efi_print_load_option(uint8_t *, size_t, int, int, int); +void hexdump(uint8_t *data, size_t datalen); +void utf8dump(uint8_t *data, size_t datalen); + Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Thu Sep 7 07:30:14 2017 (r323259) +++ head/usr.sbin/efivar/efivar.c Thu Sep 7 07:30:19 2017 (r323260) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "efiutil.h" #include "efichar.h" /* options descriptor */ @@ -54,6 +55,7 @@ static struct option longopts[] = { { "hex", no_argument, NULL, 'H' }, { "list-guids", no_argument, NULL, 'L' }, { "list", no_argument, NULL, 'l' }, + { "load-option", no_argument, NULL, 'O' }, { "name", required_argument, NULL, 'n' }, { "no-name", no_argument, NULL, 'N' }, { "print", no_argument, NULL, 'p' }, @@ -66,7 +68,7 @@ static struct option longopts[] = { static int aflag, Aflag, bflag, dflag, Dflag, gflag, Hflag, Nflag, - lflag, Lflag, Rflag, wflag, pflag, uflag; + lflag, Lflag, Rflag, wflag, pflag, uflag, load_opt_flag; static char *varname; static u_long attrib = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; @@ -74,10 +76,11 @@ static void usage(void) { - errx(1, "efivar [-abdDHlLNpRtw] [-n name] [-f file] [--append] [--ascii]\n" + errx(1, "efivar [-abdDHlLNpRtuw] [-n name] [-f file] [--append] [--ascii]\n" "\t[--attributes] [--binary] [--delete] [--fromfile file] [--hex]\n" - "\t[--list-guids] [--list] [--name name] [--no-name] [--print]\n" - "\t[--print-decimal] [--raw-guid] [--write] name[=value]"); + "\t[--list-guids] [--list] [--load-option] [--name name] [--no-name]\n" + "\t[--print] [--print-decimal] [--raw-guid] [--utf8] [--write]\n" + "\tname[=value]"); } static void @@ -149,80 +152,6 @@ write_variable(char *name, char *val) } static void -asciidump(uint8_t *data, size_t datalen) -{ - size_t i; - int len; - - len = 0; - if (!Nflag) - printf("\n"); - for (i = 0; i < datalen; i++) { - if (isprint(data[i])) { - len++; - if (len > 80) { - len = 0; - printf("\n"); - } - printf("%c", data[i]); - } else { - len +=3; - if (len > 80) { - len = 0; - printf("\n"); - } - printf("%%%02x", data[i]); - } - } - printf("\n"); -} - -static void -utf8dump(uint8_t *data, size_t datalen) -{ - char *utf8 = NULL; - efi_char *ucs2; - - /* - * NUL terminate the string. Not all strings need it, but some - * do and an extra NUL won't change what's printed. - */ - ucs2 = malloc(datalen + sizeof(efi_char)); - memcpy(ucs2, data, datalen); - ucs2[datalen / sizeof(efi_char)] = 0; - ucs2_to_utf8(ucs2, &utf8); - if (!Nflag) - printf("\n"); - printf("%s\n", utf8); - free(utf8); - free(ucs2); -} - -static void -hexdump(uint8_t *data, size_t datalen) -{ - size_t i; - - if (!Nflag) - printf("\n"); - for (i = 0; i < datalen; i++) { - if (i % 16 == 0) { - if (i != 0) - printf("\n"); - printf("%04x: ", (int)i); - } - printf("%02x ", data[i]); - } - printf("\n"); -} - -static void -bindump(uint8_t *data, size_t datalen) -{ - write(1, data, datalen); -} - -static void devpath_dump(uint8_t *data, size_t datalen) { char buffer[1024]; @@ -265,8 +194,10 @@ print_var(efi_guid_t *guid, char *name) err(1, "%s-%s", gname, name); if (!Nflag) - printf("%s-%s", gname, name); - if (Aflag) + printf("%s-%s\n", gname, name); + if (load_opt_flag) + efi_print_load_option(data, datalen, Aflag, bflag, uflag); + else if (Aflag) asciidump(data, datalen); else if (uflag) utf8dump(data, datalen); @@ -324,7 +255,7 @@ parse_args(int argc, char **argv) { int ch, i; - while ((ch = getopt_long(argc, argv, "aAbdDf:gHlLNn:pRt:w", + while ((ch = getopt_long(argc, argv, "aAbdDf:gHlLNn:OpRt:w", longopts, NULL)) != -1) { switch (ch) { case 'a': @@ -359,6 +290,9 @@ parse_args(int argc, char **argv) break; case 'N': Nflag++; + break; + case 'O': + load_opt_flag++; break; case 'p': pflag++; From owner-svn-src-head@freebsd.org Thu Sep 7 07:30:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6822E0DAEA; Thu, 7 Sep 2017 07:30:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4AFEA63486; Thu, 7 Sep 2017 07:30:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v877U6rZ006915; Thu, 7 Sep 2017 07:30:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v877U6xE006912; Thu, 7 Sep 2017 07:30:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709070730.v877U6xE006912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 07:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323258 - in head/sys/boot/efi: boot1 include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 include libefi X-SVN-Commit-Revision: 323258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 07:30:08 -0000 Author: imp Date: Thu Sep 7 07:30:05 2017 New Revision: 323258 URL: https://svnweb.freebsd.org/changeset/base/323258 Log: ucs2len Rename boot1's wcslen to ucs2len, which we can't use in userland because wchar in userland is unsigned, not short. Move it into efichar.c. Also spell '* 2' as '* sizeof(efi_char)' and add 1 for the trailing NUL to transition the FreeBSD boot env vars to being NUL terminated on the same line... Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efichar.h head/sys/boot/efi/libefi/efichar.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Thu Sep 7 07:24:22 2017 (r323257) +++ head/sys/boot/efi/boot1/boot1.c Thu Sep 7 07:30:05 2017 (r323258) @@ -80,17 +80,6 @@ Free(void *buf, const char *file __unused, int line __ (void)BS->FreePool(buf); } -static int -wcslen(const CHAR16 *str) -{ - int i; - - i = 0; - while (*str++) - i++; - return i; -} - static EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) { @@ -103,7 +92,7 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (EFI_OUT_OF_RESOURCES); rv = RS->SetVariable(var, &FreeBSDBootVarGUID, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - wcslen(valstr) * 2, valstr); + (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); free(var); return (rv); } Modified: head/sys/boot/efi/include/efichar.h ============================================================================== --- head/sys/boot/efi/include/efichar.h Thu Sep 7 07:24:22 2017 (r323257) +++ head/sys/boot/efi/include/efichar.h Thu Sep 7 07:30:05 2017 (r323258) @@ -31,5 +31,6 @@ int ucs2_to_utf8(const efi_char *, char **); int utf8_to_ucs2(const char *, efi_char **, size_t *); +int ucs2len(const efi_char *); #endif /* _BOOT_EFI_EFICHAR_H_ */ Modified: head/sys/boot/efi/libefi/efichar.c ============================================================================== --- head/sys/boot/efi/libefi/efichar.c Thu Sep 7 07:24:22 2017 (r323257) +++ head/sys/boot/efi/libefi/efichar.c Thu Sep 7 07:30:05 2017 (r323258) @@ -42,6 +42,17 @@ __FBSDID("$FreeBSD$"); #include "efichar.h" +int +ucs2len(const efi_char *str) +{ + int i; + + i = 0; + while (*str++) + i++; + return i; +} + /* * If nm were converted to utf8, what what would strlen * return on the resulting string? From owner-svn-src-head@freebsd.org Thu Sep 7 10:56:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F178E1783A; Thu, 7 Sep 2017 10:56:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9FD6F735; Thu, 7 Sep 2017 10:56:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87Auo9I091716; Thu, 7 Sep 2017 10:56:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Auotl091715; Thu, 7 Sep 2017 10:56:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201709071056.v87Auotl091715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 7 Sep 2017 10:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323263 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 323263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 10:56:52 -0000 Author: trasz Date: Thu Sep 7 10:56:50 2017 New Revision: 323263 URL: https://svnweb.freebsd.org/changeset/base/323263 Log: Hint that the "-o emul" option for ps(1) shows the ABI. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Sep 7 09:03:12 2017 (r323262) +++ head/bin/ps/ps.1 Thu Sep 7 10:56:50 2017 (r323263) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 6, 2017 +.Dd September 7, 2017 .Dt PS 1 .Os .Sh NAME @@ -545,7 +545,7 @@ short-term CPU usage factor (for scheduling) .It Cm dsiz data size (in Kbytes) .It Cm emul -system-call emulation environment +system-call emulation environment (ABI) .It Cm etime elapsed running time, format .Op days- Ns From owner-svn-src-head@freebsd.org Thu Sep 7 15:02:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 637CAE21A69; Thu, 7 Sep 2017 15:02:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087F63F53; Thu, 7 Sep 2017 15:02:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87F2v1D094827; Thu, 7 Sep 2017 15:02:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87F2v70094825; Thu, 7 Sep 2017 15:02:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071502.v87F2v70094825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 15:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323266 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 323266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 15:02:59 -0000 Author: andrew Date: Thu Sep 7 15:02:57 2017 New Revision: 323266 URL: https://svnweb.freebsd.org/changeset/base/323266 Log: Add more ARM Ltd parts to the list of knows CPUs. Submitted by: Jon Brawn Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 12:51:39 2017 (r323265) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:02:57 2017 (r323266) @@ -120,9 +120,13 @@ struct cpu_implementers { /* ARM Ltd. */ static const struct cpu_parts cpu_parts_arm[] = { { CPU_PART_FOUNDATION, "Foundation-Model" }, + { CPU_PART_CORTEX_A35, "Cortex-A35" }, { CPU_PART_CORTEX_A53, "Cortex-A53" }, + { CPU_PART_CORTEX_A55, "Cortex-A55" }, { CPU_PART_CORTEX_A57, "Cortex-A57" }, { CPU_PART_CORTEX_A72, "Cortex-A72" }, + { CPU_PART_CORTEX_A73, "Cortex-A73" }, + { CPU_PART_CORTEX_A75, "Cortex-A75" }, CPU_PART_NONE, }; /* Cavium */ Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Thu Sep 7 12:51:39 2017 (r323265) +++ head/sys/arm64/include/cpu.h Thu Sep 7 15:02:57 2017 (r323266) @@ -80,9 +80,13 @@ #define CPU_PART_THUNDER 0x0A1 #define CPU_PART_FOUNDATION 0xD00 +#define CPU_PART_CORTEX_A35 0xD04 #define CPU_PART_CORTEX_A53 0xD03 +#define CPU_PART_CORTEX_A55 0xD05 #define CPU_PART_CORTEX_A57 0xD07 #define CPU_PART_CORTEX_A72 0xD08 +#define CPU_PART_CORTEX_A73 0xD09 +#define CPU_PART_CORTEX_A75 0xD0A #define CPU_REV_THUNDER_1_0 0x00 #define CPU_REV_THUNDER_1_1 0x01 From owner-svn-src-head@freebsd.org Thu Sep 7 15:24:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79CD5E22787; Thu, 7 Sep 2017 15:24:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D181167D80; Thu, 7 Sep 2017 15:24:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87FOl9V003290; Thu, 7 Sep 2017 15:24:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87FOlkR003289; Thu, 7 Sep 2017 15:24:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071524.v87FOlkR003289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 15:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323268 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 15:24:49 -0000 Author: andrew Date: Thu Sep 7 15:24:47 2017 New Revision: 323268 URL: https://svnweb.freebsd.org/changeset/base/323268 Log: Make the bit mask of ARMv8 ID registers to print sparse to keep values close, but without having to change all values when new registers are added. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:19:10 2017 (r323267) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:24:47 2017 (r323268) @@ -88,14 +88,14 @@ struct cpu_desc cpu_desc[MAXCPU]; static u_int cpu_print_regs; #define PRINT_ID_AA64_AFR0 0x00000001 #define PRINT_ID_AA64_AFR1 0x00000002 -#define PRINT_ID_AA64_DFR0 0x00000004 -#define PRINT_ID_AA64_DFR1 0x00000008 -#define PRINT_ID_AA64_ISAR0 0x00000010 -#define PRINT_ID_AA64_ISAR1 0x00000020 -#define PRINT_ID_AA64_MMFR0 0x00000040 -#define PRINT_ID_AA64_MMFR1 0x00000080 -#define PRINT_ID_AA64_PFR0 0x00000100 -#define PRINT_ID_AA64_PFR1 0x00000200 +#define PRINT_ID_AA64_DFR0 0x00000010 +#define PRINT_ID_AA64_DFR1 0x00000020 +#define PRINT_ID_AA64_ISAR0 0x00000100 +#define PRINT_ID_AA64_ISAR1 0x00000200 +#define PRINT_ID_AA64_MMFR0 0x00001000 +#define PRINT_ID_AA64_MMFR1 0x00002000 +#define PRINT_ID_AA64_PFR0 0x00010000 +#define PRINT_ID_AA64_PFR1 0x00020000 struct cpu_parts { u_int part_id; From owner-svn-src-head@freebsd.org Thu Sep 7 15:30:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EE43E22CB5; Thu, 7 Sep 2017 15:30:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69E77697CC; Thu, 7 Sep 2017 15:30:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87FUDAW003825; Thu, 7 Sep 2017 15:30:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87FUDl9003824; Thu, 7 Sep 2017 15:30:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071530.v87FUDl9003824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 15:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323269 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 15:30:15 -0000 Author: andrew Date: Thu Sep 7 15:30:13 2017 New Revision: 323269 URL: https://svnweb.freebsd.org/changeset/base/323269 Log: Uppercase the special register names in identcpu to be more consistent with the other source files. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:24:47 2017 (r323268) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:30:13 2017 (r323269) @@ -732,14 +732,14 @@ identify_cpu(void) cpu_desc[cpu].mpidr = get_mpidr(); CPU_AFFINITY(cpu) = cpu_desc[cpu].mpidr & CPU_AFF_MASK; - cpu_desc[cpu].id_aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); - cpu_desc[cpu].id_aa64dfr1 = READ_SPECIALREG(id_aa64dfr1_el1); - cpu_desc[cpu].id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); - cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(id_aa64isar1_el1); - cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(id_aa64mmfr0_el1); - cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); - cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); + cpu_desc[cpu].id_aa64dfr0 = READ_SPECIALREG(ID_AA64DFR0_EL1); + cpu_desc[cpu].id_aa64dfr1 = READ_SPECIALREG(ID_AA64DFR1_EL1); + cpu_desc[cpu].id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1); + cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(ID_AA64ISAR1_EL1); + cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(ID_AA64MMFR0_EL1); + cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1); + cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(ID_AA64PFR0_EL1); + cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(ID_AA64PFR1_EL1); if (cpu != 0) { /* From owner-svn-src-head@freebsd.org Thu Sep 7 15:45:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61630E00658; Thu, 7 Sep 2017 15:45:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6C346CEE5; Thu, 7 Sep 2017 15:45:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87FjulG011680; Thu, 7 Sep 2017 15:45:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87FjuuO011678; Thu, 7 Sep 2017 15:45:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071545.v87FjuuO011678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 15:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323271 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 323271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 15:45:58 -0000 Author: andrew Date: Thu Sep 7 15:45:56 2017 New Revision: 323271 URL: https://svnweb.freebsd.org/changeset/base/323271 Log: Add the ARMv8.2 ID register additions and use them to decode the register values. As not all assemblers understand the new ID_AA64MMFR2_EL1 register add a macro to access it. This seems to be safe for older CPUs to read this new register, with them returning zero. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:30:52 2017 (r323270) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 15:45:56 2017 (r323271) @@ -80,6 +80,7 @@ struct cpu_desc { uint64_t id_aa64isar1; uint64_t id_aa64mmfr0; uint64_t id_aa64mmfr1; + uint64_t id_aa64mmfr2; uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; }; @@ -94,6 +95,7 @@ static u_int cpu_print_regs; #define PRINT_ID_AA64_ISAR1 0x00000200 #define PRINT_ID_AA64_MMFR0 0x00001000 #define PRINT_ID_AA64_MMFR1 0x00002000 +#define PRINT_ID_AA64_MMFR2 0x00000100 #define PRINT_ID_AA64_PFR0 0x00010000 #define PRINT_ID_AA64_PFR1 0x00020000 @@ -305,14 +307,53 @@ print_cpu_features(u_int cpu) /* AArch64 Instruction Set Attribute Register 1 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR1) != 0) { - printf(" Instruction Set Attributes 1 = <%#lx>\n", - cpu_desc[cpu].id_aa64isar1); + printed = 0; + printf(" Instruction Set Attributes 1 = <"); + + switch (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1)) { + case ID_AA64ISAR1_DPB_NONE: + break; + case ID_AA64ISAR1_DPB_IMPL: + printf("%sDC CVAP", SEP_STR); + break; + default: + printf("%sUnknown DC CVAP", SEP_STR); + break; + } + + if ((cpu_desc[cpu].id_aa64isar1 & ~ID_AA64ISAR1_MASK) != 0) + printf("%s%#lx", SEP_STR, + cpu_desc[cpu].id_aa64isar1 & ~ID_AA64ISAR1_MASK); + printf(">\n"); } /* AArch64 Processor Feature Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_PFR0) != 0) { printed = 0; printf(" Processor Features 0 = <"); + + switch (ID_AA64PFR0_SVE(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_SVE_NONE: + break; + case ID_AA64PFR0_SVE_IMPL: + printf("%sSVE", SEP_STR); + break; + default: + printf("%sUnknown SVE", SEP_STR); + break; + } + + switch (ID_AA64PFR0_RAS(cpu_desc[cpu].id_aa64pfr0)) { + case ID_AA64PFR0_RAS_NONE: + break; + case ID_AA64PFR0_RAS_V1: + printf("%sRASv1", SEP_STR); + break; + default: + printf("%sUnknown RAS", SEP_STR); + break; + } + switch (ID_AA64PFR0_GIC(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_GIC_CPUIF_NONE: break; @@ -330,6 +371,9 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_ADV_SIMD_IMPL: printf("%sAdvSIMD", SEP_STR); break; + case ID_AA64PFR0_ADV_SIMD_HP: + printf("%sAdvSIMD+HP", SEP_STR); + break; default: printf("%sUnknown AdvSIMD", SEP_STR); break; @@ -341,6 +385,9 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_FP_IMPL: printf("%sFloat", SEP_STR); break; + case ID_AA64PFR0_FP_HP: + printf("%sFloat+HP", SEP_STR); + break; default: printf("%sUnknown Float", SEP_STR); break; @@ -514,6 +561,9 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_PA_RANGE_256T: printf("%s256TB PA", SEP_STR); break; + case ID_AA64MMFR0_PA_RANGE_4P: + printf("%s4PB PA", SEP_STR); + break; default: printf("%sUnknown PA Range", SEP_STR); break; @@ -530,6 +580,28 @@ print_cpu_features(u_int cpu) printed = 0; printf(" Memory Model Features 1 = <"); + switch (ID_AA64MMFR1_XNX(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_XNX_NONE: + break; + case ID_AA64MMFR1_XNX_IMPL: + printf("%sEL2 XN", SEP_STR); + break; + default: + printf("%sUnknown XNX", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_SPEC_SEI(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_SPEC_SEI_NONE: + break; + case ID_AA64MMFR1_SPEC_SEI_IMPL: + printf("%sSpecSEI", SEP_STR); + break; + default: + printf("%sUnknown SpecSEI", SEP_STR); + break; + } + switch (ID_AA64MMFR1_PAN(cpu_desc[cpu].id_aa64mmfr1)) { case ID_AA64MMFR1_PAN_NONE: break; @@ -555,9 +627,12 @@ print_cpu_features(u_int cpu) switch (ID_AA64MMFR1_HPDS(cpu_desc[cpu].id_aa64mmfr1)) { case ID_AA64MMFR1_HPDS_NONE: break; - case ID_AA64MMFR1_HPDS_IMPL: + case ID_AA64MMFR1_HPDS_HPD: printf("%sHPDS", SEP_STR); break; + case ID_AA64MMFR1_HPDS_TTPBHA: + printf("%sTTPBHA", SEP_STR); + break; default: printf("%sUnknown HPDS", SEP_STR); break; @@ -605,10 +680,88 @@ print_cpu_features(u_int cpu) printf(">\n"); } + /* AArch64 Memory Model Feature Register 2 */ + if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR2) != 0) { + printed = 0; + printf(" Memory Model Features 2 = <"); + + switch (ID_AA64MMFR2_VA_RANGE(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_VA_RANGE_48: + printf("%s48b VA", SEP_STR); + break; + case ID_AA64MMFR2_VA_RANGE_52: + printf("%s52b VA", SEP_STR); + break; + default: + printf("%sUnknown VA Range", SEP_STR); + break; + } + + switch (ID_AA64MMFR2_IESB(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_IESB_NONE: + break; + case ID_AA64MMFR2_IESB_IMPL: + printf("%sIESB", SEP_STR); + break; + default: + printf("%sUnknown IESB", SEP_STR); + break; + } + + switch (ID_AA64MMFR2_LSM(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_LSM_NONE: + break; + case ID_AA64MMFR2_LSM_IMPL: + printf("%sLSM", SEP_STR); + break; + default: + printf("%sUnknown LSM", SEP_STR); + break; + } + + switch (ID_AA64MMFR2_UAO(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_UAO_NONE: + break; + case ID_AA64MMFR2_UAO_IMPL: + printf("%sUAO", SEP_STR); + break; + default: + printf("%sUnknown UAO", SEP_STR); + break; + } + + switch (ID_AA64MMFR2_CNP(cpu_desc[cpu].id_aa64mmfr2)) { + case ID_AA64MMFR2_CNP_NONE: + break; + case ID_AA64MMFR2_CNP_IMPL: + printf("%sCnP", SEP_STR); + break; + default: + printf("%sUnknown CnP", SEP_STR); + break; + } + + if ((cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR2_MASK) != 0) + printf("%s%#lx", SEP_STR, + cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR1_MASK); + printf(">\n"); + } + /* AArch64 Debug Feature Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_DFR0) != 0) { printed = 0; printf(" Debug Features 0 = <"); + switch(ID_AA64DFR0_PMS_VER(cpu_desc[cpu].id_aa64dfr0)) { + case ID_AA64DFR0_PMS_VER_NONE: + break; + case ID_AA64DFR0_PMS_VER_V1: + printf("%sSPE v1", SEP_STR); + break; + default: + printf("%sUnknown SPE", SEP_STR); + break; + } + printf("%s%lu CTX Breakpoints", SEP_STR, ID_AA64DFR0_CTX_CMPS(cpu_desc[cpu].id_aa64dfr0)); @@ -653,6 +806,9 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_DEBUG_VER_8_VHE: printf("%sDebug v8+VHE", SEP_STR); break; + case ID_AA64DFR0_DEBUG_VER_8_2: + printf("%sDebug v8.2", SEP_STR); + break; default: printf("%sUnknown Debug", SEP_STR); break; @@ -738,6 +894,7 @@ identify_cpu(void) cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(ID_AA64ISAR1_EL1); cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(ID_AA64MMFR0_EL1); cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1); + cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1); cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(ID_AA64PFR0_EL1); cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(ID_AA64PFR1_EL1); @@ -792,6 +949,8 @@ identify_cpu(void) cpu_print_regs |= PRINT_ID_AA64_MMFR0; if (cpu_desc[cpu].id_aa64mmfr1 != cpu_desc[0].id_aa64mmfr1) cpu_print_regs |= PRINT_ID_AA64_MMFR1; + if (cpu_desc[cpu].id_aa64mmfr2 != cpu_desc[0].id_aa64mmfr2) + cpu_print_regs |= PRINT_ID_AA64_MMFR2; if (cpu_desc[cpu].id_aa64pfr0 != cpu_desc[0].id_aa64pfr0) cpu_print_regs |= PRINT_ID_AA64_PFR0; Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Sep 7 15:30:52 2017 (r323270) +++ head/sys/arm64/include/armreg.h Thu Sep 7 15:45:56 2017 (r323271) @@ -167,12 +167,13 @@ #define ICC_SRE_EL2_EN (1U << 3) /* ID_AA64DFR0_EL1 */ -#define ID_AA64DFR0_MASK 0xf0f0ffff +#define ID_AA64DFR0_MASK 0x0000000ff0f0fffful #define ID_AA64DFR0_DEBUG_VER_SHIFT 0 #define ID_AA64DFR0_DEBUG_VER_MASK (0xf << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_DEBUG_VER(x) ((x) & ID_AA64DFR0_DEBUG_VER_MASK) #define ID_AA64DFR0_DEBUG_VER_8 (0x6 << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_DEBUG_VER_8_VHE (0x7 << ID_AA64DFR0_DEBUG_VER_SHIFT) +#define ID_AA64DFR0_DEBUG_VER_8_2 (0x8 << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER_SHIFT 4 #define ID_AA64DFR0_TRACE_VER_MASK (0xf << ID_AA64DFR0_TRACE_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER(x) ((x) & ID_AA64DFR0_TRACE_VER_MASK) @@ -197,6 +198,11 @@ #define ID_AA64DFR0_CTX_CMPS_MASK (0xf << ID_AA64DFR0_CTX_CMPS_SHIFT) #define ID_AA64DFR0_CTX_CMPS(x) \ ((((x) >> ID_AA64DFR0_CTX_CMPS_SHIFT) & 0xf) + 1) +#define ID_AA64DFR0_PMS_VER_SHIFT 32 +#define ID_AA64DFR0_PMS_VER_MASK (0xful << ID_AA64DFR0_PMS_VER_SHIFT) +#define ID_AA64DFR0_PMS_VER(x) ((x) & ID_AA64DFR0_PMS_VER_MASK) +#define ID_AA64DFR0_PMS_VER_NONE (0x0ul << ID_AA64DFR0_PMS_VER_SHIFT) +#define ID_AA64DFR0_PMS_VER_V1 (0x1ul << ID_AA64DFR0_PMS_VER_SHIFT) /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_MASK 0xf0fffff0 @@ -232,6 +238,14 @@ #define ID_AA64ISAR0_RDM_NONE (0x0 << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_RDM_IMPL (0x1 << ID_AA64ISAR0_RDM_SHIFT) +/* ID_AA64ISAR1_EL1 */ +#define ID_AA64ISAR1_MASK 0x0000000f +#define ID_AA64ISAR1_DPB_SHIFT 4 +#define ID_AA64ISAR1_DPB_MASK (0xf << ID_AA64ISAR1_DPB_SHIFT) +#define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) +#define ID_AA64ISAR1_DPB_NONE (0x0 << ID_AA64ISAR1_DPB_SHIFT) +#define ID_AA64ISAR1_DPB_IMPL (0x1 << ID_AA64ISAR1_DPB_SHIFT) + /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_MASK 0xffffffff #define ID_AA64MMFR0_PA_RANGE_SHIFT 0 @@ -243,6 +257,7 @@ #define ID_AA64MMFR0_PA_RANGE_4T (0x3 << ID_AA64MMFR0_PA_RANGE_SHIFT) #define ID_AA64MMFR0_PA_RANGE_16T (0x4 << ID_AA64MMFR0_PA_RANGE_SHIFT) #define ID_AA64MMFR0_PA_RANGE_256T (0x5 << ID_AA64MMFR0_PA_RANGE_SHIFT) +#define ID_AA64MMFR0_PA_RANGE_4P (0x6 << ID_AA64MMFR0_PA_RANGE_SHIFT) #define ID_AA64MMFR0_ASID_BITS_SHIFT 4 #define ID_AA64MMFR0_ASID_BITS_MASK (0xf << ID_AA64MMFR0_ASID_BITS_SHIFT) #define ID_AA64MMFR0_ASID_BITS(x) ((x) & ID_AA64MMFR0_ASID_BITS_MASK) @@ -280,7 +295,7 @@ #define ID_AA64MMFR0_TGRAN4_NONE (0xf << ID_AA64MMFR0_TGRAN4_SHIFT) /* ID_AA64MMFR1_EL1 */ -#define ID_AA64MMFR1_MASK 0x00ffffff +#define ID_AA64MMFR1_MASK 0xffffffff #define ID_AA64MMFR1_HAFDBS_SHIFT 0 #define ID_AA64MMFR1_HAFDBS_MASK (0xf << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) @@ -301,7 +316,8 @@ #define ID_AA64MMFR1_HPDS_MASK (0xf << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_HPDS(x) ((x) & ID_AA64MMFR1_HPDS_MASK) #define ID_AA64MMFR1_HPDS_NONE (0x0 << ID_AA64MMFR1_HPDS_SHIFT) -#define ID_AA64MMFR1_HPDS_IMPL (0x1 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_HPD (0x1 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_TTPBHA (0x2 << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_LO_SHIFT 16 #define ID_AA64MMFR1_LO_MASK (0xf << ID_AA64MMFR1_LO_SHIFT) #define ID_AA64MMFR1_LO(x) ((x) & ID_AA64MMFR1_LO_MASK) @@ -313,9 +329,48 @@ #define ID_AA64MMFR1_PAN_NONE (0x0 << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_IMPL (0x1 << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_ATS1E1 (0x2 << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_SPEC_SEI_SHIFT 24 +#define ID_AA64MMFR1_SPEC_SEI_MASK (0xf << ID_AA64MMFR1_SPEC_SEI_SHIFT) +#define ID_AA64MMFR1_SPEC_SEI(x) ((x) & ID_AA64MMFR1_SPEC_SEI_MASK) +#define ID_AA64MMFR1_SPEC_SEI_NONE (0x0 << ID_AA64MMFR1_SPEC_SEI_SHIFT) +#define ID_AA64MMFR1_SPEC_SEI_IMPL (0x1 << ID_AA64MMFR1_SPEC_SEI_SHIFT) +#define ID_AA64MMFR1_XNX_SHIFT 28 +#define ID_AA64MMFR1_XNX_MASK (0xf << ID_AA64MMFR1_XNX_SHIFT) +#define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK) +#define ID_AA64MMFR1_XNX_NONE (0x0 << ID_AA64MMFR1_XNX_SHIFT) +#define ID_AA64MMFR1_XNX_IMPL (0x1 << ID_AA64MMFR1_XNX_SHIFT) +/* ID_AA64MMFR2_EL1 */ +#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 +#define ID_AA64MMFR2_MASK 0x000fffff +#define ID_AA64MMFR2_CNP_SHIFT 0 +#define ID_AA64MMFR2_CNP_MASK (0xf << ID_AA64MMFR2_CNP_SHIFT) +#define ID_AA64MMFR2_CNP(x) ((x) & ID_AA64MMFR2_CNP_MASK) +#define ID_AA64MMFR2_CNP_NONE (0x0 << ID_AA64MMFR2_CNP_SHIFT) +#define ID_AA64MMFR2_CNP_IMPL (0x1 << ID_AA64MMFR2_CNP_SHIFT) +#define ID_AA64MMFR2_UAO_SHIFT 4 +#define ID_AA64MMFR2_UAO_MASK (0xf << ID_AA64MMFR2_UAO_SHIFT) +#define ID_AA64MMFR2_UAO(x) ((x) & ID_AA64MMFR2_UAO_MASK) +#define ID_AA64MMFR2_UAO_NONE (0x0 << ID_AA64MMFR2_UAO_SHIFT) +#define ID_AA64MMFR2_UAO_IMPL (0x1 << ID_AA64MMFR2_UAO_SHIFT) +#define ID_AA64MMFR2_LSM_SHIFT 8 +#define ID_AA64MMFR2_LSM_MASK (0xf << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_LSM(x) ((x) & ID_AA64MMFR2_LSM_MASK) +#define ID_AA64MMFR2_LSM_NONE (0x0 << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_LSM_IMPL (0x1 << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_IESB_SHIFT 12 +#define ID_AA64MMFR2_IESB_MASK (0xf << ID_AA64MMFR2_IESB_SHIFT) +#define ID_AA64MMFR2_IESB(x) ((x) & ID_AA64MMFR2_IESB_MASK) +#define ID_AA64MMFR2_IESB_NONE (0x0 << ID_AA64MMFR2_IESB_SHIFT) +#define ID_AA64MMFR2_IESB_IMPL (0x1 << ID_AA64MMFR2_IESB_SHIFT) +#define ID_AA64MMFR2_VA_RANGE_SHIFT 16 +#define ID_AA64MMFR2_VA_RANGE_MASK (0xf << ID_AA64MMFR2_VA_RANGE_SHIFT) +#define ID_AA64MMFR2_VA_RANGE(x) ((x) & ID_AA64MMFR2_VA_RANGE_MASK) +#define ID_AA64MMFR2_VA_RANGE_48 (0x0 << ID_AA64MMFR2_VA_RANGE_SHIFT) +#define ID_AA64MMFR2_VA_RANGE_52 (0x1 << ID_AA64MMFR2_VA_RANGE_SHIFT) + /* ID_AA64PFR0_EL1 */ -#define ID_AA64PFR0_MASK 0x0fffffff +#define ID_AA64PFR0_MASK 0x0000000ffffffffful #define ID_AA64PFR0_EL0_SHIFT 0 #define ID_AA64PFR0_EL0_MASK (0xf << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL0(x) ((x) & ID_AA64PFR0_EL0_MASK) @@ -342,11 +397,13 @@ #define ID_AA64PFR0_FP_MASK (0xf << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK) #define ID_AA64PFR0_FP_IMPL (0x0 << ID_AA64PFR0_FP_SHIFT) +#define ID_AA64PFR0_FP_HP (0x1 << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_NONE (0xf << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_ADV_SIMD_SHIFT 20 #define ID_AA64PFR0_ADV_SIMD_MASK (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_ADV_SIMD(x) ((x) & ID_AA64PFR0_ADV_SIMD_MASK) #define ID_AA64PFR0_ADV_SIMD_IMPL (0x0 << ID_AA64PFR0_ADV_SIMD_SHIFT) +#define ID_AA64PFR0_ADV_SIMD_HP (0x1 << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_ADV_SIMD_NONE (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */ #define ID_AA64PFR0_GIC_SHIFT 24 @@ -354,6 +411,16 @@ #define ID_AA64PFR0_GIC(x) ((x) & ID_AA64PFR0_GIC_MASK) #define ID_AA64PFR0_GIC_CPUIF_NONE (0x0 << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_GIC_CPUIF_EN (0x1 << ID_AA64PFR0_GIC_SHIFT) +#define ID_AA64PFR0_RAS_SHIFT 28 +#define ID_AA64PFR0_RAS_MASK (0xf << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS(x) ((x) & ID_AA64PFR0_RAS_MASK) +#define ID_AA64PFR0_RAS_NONE (0x0 << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS_V1 (0x1 << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_SVE_SHIFT 28 +#define ID_AA64PFR0_SVE_MASK (0xful << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SVE(x) ((x) & ID_AA64PFR0_SVE_MASK) +#define ID_AA64PFR0_SVE_NONE (0x0ul << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SVE_IMPL (0x1ul << ID_AA64PFR0_SVE_SHIFT) /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) From owner-svn-src-head@freebsd.org Thu Sep 7 15:46:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE95E0072F; Thu, 7 Sep 2017 15:46:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9910B6D125; Thu, 7 Sep 2017 15:46:45 +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 v87Fki9F011750; Thu, 7 Sep 2017 15:46:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Fki65011749; Thu, 7 Sep 2017 15:46:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709071546.v87Fki65011749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 7 Sep 2017 15:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323272 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 15:46:46 -0000 Author: imp Date: Thu Sep 7 15:46:44 2017 New Revision: 323272 URL: https://svnweb.freebsd.org/changeset/base/323272 Log: Be consistent and do return (1); Noticed by: tsoome@ Sponsored by: Netflix Modified: head/sys/boot/efi/libefi/efichar.c Modified: head/sys/boot/efi/libefi/efichar.c ============================================================================== --- head/sys/boot/efi/libefi/efichar.c Thu Sep 7 15:45:56 2017 (r323271) +++ head/sys/boot/efi/libefi/efichar.c Thu Sep 7 15:46:44 2017 (r323272) @@ -50,7 +50,7 @@ ucs2len(const efi_char *str) i = 0; while (*str++) i++; - return i; + return (i); } /* From owner-svn-src-head@freebsd.org Thu Sep 7 16:12:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C23E016F9; Thu, 7 Sep 2017 16:12:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A574072C4A; Thu, 7 Sep 2017 16:12:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87GCuZa024526; Thu, 7 Sep 2017 16:12:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87GCubB024525; Thu, 7 Sep 2017 16:12:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071612.v87GCubB024525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 16:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323273 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 323273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 16:12:58 -0000 Author: andrew Date: Thu Sep 7 16:12:56 2017 New Revision: 323273 URL: https://svnweb.freebsd.org/changeset/base/323273 Log: Fix the value of ID_AA64ISAR1_DPB_SHIFT, the field is bits 3:0. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Sep 7 15:46:44 2017 (r323272) +++ head/sys/arm64/include/armreg.h Thu Sep 7 16:12:56 2017 (r323273) @@ -240,7 +240,7 @@ /* ID_AA64ISAR1_EL1 */ #define ID_AA64ISAR1_MASK 0x0000000f -#define ID_AA64ISAR1_DPB_SHIFT 4 +#define ID_AA64ISAR1_DPB_SHIFT 0 #define ID_AA64ISAR1_DPB_MASK (0xf << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) #define ID_AA64ISAR1_DPB_NONE (0x0 << ID_AA64ISAR1_DPB_SHIFT) From owner-svn-src-head@freebsd.org Thu Sep 7 16:43:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B881E029F0; Thu, 7 Sep 2017 16:43:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8C17D7FD; Thu, 7 Sep 2017 16:43:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87GhDLv036665; Thu, 7 Sep 2017 16:43:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87GhDmU036664; Thu, 7 Sep 2017 16:43:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071643.v87GhDmU036664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 16:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323274 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 16:43:14 -0000 Author: andrew Date: Thu Sep 7 16:43:12 2017 New Revision: 323274 URL: https://svnweb.freebsd.org/changeset/base/323274 Log: Fix a mismerge, make sure PRINT_ID_AA64_MMFR2 has a unique value. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 16:12:56 2017 (r323273) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 16:43:12 2017 (r323274) @@ -95,7 +95,7 @@ static u_int cpu_print_regs; #define PRINT_ID_AA64_ISAR1 0x00000200 #define PRINT_ID_AA64_MMFR0 0x00001000 #define PRINT_ID_AA64_MMFR1 0x00002000 -#define PRINT_ID_AA64_MMFR2 0x00000100 +#define PRINT_ID_AA64_MMFR2 0x00004000 #define PRINT_ID_AA64_PFR0 0x00010000 #define PRINT_ID_AA64_PFR1 0x00020000 From owner-svn-src-head@freebsd.org Thu Sep 7 16:54:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11366E0319E; Thu, 7 Sep 2017 16:54:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 450087FFCA; Thu, 7 Sep 2017 16:54:50 +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 v87Gsn4k040632; Thu, 7 Sep 2017 16:54:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Gsm7V040618; Thu, 7 Sep 2017 16:54:48 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709071654.v87Gsm7V040618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 7 Sep 2017 16:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323275 - in head: bin/chflags bin/chflags/tests bin/mkdir bin/mkdir/tests bin/rcp bin/rcp/tests bin/rmdir bin/rmdir/tests etc/mtree X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: bin/chflags bin/chflags/tests bin/mkdir bin/mkdir/tests bin/rcp bin/rcp/tests bin/rmdir bin/rmdir/tests etc/mtree X-SVN-Commit-Revision: 323275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 16:54:51 -0000 Author: asomers Date: Thu Sep 7 16:54:47 2017 New Revision: 323275 URL: https://svnweb.freebsd.org/changeset/base/323275 Log: Add basic tests for chflags, mkdir, rcp, and rmdir Add basic command line parsing test coverage for these utilities. The tests were automatically generated based on their man pages. These tests can be expanded by hand for more thorough coverage. The aim is to generate very basic amount of test coverage for all the utilities in the base system. Submitted by: shivansh Reviewed by: asomers, brooks MFC after: 3 weeks Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D12036 Added: head/bin/chflags/tests/ head/bin/chflags/tests/Makefile (contents, props changed) head/bin/chflags/tests/chflags_test.sh (contents, props changed) head/bin/mkdir/tests/ head/bin/mkdir/tests/Makefile (contents, props changed) head/bin/mkdir/tests/mkdir_test.sh (contents, props changed) head/bin/rcp/tests/ head/bin/rcp/tests/Makefile (contents, props changed) head/bin/rcp/tests/rcp_test.sh (contents, props changed) head/bin/rmdir/tests/ head/bin/rmdir/tests/Makefile (contents, props changed) head/bin/rmdir/tests/rmdir_test.sh (contents, props changed) Modified: head/bin/chflags/Makefile head/bin/mkdir/Makefile head/bin/rcp/Makefile head/bin/rmdir/Makefile head/etc/mtree/BSD.tests.dist Modified: head/bin/chflags/Makefile ============================================================================== --- head/bin/chflags/Makefile Thu Sep 7 16:43:12 2017 (r323274) +++ head/bin/chflags/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -4,4 +4,7 @@ PACKAGE=runtime PROG= chflags +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/bin/chflags/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/chflags/tests/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= chflags_test + +.include Added: head/bin/chflags/tests/chflags_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/chflags/tests/chflags_test.sh Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,63 @@ +# +# Copyright 2017 Shivansh Rai +# 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. +# +# $FreeBSD$ +# + +usage_output='usage: chflags' + +atf_test_case invalid_usage +invalid_usage_head() +{ + atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" +} + +invalid_usage_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" chflags -f + atf_check -s not-exit:0 -e match:"$usage_output" chflags -H + atf_check -s not-exit:0 -e match:"$usage_output" chflags -h + atf_check -s not-exit:0 -e match:"$usage_output" chflags -L + atf_check -s not-exit:0 -e match:"$usage_output" chflags -P + atf_check -s not-exit:0 -e match:"$usage_output" chflags -R + atf_check -s not-exit:0 -e match:"$usage_output" chflags -v +} + +atf_test_case no_arguments +no_arguments_head() +{ + atf_set "descr" "Verify that chflags(1) fails and generates a valid usage message when no arguments are supplied" +} + +no_arguments_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" chflags +} + +atf_init_test_cases() +{ + atf_add_test_case invalid_usage + atf_add_test_case no_arguments +} Modified: head/bin/mkdir/Makefile ============================================================================== --- head/bin/mkdir/Makefile Thu Sep 7 16:43:12 2017 (r323274) +++ head/bin/mkdir/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -4,4 +4,7 @@ PACKAGE=runtime PROG= mkdir +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/bin/mkdir/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/mkdir/tests/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= mkdir_test + +.include Added: head/bin/mkdir/tests/mkdir_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/mkdir/tests/mkdir_test.sh Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,61 @@ +# +# Copyright 2017 Shivansh Rai +# 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. +# +# $FreeBSD$ +# + +usage_output='usage: mkdir' + +atf_test_case invalid_usage +invalid_usage_head() +{ + atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" +} + +invalid_usage_body() +{ + atf_check -s not-exit:0 -e inline:"mkdir: option requires an argument -- m +usage: mkdir [-pv] [-m mode] directory_name ... +" mkdir -m + atf_check -s not-exit:0 -e match:"$usage_output" mkdir -p + atf_check -s not-exit:0 -e match:"$usage_output" mkdir -v +} + +atf_test_case no_arguments +no_arguments_head() +{ + atf_set "descr" "Verify that mkdir(1) fails and generates a valid usage message when no arguments are supplied" +} + +no_arguments_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" mkdir +} + +atf_init_test_cases() +{ + atf_add_test_case invalid_usage + atf_add_test_case no_arguments +} Modified: head/bin/rcp/Makefile ============================================================================== --- head/bin/rcp/Makefile Thu Sep 7 16:43:12 2017 (r323274) +++ head/bin/rcp/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -11,4 +11,7 @@ PACKAGE=rcmds BINOWN= root BINMODE=4555 +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/bin/rcp/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/rcp/tests/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= rcp_test + +.include Added: head/bin/rcp/tests/rcp_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/rcp/tests/rcp_test.sh Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,60 @@ +# +# Copyright 2017 Shivansh Rai +# 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. +# +# $FreeBSD$ +# + +usage_output='usage: rcp' + +atf_test_case invalid_usage +invalid_usage_head() +{ + atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" +} + +invalid_usage_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" rcp -4 + atf_check -s not-exit:0 -e match:"$usage_output" rcp -6 + atf_check -s not-exit:0 -e match:"$usage_output" rcp -p + atf_check -s not-exit:0 -e match:"$usage_output" rcp -r +} + +atf_test_case no_arguments +no_arguments_head() +{ + atf_set "descr" "Verify that rcp(1) fails and generates a valid usage message when no arguments are supplied" +} + +no_arguments_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" rcp +} + +atf_init_test_cases() +{ + atf_add_test_case invalid_usage + atf_add_test_case no_arguments +} Modified: head/bin/rmdir/Makefile ============================================================================== --- head/bin/rmdir/Makefile Thu Sep 7 16:43:12 2017 (r323274) +++ head/bin/rmdir/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -4,4 +4,7 @@ PACKAGE=runtime PROG= rmdir +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/bin/rmdir/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/rmdir/tests/Makefile Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= rmdir_test + +.include Added: head/bin/rmdir/tests/rmdir_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/rmdir/tests/rmdir_test.sh Thu Sep 7 16:54:47 2017 (r323275) @@ -0,0 +1,58 @@ +# +# Copyright 2017 Shivansh Rai +# 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. +# +# $FreeBSD$ +# + +usage_output='usage: rmdir' + +atf_test_case invalid_usage +invalid_usage_head() +{ + atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" +} + +invalid_usage_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" rmdir -p + atf_check -s not-exit:0 -e match:"$usage_output" rmdir -v +} + +atf_test_case no_arguments +no_arguments_head() +{ + atf_set "descr" "Verify that rmdir(1) fails and generates a valid usage message when no arguments are supplied" +} + +no_arguments_body() +{ + atf_check -s not-exit:0 -e match:"$usage_output" rmdir +} + +atf_init_test_cases() +{ + atf_add_test_case invalid_usage + atf_add_test_case no_arguments +} Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Sep 7 16:43:12 2017 (r323274) +++ head/etc/mtree/BSD.tests.dist Thu Sep 7 16:54:47 2017 (r323275) @@ -8,6 +8,8 @@ bin cat .. + chflags + .. chmod .. date @@ -22,6 +24,8 @@ .. ls .. + mkdir + .. mv .. pax @@ -29,6 +33,10 @@ pkill .. pwait + .. + rcp + .. + rmdir .. sh builtins From owner-svn-src-head@freebsd.org Thu Sep 7 17:20:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80945E04095; Thu, 7 Sep 2017 17:20:48 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB0AA75; Thu, 7 Sep 2017 17:20:48 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87HKl05048948; Thu, 7 Sep 2017 17:20:47 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87HKlmk048946; Thu, 7 Sep 2017 17:20:47 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201709071720.v87HKlmk048946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 7 Sep 2017 17:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323276 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 323276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 17:20:48 -0000 Author: rlibby Date: Thu Sep 7 17:20:47 2017 New Revision: 323276 URL: https://svnweb.freebsd.org/changeset/base/323276 Log: crunchgen: quiet -Wmissing-prototypes Reviewed by: emaste (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12107 Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Sep 7 16:54:47 2017 (r323275) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Sep 7 17:20:47 2017 (r323276) @@ -47,6 +47,8 @@ struct stub { extern char *__progname; extern struct stub entry_points[]; +static void crunched_usage(void); + int main(int argc, char **argv, char **envp) { @@ -72,22 +74,6 @@ main(int argc, char **argv, char **envp) int -crunched_here(char *path) -{ - char *slash, *basename; - struct stub *ep; - - slash = strrchr(path, '/'); - basename = slash? slash+1 : path; - - for(ep=entry_points; ep->name != NULL; ep++) - if(!strcmp(basename, ep->name)) - return 1; - return 0; -} - - -int crunched_main(int argc, char **argv, char **envp) { char *slash; @@ -104,7 +90,7 @@ crunched_main(int argc, char **argv, char **envp) } -int +static void crunched_usage() { int columns, len; Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 7 16:54:47 2017 (r323275) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 7 17:20:47 2017 (r323276) @@ -1105,6 +1105,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_stub.c:\n", p->name); fprintf(outmk, "\techo \"" + "extern int main(int argc, char **argv, char **envp); " "int _crunched_%s_stub(int argc, char **argv, char **envp)" "{return main(argc,argv,envp);}\" >%s_stub.c\n", p->ident, p->name); From owner-svn-src-head@freebsd.org Thu Sep 7 17:51:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E72BE0554E; Thu, 7 Sep 2017 17:51:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 54A7266959; Thu, 7 Sep 2017 17:51:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87HpZR7061667; Thu, 7 Sep 2017 17:51:35 GMT (envelope-from theraven@FreeBSD.org) Received: (from theraven@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87HpZZS061666; Thu, 7 Sep 2017 17:51:35 GMT (envelope-from theraven@FreeBSD.org) Message-Id: <201709071751.v87HpZZS061666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: theraven set sender to theraven@FreeBSD.org using -f From: David Chisnall Date: Thu, 7 Sep 2017 17:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323277 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: theraven X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 323277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 17:51:36 -0000 Author: theraven Date: Thu Sep 7 17:51:35 2017 New Revision: 323277 URL: https://svnweb.freebsd.org/changeset/base/323277 Log: Document some invariants for the XLC_ enum. These can't be reordered without breaking other code. Document that and add some static asserts to ensure that anyone who tries gets build failures. Modified: head/lib/libc/locale/xlocale_private.h Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Thu Sep 7 17:20:47 2017 (r323276) +++ head/lib/libc/locale/xlocale_private.h Thu Sep 7 17:51:35 2017 (r323277) @@ -40,6 +40,14 @@ #include #include "setlocale.h" +/** + * The XLC_ values are indexes into the components array. They are defined in + * the same order as the LC_ values in locale.h, but without the LC_ALL zero + * value. Translating from LC_X to XLC_X is done by subtracting one. + * + * Any reordering of this enum should ensure that these invariants are not + * violated. + */ enum { XLC_COLLATE = 0, XLC_CTYPE, @@ -50,6 +58,19 @@ enum { XLC_LAST }; +_Static_assert(XLC_LAST - XLC_COLLATE == 6, "XLC values should be contiguous"); +_Static_assert(XLC_COLLATE == LC_COLLATE - 1, + "XLC_COLLATE doesn't match the LC_COLLATE value."); +_Static_assert(XLC_CTYPE == LC_CTYPE - 1, + "XLC_CTYPE doesn't match the LC_CTYPE value."); +_Static_assert(XLC_MONETARY == LC_MONETARY - 1, + "XLC_MONETARY doesn't match the LC_MONETARY value."); +_Static_assert(XLC_NUMERIC == LC_NUMERIC - 1, + "XLC_NUMERIC doesn't match the LC_NUMERIC value."); +_Static_assert(XLC_TIME == LC_TIME - 1, + "XLC_TIME doesn't match the LC_TIME value."); +_Static_assert(XLC_MESSAGES == LC_MESSAGES - 1, + "XLC_MESSAGES doesn't match the LC_MESSAGES value."); /** * Header used for objects that are reference counted. Objects may optionally From owner-svn-src-head@freebsd.org Thu Sep 7 18:54:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA5FE088B0; Thu, 7 Sep 2017 18:54:56 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7B1C074EAC; Thu, 7 Sep 2017 18:54:56 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87IstLX089290; Thu, 7 Sep 2017 18:54:55 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87IstVo089289; Thu, 7 Sep 2017 18:54:55 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201709071854.v87IstVo089289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Thu, 7 Sep 2017 18:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323278 - head/contrib/file/src X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/contrib/file/src X-SVN-Commit-Revision: 323278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 18:54:57 -0000 Author: gordon Date: Thu Sep 7 18:54:54 2017 New Revision: 323278 URL: https://svnweb.freebsd.org/changeset/base/323278 Log: Fix an incorrectly used conditional causing a stack buffer overflow. Reported by: Thomas Jarosch of Intra2net AG Reviewed by: emaste, jhb Security: CVE-2017-1000249 Modified: head/contrib/file/src/readelf.c Modified: head/contrib/file/src/readelf.c ============================================================================== --- head/contrib/file/src/readelf.c Thu Sep 7 17:51:35 2017 (r323277) +++ head/contrib/file/src/readelf.c Thu Sep 7 18:54:54 2017 (r323278) @@ -509,7 +509,7 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && - type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) { + type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) { uint8_t desc[20]; const char *btype; uint32_t i; From owner-svn-src-head@freebsd.org Thu Sep 7 18:58:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F377E08C08; Thu, 7 Sep 2017 18:58:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07DB875CDF; Thu, 7 Sep 2017 18:58:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87IwuVf089493; Thu, 7 Sep 2017 18:58:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Iwur4089492; Thu, 7 Sep 2017 18:58:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071858.v87Iwur4089492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 18:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323279 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 18:58:57 -0000 Author: andrew Date: Thu Sep 7 18:58:55 2017 New Revision: 323279 URL: https://svnweb.freebsd.org/changeset/base/323279 Log: Use the correct mask when printing undecoded fields from the ID_AA64MMFR2_EL1 register. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 18:54:54 2017 (r323278) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 18:58:55 2017 (r323279) @@ -743,7 +743,7 @@ print_cpu_features(u_int cpu) if ((cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR2_MASK) != 0) printf("%s%#lx", SEP_STR, - cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR1_MASK); + cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR2_MASK); printf(">\n"); } From owner-svn-src-head@freebsd.org Thu Sep 7 19:15:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DBBE09AC8; Thu, 7 Sep 2017 19:15:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 553117D8D0; Thu, 7 Sep 2017 19:15:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87JFW7I097768; Thu, 7 Sep 2017 19:15:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87JFW0x097767; Thu, 7 Sep 2017 19:15:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709071915.v87JFW0x097767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Sep 2017 19:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323280 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 323280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 19:15:34 -0000 Author: markj Date: Thu Sep 7 19:15:31 2017 New Revision: 323280 URL: https://svnweb.freebsd.org/changeset/base/323280 Log: Fix indentation. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Sep 7 18:58:55 2017 (r323279) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Sep 7 19:15:31 2017 (r323280) @@ -3226,9 +3226,9 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con NULL, 0); } else { if (conn_param) - ret = cma_accept_ib(id_priv, conn_param); - else - ret = cma_rep_recv(id_priv); + ret = cma_accept_ib(id_priv, conn_param); + else + ret = cma_rep_recv(id_priv); } break; case RDMA_TRANSPORT_IWARP: From owner-svn-src-head@freebsd.org Thu Sep 7 19:51:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B281E0BC2A; Thu, 7 Sep 2017 19:51:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0221BB23; Thu, 7 Sep 2017 19:51:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87JpIaE011737; Thu, 7 Sep 2017 19:51:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87JpINJ011736; Thu, 7 Sep 2017 19:51:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071951.v87JpINJ011736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 19:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323282 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 19:51:19 -0000 Author: andrew Date: Thu Sep 7 19:51:17 2017 New Revision: 323282 URL: https://svnweb.freebsd.org/changeset/base/323282 Log: Add the ATS1E1 case to the ID_AA64MMFR1_EL1 decoding. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Sep 7 19:23:08 2017 (r323281) +++ head/sys/arm64/arm64/identcpu.c Thu Sep 7 19:51:17 2017 (r323282) @@ -608,6 +608,9 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_PAN_IMPL: printf("%sPAN", SEP_STR); break; + case ID_AA64MMFR1_PAN_ATS1E1: + printf("%sPAN+AT", SEP_STR); + break; default: printf("%sUnknown PAN", SEP_STR); break; From owner-svn-src-head@freebsd.org Thu Sep 7 19:52:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C33E0BD79; Thu, 7 Sep 2017 19:52:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFF4EC9; Thu, 7 Sep 2017 19:52:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87Jq4aS011806; Thu, 7 Sep 2017 19:52:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Jq4UQ011805; Thu, 7 Sep 2017 19:52:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709071952.v87Jq4UQ011805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Sep 2017 19:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323283 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 323283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 19:52:05 -0000 Author: andrew Date: Thu Sep 7 19:52:04 2017 New Revision: 323283 URL: https://svnweb.freebsd.org/changeset/base/323283 Log: Fix the SVE ID field shift. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Sep 7 19:51:17 2017 (r323282) +++ head/sys/arm64/include/armreg.h Thu Sep 7 19:52:04 2017 (r323283) @@ -416,7 +416,7 @@ #define ID_AA64PFR0_RAS(x) ((x) & ID_AA64PFR0_RAS_MASK) #define ID_AA64PFR0_RAS_NONE (0x0 << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_RAS_V1 (0x1 << ID_AA64PFR0_RAS_SHIFT) -#define ID_AA64PFR0_SVE_SHIFT 28 +#define ID_AA64PFR0_SVE_SHIFT 32 #define ID_AA64PFR0_SVE_MASK (0xful << ID_AA64PFR0_SVE_SHIFT) #define ID_AA64PFR0_SVE(x) ((x) & ID_AA64PFR0_SVE_MASK) #define ID_AA64PFR0_SVE_NONE (0x0ul << ID_AA64PFR0_SVE_SHIFT) From owner-svn-src-head@freebsd.org Thu Sep 7 20:20:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C69F9E0D6E1; Thu, 7 Sep 2017 20:20:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8082066B98; Thu, 7 Sep 2017 20:20:13 +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 v87KKCHT023856; Thu, 7 Sep 2017 20:20:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87KKCcB023855; Thu, 7 Sep 2017 20:20:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709072020.v87KKCcB023855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 7 Sep 2017 20:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323286 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 323286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 20:20:14 -0000 Author: cem Date: Thu Sep 7 20:20:12 2017 New Revision: 323286 URL: https://svnweb.freebsd.org/changeset/base/323286 Log: cpufreq(4) hwpstate: Yield CPU awaiting frequency change It doesn't seem necessary to busy the CPU while waiting to transition into a different p-state. PR: 221621 (related, but does not completely address) Reviewed by: truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12260 Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Thu Sep 7 20:18:57 2017 (r323285) +++ head/sys/x86/cpufreq/hwpstate.c Thu Sep 7 20:20:12 2017 (r323286) @@ -160,6 +160,7 @@ DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate static int hwpstate_goto_pstate(device_t dev, int pstate) { + sbintime_t sbt; int i; uint64_t msr; int j; @@ -170,7 +171,7 @@ hwpstate_goto_pstate(device_t dev, int pstate) /* get the current pstate limit */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); - if(limit > id) + if (limit > id) id = limit; /* @@ -184,7 +185,7 @@ hwpstate_goto_pstate(device_t dev, int pstate) sched_bind(curthread, i); thread_unlock(curthread); HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n", - id, PCPU_GET(cpuid)); + id, PCPU_GET(cpuid)); /* Go To Px-state */ wrmsr(MSR_AMD_10H_11H_CONTROL, id); } @@ -194,13 +195,14 @@ hwpstate_goto_pstate(device_t dev, int pstate) sched_bind(curthread, i); thread_unlock(curthread); /* wait loop (100*100 usec is enough ?) */ - for(j = 0; j < 100; j++){ + for (j = 0; j < 100; j++){ /* get the result. not assure msr=id */ msr = rdmsr(MSR_AMD_10H_11H_STATUS); - if(msr == id){ + if (msr == id) break; - } - DELAY(100); + sbt = SBT_1MS / 10; + tsleep_sbt(dev, PZERO, "pstate_goto", sbt, + sbt >> tc_precexp, 0); } HWPSTATE_DEBUG(dev, "result: P%d-state on cpu%d\n", (int)msr, PCPU_GET(cpuid)); From owner-svn-src-head@freebsd.org Thu Sep 7 21:29:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 975E0E110C0; Thu, 7 Sep 2017 21:29:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 417C876828; Thu, 7 Sep 2017 21:29:53 +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 v87LTq6k052496; Thu, 7 Sep 2017 21:29:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87LTpQ5052493; Thu, 7 Sep 2017 21:29:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709072129.v87LTpQ5052493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 7 Sep 2017 21:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323287 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 323287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 21:29:53 -0000 Author: cem Date: Thu Sep 7 21:29:51 2017 New Revision: 323287 URL: https://svnweb.freebsd.org/changeset/base/323287 Log: Store AMD RAS Capabilities cpuid value and name flags Reviewed by: truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12237 Modified: head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Sep 7 20:20:12 2017 (r323286) +++ head/sys/x86/include/specialreg.h Thu Sep 7 21:29:51 2017 (r323287) @@ -308,6 +308,15 @@ #define CPUID_EXTSTATE_XSAVES 0x00000008 /* + * AMD extended function 8000_0007h ebx info + */ +#define AMDRAS_MCA_OF_RECOV 0x00000001 +#define AMDRAS_SUCCOR 0x00000002 +#define AMDRAS_HW_ASSERT 0x00000004 +#define AMDRAS_SCALABLE_MCA 0x00000008 +#define AMDRAS_PFEH_SUPPORT 0x00000010 + +/* * AMD extended function 8000_0007h edx info */ #define AMDPM_TS 0x00000001 Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Thu Sep 7 20:20:12 2017 (r323286) +++ head/sys/x86/include/x86_var.h Thu Sep 7 21:29:51 2017 (r323287) @@ -44,6 +44,7 @@ extern u_int cpu_feature; extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; +extern u_int amd_rascap; extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Sep 7 20:20:12 2017 (r323286) +++ head/sys/x86/x86/identcpu.c Thu Sep 7 21:29:51 2017 (r323287) @@ -91,6 +91,7 @@ u_int cpu_feature; /* Feature flags */ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ +u_int amd_rascap; /* AMD RAS capabilities */ u_int amd_pminfo; /* AMD advanced power management info */ u_int via_feature_rng; /* VIA RNG features */ u_int via_feature_xcrypt; /* VIA ACE features */ @@ -1461,6 +1462,7 @@ finishidentcpu(void) } if (cpu_exthigh >= 0x80000007) { do_cpuid(0x80000007, regs); + amd_rascap = regs[1]; amd_pminfo = regs[3]; } if (cpu_exthigh >= 0x80000008) { From owner-svn-src-head@freebsd.org Thu Sep 7 21:31:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438F7E11251; Thu, 7 Sep 2017 21:31:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id C9F9676C8A; Thu, 7 Sep 2017 21:31:08 +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 v87LV7kg052599; Thu, 7 Sep 2017 21:31:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87LV7cn052597; Thu, 7 Sep 2017 21:31:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709072131.v87LV7cn052597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 7 Sep 2017 21:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323288 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 323288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 21:31:09 -0000 Author: cem Date: Thu Sep 7 21:31:07 2017 New Revision: 323288 URL: https://svnweb.freebsd.org/changeset/base/323288 Log: x86 MCA: Enable AMD thresholding support on 17h 17h supports MCA thresholding in the same way as 16h and earlier. Supposedly a ScalableMca feature bit in CPUID 8000_0007:EBX must be set, but that was not true for earlier models, so be careful about relying on it. While here, document a missing bit in LS MCA MISC0. Reviewed by: truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12237 Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/mca.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Sep 7 21:29:51 2017 (r323287) +++ head/sys/x86/include/specialreg.h Thu Sep 7 21:31:07 2017 (r323288) @@ -718,6 +718,7 @@ #define MC_MISC_AMDNB_VAL 0x8000000000000000 /* Counter presence valid */ #define MC_MISC_AMDNB_CNTP 0x4000000000000000 /* Counter present */ #define MC_MISC_AMDNB_LOCK 0x2000000000000000 /* Register locked */ +#define MC_MISC_AMDNB_INTP 0x1000000000000000 /* Int. type can generate interrupts */ #define MC_MISC_AMDNB_LVT_MASK 0x00f0000000000000 /* Extended LVT offset */ #define MC_MISC_AMDNB_LVT_SHIFT 52 #define MC_MISC_AMDNB_CNTEN 0x0008000000000000 /* Counter enabled */ Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Thu Sep 7 21:29:51 2017 (r323287) +++ head/sys/x86/x86/mca.c Thu Sep 7 21:31:07 2017 (r323288) @@ -132,8 +132,20 @@ static int amd_elvt = -1; static inline bool amd_thresholding_supported(void) { - return (cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) >= 0x10 && CPUID_TO_FAMILY(cpu_id) <= 0x16); + if (cpu_vendor_id != CPU_VENDOR_AMD) + return (false); + /* + * The RASCap register is wholly reserved in families 0x10-0x15 (through model 1F). + * + * It begins to be documented in family 0x15 model 30 and family 0x16, + * but neither of these families documents the ScalableMca bit, which + * supposedly defines the presence of this feature on family 0x17. + */ + if (CPUID_TO_FAMILY(cpu_id) >= 0x10 && CPUID_TO_FAMILY(cpu_id) <= 0x16) + return (true); + if (CPUID_TO_FAMILY(cpu_id) >= 0x17) + return ((amd_rascap & AMDRAS_SCALABLE_MCA) != 0); + return (false); } #endif From owner-svn-src-head@freebsd.org Thu Sep 7 21:33:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56F6AE11570; Thu, 7 Sep 2017 21:33:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id 037AE777B2; Thu, 7 Sep 2017 21:33:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v87LXSkS056239; Thu, 7 Sep 2017 21:33:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87LXSLS056238; Thu, 7 Sep 2017 21:33:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709072133.v87LXSLS056238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 7 Sep 2017 21:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323289 - 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: 323289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 21:33:29 -0000 Author: cem Date: Thu Sep 7 21:33:27 2017 New Revision: 323289 URL: https://svnweb.freebsd.org/changeset/base/323289 Log: x86 MCA: Helpfully, print why ECC thresholding is not enabled on AMD Sponsored by: Dell EMC Isilon Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Thu Sep 7 21:31:07 2017 (r323288) +++ head/sys/x86/x86/mca.c Thu Sep 7 21:33:27 2017 (r323289) @@ -981,19 +981,25 @@ amd_thresholding_init(void) /* The counter must be valid and present. */ misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); if ((misc & (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) != - (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) + (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) { + printf("%s: 0x%lx: !valid | !present\n", __func__, misc); return; + } /* The register should not be locked. */ - if ((misc & MC_MISC_AMDNB_LOCK) != 0) + if ((misc & MC_MISC_AMDNB_LOCK) != 0) { + printf("%s: 0x%lx: locked\n", __func__, misc); return; + } /* * If counter is enabled then either the firmware or another CPU * has already claimed it. */ - if ((misc & MC_MISC_AMDNB_CNTEN) != 0) + if ((misc & MC_MISC_AMDNB_CNTEN) != 0) { + printf("%s: 0x%lx: count already enabled\n", __func__, misc); return; + } /* * Configure an Extended Interrupt LVT register for reporting @@ -1001,10 +1007,15 @@ amd_thresholding_init(void) * extended register is available. */ amd_elvt = lapic_enable_mca_elvt(); - if (amd_elvt < 0) + if (amd_elvt < 0) { + printf("%s: lapic enable mca elvt failed: %d\n", __func__, amd_elvt); return; + } /* Re-use Intel CMC support infrastructure. */ + if (bootverbose) + printf("%s: Starting AMD thresholding\n", __func__); + cc = &amd_et_state[PCPU_GET(cpuid)]; cc->cur_threshold = 1; amd_thresholding_start(cc); From owner-svn-src-head@freebsd.org Thu Sep 7 21:43:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0FE2E11DDD; Thu, 7 Sep 2017 21:43:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id 82C9B7DF1A; Thu, 7 Sep 2017 21:43:40 +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 v87Lhdux060314; Thu, 7 Sep 2017 21:43:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v87Lhdsg060310; Thu, 7 Sep 2017 21:43:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709072143.v87Lhdsg060310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Sep 2017 21:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323290 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 323290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 07 Sep 2017 21:43:40 -0000 Author: markj Date: Thu Sep 7 21:43:39 2017 New Revision: 323290 URL: https://svnweb.freebsd.org/changeset/base/323290 Log: Speed up vm_page_array initialization. We currently initialize the vm_page array in three passes: one to zero the array, one to initialize the "order" field of each page (necessary when inserting them into the vm_phys buddy allocator one-by-one), and one to initialize the remaining non-zero fields and individually insert each page into the allocator. Merge the three passes into one following a suggestion from alc: initialize vm_page fields in a single pass, and use vm_phys_free_contig() to efficiently insert physical memory segments into the buddy allocator. This reduces the initialization time to a third or a quarter of what it was before on most systems that I tested. Reviewed by: alc, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D12248 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Sep 7 21:33:27 2017 (r323289) +++ head/sys/vm/vm_page.c Thu Sep 7 21:43:39 2017 (r323290) @@ -429,17 +429,15 @@ vm_page_domain_init(struct vm_domain *vmd) vm_offset_t vm_page_startup(vm_offset_t vaddr) { - vm_offset_t mapped; - vm_paddr_t high_avail, low_avail, page_range, size; - vm_paddr_t new_end; - int i; - vm_paddr_t pa; - vm_paddr_t last_pa; + struct vm_domain *vmd; + struct vm_phys_seg *seg; + vm_page_t m; char *list, *listend; - vm_paddr_t end; - vm_paddr_t biggestsize; - int biggestone; - int pages_per_zone; + vm_offset_t mapped; + vm_paddr_t end, high_avail, low_avail, new_end, page_range, size; + vm_paddr_t biggestsize, last_pa, pa; + u_long pagecount; + int biggestone, i, pages_per_zone, segind; biggestsize = 0; biggestone = 0; @@ -519,6 +517,8 @@ vm_page_startup(vm_offset_t vaddr) vm_page_dump = (void *)(uintptr_t)pmap_map(&vaddr, new_end, new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE); bzero((void *)vm_page_dump, vm_page_dump_size); +#else + (void)last_pa; #endif #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) /* @@ -623,7 +623,9 @@ vm_page_startup(vm_offset_t vaddr) new_end = trunc_page(end - page_range * sizeof(struct vm_page)); mapped = pmap_map(&vaddr, new_end, end, VM_PROT_READ | VM_PROT_WRITE); - vm_page_array = (vm_page_t) mapped; + vm_page_array = (vm_page_t)mapped; + vm_page_array_size = page_range; + #if VM_NRESERVLEVEL > 0 /* * Allocate physical memory for the reservation management system's @@ -650,33 +652,52 @@ vm_page_startup(vm_offset_t vaddr) vm_phys_add_seg(phys_avail[i], phys_avail[i + 1]); /* - * Clear all of the page structures - */ - bzero((caddr_t) vm_page_array, page_range * sizeof(struct vm_page)); - for (i = 0; i < page_range; i++) - vm_page_array[i].order = VM_NFREEORDER; - vm_page_array_size = page_range; - - /* * Initialize the physical memory allocator. */ vm_phys_init(); /* - * Add every available physical page that is not blacklisted to - * the free lists. + * Initialize the page structures and add every available page to the + * physical memory allocator's free lists. */ vm_cnt.v_page_count = 0; vm_cnt.v_free_count = 0; - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - pa = phys_avail[i]; - last_pa = phys_avail[i + 1]; - while (pa < last_pa) { - vm_phys_add_page(pa); - pa += PAGE_SIZE; + for (segind = 0; segind < vm_phys_nsegs; segind++) { + seg = &vm_phys_segs[segind]; + for (pa = seg->start; pa < seg->end; pa += PAGE_SIZE) + vm_phys_init_page(pa); + + /* + * Add the segment to the free lists only if it is covered by + * one of the ranges in phys_avail. Because we've added the + * ranges to the vm_phys_segs array, we can assume that each + * segment is either entirely contained in one of the ranges, + * or doesn't overlap any of them. + */ + for (i = 0; phys_avail[i + 1] != 0; i += 2) { + if (seg->start < phys_avail[i] || + seg->end > phys_avail[i + 1]) + continue; + + m = seg->first_page; + pagecount = (u_long)atop(seg->end - seg->start); + + mtx_lock(&vm_page_queue_free_mtx); + vm_phys_free_contig(m, pagecount); + vm_phys_freecnt_adj(m, (int)pagecount); + mtx_unlock(&vm_page_queue_free_mtx); + vm_cnt.v_page_count += (u_int)pagecount; + + vmd = &vm_dom[seg->domain]; + vmd->vmd_page_count += (u_int)pagecount; + vmd->vmd_segs |= 1UL << m->segind; + break; } } + /* + * Remove blacklisted pages from the physical memory allocator. + */ TAILQ_INIT(&blacklist_head); vm_page_blacklist_load(&list, &listend); vm_page_blacklist_check(list, listend); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Sep 7 21:33:27 2017 (r323289) +++ head/sys/vm/vm_phys.c Thu Sep 7 21:43:39 2017 (r323290) @@ -729,32 +729,28 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_f } /* - * Initialize a physical page and add it to the free lists. + * Initialize a physical page in preparation for adding it to the free + * lists. */ void -vm_phys_add_page(vm_paddr_t pa) +vm_phys_init_page(vm_paddr_t pa) { vm_page_t m; - struct vm_domain *vmd; - vm_cnt.v_page_count++; m = vm_phys_paddr_to_vm_page(pa); + m->object = NULL; + m->wire_count = 0; m->busy_lock = VPB_UNBUSIED; + m->hold_count = 0; + m->flags = m->aflags = m->oflags = 0; m->phys_addr = pa; m->queue = PQ_NONE; + m->psind = 0; m->segind = vm_phys_paddr_to_segind(pa); - vmd = vm_phys_domain(m); - vmd->vmd_page_count++; - vmd->vmd_segs |= 1UL << m->segind; - KASSERT(m->order == VM_NFREEORDER, - ("vm_phys_add_page: page %p has unexpected order %d", - m, m->order)); + m->order = VM_NFREEORDER; m->pool = VM_FREEPOOL_DEFAULT; + m->valid = m->dirty = 0; pmap_page_init(m); - mtx_lock(&vm_page_queue_free_mtx); - vm_phys_freecnt_adj(m, 1); - vm_phys_free_pages(m, 0); - mtx_unlock(&vm_page_queue_free_mtx); } /* @@ -910,6 +906,7 @@ vm_phys_fictitious_init_range(vm_page_t range, vm_padd { long i; + bzero(range, page_count * sizeof(*range)); for (i = 0; i < page_count; i++) { vm_page_initfake(&range[i], start + PAGE_SIZE * i, memattr); range[i].oflags &= ~VPO_UNMANAGED; @@ -984,7 +981,7 @@ vm_phys_fictitious_reg_range(vm_paddr_t start, vm_padd alloc: #endif fp = malloc(page_count * sizeof(struct vm_page), M_FICT_PAGES, - M_WAITOK | M_ZERO); + M_WAITOK); #ifdef VM_PHYSSEG_DENSE } #endif Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Thu Sep 7 21:33:27 2017 (r323289) +++ head/sys/vm/vm_phys.h Thu Sep 7 21:43:39 2017 (r323290) @@ -69,7 +69,6 @@ extern int vm_phys_nsegs; /* * The following functions are only to be used by the virtual memory system. */ -void vm_phys_add_page(vm_paddr_t pa); void vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end); vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); @@ -83,6 +82,7 @@ vm_page_t vm_phys_fictitious_to_vm_page(vm_paddr_t pa) void vm_phys_free_contig(vm_page_t m, u_long npages); void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); +void vm_phys_init_page(vm_paddr_t pa); vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa); vm_page_t vm_phys_scan_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); From owner-svn-src-head@freebsd.org Fri Sep 8 01:06:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AB1CE1CC78; Fri, 8 Sep 2017 01:06:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id AD590642F1; Fri, 8 Sep 2017 01:06:36 +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 v8816Z9h041335; Fri, 8 Sep 2017 01:06:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8816ZsY041334; Fri, 8 Sep 2017 01:06:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709080106.v8816ZsY041334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 8 Sep 2017 01:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323295 - 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: 323295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 01:06:37 -0000 Author: cem Date: Fri Sep 8 01:06:35 2017 New Revision: 323295 URL: https://svnweb.freebsd.org/changeset/base/323295 Log: mca: Fix printf types from r323289 on i386 Reported by: Michael Butler Sponsored by: Dell EMC Isilon Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Fri Sep 8 00:11:58 2017 (r323294) +++ head/sys/x86/x86/mca.c Fri Sep 8 01:06:35 2017 (r323295) @@ -982,13 +982,14 @@ amd_thresholding_init(void) misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); if ((misc & (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) != (MC_MISC_AMDNB_VAL | MC_MISC_AMDNB_CNTP)) { - printf("%s: 0x%lx: !valid | !present\n", __func__, misc); + printf("%s: 0x%jx: !valid | !present\n", __func__, + (uintmax_t)misc); return; } /* The register should not be locked. */ if ((misc & MC_MISC_AMDNB_LOCK) != 0) { - printf("%s: 0x%lx: locked\n", __func__, misc); + printf("%s: 0x%jx: locked\n", __func__, (uintmax_t)misc); return; } @@ -997,7 +998,8 @@ amd_thresholding_init(void) * has already claimed it. */ if ((misc & MC_MISC_AMDNB_CNTEN) != 0) { - printf("%s: 0x%lx: count already enabled\n", __func__, misc); + printf("%s: 0x%jx: count already enabled\n", __func__, + (uintmax_t)misc); return; } From owner-svn-src-head@freebsd.org Fri Sep 8 06:46:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C1EE0747C; Fri, 8 Sep 2017 06:46:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B49896D44B; Fri, 8 Sep 2017 06:46:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v886k2h9081797; Fri, 8 Sep 2017 06:46:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v886k23Z081796; Fri, 8 Sep 2017 06:46:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709080646.v886k23Z081796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Sep 2017 06:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323305 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 06:46:04 -0000 Author: mjg Date: Fri Sep 8 06:46:02 2017 New Revision: 323305 URL: https://svnweb.freebsd.org/changeset/base/323305 Log: Annotate global process locks with __exclusive_cache_line MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Sep 8 04:51:16 2017 (r323304) +++ head/sys/kern/kern_proc.c Fri Sep 8 06:46:02 2017 (r323305) @@ -131,9 +131,9 @@ struct pgrphashhead *pgrphashtbl; u_long pgrphash; struct proclist allproc; struct proclist zombproc; -struct sx allproc_lock; -struct sx proctree_lock; -struct mtx ppeers_lock; +struct sx __exclusive_cache_line allproc_lock; +struct sx __exclusive_cache_line proctree_lock; +struct mtx __exclusive_cache_line ppeers_lock; uma_zone_t proc_zone; /* From owner-svn-src-head@freebsd.org Fri Sep 8 06:46:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A057E074D3; Fri, 8 Sep 2017 06:46:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9BE506D5A0; Fri, 8 Sep 2017 06:46:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v886kOv3081860; Fri, 8 Sep 2017 06:46:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v886kOJI081859; Fri, 8 Sep 2017 06:46:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709080646.v886kOJI081859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Sep 2017 06:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323306 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 06:46:26 -0000 Author: mjg Date: Fri Sep 8 06:46:24 2017 New Revision: 323306 URL: https://svnweb.freebsd.org/changeset/base/323306 Log: Annotate Giant with __exclusive_cache_line Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Sep 8 06:46:02 2017 (r323305) +++ head/sys/kern/kern_mutex.c Fri Sep 8 06:46:24 2017 (r323306) @@ -166,7 +166,7 @@ LOCK_DELAY_SYSINIT_DEFAULT(mtx_spin_delay); * System-wide mutexes */ struct mtx blocked_lock; -struct mtx Giant; +struct mtx __exclusive_cache_line Giant; void assert_mtx(const struct lock_object *lock, int what) From owner-svn-src-head@freebsd.org Fri Sep 8 06:51:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DA9E07822; Fri, 8 Sep 2017 06:51:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8E45F6E5F1; Fri, 8 Sep 2017 06:51:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v886pXCO082123; Fri, 8 Sep 2017 06:51:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v886pXfp082122; Fri, 8 Sep 2017 06:51:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709080651.v886pXfp082122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Sep 2017 06:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323307 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 06:51:35 -0000 Author: mjg Date: Fri Sep 8 06:51:33 2017 New Revision: 323307 URL: https://svnweb.freebsd.org/changeset/base/323307 Log: namecache: factor out dot lookup into a dedicated function The intent is to move uncommon cases out of the way. MFC after: 1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 8 06:46:24 2017 (r323306) +++ head/sys/kern/vfs_cache.c Fri Sep 8 06:51:33 2017 (r323307) @@ -1073,6 +1073,42 @@ cache_lookup_unlock(struct rwlock *blp, struct mtx *vl } } +static int __noinline +cache_lookup_dot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, + struct timespec *tsp, int *ticksp) +{ + int ltype; + + *vpp = dvp; + CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .", + dvp, cnp->cn_nameptr); + counter_u64_add(dothits, 1); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp); + if (tsp != NULL) + timespecclear(tsp); + if (ticksp != NULL) + *ticksp = ticks; + vrefact(*vpp); + /* + * When we lookup "." we still can be asked to lock it + * differently... + */ + ltype = cnp->cn_lkflags & LK_TYPE_MASK; + if (ltype != VOP_ISLOCKED(*vpp)) { + if (ltype == LK_EXCLUSIVE) { + vn_lock(*vpp, LK_UPGRADE | LK_RETRY); + if ((*vpp)->v_iflag & VI_DOOMED) { + /* forced unmount */ + vrele(*vpp); + *vpp = NULL; + return (ENOENT); + } + } else + vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY); + } + return (-1); +} + /* * Lookup an entry in the cache * @@ -1111,36 +1147,8 @@ retry: counter_u64_add(numcalls, 1); if (cnp->cn_nameptr[0] == '.') { - if (cnp->cn_namelen == 1) { - *vpp = dvp; - CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .", - dvp, cnp->cn_nameptr); - counter_u64_add(dothits, 1); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp); - if (tsp != NULL) - timespecclear(tsp); - if (ticksp != NULL) - *ticksp = ticks; - vrefact(*vpp); - /* - * When we lookup "." we still can be asked to lock it - * differently... - */ - ltype = cnp->cn_lkflags & LK_TYPE_MASK; - if (ltype != VOP_ISLOCKED(*vpp)) { - if (ltype == LK_EXCLUSIVE) { - vn_lock(*vpp, LK_UPGRADE | LK_RETRY); - if ((*vpp)->v_iflag & VI_DOOMED) { - /* forced unmount */ - vrele(*vpp); - *vpp = NULL; - return (ENOENT); - } - } else - vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY); - } - return (-1); - } + if (cnp->cn_namelen == 1) + return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp)); if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { counter_u64_add(dotdothits, 1); dvlp2 = NULL; From owner-svn-src-head@freebsd.org Fri Sep 8 06:57:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08D42E07AFE; Fri, 8 Sep 2017 06:57:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7B25D6FCDD; Fri, 8 Sep 2017 06:57:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v886vBSD086387; Fri, 8 Sep 2017 06:57:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v886vBaF086386; Fri, 8 Sep 2017 06:57:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709080657.v886vBaF086386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Sep 2017 06:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323308 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 06:57:13 -0000 Author: mjg Date: Fri Sep 8 06:57:11 2017 New Revision: 323308 URL: https://svnweb.freebsd.org/changeset/base/323308 Log: namecache: fold the unlock label into the only consumer No functional changes. MFC after: 1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 8 06:51:33 2017 (r323307) +++ head/sys/kern/vfs_cache.c Fri Sep 8 06:57:11 2017 (r323308) @@ -1224,7 +1224,8 @@ retry_dotdot: } else { counter_u64_add(nummiss, 1); } - goto unlock; + cache_lookup_unlock(blp, dvlp); + return (0); } /* We don't want to have an entry, so dump it */ @@ -1294,10 +1295,6 @@ success: ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); } return (-1); - -unlock: - cache_lookup_unlock(blp, dvlp); - return (0); zap_and_exit: if (blp != NULL) From owner-svn-src-head@freebsd.org Fri Sep 8 08:02:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E8BE09C10; Fri, 8 Sep 2017 08:02:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7E3F81CDB; Fri, 8 Sep 2017 08:02:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v888268o012634; Fri, 8 Sep 2017 08:02:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88826LG012633; Fri, 8 Sep 2017 08:02:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201709080802.v88826LG012633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 8 Sep 2017 08:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323309 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 323309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 08:02:08 -0000 Author: andrew Date: Fri Sep 8 08:02:06 2017 New Revision: 323309 URL: https://svnweb.freebsd.org/changeset/base/323309 Log: Not all CPUs handle reading ID_AA64MMFR2_EL1 (e.g. qemu), disable it for now. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Fri Sep 8 06:57:11 2017 (r323308) +++ head/sys/arm64/arm64/identcpu.c Fri Sep 8 08:02:06 2017 (r323309) @@ -897,7 +897,11 @@ identify_cpu(void) cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(ID_AA64ISAR1_EL1); cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(ID_AA64MMFR0_EL1); cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1); +#ifdef NOTYET cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1); +#else + cpu_desc[cpu].id_aa64mmfr2 = 0; +#endif cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(ID_AA64PFR0_EL1); cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(ID_AA64PFR1_EL1); From owner-svn-src-head@freebsd.org Fri Sep 8 10:39:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CA68E10007; Fri, 8 Sep 2017 10:39:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id B666A823FD; Fri, 8 Sep 2017 10:39:29 +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 v88AdS5p075320; Fri, 8 Sep 2017 10:39:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88AdS4d075319; Fri, 8 Sep 2017 10:39:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081039.v88AdS4d075319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 10:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323310 - head/sys/x86/pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/pci X-SVN-Commit-Revision: 323310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 10:39:30 -0000 Author: kib Date: Fri Sep 8 10:39:28 2017 New Revision: 323310 URL: https://svnweb.freebsd.org/changeset/base/323310 Log: Consistently use tabs for indent. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/pci/qpi.c Modified: head/sys/x86/pci/qpi.c ============================================================================== --- head/sys/x86/pci/qpi.c Fri Sep 8 08:02:06 2017 (r323309) +++ head/sys/x86/pci/qpi.c Fri Sep 8 10:39:28 2017 (r323310) @@ -64,15 +64,15 @@ static void qpi_identify(driver_t *driver, device_t parent) { - /* Check CPUID to ensure this is an i7 CPU of some sort. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL && + /* Check CPUID to ensure this is an i7 CPU of some sort. */ + if (!(cpu_vendor_id == CPU_VENDOR_INTEL && CPUID_TO_FAMILY(cpu_id) == 0x6 && (CPUID_TO_MODEL(cpu_id) == 0x1a || CPUID_TO_MODEL(cpu_id) == 0x2c))) - return; + return; - /* PCI config register access is required. */ - if (pci_cfgregopen() == 0) - return; + /* PCI config register access is required. */ + if (pci_cfgregopen() == 0) + return; /* Add a qpi bus device. */ if (BUS_ADD_CHILD(parent, 20, "qpi", -1) == NULL) @@ -219,7 +219,7 @@ qpi_pcib_attach(device_t dev) { device_add_child(dev, "pci", -1); - return (bus_generic_attach(dev)); + return (bus_generic_attach(dev)); } static int From owner-svn-src-head@freebsd.org Fri Sep 8 12:14:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D682BE14DD8; Fri, 8 Sep 2017 12:14:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A70071E17; Fri, 8 Sep 2017 12:14:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [50.235.236.73]) by mail.baldwin.cx (Postfix) with ESMTPSA id F256A10A7DB; Fri, 8 Sep 2017 08:14:26 -0400 (EDT) Subject: Re: svn commit: r323254 - head/sys/compat/freebsd32 To: Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709070429.v874Tvom033960@repo.freebsd.org> From: John Baldwin Message-ID: <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> Date: Fri, 8 Sep 2017 08:14:26 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201709070429.v874Tvom033960@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 08 Sep 2017 08:14:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 12:14:29 -0000 On 9/7/17 12:29 AM, Maxim Sobolev wrote: > Author: sobomax > Date: Thu Sep 7 04:29:57 2017 > New Revision: 323254 > URL: https://svnweb.freebsd.org/changeset/base/323254 > > Log: > In the recvmsg32() system call iterate over returned structure(s) > and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, > SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit > representation. Otherwise we either run out of user-supplied > buffer to copy those out resulting in the MSG_CTRUNC or simply > return values that the userland 32-bit code is not going > to parse correctly. This fixes at least two regression tests > failing to function properly in 32-bit compat mode: > > tools/regression/sockets/udp_pingpong > tools/regression/sockets/unix_cmsg > > PR: kern/222039 > MFC after: 30 days Is this correct on !amd64? Other 32-bit platforms use a 64-bit time_t (note the time32_t type defined earlier in freebsd32.h). struct bintime32 should use time32_t for the seconds field, not uint32_t. I think that will be sufficient to make this correct on !amd64 (it also means that bintime32 == bintime on !amd64 so you could perhaps use a simpler BT_CP for !amd64, but the existing one is probably ok). -- John Baldwin From owner-svn-src-head@freebsd.org Fri Sep 8 14:54:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89F2E1C294; Fri, 8 Sep 2017 14:54:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87FFD82425; Fri, 8 Sep 2017 14:54:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88Es739081210; Fri, 8 Sep 2017 14:54:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88Es77u081209; Fri, 8 Sep 2017 14:54:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081454.v88Es77u081209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 14:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323312 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 323312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 14:54:08 -0000 Author: kib Date: Fri Sep 8 14:54:07 2017 New Revision: 323312 URL: https://svnweb.freebsd.org/changeset/base/323312 Log: Fix malloc() uses in em_get_regs(). Do not use malloc(M_NOWAIT), wait is possible there, and the malloc failures where not checked. Do not forget to free malloced memory. Reported and tested by: pho Approved by: sbruno Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Sep 8 14:35:17 2017 (r323311) +++ head/sys/dev/e1000/if_em.c Fri Sep 8 14:54:07 2017 (r323312) @@ -534,22 +534,26 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS) { struct adapter *adapter = (struct adapter *)arg1; struct e1000_hw *hw = &adapter->hw; - struct sbuf *sb; - u32 *regs_buff = (u32 *)malloc(sizeof(u32) * IGB_REGS_LEN, M_DEVBUF, M_NOWAIT); + u32 *regs_buff; int rc; + regs_buff = malloc(sizeof(u32) * IGB_REGS_LEN, M_DEVBUF, M_WAITOK); memset(regs_buff, 0, IGB_REGS_LEN * sizeof(u32)); rc = sysctl_wire_old_buffer(req, 0); MPASS(rc == 0); - if (rc != 0) + if (rc != 0) { + free(regs_buff, M_DEVBUF); return (rc); + } sb = sbuf_new_for_sysctl(NULL, NULL, 32*400, req); MPASS(sb != NULL); - if (sb == NULL) + if (sb == NULL) { + free(regs_buff, M_DEVBUF); return (ENOMEM); + } /* General Registers */ regs_buff[0] = E1000_READ_REG(hw, E1000_CTRL); @@ -604,6 +608,8 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "\tTDFT\t %08x\n", regs_buff[19]); sbuf_printf(sb, "\tTDFHS\t %08x\n", regs_buff[20]); sbuf_printf(sb, "\tTDFPC\t %08x\n\n", regs_buff[21]); + + free(regs_buff, M_DEVBUF); #ifdef DUMP_DESCS { From owner-svn-src-head@freebsd.org Fri Sep 8 15:04:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283E3E1CAB3 for ; Fri, 8 Sep 2017 15:04:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from bat.oak.relay.mailchannels.net (bat.oak.relay.mailchannels.net [23.83.215.13]) (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 DB37182C31 for ; Fri, 8 Sep 2017 15:04:49 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ED3DA2008A8 for ; Fri, 8 Sep 2017 14:56:46 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.134.127]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id 4C203200F61 for ; Fri, 8 Sep 2017 14:56:46 +0000 (UTC) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.20.63.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.14); Fri, 08 Sep 2017 14:56:46 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: _forwarded-from|73.78.92.27 X-MailChannels-Auth-Id: duocircle X-Reign-Celery: 6d6e61982e5c05df_1504882606746_1108520393 X-MC-Loop-Signature: 1504882606746:3878035952 X-MC-Ingress-Time: 1504882606745 X-MHO-User: ec16db91-94a5-11e7-83af-a91f44540cb3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id ec16db91-94a5-11e7-83af-a91f44540cb3; Fri, 08 Sep 2017 14:56:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v88Euc4u001239; Fri, 8 Sep 2017 08:56:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1504882598.32063.3.camel@freebsd.org> Subject: Re: svn commit: r323254 - head/sys/compat/freebsd32 From: Ian Lepore To: John Baldwin , Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 08 Sep 2017 08:56:38 -0600 In-Reply-To: <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> References: <201709070429.v874Tvom033960@repo.freebsd.org> <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 15:04:50 -0000 On Fri, 2017-09-08 at 08:14 -0400, John Baldwin wrote: > On 9/7/17 12:29 AM, Maxim Sobolev wrote: > >=20 > > Author: sobomax > > Date: Thu Sep=A0=A07 04:29:57 2017 > > New Revision: 323254 > > URL: https://svnweb.freebsd.org/changeset/base/323254 > >=20 > > Log: > > =A0 In the recvmsg32() system call iterate over returned structure(s) > > =A0 and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, > > =A0 SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit > > =A0 representation. Otherwise we either run out of user-supplied > > =A0 buffer to copy those out resulting in the MSG_CTRUNC or simply > > =A0 return values that the userland 32-bit code is not going > > =A0 to parse correctly. This fixes at least two regression tests > > =A0 failing to function properly in 32-bit compat mode: > > =A0=A0 > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/udp_pingpong > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/unix_cmsg > > =A0=A0 > > =A0 PR:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0kern/222039 > > =A0 MFC after: 30 days > Is this correct on !amd64?=A0=A0Other 32-bit platforms use a 64-bit tim= e_t > (note the time32_t type defined earlier in freebsd32.h).=A0=A0struct bi= ntime32 > should use time32_t for the seconds field, not uint32_t.=A0=A0I think t= hat > will be sufficient to make this correct on !amd64 (it also means that > bintime32 =3D=3D bintime on !amd64 so you could perhaps use a simpler B= T_CP > for !amd64, but the existing one is probably ok). >=20 The existing one now does *(uint64_t *) on a value that's only aligned to a 32-bit boundary. =A0That will work in practice because only i386 has a 32-bit time_t that will use this code, and it's not a strict- alignment platform. =A0It may still cause compiler warnings about alignment. -- Ian From owner-svn-src-head@freebsd.org Fri Sep 8 15:08:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5B5E1CD49; Fri, 8 Sep 2017 15:08:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1A40382D1D; Fri, 8 Sep 2017 15:08:19 +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 v88F8IEc085348; Fri, 8 Sep 2017 15:08:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88F8IaB085346; Fri, 8 Sep 2017 15:08:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709081508.v88F8IaB085346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 8 Sep 2017 15:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323314 - in head/sbin/geom: class/virstor misc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sbin/geom: class/virstor misc X-SVN-Commit-Revision: 323314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 15:08:19 -0000 Author: cem Date: Fri Sep 8 15:08:17 2017 New Revision: 323314 URL: https://svnweb.freebsd.org/changeset/base/323314 Log: Audit userspace geom code for leaking memory to disk Any geom class using g_metadata_store, as well as geom_virstor which duplicated g_metadata_store internally, would dump sectorsize - mdsize bytes of userspace memory following the metadata block stored. This is most or all geom classes (gcache, gconcat, geli, gjournal, glabel, gmirror, gmultipath, graid3, gshsec, gstripe, and geom_virstor). PR: 222077 (comment #3) Reported by: Maxim Khitrov Reviewed by: des Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12269 Modified: head/sbin/geom/class/virstor/geom_virstor.c head/sbin/geom/misc/subr.c Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Fri Sep 8 14:56:26 2017 (r323313) +++ head/sbin/geom/class/virstor/geom_virstor.c Fri Sep 8 15:08:17 2017 (r323314) @@ -183,6 +183,7 @@ my_g_metadata_store(const char *name, u_char *md, size goto out; } bcopy(md, sector, size); + bzero(sector + size, sectorsize - size); if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) != (ssize_t)sectorsize) { error = errno; Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Fri Sep 8 14:56:26 2017 (r323313) +++ head/sbin/geom/misc/subr.c Fri Sep 8 15:08:17 2017 (r323314) @@ -302,6 +302,7 @@ g_metadata_store(const char *name, const unsigned char goto out; } bcopy(md, sector, size); + bzero(sector + size, sectorsize - size); if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) != sectorsize) { error = errno; From owner-svn-src-head@freebsd.org Fri Sep 8 15:38:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B602E1E638; Fri, 8 Sep 2017 15:38:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 150E283E37; Fri, 8 Sep 2017 15:38:04 +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 v88Fc3dk097491; Fri, 8 Sep 2017 15:38:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88Fc3re097490; Fri, 8 Sep 2017 15:38:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709081538.v88Fc3re097490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 8 Sep 2017 15:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323315 - head/sbin/geom/class/virstor X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/geom/class/virstor X-SVN-Commit-Revision: 323315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 15:38:04 -0000 Author: cem Date: Fri Sep 8 15:38:02 2017 New Revision: 323315 URL: https://svnweb.freebsd.org/changeset/base/323315 Log: geom_virstor: Remove wholly unnecessary g_metadata_store copy Just code cleanup. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sbin/geom/class/virstor/geom_virstor.c Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Fri Sep 8 15:08:17 2017 (r323314) +++ head/sbin/geom/class/virstor/geom_virstor.c Fri Sep 8 15:38:02 2017 (r323315) @@ -140,62 +140,6 @@ virstor_main(struct gctl_req *req, unsigned flags) */ } -static void -pathgen(const char *name, char *path, size_t size) -{ - - if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) != 0) - snprintf(path, size, "%s%s", _PATH_DEV, name); - else - strlcpy(path, name, size); -} - -static int -my_g_metadata_store(const char *name, u_char *md, size_t size) -{ - char path[MAXPATHLEN]; - unsigned sectorsize; - off_t mediasize; - u_char *sector; - int error, fd; - - pathgen(name, path, sizeof(path)); - sector = NULL; - error = 0; - - fd = open(path, O_RDWR); - if (fd == -1) - return (errno); - mediasize = g_get_mediasize(name); - if (mediasize == 0) { - error = errno; - goto out; - } - sectorsize = g_get_sectorsize(name); - if (sectorsize == 0) { - error = errno; - goto out; - } - assert(sectorsize >= size); - sector = malloc(sectorsize); - if (sector == NULL) { - error = ENOMEM; - goto out; - } - bcopy(md, sector, size); - bzero(sector + size, sectorsize - size); - if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) != - (ssize_t)sectorsize) { - error = errno; - goto out; - } -out: - if (sector != NULL) - free(sector); - close(fd); - return (error); -} - /* * Labels a new geom Meaning: parses and checks the parameters, calculates & * writes metadata to the relevant providers so when the next round of @@ -465,7 +409,7 @@ virstor_label(struct gctl_req *req) err(1, "Cannot allocate sector of %zu bytes", ssize); bzero(sect, ssize); virstor_metadata_encode(&md, sect); - error = my_g_metadata_store(name, sect, ssize); + error = g_metadata_store(name, sect, ssize); free(sect); if (error != 0) { if (verbose) From owner-svn-src-head@freebsd.org Fri Sep 8 15:44:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1357CE1EBFB; Fri, 8 Sep 2017 15:44:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id D5C0E376; Fri, 8 Sep 2017 15:44:53 +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 v88Fiqv5001395; Fri, 8 Sep 2017 15:44:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88FiqbX001394; Fri, 8 Sep 2017 15:44:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709081544.v88FiqbX001394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 8 Sep 2017 15:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323316 - head/lib/libgeom X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libgeom X-SVN-Commit-Revision: 323316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 15:44:54 -0000 Author: cem Date: Fri Sep 8 15:44:52 2017 New Revision: 323316 URL: https://svnweb.freebsd.org/changeset/base/323316 Log: libgeom: Remove redundant and duplicated code In g_open(), g_device_path_open(). No functional change. Sponsored by: Dell EMC Isilon Modified: head/lib/libgeom/geom_util.c Modified: head/lib/libgeom/geom_util.c ============================================================================== --- head/lib/libgeom/geom_util.c Fri Sep 8 15:38:02 2017 (r323315) +++ head/lib/libgeom/geom_util.c Fri Sep 8 15:44:52 2017 (r323316) @@ -56,8 +56,6 @@ g_open(const char *name, int dowrite) path = g_device_path_open(name, &fd, dowrite); if (path != NULL) free(path); - if (fd == -1) - return (-1); return (fd); } @@ -281,58 +279,45 @@ g_device_path_open(const char *devpath, int *fdp, int /* Make sure that we can fail. */ if (fdp != NULL) *fdp = -1; + /* Use the device node if we're able to open it. */ - do { - fd = open(devpath, dowrite ? O_RDWR : O_RDONLY); - if (fd == -1) - break; - /* - * Let try to get sectorsize, which will prove it is a GEOM - * provider. - */ - if (g_sectorsize(fd) == -1) { - close(fd); - errno = EFTYPE; - return (NULL); - } + fd = open(devpath, dowrite ? O_RDWR : O_RDONLY); + if (fd != -1) { if ((path = strdup(devpath)) == NULL) { close(fd); return (NULL); } - if (fdp != NULL) - *fdp = fd; - else - close(fd); - return (path); - } while (0); + goto fd_ok; + } /* If we're not given an absolute path, assume /dev/ prefix. */ - if (*devpath != '/') { - asprintf(&path, "%s%s", _PATH_DEV, devpath); - if (path == NULL) - return (NULL); - fd = open(path, dowrite ? O_RDWR : O_RDONLY); - if (fd == -1) { - free(path); - return (NULL); - } - /* - * Let try to get sectorsize, which will prove it is a GEOM - * provider. - */ - if (g_sectorsize(fd) == -1) { - free(path); - close(fd); - errno = EFTYPE; - return (NULL); - } - if (fdp != NULL) - *fdp = fd; - else - close(fd); - return (path); + if (*devpath == '/') + return (NULL); + + asprintf(&path, "%s%s", _PATH_DEV, devpath); + if (path == NULL) + return (NULL); + fd = open(path, dowrite ? O_RDWR : O_RDONLY); + if (fd == -1) { + free(path); + return (NULL); } - return (NULL); + +fd_ok: + /* + * Let try to get sectorsize, which will prove it is a GEOM provider. + */ + if (g_sectorsize(fd) == -1) { + free(path); + close(fd); + errno = EFTYPE; + return (NULL); + } + if (fdp != NULL) + *fdp = fd; + else + close(fd); + return (path); } char * From owner-svn-src-head@freebsd.org Fri Sep 8 16:53:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D92E22313; Fri, 8 Sep 2017 16:53:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 922BF2D42; Fri, 8 Sep 2017 16:53:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88Gqxfu029386; Fri, 8 Sep 2017 16:52:59 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88GqxZE029385; Fri, 8 Sep 2017 16:52:59 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709081652.v88GqxZE029385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 8 Sep 2017 16:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323317 - head/sys/dev/aac X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/aac X-SVN-Commit-Revision: 323317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 16:53:00 -0000 Author: scottl Date: Fri Sep 8 16:52:59 2017 New Revision: 323317 URL: https://svnweb.freebsd.org/changeset/base/323317 Log: Move the intrhook release to later in the function so that GEOM knows to wait longer for possible root devices to come online. This fixes a race that seems to be triggered by EARLY_AP_STARTUP. Submitted by: cgull@glup.org Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Fri Sep 8 15:44:52 2017 (r323316) +++ head/sys/dev/aac/aac.c Fri Sep 8 16:52:59 2017 (r323317) @@ -418,9 +418,6 @@ aac_startup(void *arg) sc = (struct aac_softc *)arg; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - /* disconnect ourselves from the intrhook chain */ - config_intrhook_disestablish(&sc->aac_ich); - mtx_lock(&sc->aac_io_lock); aac_alloc_sync_fib(sc, &fib); @@ -437,12 +434,15 @@ aac_startup(void *arg) aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); + /* mark the controller up */ + sc->aac_state &= ~AAC_STATE_SUSPEND; + /* poke the bus to actually attach the child devices */ if (bus_generic_attach(sc->aac_dev)) device_printf(sc->aac_dev, "bus_generic_attach failed\n"); - /* mark the controller up */ - sc->aac_state &= ~AAC_STATE_SUSPEND; + /* disconnect ourselves from the intrhook chain */ + config_intrhook_disestablish(&sc->aac_ich); /* enable interrupts now */ AAC_UNMASK_INTERRUPTS(sc); From owner-svn-src-head@freebsd.org Fri Sep 8 17:10:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67712E22FFD; Fri, 8 Sep 2017 17:10:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 431AD34CC; Fri, 8 Sep 2017 17:10:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [50.235.236.73]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5D1A010A82E; Fri, 8 Sep 2017 13:10:30 -0400 (EDT) Subject: Re: svn commit: r323254 - head/sys/compat/freebsd32 To: Ian Lepore , Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709070429.v874Tvom033960@repo.freebsd.org> <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> <1504882598.32063.3.camel@freebsd.org> From: John Baldwin Message-ID: Date: Fri, 8 Sep 2017 13:10:29 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1504882598.32063.3.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 08 Sep 2017 13:10:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 17:10:32 -0000 On 9/8/17 10:56 AM, Ian Lepore wrote: > On Fri, 2017-09-08 at 08:14 -0400, John Baldwin wrote: >> On 9/7/17 12:29 AM, Maxim Sobolev wrote: >>> >>> Author: sobomax >>> Date: Thu Sep  7 04:29:57 2017 >>> New Revision: 323254 >>> URL: https://svnweb.freebsd.org/changeset/base/323254 >>> >>> Log: >>>   In the recvmsg32() system call iterate over returned structure(s) >>>   and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, >>>   SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit >>>   representation. Otherwise we either run out of user-supplied >>>   buffer to copy those out resulting in the MSG_CTRUNC or simply >>>   return values that the userland 32-bit code is not going >>>   to parse correctly. This fixes at least two regression tests >>>   failing to function properly in 32-bit compat mode: >>>    >>>       tools/regression/sockets/udp_pingpong >>>       tools/regression/sockets/unix_cmsg >>>    >>>   PR:             kern/222039 >>>   MFC after: 30 days >> Is this correct on !amd64?  Other 32-bit platforms use a 64-bit time_t >> (note the time32_t type defined earlier in freebsd32.h).  struct bintime32 >> should use time32_t for the seconds field, not uint32_t.  I think that >> will be sufficient to make this correct on !amd64 (it also means that >> bintime32 == bintime on !amd64 so you could perhaps use a simpler BT_CP >> for !amd64, but the existing one is probably ok). >> > > The existing one now does *(uint64_t *) on a value that's only aligned > to a 32-bit boundary.  That will work in practice because only i386 has > a 32-bit time_t that will use this code, and it's not a strict- > alignment platform.  It may still cause compiler warnings about > alignment. Mmmm, the code is used on ppc and mips as well (and mips will fault for unaligned access at least). However, once bintime32 is fixed to use time32_t I think the fraction will be 64-bit aligned? I would be fine with BT_CP() being an #ifdef though that just uses "(dst) = (src)" for !amd64. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Sep 8 17:40:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21E73E007CB; Fri, 8 Sep 2017 17:40:31 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E544063A40; Fri, 8 Sep 2017 17:40:30 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88HeUfC045684; Fri, 8 Sep 2017 17:40:30 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88HeUOJ045683; Fri, 8 Sep 2017 17:40:30 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709081740.v88HeUOJ045683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 8 Sep 2017 17:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323319 - head/sys/dev/amr X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/amr X-SVN-Commit-Revision: 323319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 17:40:31 -0000 Author: scottl Date: Fri Sep 8 17:40:29 2017 New Revision: 323319 URL: https://svnweb.freebsd.org/changeset/base/323319 Log: As with r323317, hold off on releasing the intrhook during boot until we're ready to accept probing from GEOM. Untested, but the pattern is the same as with aac. Modified: head/sys/dev/amr/amr.c Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Fri Sep 8 16:59:56 2017 (r323318) +++ head/sys/dev/amr/amr.c Fri Sep 8 17:40:29 2017 (r323319) @@ -302,11 +302,6 @@ amr_startup(void *arg) debug_called(1); - /* pull ourselves off the intrhook chain */ - if (sc->amr_ich.ich_func) - config_intrhook_disestablish(&sc->amr_ich); - sc->amr_ich.ich_func = NULL; - /* get up-to-date drive information */ if (amr_query_controller(sc)) { device_printf(sc->amr_dev, "can't scan controller for drives\n"); @@ -342,6 +337,11 @@ amr_startup(void *arg) /* interrupts will be enabled before we do anything more */ sc->amr_state |= AMR_STATE_INTEN; + + /* pull ourselves off the intrhook chain */ + if (sc->amr_ich.ich_func) + config_intrhook_disestablish(&sc->amr_ich); + sc->amr_ich.ich_func = NULL; return; } From owner-svn-src-head@freebsd.org Fri Sep 8 17:51:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 227B9E010CA; Fri, 8 Sep 2017 17:51:21 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E648564273; Fri, 8 Sep 2017 17:51:20 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88HpJb6052077; Fri, 8 Sep 2017 17:51:19 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88HpJBI052076; Fri, 8 Sep 2017 17:51:19 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709081751.v88HpJBI052076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 8 Sep 2017 17:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323320 - head/sys/dev/mfi X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mfi X-SVN-Commit-Revision: 323320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 17:51:21 -0000 Author: scottl Date: Fri Sep 8 17:51:19 2017 New Revision: 323320 URL: https://svnweb.freebsd.org/changeset/base/323320 Log: Fix intrhook release in MFI as well Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Sep 8 17:40:29 2017 (r323319) +++ head/sys/dev/mfi/mfi.c Fri Sep 8 17:51:19 2017 (r323320) @@ -1263,8 +1263,6 @@ mfi_startup(void *arg) sc = (struct mfi_softc *)arg; - config_intrhook_disestablish(&sc->mfi_ich); - sc->mfi_enable_intr(sc); sx_xlock(&sc->mfi_config_lock); mtx_lock(&sc->mfi_io_lock); @@ -1273,6 +1271,8 @@ mfi_startup(void *arg) mfi_syspdprobe(sc); mtx_unlock(&sc->mfi_io_lock); sx_xunlock(&sc->mfi_config_lock); + + config_intrhook_disestablish(&sc->mfi_ich); } static void From owner-svn-src-head@freebsd.org Fri Sep 8 18:03:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD25E01B50; Fri, 8 Sep 2017 18:03:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4477B64A79; Fri, 8 Sep 2017 18:03:36 +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 v88I3Z8P057854; Fri, 8 Sep 2017 18:03:35 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88I3Zeb057848; Fri, 8 Sep 2017 18:03:35 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709081803.v88I3Zeb057848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 8 Sep 2017 18:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323321 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 323321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 18:03:36 -0000 Author: shurd Date: Fri Sep 8 18:03:34 2017 New Revision: 323321 URL: https://svnweb.freebsd.org/changeset/base/323321 Log: Added support for displaying HW port stats using sysctl. This provides port stats (updated once per second) in dev.bnxt.X.port_stats for PFs. VFs do not have access to the port stats. Submitted by: Bhargava Chenna Marreddy Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D11914 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/bnxt_sysctl.c head/sys/dev/bnxt/bnxt_sysctl.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/bnxt.h Fri Sep 8 18:03:34 2017 (r323321) @@ -558,6 +558,7 @@ struct bnxt_softc { uint8_t max_tc; struct bnxt_cos_queue q_info[BNXT_MAX_QUEUE]; + uint64_t admin_ticks; struct iflib_dma_info hw_rx_port_stats; struct iflib_dma_info hw_tx_port_stats; struct rx_port_stats *rx_port_stats; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/bnxt_hwrm.c Fri Sep 8 18:03:34 2017 (r323321) @@ -820,6 +820,25 @@ fail: } int +bnxt_hwrm_port_qstats(struct bnxt_softc *softc) +{ + struct hwrm_port_qstats_input req = {0}; + int rc = 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS); + + req.port_id = htole16(softc->pf.port_id); + req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats.idi_paddr); + req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats.idi_paddr); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + BNXT_HWRM_UNLOCK(softc); + + return rc; +} + +int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/bnxt_hwrm.h Fri Sep 8 18:03:34 2017 (r323321) @@ -52,6 +52,7 @@ int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr); +int bnxt_hwrm_port_qstats(struct bnxt_softc *softc); int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp); int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); Modified: head/sys/dev/bnxt/bnxt_sysctl.c ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.c Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/bnxt_sysctl.c Fri Sep 8 18:03:34 2017 (r323321) @@ -164,6 +164,456 @@ bnxt_create_tx_sysctls(struct bnxt_softc *softc, int t } int +bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) +{ + struct sysctl_oid *oid; + char name[32]; + char desc[64]; + + sprintf(name, "port_stats"); + sprintf(desc, "Port Stats"); + oid = SYSCTL_ADD_NODE(&softc->hw_stats, + SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0, + desc); + if (!oid) + return ENOMEM; + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_64b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_64b_frames, "Transmitted 64b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_65b_127b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_65b_127b_frames, + "Transmitted 65b 127b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_128b_255b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_128b_255b_frames, + "Transmitted 128b 255b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_256b_511b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_256b_511b_frames, + "Transmitted 256b 511b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_512b_1023b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_512b_1023b_frames, + "Transmitted 512b 1023b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_1024b_1518_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_1024b_1518_frames, + "Transmitted 1024b 1518 frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_good_vlan_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_good_vlan_frames, + "Transmitted good vlan frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_1519b_2047_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_1519b_2047_frames, + "Transmitted 1519b 2047 frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_2048b_4095b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_2048b_4095b_frames, + "Transmitted 2048b 4095b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_4096b_9216b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_4096b_9216b_frames, + "Transmitted 4096b 9216b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_9217b_16383b_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_9217b_16383b_frames, + "Transmitted 9217b 16383b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_good_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_good_frames, "Transmitted good frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_total_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_total_frames, "Transmitted total frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_ucast_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_ucast_frames, "Transmitted ucast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_mcast_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_mcast_frames, "Transmitted mcast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bcast_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_bcast_frames, "Transmitted bcast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pause_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_pause_frames, "Transmitted pause frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_frames, "Transmitted pfc frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_jabber_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_jabber_frames, "Transmitted jabber frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_fcs_err_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_fcs_err_frames, + "Transmitted fcs err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_control_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_control_frames, + "Transmitted control frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_oversz_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_oversz_frames, "Transmitted oversz frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_single_dfrl_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_single_dfrl_frames, + "Transmitted single dfrl frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_multi_dfrl_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_multi_dfrl_frames, + "Transmitted multi dfrl frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_single_coll_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_single_coll_frames, + "Transmitted single coll frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_multi_coll_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_multi_coll_frames, + "Transmitted multi coll frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_late_coll_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_late_coll_frames, + "Transmitted late coll frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_excessive_coll_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_excessive_coll_frames, + "Transmitted excessive coll frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_frag_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_frag_frames, "Transmitted frag frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_err", CTLFLAG_RD, + &softc->tx_port_stats->tx_err, "Transmitted err"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_tagged_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_tagged_frames, "Transmitted tagged frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_dbl_tagged_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_dbl_tagged_frames, + "Transmitted dbl tagged frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_runt_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_runt_frames, "Transmitted runt frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_fifo_underruns", CTLFLAG_RD, + &softc->tx_port_stats->tx_fifo_underruns, + "Transmitted fifo underruns"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri0", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri0, + "Transmitted pfc ena frames pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri1", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri1, + "Transmitted pfc ena frames pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri2", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri2, + "Transmitted pfc ena frames pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri3", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri3, + "Transmitted pfc ena frames pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri4", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri4, + "Transmitted pfc ena frames pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri5", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri5, + "Transmitted pfc ena frames pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri6", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri6, + "Transmitted pfc ena frames pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_pfc_ena_frames_pri7", CTLFLAG_RD, + &softc->tx_port_stats->tx_pfc_ena_frames_pri7, + "Transmitted pfc ena frames pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_eee_lpi_events", CTLFLAG_RD, + &softc->tx_port_stats->tx_eee_lpi_events, + "Transmitted eee lpi events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_eee_lpi_duration", CTLFLAG_RD, + &softc->tx_port_stats->tx_eee_lpi_duration, + "Transmitted eee lpi duration"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_llfc_logical_msgs", CTLFLAG_RD, + &softc->tx_port_stats->tx_llfc_logical_msgs, + "Transmitted llfc logical msgs"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_hcfc_msgs", CTLFLAG_RD, + &softc->tx_port_stats->tx_hcfc_msgs, "Transmitted hcfc msgs"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_total_collisions", CTLFLAG_RD, + &softc->tx_port_stats->tx_total_collisions, + "Transmitted total collisions"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes", CTLFLAG_RD, + &softc->tx_port_stats->tx_bytes, "Transmitted bytes"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_xthol_frames", CTLFLAG_RD, + &softc->tx_port_stats->tx_xthol_frames, "Transmitted xthol frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_stat_discard", CTLFLAG_RD, + &softc->tx_port_stats->tx_stat_discard, "Transmitted stat discard"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_stat_error", CTLFLAG_RD, + &softc->tx_port_stats->tx_stat_error, "Transmitted stat error"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_64b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_64b_frames, "Received 64b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_65b_127b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_65b_127b_frames, "Received 65b 127b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_128b_255b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_128b_255b_frames, + "Received 128b 255b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_256b_511b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_256b_511b_frames, + "Received 256b 511b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_512b_1023b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_512b_1023b_frames, + "Received 512b 1023b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_1024b_1518_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_1024b_1518_frames, + "Received 1024b 1518 frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_good_vlan_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_good_vlan_frames, + "Received good vlan frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_1519b_2047b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_1519b_2047b_frames, + "Received 1519b 2047b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_2048b_4095b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_2048b_4095b_frames, + "Received 2048b 4095b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_4096b_9216b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_4096b_9216b_frames, + "Received 4096b 9216b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_9217b_16383b_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_9217b_16383b_frames, + "Received 9217b 16383b frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_total_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_total_frames, "Received total frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_ucast_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_ucast_frames, "Received ucast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_mcast_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_mcast_frames, "Received mcast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bcast_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_bcast_frames, "Received bcast frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_fcs_err_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_fcs_err_frames, "Received fcs err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_ctrl_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_ctrl_frames, "Received ctrl frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pause_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_pause_frames, "Received pause frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_frames, "Received pfc frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_unsupported_opcode_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_unsupported_opcode_frames, + "Received unsupported opcode frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_unsupported_da_pausepfc_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_unsupported_da_pausepfc_frames, + "Received unsupported da pausepfc frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_wrong_sa_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_wrong_sa_frames, + "Received wrong sa frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_align_err_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_align_err_frames, + "Received align err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_oor_len_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_oor_len_frames, + "Received oor len frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_code_err_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_code_err_frames, + "Received code err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_false_carrier_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_false_carrier_frames, + "Received false carrier frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_ovrsz_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_ovrsz_frames, + "Received ovrsz frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_jbr_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_jbr_frames, + "Received jbr frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_mtu_err_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_mtu_err_frames, + "Received mtu err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_match_crc_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_match_crc_frames, + "Received match crc frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_promiscuous_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_promiscuous_frames, + "Received promiscuous frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_tagged_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_tagged_frames, + "Received tagged frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_double_tagged_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_double_tagged_frames, + "Received double tagged frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_trunc_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_trunc_frames, + "Received trunc frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_good_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_good_frames, + "Received good frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri0", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri0, + "Received pfc xon2xoff frames pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri1", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri1, + "Received pfc xon2xoff frames pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri2", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri2, + "Received pfc xon2xoff frames pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri3", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri3, + "Received pfc xon2xoff frames pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri4", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri4, + "Received pfc xon2xoff frames pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri5", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri5, + "Received pfc xon2xoff frames pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri6", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri6, + "Received pfc xon2xoff frames pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_xon2xoff_frames_pri7", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri7, + "Received pfc xon2xoff frames pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri0", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri0, + "Received pfc ena frames pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri1", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri1, + "Received pfc ena frames pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri2", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri2, + "Received pfc ena frames pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri3", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri3, + "Received pfc ena frames pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri4", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri4, + "Received pfc ena frames pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri5", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri5, + "Received pfc ena frames pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri6", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri6, + "Received pfc ena frames pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pfc_ena_frames_pri7", CTLFLAG_RD, + &softc->rx_port_stats->rx_pfc_ena_frames_pri7, + "Received pfc ena frames pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_sch_crc_err_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_sch_crc_err_frames, + "Received sch crc err frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_undrsz_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_undrsz_frames, "Received undrsz frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_frag_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_frag_frames, "Received frag frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_eee_lpi_events", CTLFLAG_RD, + &softc->rx_port_stats->rx_eee_lpi_events, "Received eee lpi events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_eee_lpi_duration", CTLFLAG_RD, + &softc->rx_port_stats->rx_eee_lpi_duration, + "Received eee lpi duration"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_llfc_physical_msgs", CTLFLAG_RD, + &softc->rx_port_stats->rx_llfc_physical_msgs, + "Received llfc physical msgs"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_llfc_logical_msgs", CTLFLAG_RD, + &softc->rx_port_stats->rx_llfc_logical_msgs, + "Received llfc logical msgs"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_llfc_msgs_with_crc_err", CTLFLAG_RD, + &softc->rx_port_stats->rx_llfc_msgs_with_crc_err, + "Received llfc msgs with crc err"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_hcfc_msgs", CTLFLAG_RD, + &softc->rx_port_stats->rx_hcfc_msgs, "Received hcfc msgs"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_hcfc_msgs_with_crc_err", CTLFLAG_RD, + &softc->rx_port_stats->rx_hcfc_msgs_with_crc_err, + "Received hcfc msgs with crc err"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes", CTLFLAG_RD, + &softc->rx_port_stats->rx_bytes, "Received bytes"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_runt_bytes", CTLFLAG_RD, + &softc->rx_port_stats->rx_runt_bytes, "Received runt bytes"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_runt_frames", CTLFLAG_RD, + &softc->rx_port_stats->rx_runt_frames, "Received runt frames"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_stat_discard", CTLFLAG_RD, + &softc->rx_port_stats->rx_stat_discard, "Received stat discard"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_stat_err", CTLFLAG_RD, + &softc->rx_port_stats->rx_stat_err, "Received stat err"); + + return 0; +} + + +int bnxt_create_rx_sysctls(struct bnxt_softc *softc, int rxr) { struct sysctl_oid *oid; Modified: head/sys/dev/bnxt/bnxt_sysctl.h ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.h Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/bnxt_sysctl.h Fri Sep 8 18:03:34 2017 (r323321) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); int bnxt_init_sysctl_ctx(struct bnxt_softc *softc); int bnxt_free_sysctl_ctx(struct bnxt_softc *softc); +int bnxt_create_port_stats_sysctls(struct bnxt_softc *softc); int bnxt_create_tx_sysctls(struct bnxt_softc *softc, int txr); int bnxt_create_rx_sysctls(struct bnxt_softc *softc, int rxr); int bnxt_create_ver_sysctls(struct bnxt_softc *softc); Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Fri Sep 8 17:51:19 2017 (r323320) +++ head/sys/dev/bnxt/if_bnxt.c Fri Sep 8 18:03:34 2017 (r323321) @@ -176,6 +176,7 @@ static int bnxt_media_change(if_ctx_t ctx); static int bnxt_promisc_set(if_ctx_t ctx, int flags); static uint64_t bnxt_get_counter(if_ctx_t, ift_counter); static void bnxt_update_admin_status(if_ctx_t ctx); +static void bnxt_if_timer(if_ctx_t ctx, uint16_t qid); /* Interrupt enable / disable */ static void bnxt_intr_enable(if_ctx_t ctx); @@ -260,6 +261,7 @@ static device_method_t bnxt_iflib_methods[] = { DEVMETHOD(ifdi_promisc_set, bnxt_promisc_set), DEVMETHOD(ifdi_get_counter, bnxt_get_counter), DEVMETHOD(ifdi_update_admin_status, bnxt_update_admin_status), + DEVMETHOD(ifdi_timer, bnxt_if_timer), DEVMETHOD(ifdi_intr_enable, bnxt_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, bnxt_tx_queue_intr_enable), @@ -424,6 +426,8 @@ bnxt_queues_free(if_ctx_t ctx) // Free RX queues iflib_dma_free(&softc->rx_stats); + iflib_dma_free(&softc->hw_tx_port_stats); + iflib_dma_free(&softc->hw_rx_port_stats); free(softc->grp_info, M_DEVBUF); free(softc->ag_rings, M_DEVBUF); free(softc->rx_rings, M_DEVBUF); @@ -480,6 +484,33 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, bus_dmamap_sync(softc->rx_stats.idi_tag, softc->rx_stats.idi_map, BUS_DMASYNC_PREREAD); +/* + * Additional 512 bytes for future expansion. + * To prevent corruption when loaded with newer firmwares with added counters. + * This can be deleted when there will be no further additions of counters. + */ +#define BNXT_PORT_STAT_PADDING 512 + + rc = iflib_dma_alloc(ctx, sizeof(struct rx_port_stats) + BNXT_PORT_STAT_PADDING, + &softc->hw_rx_port_stats, 0); + if (rc) + goto hw_port_rx_stats_alloc_fail; + + bus_dmamap_sync(softc->hw_rx_port_stats.idi_tag, + softc->hw_rx_port_stats.idi_map, BUS_DMASYNC_PREREAD); + + rc = iflib_dma_alloc(ctx, sizeof(struct tx_port_stats) + BNXT_PORT_STAT_PADDING, + &softc->hw_tx_port_stats, 0); + + if (rc) + goto hw_port_tx_stats_alloc_fail; + + bus_dmamap_sync(softc->hw_tx_port_stats.idi_tag, + softc->hw_tx_port_stats.idi_map, BUS_DMASYNC_PREREAD); + + softc->rx_port_stats = (void *) softc->hw_rx_port_stats.idi_vaddr; + softc->tx_port_stats = (void *) softc->hw_tx_port_stats.idi_vaddr; + for (i = 0; i < nrxqsets; i++) { /* Allocation the completion ring */ softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; @@ -538,6 +569,13 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, bnxt_create_rx_sysctls(softc, i); } + /* + * When SR-IOV is enabled, avoid each VF sending PORT_QSTATS + * HWRM every sec with which firmware timeouts can happen + */ + if (BNXT_PF(softc)) + bnxt_create_port_stats_sysctls(softc); + /* And finally, the VNIC */ softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; softc->vnic_info.flow_id = (uint16_t)HWRM_NA_SIGNATURE; @@ -586,6 +624,10 @@ tpa_alloc_fail: mc_list_alloc_fail: for (i = i - 1; i >= 0; i--) free(softc->rx_rings[i].tpa_start, M_DEVBUF); + iflib_dma_free(&softc->hw_tx_port_stats); +hw_port_tx_stats_alloc_fail: + iflib_dma_free(&softc->hw_rx_port_stats); +hw_port_rx_stats_alloc_fail: iflib_dma_free(&softc->rx_stats); hw_stats_alloc_fail: free(softc->grp_info, M_DEVBUF); @@ -1467,7 +1509,32 @@ bnxt_get_counter(if_ctx_t ctx, ift_counter cnt) static void bnxt_update_admin_status(if_ctx_t ctx) { - /* TODO: do we need to do anything here? */ + struct bnxt_softc *softc = iflib_get_softc(ctx); + + /* + * When SR-IOV is enabled, avoid each VF sending this HWRM + * request every sec with which firmware timeouts can happen + */ + if (BNXT_PF(softc)) { + bnxt_hwrm_port_qstats(softc); + } + + return; +} + +static void +bnxt_if_timer(if_ctx_t ctx, uint16_t qid) +{ + + struct bnxt_softc *softc = iflib_get_softc(ctx); + uint64_t ticks_now = ticks; + + /* Schedule bnxt_update_admin_status() once per sec */ + if (ticks_now - softc->admin_ticks >= hz) { + softc->admin_ticks = ticks_now; + iflib_admin_intr_deferred(ctx); + } + return; } From owner-svn-src-head@freebsd.org Fri Sep 8 18:32:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF279E032BB; Fri, 8 Sep 2017 18:32:14 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6BC65A84; Fri, 8 Sep 2017 18:32:14 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88IWDJ5069915; Fri, 8 Sep 2017 18:32:13 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88IWDI1069914; Fri, 8 Sep 2017 18:32:13 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201709081832.v88IWDI1069914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 8 Sep 2017 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323322 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 323322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 18:32:14 -0000 Author: sobomax Date: Fri Sep 8 18:32:13 2017 New Revision: 323322 URL: https://svnweb.freebsd.org/changeset/base/323322 Log: Correct bintime32 declaration: uint32_t sec -> time32_t sec. Submitted by: jhb MFC after: 1 month Modified: head/sys/compat/freebsd32/freebsd32.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Fri Sep 8 18:03:34 2017 (r323321) +++ head/sys/compat/freebsd32/freebsd32.h Fri Sep 8 18:32:13 2017 (r323322) @@ -79,7 +79,7 @@ struct itimerspec32 { } while (0) struct bintime32 { - uint32_t sec; + time32_t sec; uint32_t frac[2]; }; #define BT_CP(src, dst, fld) do { \ From owner-svn-src-head@freebsd.org Fri Sep 8 19:20:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 121EBE05757; Fri, 8 Sep 2017 19:20:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D55DE670DA; Fri, 8 Sep 2017 19:20:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88JKhFj086272; Fri, 8 Sep 2017 19:20:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88JKhVA086271; Fri, 8 Sep 2017 19:20:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201709081920.v88JKhVA086271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 8 Sep 2017 19:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323323 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 323323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 19:20:44 -0000 Author: bdrewery Date: Fri Sep 8 19:20:42 2017 New Revision: 323323 URL: https://svnweb.freebsd.org/changeset/base/323323 Log: Tweak comment for install -S usage since it does not impact the build. The -S flag is currently ignored for builds since we filter through tools/install.sh that is intended for both non-root and cross-builds. Sponsored by: Dell EMC Isilon X-MFC-With: r322565 Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Sep 8 18:32:13 2017 (r323322) +++ head/share/mk/bsd.lib.mk Fri Sep 8 19:20:42 2017 (r323323) @@ -327,9 +327,9 @@ _EXTRADEPEND: SHLINSTALLFLAGS+= -fschg .endif .endif -# Install libraries with -S to avoid linker races with WORLDTMP and risk -# of modifying in-use libraries when installing to a running system. -# It is safe to avoid this for NO_ROOT builds that are only creating an image. +# Install libraries with -S to avoid risk of modifying in-use libraries when +# installing to a running system. It is safe to avoid this for NO_ROOT builds +# that are only creating an image. .if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT) SHLINSTALLFLAGS+= -S .endif From owner-svn-src-head@freebsd.org Fri Sep 8 19:25:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5563E05CAC; Fri, 8 Sep 2017 19:25:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A517267529; Fri, 8 Sep 2017 19:25:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88JPBPt090507; Fri, 8 Sep 2017 19:25:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88JPBPx090506; Fri, 8 Sep 2017 19:25:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081925.v88JPBPx090506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 19:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323324 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 323324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 19:25:12 -0000 Author: kib Date: Fri Sep 8 19:25:11 2017 New Revision: 323324 URL: https://svnweb.freebsd.org/changeset/base/323324 Log: Add a constant specifying the min size of the IOAPIC registers window. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/apicreg.h Modified: head/sys/x86/include/apicreg.h ============================================================================== --- head/sys/x86/include/apicreg.h Fri Sep 8 19:20:42 2017 (r323323) +++ head/sys/x86/include/apicreg.h Fri Sep 8 19:25:11 2017 (r323324) @@ -469,6 +469,8 @@ typedef struct IOAPIC ioapic_t; #define IOAPIC_WINDOW 0x10 #define IOAPIC_EOIR 0x40 +#define IOAPIC_WND_SIZE 0x50 + /* indexes into IO APIC */ #define IOAPIC_ID 0x00 #define IOAPIC_VER 0x01 From owner-svn-src-head@freebsd.org Fri Sep 8 19:39:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28152E06677; Fri, 8 Sep 2017 19:39:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id DE45767AD4; Fri, 8 Sep 2017 19:39:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88JdLPa094558; Fri, 8 Sep 2017 19:39:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88JdL5d094556; Fri, 8 Sep 2017 19:39:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081939.v88JdL5d094556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 19:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323325 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 323325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 19:39:22 -0000 Author: kib Date: Fri Sep 8 19:39:20 2017 New Revision: 323325 URL: https://svnweb.freebsd.org/changeset/base/323325 Log: Add an ioapic_get_rid() function to obtain PCIe TLP requester-id for the interrupt messages from given IOAPIC, if the IOAPIC can be enumerated on PCI bus. If IOAPIC has PCI binding, match the PCI device against MADT enumerated IOAPIC. Match is done first by registers window physical address, then by IOAPIC ID as read from the APIC ID register. PCI bsf address of the matched PCI device is the rid. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Hardware provided by: Intel MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12205 Modified: head/sys/x86/include/apicvar.h head/sys/x86/x86/io_apic.c Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Fri Sep 8 19:25:11 2017 (r323324) +++ head/sys/x86/include/apicvar.h Fri Sep 8 19:39:20 2017 (r323325) @@ -478,6 +478,8 @@ void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); void lapic_handle_timer(struct trapframe *frame); +int ioapic_get_rid(u_int apic_id, uint16_t *ridp); + extern int x2apic_mode; extern int lapic_eoi_suppression; Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Fri Sep 8 19:25:11 2017 (r323324) +++ head/sys/x86/x86/io_apic.c Fri Sep 8 19:39:20 2017 (r323325) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -99,6 +100,9 @@ struct ioapic { volatile ioapic_t *io_addr; /* XXX: should use bus_space */ vm_paddr_t io_paddr; STAILQ_ENTRY(ioapic) io_next; + device_t pci_dev; /* matched pci device, if found */ + struct resource *pci_wnd; /* BAR 0, should be same or alias to + io_paddr */ struct ioapic_intsrc io_pins[0]; }; @@ -622,6 +626,8 @@ ioapic_create(vm_paddr_t addr, int32_t apic_id, int in io = malloc(sizeof(struct ioapic) + numintr * sizeof(struct ioapic_intsrc), M_IOAPIC, M_WAITOK); io->io_pic = ioapic_template; + io->pci_dev = NULL; + io->pci_wnd = NULL; mtx_lock_spin(&icu_lock); io->io_id = next_id++; io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT; @@ -954,7 +960,72 @@ ioapic_pci_probe(device_t dev) static int ioapic_pci_attach(device_t dev) { + struct resource *res; + volatile ioapic_t *apic; + struct ioapic *io; + int rid; + u_int apic_id; + /* + * Try to match the enumerated ioapic. Match BAR start + * against io_paddr. Due to a fear that PCI window is not the + * same as the MADT reported io window, but an alias, read the + * APIC ID from the mapped BAR and match against it. + */ + rid = PCIR_BAR(0); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (res == NULL) { + if (bootverbose) + device_printf(dev, "cannot activate BAR0\n"); + return (ENXIO); + } + apic = (volatile ioapic_t *)rman_get_virtual(res); + if (rman_get_size(res) < IOAPIC_WND_SIZE) { + if (bootverbose) + device_printf(dev, + "BAR0 too small (%jd) for IOAPIC window\n", + (uintmax_t)rman_get_size(res)); + goto fail; + } + mtx_lock_spin(&icu_lock); + apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT; + /* First match by io window address */ + STAILQ_FOREACH(io, &ioapic_list, io_next) { + if (io->io_paddr == (vm_paddr_t)rman_get_start(res)) + goto found; + } + /* Then by apic id */ + STAILQ_FOREACH(io, &ioapic_list, io_next) { + if (io->io_id == apic_id) + goto found; + } + mtx_unlock_spin(&icu_lock); + if (bootverbose) + device_printf(dev, + "cannot match pci bar apic id %d against MADT\n", + apic_id); +fail: + bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + return (ENXIO); +found: + KASSERT(io->pci_dev == NULL, + ("ioapic %d pci_dev not NULL", io->io_id)); + KASSERT(io->pci_wnd == NULL, + ("ioapic %d pci_wnd not NULL", io->io_id)); + + io->pci_dev = dev; + io->pci_wnd = res; + if (bootverbose && (io->io_paddr != (vm_paddr_t)rman_get_start(res) || + io->io_id != apic_id)) { + device_printf(dev, "pci%d:%d:%d:%d pci BAR0@%jx id %d " + "MADT id %d paddr@%jx\n", + pci_get_domain(dev), pci_get_bus(dev), + pci_get_slot(dev), pci_get_function(dev), + (uintmax_t)rman_get_start(res), apic_id, + io->io_id, (uintmax_t)io->io_paddr); + } + mtx_unlock_spin(&icu_lock); return (0); } @@ -971,6 +1042,28 @@ DEFINE_CLASS_0(ioapic, ioapic_pci_driver, ioapic_pci_m static devclass_t ioapic_devclass; DRIVER_MODULE(ioapic, pci, ioapic_pci_driver, ioapic_devclass, 0, 0); +int +ioapic_get_rid(u_int apic_id, uint16_t *ridp) +{ + struct ioapic *io; + uintptr_t rid; + int error; + + mtx_lock_spin(&icu_lock); + STAILQ_FOREACH(io, &ioapic_list, io_next) { + if (io->io_id == apic_id) + break; + } + mtx_unlock_spin(&icu_lock); + if (io == NULL || io->pci_dev == NULL) + return (EINVAL); + error = pci_get_id(io->pci_dev, PCI_ID_RID, &rid); + if (error != 0) + return (error); + *ridp = rid; + return (0); +} + /* * A new-bus driver to consume the memory resources associated with * the APICs in the system. On some systems ACPI or PnPBIOS system @@ -1008,7 +1101,7 @@ apic_add_resource(device_t dev, int rid, vm_paddr_t ba if (error) panic("apic_add_resource: resource %d failed set with %d", rid, error); - bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_SHAREABLE); } static int From owner-svn-src-head@freebsd.org Fri Sep 8 19:45:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F6DE06C68; Fri, 8 Sep 2017 19:45:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id B88E1680FE; Fri, 8 Sep 2017 19:45:38 +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 v88Jjbth098365; Fri, 8 Sep 2017 19:45:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88JjbmQ098364; Fri, 8 Sep 2017 19:45:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081945.v88JjbmQ098364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 19:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323326 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 323326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 19:45:39 -0000 Author: kib Date: Fri Sep 8 19:45:37 2017 New Revision: 323326 URL: https://svnweb.freebsd.org/changeset/base/323326 Log: Use IOAPIC PCI rid as the interrupt TLP source id for DMAR interrupt remapping. VT-d specification requires use of PCI rid as source id for IOAPICs enumerated by PCI bus. The values from the DMAR ACPI table should be only used when IOAPIC is not on PCI. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Hardware provided by: Intel MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12205 Modified: head/sys/x86/iommu/intel_drv.c Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Fri Sep 8 19:39:20 2017 (r323325) +++ head/sys/x86/iommu/intel_drv.c Fri Sep 8 19:45:37 2017 (r323326) @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_APIC #include "pcib_if.h" +#include +#include +#include #endif #define DMAR_FAULT_IRQ_RID 0 @@ -788,6 +791,9 @@ dmar_find_nonpci(u_int id, u_int entry_type, uint16_t ACPI_DMAR_DEVICE_SCOPE *devscope; ACPI_DMAR_PCI_PATH *path; char *ptr, *ptrend; +#ifdef DEV_APIC + int error; +#endif int i; for (i = 0; i < dmar_devcnt; i++) { @@ -809,6 +815,17 @@ dmar_find_nonpci(u_int id, u_int entry_type, uint16_t continue; if (devscope->EnumerationId != id) continue; +#ifdef DEV_APIC + if (entry_type == ACPI_DMAR_SCOPE_TYPE_IOAPIC) { + error = ioapic_get_rid(id, rid); + /* + * If our IOAPIC has PCI bindings then + * use the PCI device rid. + */ + if (error == 0) + return (unit); + } +#endif if (devscope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE) == 2) { if (rid != NULL) { @@ -818,12 +835,11 @@ dmar_find_nonpci(u_int id, u_int entry_type, uint16_t path->Device, path->Function); } return (unit); - } else { - /* XXXKIB */ - printf( - "dmar_find_nonpci: id %d type %d path length != 2\n", - id, entry_type); } + printf( + "dmar_find_nonpci: id %d type %d path length != 2\n", + id, entry_type); + break; } } return (NULL); From owner-svn-src-head@freebsd.org Fri Sep 8 19:51:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B360CE070F4; Fri, 8 Sep 2017 19:51:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB7C68553; Fri, 8 Sep 2017 19:51:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88Jp3rO099989; Fri, 8 Sep 2017 19:51:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88Jp3lW099988; Fri, 8 Sep 2017 19:51:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709081951.v88Jp3lW099988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Sep 2017 19:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323327 - head/sys/x86/pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/pci X-SVN-Commit-Revision: 323327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 19:51:04 -0000 Author: kib Date: Fri Sep 8 19:51:03 2017 New Revision: 323327 URL: https://svnweb.freebsd.org/changeset/base/323327 Log: Enhance qpi.c to make it usable on all Core-microarchitecture Xeons. Scan all buses for CSR bus, not stopping on the first failed match. Scan all slots for function 0 on the found bus, for instance on IvyBridge the slot 0 is not decoded at all. Since the scan is quite unsafe, and access to the buses is mostly useful for developers, enable the csr buses scan with the tunable. Current qpi.c makes too many assumptions about the uncore configuration buses location and about slots occupied. Also it restricts itself only to Nehalem CPUs. It is needed on all Core-based Xeons. On the 2600 v2 (IvyBridge) machine I have access to, the CSR buses have numbers 31 (BSP socket) and 63 (second socket), and there is no functions pci0.31.0.0 or pci0.63.0.0. According to the CPU datasheet, all devices on the uncore bus occupy slots >= 8. Practically, the attach to config buses is required for the intel-pcm pcm-memory.x tool to work, for instance. Reviewed by: jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D12268 Modified: head/sys/x86/pci/qpi.c Modified: head/sys/x86/pci/qpi.c ============================================================================== --- head/sys/x86/pci/qpi.c Fri Sep 8 19:45:37 2017 (r323326) +++ head/sys/x86/pci/qpi.c Fri Sep 8 19:51:03 2017 (r323327) @@ -63,13 +63,19 @@ static MALLOC_DEFINE(M_QPI, "qpidrv", "qpi system devi static void qpi_identify(driver_t *driver, device_t parent) { + int do_qpi; /* Check CPUID to ensure this is an i7 CPU of some sort. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL && - CPUID_TO_FAMILY(cpu_id) == 0x6 && - (CPUID_TO_MODEL(cpu_id) == 0x1a || CPUID_TO_MODEL(cpu_id) == 0x2c))) + if (cpu_vendor_id != CPU_VENDOR_INTEL || + CPUID_TO_FAMILY(cpu_id) != 0x6) return; + /* Only discover buses with configuration devices if allowed by user */ + do_qpi = 0; + TUNABLE_INT_FETCH("hw.attach_intel_csr_pci", &do_qpi); + if (!do_qpi) + return; + /* PCI config register access is required. */ if (pci_cfgregopen() == 0) return; @@ -97,6 +103,7 @@ qpi_probe_pcib(device_t dev, int bus) struct qpi_device *qdev; device_t child; uint32_t devid; + int s; /* * If a PCI bus already exists for this bus number, then @@ -106,18 +113,23 @@ qpi_probe_pcib(device_t dev, int bus) return (EEXIST); /* - * Attempt to read the device id for device 0, function 0 on - * the bus. A value of 0xffffffff means that the bus is not - * present. + * Attempt to read the device id for every slot, function 0 on + * the bus. If all read values are 0xffffffff this means that + * the bus is not present. */ - devid = pci_cfgregread(bus, 0, 0, PCIR_DEVVENDOR, 4); + for (s = 0; s <= PCI_SLOTMAX; s++) { + devid = pci_cfgregread(bus, s, 0, PCIR_DEVVENDOR, 4); + if (devid != 0xffffffff) + break; + } if (devid == 0xffffffff) return (ENOENT); if ((devid & 0xffff) != 0x8086) { - device_printf(dev, - "Device at pci%d.0.0 has non-Intel vendor 0x%x\n", bus, - devid & 0xffff); + if (bootverbose) + device_printf(dev, + "Device at pci%d.%d.0 has non-Intel vendor 0x%x\n", + bus, s, devid & 0xffff); return (ENXIO); } @@ -137,12 +149,12 @@ qpi_attach(device_t dev) int bus; /* - * Each processor socket has a dedicated PCI bus counting down from - * 255. We keep probing buses until one fails. + * Each processor socket has a dedicated PCI bus, sometimes + * not enumerated by ACPI. Probe all unattached buses from 0 + * to 255. */ - for (bus = 255;; bus--) - if (qpi_probe_pcib(dev, bus) != 0) - break; + for (bus = PCI_BUSMAX; bus >= 0; bus--) + qpi_probe_pcib(dev, bus); return (bus_generic_attach(dev)); } From owner-svn-src-head@freebsd.org Fri Sep 8 20:09:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED892E07F62; Fri, 8 Sep 2017 20:09:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BD3A1692C5; Fri, 8 Sep 2017 20:09:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88K9EXu006965; Fri, 8 Sep 2017 20:09:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88K9EGW006964; Fri, 8 Sep 2017 20:09:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709082009.v88K9EGW006964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 8 Sep 2017 20:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323329 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 323329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 20:09:16 -0000 Author: mjg Date: Fri Sep 8 20:09:14 2017 New Revision: 323329 URL: https://svnweb.freebsd.org/changeset/base/323329 Log: Allow __builtin_memset instead of bzero for small buffers of known size In particular this eliminates function calls and related register save/restore when only few writes would suffice. Example speed up can be seen in a fstat microbenchmark on AMD Ryzen cpus, where the throughput went up by ~4.5%. Thanks to cem@ for benchmarking and reviewing the patch. MFC after: 1 week Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Sep 8 20:07:53 2017 (r323328) +++ head/sys/sys/systm.h Fri Sep 8 20:09:14 2017 (r323329) @@ -258,6 +258,12 @@ void hexdump(const void *ptr, int length, const char * #define ovbcopy(f, t, l) bcopy((f), (t), (l)) void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len); void bzero(void * _Nonnull buf, size_t len); +#define bzero(buf, len) ({ \ + if (__builtin_constant_p(len) && (len) <= 64) \ + __builtin_memset((buf), 0, (len)); \ + else \ + bzero((buf), (len)); \ +}) void explicit_bzero(void * _Nonnull, size_t); void *memcpy(void * _Nonnull to, const void * _Nonnull from, size_t len); From owner-svn-src-head@freebsd.org Fri Sep 8 20:20:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B2FE087E7; Fri, 8 Sep 2017 20:20:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF33697F6; Fri, 8 Sep 2017 20:20:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v88KKa0M010957; Fri, 8 Sep 2017 20:20:36 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v88KKasm010955; Fri, 8 Sep 2017 20:20:36 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709082020.v88KKasm010955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 8 Sep 2017 20:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323330 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 08 Sep 2017 20:20:37 -0000 Author: scottl Date: Fri Sep 8 20:20:35 2017 New Revision: 323330 URL: https://svnweb.freebsd.org/changeset/base/323330 Log: Refactor interrupt allocation and deallocation. Add some extra diagnostics. No other functional changes. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_pci.c head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Fri Sep 8 20:09:14 2017 (r323329) +++ head/sys/dev/mpr/mpr_pci.c Fri Sep 8 20:20:35 2017 (r323330) @@ -268,10 +268,21 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc) if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT)) error = mpr_alloc_msi(sc, MPR_MSI_COUNT); - if (error != 0) - msgs = 0; + if (error != 0) { + /* + * If neither MSI or MSI-X are available, assume legacy INTx. + * This also implies that there will be only 1 queue. + */ + sc->mpr_flags |= MPR_FLAGS_INTX; + msgs = 1; + } else { + sc->mpr_flags |= MPR_FLAGS_MSI; + msgs = MPR_MSI_COUNT; /* XXX */ + } sc->msi_msgs = msgs; + mpr_dprint(sc, MPR_INIT, "Allocated %d interrupts\n", msgs); + return (error); } @@ -279,47 +290,45 @@ int mpr_pci_setup_interrupts(struct mpr_softc *sc) { device_t dev; - int i, error; + void *ihandler; + int i, error, rid, initial_rid; dev = sc->mpr_dev; error = ENXIO; - if (sc->msi_msgs == 0) { - sc->mpr_flags |= MPR_FLAGS_INTX; - sc->mpr_irq_rid[0] = 0; - sc->mpr_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->mpr_irq_rid[0], RF_SHAREABLE | RF_ACTIVE); - if (sc->mpr_irq[0] == NULL) { - mpr_printf(sc, "Cannot allocate INTx interrupt\n"); - return (ENXIO); - } - error = bus_setup_intr(dev, sc->mpr_irq[0], - INTR_TYPE_BIO | INTR_MPSAFE, NULL, mpr_intr, sc, - &sc->mpr_intrhand[0]); - if (error) - mpr_printf(sc, "Cannot setup INTx interrupt\n"); + if (sc->mpr_flags & MPR_FLAGS_INTX) { + initial_rid = 0; + ihandler = mpr_intr; + } else if (sc->mpr_flags & MPR_FLAGS_MSI) { + initial_rid = 1; + ihandler = mpr_intr_msi; } else { - sc->mpr_flags |= MPR_FLAGS_MSI; - for (i = 0; i < MPR_MSI_COUNT; i++) { - sc->mpr_irq_rid[i] = i + 1; - sc->mpr_irq[i] = bus_alloc_resource_any(dev, - SYS_RES_IRQ, &sc->mpr_irq_rid[i], RF_ACTIVE); - if (sc->mpr_irq[i] == NULL) { - mpr_printf(sc, - "Cannot allocate MSI interrupt\n"); - return (ENXIO); - } - error = bus_setup_intr(dev, sc->mpr_irq[i], - INTR_TYPE_BIO | INTR_MPSAFE, NULL, mpr_intr_msi, - sc, &sc->mpr_intrhand[i]); - if (error) { - mpr_printf(sc, - "Cannot setup MSI interrupt %d\n", i); - break; - } + mpr_dprint(sc, MPR_ERROR|MPR_INIT, + "Unable to set up interrupts\n"); + return (EINVAL); + } + + for (i = 0; i < sc->msi_msgs; i++) { + rid = i + initial_rid; + sc->mpr_irq_rid[i] = rid; + sc->mpr_irq[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->mpr_irq_rid[i], RF_ACTIVE); + if (sc->mpr_irq[i] == NULL) { + mpr_dprint(sc, MPR_ERROR|MPR_INIT, + "Cannot allocate interrupt RID %d\n", rid); + break; } + error = bus_setup_intr(dev, sc->mpr_irq[i], + INTR_TYPE_BIO | INTR_MPSAFE, NULL, mpr_intr_msi, + sc, &sc->mpr_intrhand[i]); + if (error) { + mpr_dprint(sc, MPR_ERROR|MPR_INIT, + "Cannot setup interrupt RID %d\n", rid); + break; + } } + mpr_dprint(sc, MPR_INIT, "Set up %d interrupts\n", sc->msi_msgs); return (error); } @@ -347,24 +356,17 @@ mpr_pci_free(struct mpr_softc *sc) bus_dma_tag_destroy(sc->mpr_parent_dmat); } - if (sc->mpr_flags & MPR_FLAGS_MSI) { - for (i = 0; i < MPR_MSI_COUNT; i++) { - if (sc->mpr_irq[i] != NULL) { - bus_teardown_intr(sc->mpr_dev, sc->mpr_irq[i], - sc->mpr_intrhand[i]); - bus_release_resource(sc->mpr_dev, SYS_RES_IRQ, - sc->mpr_irq_rid[i], sc->mpr_irq[i]); - } + for (i = 0; i < sc->msi_msgs; i++) { + if (sc->mpr_irq[i] != NULL) { + bus_teardown_intr(sc->mpr_dev, sc->mpr_irq[i], + sc->mpr_intrhand[i]); + bus_release_resource(sc->mpr_dev, SYS_RES_IRQ, + sc->mpr_irq_rid[i], sc->mpr_irq[i]); } - pci_release_msi(sc->mpr_dev); } - if (sc->mpr_flags & MPR_FLAGS_INTX) { - bus_teardown_intr(sc->mpr_dev, sc->mpr_irq[0], - sc->mpr_intrhand[0]); - bus_release_resource(sc->mpr_dev, SYS_RES_IRQ, - sc->mpr_irq_rid[0], sc->mpr_irq[0]); - } + if (sc->mpr_flags & MPR_FLAGS_MSI) + pci_release_msi(sc->mpr_dev); if (sc->mpr_regs_resource != NULL) { bus_release_resource(sc->mpr_dev, SYS_RES_MEMORY, Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Fri Sep 8 20:09:14 2017 (r323329) +++ head/sys/dev/mps/mps_pci.c Fri Sep 8 20:20:35 2017 (r323330) @@ -253,10 +253,21 @@ mps_pci_alloc_interrupts(struct mps_softc *sc) if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT)) error = mps_alloc_msi(sc, MPS_MSI_COUNT); - if (error != 0) - msgs = 0; + if (error != 0) { + /* + * If neither MSI or MSI-X are avaiable, assume legacy INTx. + * This also implies that there will be only 1 queue. + */ + sc->mps_flags |= MPS_FLAGS_INTX; + msgs = 1; + } else { + sc->mps_flags |= MPS_FLAGS_MSI; + msgs = 1; /* XXX */ + } sc->msi_msgs = msgs; + mps_dprint(sc, MPS_INIT, "Allocated %d interrupts\n", msgs); + return (error); } @@ -264,47 +275,46 @@ int mps_pci_setup_interrupts(struct mps_softc *sc) { device_t dev; - int i, error; + void *ihandler; + int i, error, rid, initial_rid; dev = sc->mps_dev; error = ENXIO; - if (sc->msi_msgs == 0) { - sc->mps_flags |= MPS_FLAGS_INTX; - sc->mps_irq_rid[0] = 0; - sc->mps_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->mps_irq_rid[0], RF_SHAREABLE | RF_ACTIVE); - if (sc->mps_irq[0] == NULL) { - mps_printf(sc, "Cannot allocate INTx interrupt\n"); - return (ENXIO); - } - error = bus_setup_intr(dev, sc->mps_irq[0], - INTR_TYPE_BIO | INTR_MPSAFE, NULL, mps_intr, sc, - &sc->mps_intrhand[0]); - if (error) - mps_printf(sc, "Cannot setup INTx interrupt\n"); + if (sc->mps_flags & MPS_FLAGS_INTX) { + initial_rid = 0; + ihandler = mps_intr; + } else if (sc->mps_flags & MPS_FLAGS_MSI) { + initial_rid = 1; + ihandler = mps_intr_msi; } else { - sc->mps_flags |= MPS_FLAGS_MSI; - for (i = 0; i < MPS_MSI_COUNT; i++) { - sc->mps_irq_rid[i] = i + 1; - sc->mps_irq[i] = bus_alloc_resource_any(dev, - SYS_RES_IRQ, &sc->mps_irq_rid[i], RF_ACTIVE); - if (sc->mps_irq[i] == NULL) { - mps_printf(sc, - "Cannot allocate MSI interrupt\n"); - return (ENXIO); - } - error = bus_setup_intr(dev, sc->mps_irq[i], - INTR_TYPE_BIO | INTR_MPSAFE, NULL, mps_intr_msi, - sc, &sc->mps_intrhand[i]); - if (error) { - mps_printf(sc, - "Cannot setup MSI interrupt %d\n", i); - break; - } + mps_dprint(sc, MPS_ERROR|MPS_INIT, + "Unable to set up interrupts\n"); + return (EINVAL); + } + + for (i = 0; i < sc->msi_msgs; i++) { + rid = i + initial_rid; + sc->mps_irq_rid[i] = rid; + sc->mps_irq[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->mps_irq_rid[i], RF_ACTIVE); + if (sc->mps_irq[i] == NULL) { + mps_dprint(sc, MPS_ERROR|MPS_INIT, + "Cannot allocate interrupt RID%d\n", rid); + break; } + error = bus_setup_intr(dev, sc->mps_irq[i], + INTR_TYPE_BIO | INTR_MPSAFE, NULL, ihandler, + sc, &sc->mps_intrhand[i]); + if (error) { + mps_dprint(sc, MPS_ERROR|MPS_INIT, + "Cannot setup interrupt RID %d\n", rid); + break; + } } + mps_dprint(sc, MPS_INIT, "Set up %d interrupts\n", sc->msi_msgs); + return (error); } @@ -332,24 +342,17 @@ mps_pci_free(struct mps_softc *sc) bus_dma_tag_destroy(sc->mps_parent_dmat); } - if (sc->mps_flags & MPS_FLAGS_MSI) { - for (i = 0; i < MPS_MSI_COUNT; i++) { - if (sc->mps_irq[i] != NULL) { - bus_teardown_intr(sc->mps_dev, sc->mps_irq[i], - sc->mps_intrhand[i]); - bus_release_resource(sc->mps_dev, SYS_RES_IRQ, - sc->mps_irq_rid[i], sc->mps_irq[i]); - } + for (i = 0; i < sc->msi_msgs; i++) { + if (sc->mps_irq[i] != NULL) { + bus_teardown_intr(sc->mps_dev, sc->mps_irq[i], + sc->mps_intrhand[i]); + bus_release_resource(sc->mps_dev, SYS_RES_IRQ, + sc->mps_irq_rid[i], sc->mps_irq[i]); } - pci_release_msi(sc->mps_dev); } - if (sc->mps_flags & MPS_FLAGS_INTX) { - bus_teardown_intr(sc->mps_dev, sc->mps_irq[0], - sc->mps_intrhand[0]); - bus_release_resource(sc->mps_dev, SYS_RES_IRQ, - sc->mps_irq_rid[0], sc->mps_irq[0]); - } + if (sc->mps_flags & MPS_FLAGS_MSI) + pci_release_msi(sc->mps_dev); if (sc->mps_regs_resource != NULL) { bus_release_resource(sc->mps_dev, SYS_RES_MEMORY, From owner-svn-src-head@freebsd.org Sat Sep 9 01:41:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 734E7E18DB4; Sat, 9 Sep 2017 01:41:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 41378736C0; Sat, 9 Sep 2017 01:41:02 +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 v891f1eK041554; Sat, 9 Sep 2017 01:41:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v891f1h4041553; Sat, 9 Sep 2017 01:41:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709090141.v891f1h4041553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 9 Sep 2017 01:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323338 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 323338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 01:41:02 -0000 Author: cem Date: Sat Sep 9 01:41:01 2017 New Revision: 323338 URL: https://svnweb.freebsd.org/changeset/base/323338 Log: Fix information leak in geli(8) integrity mode In integrity mode, a larger logical sector (e.g., 4096 bytes) spans several physical sectors (e.g., 512 bytes) on the backing device. Due to hash overhead, a 4096 byte logical sector takes 8.5625 512-byte physical sectors. This means that only 288 bytes (256 data + 32 hash) of the last 512 byte sector are used. The memory allocation used to store the encrypted data to be written to the physical sectors comes from malloc(9) and does not use M_ZERO. Previously, nothing initialized the final physical sector backing each logical sector, aside from the hash + encrypted data portion. So 224 bytes of kernel heap memory was leaked to every block :-(. This patch addresses the issue by initializing the trailing portion of the physical sector in every logical sector to zeros before use. A much simpler but higher overhead fix would be to tag the entire allocation M_ZERO. PR: 222077 Reported by: Maxim Khitrov Reviewed by: emaste Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12272 Modified: head/sys/geom/eli/g_eli_integrity.c Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Sat Sep 9 01:23:30 2017 (r323337) +++ head/sys/geom/eli/g_eli_integrity.c Sat Sep 9 01:41:01 2017 (r323338) @@ -463,8 +463,16 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp authkey = (u_char *)p; p += G_ELI_AUTH_SECKEYLEN; data_secsize = sc->sc_data_per_sector; - if ((i % lsec) == 0) + if ((i % lsec) == 0) { data_secsize = decr_secsize % data_secsize; + /* + * Last encrypted sector of each decrypted sector is + * only partially filled. + */ + if (bp->bio_cmd == BIO_WRITE) + memset(data + sc->sc_alen + data_secsize, 0, + encr_secsize - sc->sc_alen - data_secsize); + } if (bp->bio_cmd == BIO_READ) { /* Remember read HMAC. */ From owner-svn-src-head@freebsd.org Sat Sep 9 02:08:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D24E1B2D7; Sat, 9 Sep 2017 02:08:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A2BB74A4C; Sat, 9 Sep 2017 02:08:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8928MF9053376; Sat, 9 Sep 2017 02:08:22 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8928MHC053375; Sat, 9 Sep 2017 02:08:22 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201709090208.v8928MHC053375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 9 Sep 2017 02:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323339 - 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: 323339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 02:08:23 -0000 Author: jhibbits Date: Sat Sep 9 02:08:22 2017 New Revision: 323339 URL: https://svnweb.freebsd.org/changeset/base/323339 Log: Add some more PVR and SVR defines These processors may not be supported yet, but add them for completion. POWER9 is planned for support. e300 may work (based on 603e core). P5040/P5021 are similar to P5020, so should work as well. One addition is needed for P5040, to support the number of LAWs, and will be a separate commit. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Sep 9 01:41:01 2017 (r323338) +++ head/sys/powerpc/include/spr.h Sat Sep 9 02:08:22 2017 (r323339) @@ -171,6 +171,7 @@ #define IBMPOWER7PLUS 0x004a #define IBMPOWER8E 0x004b #define IBMPOWER8 0x004d +#define IBMPOWER9 0x004e #define MPC860 0x0050 #define IBMCELLBE 0x0070 #define MPC8240 0x0081 @@ -191,6 +192,10 @@ #define FSL_E500mc 0x8023 #define FSL_E5500 0x8024 #define FSL_E6500 0x8040 +#define FSL_E300C1 0x8083 +#define FSL_E300C2 0x8084 +#define FSL_E300C3 0x8085 +#define FSL_E300C4 0x8086 #define SPR_EPCR 0x133 #define EPCR_EXTGS 0x80000000 @@ -733,6 +738,10 @@ #define SVR_P4080E 0x8209 #define SVR_P5020 0x8220 #define SVR_P5020E 0x8228 +#define SVR_P5021 0x8205 +#define SVR_P5021E 0x820d +#define SVR_P5040 0x8204 +#define SVR_P5040E 0x820c #define SVR_VER(svr) (((svr) >> 16) & 0xffff) #define SPR_PID0 0x030 /* ..8 Process ID Register 0 */ From owner-svn-src-head@freebsd.org Sat Sep 9 02:19:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F6FE1BF71; Sat, 9 Sep 2017 02:19: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 mx1.freebsd.org (Postfix) with ESMTPS id 65F38750D3; Sat, 9 Sep 2017 02:19:45 +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 v892Jixv057638; Sat, 9 Sep 2017 02:19:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v892JixV057637; Sat, 9 Sep 2017 02:19:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201709090219.v892JixV057637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 9 Sep 2017 02:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323340 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 323340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 02:19:45 -0000 Author: jhibbits Date: Sat Sep 9 02:19:44 2017 New Revision: 323340 URL: https://svnweb.freebsd.org/changeset/base/323340 Log: Add P5021 and P5040 conditions for LAW count check. P5040/P5021 have the same number of LAWs as P5020. There may be a better way of getting the count from the FDT (fsl,num-laws property on soc/corenet-law or soc/ecm-law), but that's not supported everywhere, so we still need this check for those other cases. Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sat Sep 9 02:08:22 2017 (r323339) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sat Sep 9 02:19:44 2017 (r323340) @@ -96,6 +96,10 @@ law_getmax(void) break; case SVR_P5020: case SVR_P5020E: + case SVR_P5021: + case SVR_P5021E: + case SVR_P5040: + case SVR_P5040E: law_max = 32; break; default: From owner-svn-src-head@freebsd.org Sat Sep 9 02:28:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D673E1CD99; Sat, 9 Sep 2017 02:28:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id EF8B5758D6; Sat, 9 Sep 2017 02:28:22 +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 v892SMqi061505; Sat, 9 Sep 2017 02:28:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v892SMk1061504; Sat, 9 Sep 2017 02:28:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201709090228.v892SMk1061504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 9 Sep 2017 02:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323341 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 323341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 02:28:23 -0000 Author: ian Date: Sat Sep 9 02:28:21 2017 New Revision: 323341 URL: https://svnweb.freebsd.org/changeset/base/323341 Log: Clarify that the size option is in bytes by default, but also accepts the usual SI suffixes. Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Sat Sep 9 02:19:44 2017 (r323340) +++ head/share/man/man5/tmpfs.5 Sat Sep 9 02:28:21 2017 (r323341) @@ -54,7 +54,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2017 +.Dd September 8, 2017 .Dt TMPFS 5 .Os .Sh NAME @@ -131,7 +131,9 @@ the file system size, which can be limited with the .Cm size option. .It Cm size -Specifies the total file system size in bytes. +Specifies the total file system size in bytes, unless suffixed +with one of k, m, g, t, or p, which denote byte, kilobyte, +megabyte, gigabyte, terabyte and petabyte respectively. If zero (the default) or a value larger than SIZE_MAX - PAGE_SIZE is given, the available amount of memory (including main memory and swap space) will be used. From owner-svn-src-head@freebsd.org Sat Sep 9 03:09:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B8DE1FF5B; Sat, 9 Sep 2017 03:09:03 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3EAF4775D3; Sat, 9 Sep 2017 03:09:03 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89392Ep078364; Sat, 9 Sep 2017 03:09:02 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89392BQ078362; Sat, 9 Sep 2017 03:09:02 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201709090309.v89392BQ078362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Sat, 9 Sep 2017 03:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323342 - head/usr.sbin/manctl X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/usr.sbin/manctl X-SVN-Commit-Revision: 323342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 03:09:03 -0000 Author: gordon Date: Sat Sep 9 03:09:02 2017 New Revision: 323342 URL: https://svnweb.freebsd.org/changeset/base/323342 Log: The purge option hasn't been implemented since 1994 when we imported this code. I think it is safe to say it's not going to be. I'm also working to de-orbit catman, so remove the reference in the manpage. Reviewed by: allanjude Modified: head/usr.sbin/manctl/manctl.8 head/usr.sbin/manctl/manctl.sh Modified: head/usr.sbin/manctl/manctl.8 ============================================================================== --- head/usr.sbin/manctl/manctl.8 Sat Sep 9 02:28:21 2017 (r323341) +++ head/usr.sbin/manctl/manctl.8 Sat Sep 9 03:09:02 2017 (r323342) @@ -33,7 +33,6 @@ .Nm .Op Fl compress .Op Fl uncompress -.Op Fl purge .Op Fl help .Ar path ... .Sh DESCRIPTION @@ -50,9 +49,6 @@ Print options and exit. Compress uncompressed man pages (eliminating .so's). .It Fl uncompress Uncompress compressed man pages. -.It Fl purge -Purge old formatted man pages (not implemented yet). .El .Sh SEE ALSO -.Xr catman 1 , .Xr man 1 Modified: head/usr.sbin/manctl/manctl.sh ============================================================================== --- head/usr.sbin/manctl/manctl.sh Sat Sep 9 02:28:21 2017 (r323341) +++ head/usr.sbin/manctl/manctl.sh Sat Sep 9 03:09:02 2017 (r323342) @@ -39,7 +39,6 @@ # this is now two-pass. If possible, .so's # are replaced with hard links # uncompress compressed man pages -# purge old formatted man pages (not implemented yet) # Things to watch out for: # Hard links - careful with g(un)zipping! # .so's - throw everything through soelim before gzip! @@ -49,16 +48,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH # -# purge cat? directories -# -do_purge() -{ - echo "purge $@" 2>&1 - echo "not implemented yet\n" 2>&1 -} - - -# # Uncompress one page # uncompress_page() @@ -351,8 +340,6 @@ ctl_usage() { echo "usage: $1 -compress ... " 1>&2 echo " $1 -uncompress ... " 1>&2 - echo " $1 -purge ... " 1>&2 - echo " $1 -purge expire ... " 1>&2 exit 1 } @@ -375,6 +362,5 @@ if [ $# -lt 2 ] ; then ctl_usage $0 ; fi ; case "$1" in -compress) shift ; do_compress "$@" ;; -uncompress) shift ; do_uncompress "$@" ;; - -purge) shift ; do_purge "$@" ;; *) ctl_usage $0 ;; esac From owner-svn-src-head@freebsd.org Sat Sep 9 04:57:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2666E02384; Sat, 9 Sep 2017 04:57:39 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 98DB07ED1B; Sat, 9 Sep 2017 04:57:39 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id qXpnd8lVf8LPZqXpodZ1H8; Fri, 08 Sep 2017 22:57:37 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=axOHCFhrkk2_j_tWfR8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id EDECEE3E; Fri, 8 Sep 2017 21:57:34 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v894vYJ7090075; Fri, 8 Sep 2017 21:57:34 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709090457.v894vYJ7090075@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Gordon Tetlow cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323342 - head/usr.sbin/manctl In-Reply-To: Message from Gordon Tetlow of "Sat, 09 Sep 2017 03:09:02 -0000." <201709090309.v89392BQ078362@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Sep 2017 21:57:34 -0700 X-CMAE-Envelope: MS4wfDZJH+X16aBbhSjEG9qLHvRxtgrHgjtpOWQqi9sYq8T4L9lHYu6fOsOKix21tHtjcPy12aVJjLAk9bsOe8vOsFF+bqsDxcL+Ud8Jcw9vl3h63zgaZJtB vX+9h863EV1qH5mAHcw49BYJbpPK9l04/gJIk8s9qK7SFehFjP5nUpTQBA2yZn04V5iOuFc3rOONMLHV9M0e2eKKAIZ5qRehgTQ45eGmvSkJ4KM7LS9cRWB6 5gX7vQ8OjuHDZ8YVzTa4GqE/mnonnnbIMyAsKwBgRlYXVKM19L5ZwPJ2Bmjr6f97 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 04:57:40 -0000 In message <201709090309.v89392BQ078362@repo.freebsd.org>, Gordon Tetlow writes : > Author: gordon > Date: Sat Sep 9 03:09:02 2017 > New Revision: 323342 > URL: https://svnweb.freebsd.org/changeset/base/323342 > > Log: > The purge option hasn't been implemented since 1994 when we imported this > code. I think it is safe to say it's not going to be. I'm also working to > de-orbit catman, so remove the reference in the manpage. > > Reviewed by: allanjude > > Modified: > head/usr.sbin/manctl/manctl.8 > head/usr.sbin/manctl/manctl.sh > > Modified: head/usr.sbin/manctl/manctl.8 > ============================================================================= > = > --- head/usr.sbin/manctl/manctl.8 Sat Sep 9 02:28:21 2017 (r32334 > 1) > +++ head/usr.sbin/manctl/manctl.8 Sat Sep 9 03:09:02 2017 (r32334 > 2) > @@ -33,7 +33,6 @@ > .Nm > .Op Fl compress > .Op Fl uncompress > -.Op Fl purge > .Op Fl help > .Ar path ... > .Sh DESCRIPTION > @@ -50,9 +49,6 @@ Print options and exit. > Compress uncompressed man pages (eliminating .so's). > .It Fl uncompress > Uncompress compressed man pages. > -.It Fl purge > -Purge old formatted man pages (not implemented yet). > .El > .Sh SEE ALSO > -.Xr catman 1 , > .Xr man 1 Don't forget this... Index: manctl.8 =================================================================== --- manctl.8 (revision 323342) +++ manctl.8 (working copy) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 1, 1996 +.Dd September 8, 2017 .Dt MANCTL 8 .Os .Sh NAME -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 9 05:08:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB683E0300B; Sat, 9 Sep 2017 05:08:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com [IPv6:2607:f8b0:400e:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5E237F729; Sat, 9 Sep 2017 05:08:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22e.google.com with SMTP id t3so7863863pgt.0; Fri, 08 Sep 2017 22:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=O8duBlX8HlFbDhgw4+VckevJyBhHwbc11LgNyHX0v7E=; b=JkYkqKDKIv1fZVarHKbiq6/SAyUeEYlQ0Y2ktnpL6NA6cQhiK/SCXQmIiCrlTeOO8X fVjw5fYPUVbjpNcMdRjqM9LFA0fBa4MKlmD5uD+K7y0tn+xM0cB8LkJDFczkYNswNog4 AxsN4km+Vnh/Mnb2nei4E+pmaWPUueIvTbxHcURaR66CUz5RtX6oQV0fWtv7X8xKh0lh W2lBOlhnk/HqAxrC7xopYutfvjTKjMRk49qabLUgG+EndAWblgjLYvhyXEaA/ofI2Bu7 C4G0QUr38TTqAMtZpkI8wfV3XIC/7iRt4MeXZ7toeW8ul7kRwMvzJ+Ch3/4cKjtcchRp t9Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=O8duBlX8HlFbDhgw4+VckevJyBhHwbc11LgNyHX0v7E=; b=NlwOO3iERVWXqKHXl85Wt2kffdmoZ0Vxgn4O/k5d3t8LxXV3jQ3T3U+OHtfFTdKrEi XFwa3Vaccd2zEcP1es346qAiE9tA7eL7hvGcXuJRwheMuLsAunf4ZaMDOfbjctU7C+Dx 98T2htWUNvY95GTr9FpsCuQP82NeFP6ahbQi8MOBt+TDtCKDmSWQF5bY6dbng9SYNVIz U0OGfxr2YJkzixu+TYDYQ8By2XnyBp0mBfqO1C3sWyu+2VyYFiQGt3Ie1X4DHhQpI0/H 8pi0RL0RnSioQK3mduijYizwSFieiMniX4Y4UZsFP4hLnveBv3yU4hzQMg5EWWehMdZ0 VbLw== X-Gm-Message-State: AHPjjUiQxY1Bc3mRn3PkwyWC/suRTeYmtleq14Ob3RaK8w6f+OqPNpwz LXkyOL/xNOebLX4UVHE= X-Google-Smtp-Source: ADKCNb5YWm+iFC2T6Qa10NBPeLwvj6Lc70TOK/n1rdkIZrznJim5221tT6WEtWOHMT1ADGyz2mFYuA== X-Received: by 10.84.141.1 with SMTP id 1mr6008956plu.234.1504933703910; Fri, 08 Sep 2017 22:08:23 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 133sm6710562pfy.2.2017.09.08.22.08.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Sep 2017 22:08:22 -0700 (PDT) Subject: Re: svn commit: r323329 - head/sys/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_D4977873-6CC0-4F5C-8FCA-F3CFE1247636"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201709082009.v88K9EGW006964@repo.freebsd.org> Date: Fri, 8 Sep 2017 22:08:21 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <75479AB5-BB64-4D5B-8FA0-474532E7B103@gmail.com> References: <201709082009.v88K9EGW006964@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 05:08:25 -0000 --Apple-Mail=_D4977873-6CC0-4F5C-8FCA-F3CFE1247636 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 8, 2017, at 13:09, Mateusz Guzik wrote: >=20 > Author: mjg > Date: Fri Sep 8 20:09:14 2017 > New Revision: 323329 > URL: https://svnweb.freebsd.org/changeset/base/323329 >=20 > Log: > Allow __builtin_memset instead of bzero for small buffers of known = size >=20 > In particular this eliminates function calls and related register = save/restore > when only few writes would suffice. >=20 > Example speed up can be seen in a fstat microbenchmark on AMD Ryzen = cpus, where > the throughput went up by ~4.5%. >=20 > Thanks to cem@ for benchmarking and reviewing the patch. This change breaks all platforms that use gcc. If it=E2=80=99s not = reverted in the next 3 hours, I=E2=80=99ll revert it. Please fix ASAP if possible: = https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/3668/console . Thanks, -Ngie --Apple-Mail=_D4977873-6CC0-4F5C-8FCA-F3CFE1247636 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZs3dFAAoJEPWDqSZpMIYV+XMP/0cxFRiEOueHlk5RL4u/ztrA wZo7RJfovmAg8a1AkgIP0FuiyLVR9GDX1A1ZkMVTXrTOFUZapef90WFy/uf07bCS DnJQ5/5HZTJbsOBpNLS8CSBY1DYLgMb7Q/HitwXvUWx687trnq7CaB6UyCLJPFyt NfOw4Uxgq1mOVh7usFkSXxfFRemcOmyfe+tPC4c44/J2sSSz2j0W529Yzdlp90W4 55iTCotkiMdzSQqs3R4nb0NmdHGwRX1N39YV0aVfvasiHWm71rvi69oQicxZm5wj jjQDmyVf+cJPX0HoOVe0TtO+jn/cCXAGtoQPfu4fVzC3ZWAPggy2SQRYb/oENQnt sBMDz00wWj3rExmEo8ZhDmXDdnFr1yADblvv83N2G5OwNECcEZXCvV+AHDaoa7zA 48g04T/MWnKyetlmragsLqHnqDTt43EVjSllIk65Ran1xOquxzCvExvAKI5RYv/N mAAmQmBlXDmx/Y8RiM3dl6Ko4NCCOLhBEmFS3C3oStAlxPxu55ngUD236wuv+kU/ BeJGTmtvICWVvt2TgWy6w07Lu50RJkIfTFcy9DFW+a2yOG6/zBIjjBtv8HeXHG56 L45eMrELiCXb3vB8IxqO/J/BtgQvo+To6V2tDEt8LXTcf2jb+bG+Epej3u1nH6yQ xxhF/argE9/b9fIz03l5 =U930 -----END PGP SIGNATURE----- --Apple-Mail=_D4977873-6CC0-4F5C-8FCA-F3CFE1247636-- From owner-svn-src-head@freebsd.org Sat Sep 9 05:12:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE98E03486; Sat, 9 Sep 2017 05:12:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id A6A407FB4F; Sat, 9 Sep 2017 05:12:15 +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 v895CEZ5031634; Sat, 9 Sep 2017 05:12:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v895CEpW031633; Sat, 9 Sep 2017 05:12:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <201709090512.v895CEpW031633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 9 Sep 2017 05:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323343 - 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: 323343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 05:12:16 -0000 Author: np Date: Sat Sep 9 05:12:14 2017 New Revision: 323343 URL: https://svnweb.freebsd.org/changeset/base/323343 Log: cxgbe(4): Fix a couple of problems in the sge_wrq data path. - start_wrq_wr must not drain the wr_list if there are incomplete_wrs pending. This can happen when a t4_wrq_tx runs between two start_wrq_wr. - commit_wrq_wr must examine the cookie's pidx and ndesc with the queue's lock held. Otherwise there is a bad race when incomplete WRs are being completed and commit_wrq_wr for the WR that is ahead in the queue updates the next incomplete WR's cookie's pidx/ndesc but the commit_wrq_wr for the second one is using stale values that it read without the lock. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Sep 9 03:09:02 2017 (r323342) +++ head/sys/dev/cxgbe/t4_sge.c Sat Sep 9 05:12:14 2017 (r323343) @@ -2354,7 +2354,7 @@ start_wrq_wr(struct sge_wrq *wrq, int len16, struct wr EQ_LOCK(eq); - if (!STAILQ_EMPTY(&wrq->wr_list)) + if (TAILQ_EMPTY(&wrq->incomplete_wrs) && !STAILQ_EMPTY(&wrq->wr_list)) drain_wrq_wr_list(sc, wrq); if (!STAILQ_EMPTY(&wrq->wr_list)) { @@ -2408,9 +2408,6 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq return; } - ndesc = cookie->ndesc; /* Can be more than SGE_MAX_WR_NDESC here. */ - pidx = cookie->pidx; - MPASS(pidx >= 0 && pidx < eq->sidx); if (__predict_false(w == &wrq->ss[0])) { int n = (eq->sidx - wrq->ss_pidx) * EQ_ESIZE; @@ -2422,6 +2419,9 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq wrq->tx_wrs_direct++; EQ_LOCK(eq); + ndesc = cookie->ndesc; /* Can be more than SGE_MAX_WR_NDESC here. */ + pidx = cookie->pidx; + MPASS(pidx >= 0 && pidx < eq->sidx); prev = TAILQ_PREV(cookie, wrq_incomplete_wrs, link); next = TAILQ_NEXT(cookie, link); if (prev == NULL) { From owner-svn-src-head@freebsd.org Sat Sep 9 05:50:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34469E04663; Sat, 9 Sep 2017 05:50: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 mx1.freebsd.org (Postfix) with ESMTPS id 03AB580AC3; Sat, 9 Sep 2017 05:50: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 v895omUq043971; Sat, 9 Sep 2017 05:50:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v895omwQ043970; Sat, 9 Sep 2017 05:50:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709090550.v895omwQ043970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 9 Sep 2017 05:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323345 - head/usr.bin/tail/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/tail/tests X-SVN-Commit-Revision: 323345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 05:50:49 -0000 Author: ngie Date: Sat Sep 9 05:50:47 2017 New Revision: 323345 URL: https://svnweb.freebsd.org/changeset/base/323345 Log: Check result of seq call and save output via atf_check -o This ensures that seq outputting to ints will not fail as silently if there's an error. Modified: head/usr.bin/tail/tests/tail_test.sh Modified: head/usr.bin/tail/tests/tail_test.sh ============================================================================== --- head/usr.bin/tail/tests/tail_test.sh Sat Sep 9 05:42:23 2017 (r323344) +++ head/usr.bin/tail/tests/tail_test.sh Sat Sep 9 05:50:47 2017 (r323345) @@ -224,7 +224,7 @@ broken_pipe_body() { atf_expect_fail "Can't seem to get testcase to work in test environment. Reproduces easily in interactive shell." - seq -f '%128g' 1 1000 > ints + atf_check -o save:ints seq -f '%128g' 1 1000 atf_check -s exit:1 -o ignore -e "inline:tail: stdout" tail -n 856 ints | awk '{ exit }' } From owner-svn-src-head@freebsd.org Sat Sep 9 05:56:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E6FE04944; Sat, 9 Sep 2017 05:56:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6214780EAC; Sat, 9 Sep 2017 05:56:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v895u45t047917; Sat, 9 Sep 2017 05:56:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v895u4jT047914; Sat, 9 Sep 2017 05:56:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709090556.v895u4jT047914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 9 Sep 2017 05:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323346 - in head/sys: powerpc/powerpc riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: powerpc/powerpc riscv/riscv X-SVN-Commit-Revision: 323346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 05:56:05 -0000 Author: mjg Date: Sat Sep 9 05:56:04 2017 New Revision: 323346 URL: https://svnweb.freebsd.org/changeset/base/323346 Log: Fix riscv and powerpc compilation after r323329. On these archs bzero is a C function, which triggers a compilation error as the compiler tries to expand the macro. Modified: head/sys/powerpc/powerpc/machdep.c head/sys/riscv/riscv/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sat Sep 9 05:50:47 2017 (r323345) +++ head/sys/powerpc/powerpc/machdep.c Sat Sep 9 05:56:04 2017 (r323346) @@ -417,43 +417,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs (sizeof(struct callframe) - 3*sizeof(register_t))) & ~15UL); } -void -bzero(void *buf, size_t len) -{ - caddr_t p; - - p = buf; - - while (((vm_offset_t) p & (sizeof(u_long) - 1)) && len) { - *p++ = 0; - len--; - } - - while (len >= sizeof(u_long) * 8) { - *(u_long*) p = 0; - *((u_long*) p + 1) = 0; - *((u_long*) p + 2) = 0; - *((u_long*) p + 3) = 0; - len -= sizeof(u_long) * 8; - *((u_long*) p + 4) = 0; - *((u_long*) p + 5) = 0; - *((u_long*) p + 6) = 0; - *((u_long*) p + 7) = 0; - p += sizeof(u_long) * 8; - } - - while (len >= sizeof(u_long)) { - *(u_long*) p = 0; - len -= sizeof(u_long); - p += sizeof(u_long); - } - - while (len) { - *p++ = 0; - len--; - } -} - /* * Flush the D-cache for non-DMA I/O so that the I-cache can * be made coherent later. @@ -555,3 +518,41 @@ DB_SHOW_COMMAND(spr, db_show_spr) (unsigned long)spr); } #endif + +#undef bzero +void +bzero(void *buf, size_t len) +{ + caddr_t p; + + p = buf; + + while (((vm_offset_t) p & (sizeof(u_long) - 1)) && len) { + *p++ = 0; + len--; + } + + while (len >= sizeof(u_long) * 8) { + *(u_long*) p = 0; + *((u_long*) p + 1) = 0; + *((u_long*) p + 2) = 0; + *((u_long*) p + 3) = 0; + len -= sizeof(u_long) * 8; + *((u_long*) p + 4) = 0; + *((u_long*) p + 5) = 0; + *((u_long*) p + 6) = 0; + *((u_long*) p + 7) = 0; + p += sizeof(u_long) * 8; + } + + while (len >= sizeof(u_long)) { + *(u_long*) p = 0; + len -= sizeof(u_long); + p += sizeof(u_long); + } + + while (len) { + *p++ = 0; + len--; + } +} Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sat Sep 9 05:50:47 2017 (r323345) +++ head/sys/riscv/riscv/machdep.c Sat Sep 9 05:56:04 2017 (r323346) @@ -151,16 +151,6 @@ cpu_idle_wakeup(int cpu) return (0); } -void -bzero(void *buf, size_t len) -{ - uint8_t *p; - - p = buf; - while(len-- > 0) - *p++ = 0; -} - int fill_regs(struct thread *td, struct reg *regs) { @@ -890,4 +880,15 @@ initriscv(struct riscv_bootparams *rvbp) riscv_init_interrupts(); early_boot = 0; +} + +#undef bzero +void +bzero(void *buf, size_t len) +{ + uint8_t *p; + + p = buf; + while(len-- > 0) + *p++ = 0; } From owner-svn-src-head@freebsd.org Sat Sep 9 06:04:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AF0EE04CC8; Sat, 9 Sep 2017 06:04:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id 36E9F812F8; Sat, 9 Sep 2017 06:04:06 +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 v89645pb051764; Sat, 9 Sep 2017 06:04:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89645u9051763; Sat, 9 Sep 2017 06:04:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709090604.v89645u9051763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 9 Sep 2017 06:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323347 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 323347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:04:06 -0000 Author: hselasky Date: Sat Sep 9 06:04:05 2017 New Revision: 323347 URL: https://svnweb.freebsd.org/changeset/base/323347 Log: Add more sanity checks to linux_fget() in the LinuxKPI. This prevents returning pointers to file descriptors which were not created by the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/file.h Modified: head/sys/compat/linuxkpi/common/include/linux/file.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/file.h Sat Sep 9 05:56:04 2017 (r323346) +++ head/sys/compat/linuxkpi/common/include/linux/file.h Sat Sep 9 06:04:05 2017 (r323347) @@ -53,11 +53,18 @@ linux_fget(unsigned int fd) cap_rights_t rights; struct file *file; + /* lookup file pointer by file descriptor index */ if (fget_unlocked(curthread->td_proc->p_fd, fd, - cap_rights_init(&rights), &file, NULL) != 0) { + cap_rights_init(&rights), &file, NULL) != 0) return (NULL); + + /* check if file handle really belongs to us */ + if (file->f_data == NULL || + file->f_ops != &linuxfileops) { + fdrop(file, curthread); + return (NULL); } - return (struct linux_file *)file->f_data; + return ((struct linux_file *)file->f_data); } extern void linux_file_free(struct linux_file *filp); From owner-svn-src-head@freebsd.org Sat Sep 9 06:12:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E25E05151 for ; Sat, 9 Sep 2017 06:12:29 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (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 0101A81749 for ; Sat, 9 Sep 2017 06:12:28 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (124-18-21-125.dz.commufa.jp [124.18.21.125]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id v896CIDE023350; Sat, 9 Sep 2017 15:12:18 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 9 Sep 2017 15:12:17 +0900 From: Tomoaki AOKI To: svn-src-head@freebsd.org Cc: Warner Losh Subject: Re: svn commit: r322941 - head/sys/boot/efi/boot1 Message-Id: <20170909151217.9082b61a9ef00b86bf90ff8e@dec.sakura.ne.jp> In-Reply-To: References: <20170902164311.eb7e5d2fa0e40f3b4e5e6142@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sat__9_Sep_2017_15_12_17_+0900_dSgJ8XyasnCX=vd0" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:12:29 -0000 This is a multi-part message in MIME format. --Multipart=_Sat__9_Sep_2017_15_12_17_+0900_dSgJ8XyasnCX=vd0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 2 Sep 2017 11:26:50 -0600 Warner Losh wrote: > On Sat, Sep 2, 2017 at 11:25 AM, Warner Losh wrote: > > > > > > > On Sat, Sep 2, 2017 at 1:43 AM, Tomoaki AOKI > > wrote: > > > >> Hi. > >> > >> This broke boot drive selection functionality by smh@ at r295320 on > >> Feb.5, 2016. [1] > >> Now, even if I forcibly select 2nd HDD via UEFI firmware, boot1.efi > >> (as bootx64.efi) selects /boot/loader.efi on 1st HDD. Each boot > >> partition are ZFS pools. Confirmed previous rev was OK. > >> > >> Attached is the boot log (with EFI_DEBUG). Pool zsysS02 should be > >> selected there instead of zsysS01. As I have no serial console, there > >> can be some typos. (Took video and hand-typed.) > >> > >> The boot order should be as below (what smh@ implemented). > >> > >> 1. ZFS pool on which drive boot1.efi is read from. > >> 2. UFS partition on which drive boot1.efi is read from. > >> 3. If both 1 and 2 are missed, try from UEFI 1st drive and later. > >> > >> P.S. Another possibility (not tested yet): > >> Not forcibly prefer 1st drive, but reversed selection. > >> (If boot1.efi is on 1st drive, loader.efi on 2nd drive is read.) > >> > >> [1] > >> https://lists.freebsd.org/pipermail/svn-src-head/2016-Februa > >> ry/082215.html > > > > > > Looks like the matching function that I replaced this stuff with wasn't > > quite the same. Will fix. I hadn't thought I'd broken it, honestly, since > > the setup I have still worked. The intent was to keep things as they were, > > which clearly didn't happen in at least your case. I'll take a look at the > > logs to see if I can spot the differences between the two setups. The > > intent was to keep functionality, for now, the same. > > > > In the long term, though, this guessing and matching is going to end up > > first as deprecated and then as removed. To be replaced by a boot1.efi that > > follows the EFI Boot Manager protocol where exactly what to load is > > contained in EFI env variables. That's what all my changes to boot1 have > > been working towards. > > > > Warner > > > > P.S. This is the doc I put together for discussion. I'm keeping it updated > as each stage is implemented. > > https://docs.google.com/document/d/1aK9IqF-60JPEbUeSAUAkYjF2W_8EnmczFs6RqCT90Jg/edit > > Lemme know if you have any comments. > > Warner > Read that, and have some comments. (Maybe not enough understood UEFI 2.6 boot manager spec, though) If I understood current code correctly, third on "Current Algorithm" looks incorrect. boot1.efi looks for ZFS, then UFS for all devices, per-device basis. And yes, it cannot specify which partition to boot from. A fix was proposed by Naomichi Nonaka as bug 207940.[1] (Not using UEFI boot manager protocol, though.) This patch no longer applicable to head with recent changes, but applicable for stable/11 with slight fix (attached, working for me). Unfortunately, Naomichi is no longer working on it, as it haven't introduced to head for a long time, and now he knows GRUB2 can chainload loader.efi on ZFS pool. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207940 For "Proposed Algorithm", some problematic UEFI firmware could miss non-default location. As workaround, current \EFI\BOOT\BOOTx64.efi (within boot1.efifat) should be kept (at least, as an installer option) to fallback. For 2) b), some people could want largest partition number to take precedence over smaller, especially when they create a new partition to test new environment keeping old environment untouched. For 2) c), the administrator should better have opportunity to re-select another device to boot from, especially for -head users. Sometimes head cannot boot after installworld and need convenient way to boot from other device temporarily. (Improperly built loader.efi, broken *.4th, ...) If the machine is at a datacenter, USB memstick wouldn't help, but flexible boot manager could do if there's any remote KVM switch or something alike. *Setting BootNext and restart would be fine, if the UEFI firmware is NOT a problematic one, and BootNext is cleared after successful boot (just like "boot once" for MBR+UFS). *Would be better if something like "BootEmergency" (non-existent for now, automatically selected only when "BootFailed") can be implemented. But maybe cannot, as it should need UEFI firmware support and I couldn't find such a feature in UEFI spec. > > > Author: imp > >> > Date: Sun Aug 27 03:10:16 2017 > >> > New Revision: 322941 > >> > URL: https://svnweb.freebsd.org/changeset/base/322941 > >> > > >> > Log: > >> > Eliminate redunant device path matching. > >> > > >> > Use efi_devpath_match instead of device_paths_match. They are > >> > functionally the same. Remove device_paths_match from boot1.c and call > >> > efi_devpath_match instead. > >> > > >> > Sponsored by: Netflix > >> > > >> > Modified: > >> > head/sys/boot/efi/boot1/boot1.c > >> > > >> > Modified: head/sys/boot/efi/boot1/boot1.c > >> > ============================================================ > >> ================== > >> > --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 23:13:18 2017 > >> (r322940) > >> > +++ head/sys/boot/efi/boot1/boot1.c Sun Aug 27 03:10:16 2017 > >> (r322941) > >> > @@ -76,53 +76,6 @@ Free(void *buf, const char *file __unused, int line > >> __ } > >> > > >> > /* > >> > - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes > >> match, > >> > - * FALSE otherwise. > >> > - */ > >> > -static BOOLEAN > >> > -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) > >> > -{ > >> > - size_t len; > >> > - > >> > - if (imgpath == NULL || imgpath->Type != devpath->Type || > >> > - imgpath->SubType != devpath->SubType) > >> > - return (FALSE); > >> > - > >> > - len = DevicePathNodeLength(imgpath); > >> > - if (len != DevicePathNodeLength(devpath)) > >> > - return (FALSE); > >> > - > >> > - return (memcmp(imgpath, devpath, (size_t)len) == 0); > >> > -} > >> > - > >> > -/* > >> > - * device_paths_match returns TRUE if the imgpath isn't NULL and all > >> nodes > >> > - * in imgpath and devpath match up to their respective occurrences of a > >> > - * media node, FALSE otherwise. > >> > - */ > >> > -static BOOLEAN > >> > -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) > >> > -{ > >> > - > >> > - if (imgpath == NULL) > >> > - return (FALSE); > >> > - > >> > - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) > >> { > >> > - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && > >> > - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) > >> > - return (TRUE); > >> > - > >> > - if (!nodes_match(imgpath, devpath)) > >> > - return (FALSE); > >> > - > >> > - imgpath = NextDevicePathNode(imgpath); > >> > - devpath = NextDevicePathNode(devpath); > >> > - } > >> > - > >> > - return (FALSE); > >> > -} > >> > - > >> > -/* > >> > * devpath_last returns the last non-path end node in devpath. > >> > */ > >> > static EFI_DEVICE_PATH * > >> > @@ -318,7 +271,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH > >> *imgpath, B > >> > if (!blkio->Media->LogicalPartition) > >> > return (EFI_UNSUPPORTED); > >> > > >> > - *preferred = device_paths_match(imgpath, devpath); > >> > + *preferred = efi_devpath_match(imgpath, devpath); > >> > > >> > /* Run through each module, see if it can load this partition > >> */ > >> > for (i = 0; i < NUM_BOOT_MODULES; i++) { > >> > >> -- > >> Tomoaki AOKI > >> > > > > -- Tomoaki AOKI --Multipart=_Sat__9_Sep_2017_15_12_17_+0900_dSgJ8XyasnCX=vd0 Content-Type: application/octet-stream; name="boot1.c.NNonaka.diff.rev4_after_s11_r318625" Content-Disposition: attachment; filename="boot1.c.NNonaka.diff.rev4_after_s11_r318625" Content-Transfer-Encoding: base64 SW5kZXg6IHN5cy9ib290L2VmaS9ib290MS9ib290MS5jCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9ib290 L2VmaS9ib290MS9ib290MS5jCShyZXZpc2lvbiAyOTU2ODMpCisrKyBzeXMvYm9vdC9lZmkvYm9v dDEvYm9vdDEuYwkod29ya2luZyBjb3B5KQpAQCAtMjksNiArMjksNyBAQAogCiAjaW5jbHVkZSA8 ZWZpLmg+CiAjaW5jbHVkZSA8ZWZpY29uc2N0bC5oPgorI2luY2x1ZGUgPGVmaWxpYi5oPgogCiAj aW5jbHVkZSAiYm9vdF9tb2R1bGUuaCIKICNpbmNsdWRlICJwYXRocy5oIgpAQCAtNDcsMTEgKzQ4 LDE4IEBACiAvKiBUaGUgaW5pdGlhbCBudW1iZXIgb2YgaGFuZGxlcyB1c2VkIHRvIHF1ZXJ5IEVG SSBmb3IgcGFydGl0aW9ucy4gKi8KICNkZWZpbmUgTlVNX0hBTkRMRVNfSU5JVAkyNAogCit2b2lk IGVmaV9jb25zX3B1dGNoYXIoaW50KTsKK2ludCBlZmlfY29uc19nZXRjaGFyKHZvaWQpOworaW50 IGVmaV9jb25zX3BvbGwodm9pZCk7CitpbnQgZ2V0Y2hhcih2b2lkKTsKK2NoYXIgKmh1bWFuaXpl X251bWJlcl9rbWd0KFVJTlQ2NCk7CiBFRklfU1RBVFVTIGVmaV9tYWluKEVGSV9IQU5ETEUgWGlt YWdlLCBFRklfU1lTVEVNX1RBQkxFKiBYc3lzdGFiKTsKIAogRUZJX1NZU1RFTV9UQUJMRSAqc3lz dGFiOwogRUZJX0JPT1RfU0VSVklDRVMgKmJzOwogc3RhdGljIEVGSV9IQU5ETEUgKmltYWdlOwor c3RhdGljIFNJTVBMRV9URVhUX09VVFBVVF9JTlRFUkZBQ0UJKmNvbm91dDsKK3N0YXRpYyBTSU1Q TEVfSU5QVVRfSU5URVJGQUNFCQkqY29uaW47CiAKIHN0YXRpYyBFRklfR1VJRCBCbG9ja0lvUHJv dG9jb2xHVUlEID0gQkxPQ0tfSU9fUFJPVE9DT0w7CiBzdGF0aWMgRUZJX0dVSUQgRGV2aWNlUGF0 aEdVSUQgPSBERVZJQ0VfUEFUSF9QUk9UT0NPTDsKQEAgLTU5LDYgKzY3LDM1IEBACiBzdGF0aWMg RUZJX0dVSUQgTG9hZGVkSW1hZ2VHVUlEID0gTE9BREVEX0lNQUdFX1BST1RPQ09MOwogc3RhdGlj IEVGSV9HVUlEIENvbnNvbGVDb250cm9sR1VJRCA9IEVGSV9DT05TT0xFX0NPTlRST0xfUFJPVE9D T0xfR1VJRDsKIAorCisjZGVmaW5lIERFRkFVTFRfRkdDT0xPUiBFRklfTElHSFRHUkFZCisjZGVm aW5lIERFRkFVTFRfQkdDT0xPUiBFRklfQkxBQ0sKKworY2hhciAqaHVtYW5pemVfbnVtYmVyX2tt Z3QoVUlOVDY0IHNpemUpIHsKKwlzdGF0aWMgY2hhciBidWYyWzZdOworCVVJTlQ2NCBzaXplMDsK KworCWlmIChzaXplIDwgMTAyNCkKKwkJc3ByaW50ZihidWYyLCAiJWx1QiIsIHNpemUpOworCWVs c2UgaWYgKHNpemUwID0gKHNpemUqMTArNTEyKS8xMDI0LCBzaXplMCA8IDEwMCkKKwkJc3ByaW50 ZihidWYyLCAiJWx1LiVsdUsiLCBzaXplMCAvIDEwLCBzaXplMCAlIDEwKTsKKwllbHNlIGlmIChz aXplMCA9IChzaXplKzUxMikvMTAyNCwgc2l6ZTAgPCAxMDI0KQorCQlzcHJpbnRmKGJ1ZjIsICIl bHVLIiwgc2l6ZTApOworCWVsc2UgaWYgKHNpemUwID0gKHNpemUqMTAvMTAyNCs1MTIpLzEwMjQs IHNpemUwIDwgMTAwKQorCQlzcHJpbnRmKGJ1ZjIsICIlbHUuJWx1TSIsIHNpemUwIC8gMTAsIHNp emUwICUgMTApOworCWVsc2UgaWYgKHNpemUwID0gKHNpemUvMTAyNCs1MTIpLzEwMjQsIHNpemUw IDwgMTAyNCkKKwkJc3ByaW50ZihidWYyLCAiJWx1TSIsIHNpemUwKTsKKwllbHNlIGlmIChzaXpl MCA9IChzaXplKjEwLzEwMjQvMTAyNCs1MTIpLzEwMjQsIHNpemUwIDwgMTAwKQorCQlzcHJpbnRm KGJ1ZjIsICIlbHUuJWx1RyIsIHNpemUwIC8gMTAsIHNpemUwICUgMTApOworCWVsc2UgaWYgKHNp emUwID0gKHNpemUvMTAyNC8xMDI0KzUxMikvMTAyNCwgc2l6ZTAgPCAxMDI0KQorCQlzcHJpbnRm KGJ1ZjIsICIlbHVHIiwgc2l6ZTApOworCWVsc2UgaWYgKHNpemUwID0gKHNpemUqMTAvMTAyNC8x MDI0LzEwMjQrNTEyKS8xMDI0LCBzaXplMCA8IDEwMCkKKwkJc3ByaW50ZihidWYyLCAiJWx1LiVs dVQiLCBzaXplMCAvIDEwLCBzaXplMCAlIDEwKTsKKwllbHNlCisJCXNwcmludGYoYnVmMiwgIiVs dVQiLCAoc2l6ZS8xMDI0LzEwMjQvMTAyNCs1MTIpLzEwMjQpOworCXJldHVybihidWYyKTsKK30K KwogLyoKICAqIFByb3ZpZGUgTWFsbG9jIC8gRnJlZSBiYWNrZWQgYnkgRUZJcyBBbGxvY2F0ZVBv b2wgLyBGcmVlUG9vbCB3aGljaCBlbnN1cmVzCiAgKiBtZW1vcnkgaXMgY29ycmVjdGx5IGFsaWdu ZWQgYXZvaWRpbmcgRUZJX0lOVkFMSURfUEFSQU1FVEVSIHJldHVybnMgZnJvbQpAQCAtMTUxLDcg KzE4OCw2IEBACiBzdGF0aWMgaW50CiBkZXZwYXRoX25vZGVfc3RyKGNoYXIgKmJ1Ziwgc2l6ZV90 IHNpemUsIEVGSV9ERVZJQ0VfUEFUSCAqZGV2cGF0aCkKIHsKLQogCXN3aXRjaCAoZGV2cGF0aC0+ VHlwZSkgewogCWNhc2UgTUVTU0FHSU5HX0RFVklDRV9QQVRIOgogCQlzd2l0Y2ggKGRldnBhdGgt PlN1YlR5cGUpIHsKQEAgLTI1MSw4ICsyODcsOSBAQAogCQkJSEFSRERSSVZFX0RFVklDRV9QQVRI ICpoZDsKIAogCQkJaGQgPSAoSEFSRERSSVZFX0RFVklDRV9QQVRIICopKHZvaWQgKilkZXZwYXRo OwotCQkJcmV0dXJuIHNucHJpbnRmKGJ1Ziwgc2l6ZSwgImhkKCV4KSIsCi0JCQkgICAgaGQtPlBh cnRpdGlvbk51bWJlcik7CisJCQlyZXR1cm4gc25wcmludGYoYnVmLCBzaXplLCAiaGQocCVkKSAo JXMpIiwKKwkJCSAgICBoZC0+UGFydGl0aW9uTnVtYmVyLAorCQkJICAgIGh1bWFuaXplX251bWJl cl9rbWd0KGhkLT5QYXJ0aXRpb25TaXplICogNTEyKSk7CiAJCX0KIAkJZGVmYXVsdDoKIAkJCXJl dHVybiBzbnByaW50ZihidWYsIHNpemUsICJtZWRpYSgweCUwMngpIiwKQEAgLTM1MCw2ICszODcs MTg2IEBACiAJcmV0dXJuIChFRklfTk9UX0ZPVU5EKTsKIH0KIAorLyogcXVpY2sgZGlydHkgd29y ay4gKi8KKyNkZWZpbmUJTlVNX0RFVl9MSVNUCTM1CisKK3R5cGVkZWYgc3RydWN0IHsKKwljb25z dCBib290X21vZHVsZV90CSptb2RwOworCWRldl9pbmZvX3QJCSpkZXZpbmZvcDsKK30gbW9kZGV2 X3Q7CisKK3N0YXRpYyBtb2RkZXZfdCBkZXZfbGlzdFtOVU1fREVWX0xJU1RdOworCitzdGF0aWMg aW50CitsaXN0X2RldmljZXModm9pZCkKK3sKKwlVSU5UTiBpLCBqOworCWRldl9pbmZvX3QgKmRl djsKKwljb25zdCBib290X21vZHVsZV90ICptb2Q7CisKKwlqID0gMDsKKwlmb3IgKGkgPSAwOyBp IDwgTlVNX0JPT1RfTU9EVUxFUzsgaSsrKSB7CisJCWlmIChib290X21vZHVsZXNbaV0gPT0gTlVM TCkKKwkJCWNvbnRpbnVlOworCQltb2QgPSBib290X21vZHVsZXNbaV07CisJCWZvciAoZGV2ID0g bW9kLT5kZXZpY2VzKCk7IGRldiAhPSBOVUxMOyBkZXYgPSBkZXYtPm5leHQpIHsKKwkJCWRldl9s aXN0W2pdLmRldmluZm9wID0gZGV2OworCQkJZGV2X2xpc3Rbal0ubW9kcCA9IG1vZDsKKwkJCWor KzsKKwkJCWlmIChqID49IE5VTV9ERVZfTElTVCkKKwkJCSAgICBicmVhazsKKwkJfQorCX0KKwor CXJldHVybiAoaik7Cit9CisKKyNkZWZpbmUJU0VMRUNUX1RJTUVPVVQJMTAKKworc3RhdGljIGNo YXIKK2lkeDJjaGFyKGludCBpKQoreworCXJldHVybiAoaTwxMCA/ICcwJytpIDogJ2EnK2ktMTAp OworfQorCitzdGF0aWMgaW50CitjaGFyMmlkeChjaGFyIGMpCit7CisJcmV0dXJuICgoYyA+PSAn MCcgJiYgYyA8PSAnOScpID8gYyAtICcwJyA6CisJICAgIChjID49ICdBJyAmJiBjIDw9ICdaJykg PyBjIC0gJ0EnICsgMTAgOgorCSAgICAoYyA+PSAnYScgJiYgYyA8PSAneicpID8gYyAtICdhJyAr IDEwIDoKKwkgICAgLTEgKTsKK30KKworc3RhdGljIHZvaWQKK21vdmVfdG9fdG9sKCkKK3sKKwlp bnQgeCx5OworCisJeCA9IGNvbm91dC0+TW9kZS0+Q3Vyc29yQ29sdW1uOworCXkgPSBjb25vdXQt Pk1vZGUtPkN1cnNvclJvdzsKKwljb25vdXQtPlNldEN1cnNvclBvc2l0aW9uKGNvbm91dCwgMCwg eSk7Cit9CisKK3N0YXRpYyBFRklfU1RBVFVTCitzZWxlY3RfYm9vdGRldihpbnQgbmRldnMsIGNv bnN0IGJvb3RfbW9kdWxlX3QgKiptb2RwLCBkZXZfaW5mb190ICoqZGV2aW5mb3AsCisgICAgdm9p ZCAqKmJ1ZnAsIHNpemVfdCAqYnVmc2l6ZSkKK3sKKwlpbnQgaTsKKwlpbnQgYywgbjsKKwlpbnQg dGltZV9sZWZ0OworCUVGSV9TVEFUVVMgc3RhdHVzOworCUVGSV9FVkVOVCB0aW1lcjsKKwlFRklf RVZFTlQgZXZlbnRzWzJdOworCVVJTlROIGlkeDsKKwlkZXZfaW5mb190ICpkZXY7CisJY29uc3Qg Ym9vdF9tb2R1bGVfdCAqbW9kOworCisJaWYgKChuZGV2cyA8PSAwKSB8fCAobmRldnMgPj0gTlVN X0RFVl9MSVNUKSkgeworCQlyZXR1cm4gKEVGSV9OT1RfRk9VTkQpOworCX0gZWxzZSBpZiAobmRl dnMgPT0gMSkgeworCQkvKiBPbmx5IG9uZSBjb25kaWRhdGUuICovCisJCSptb2RwID0gbW9kID0g ZGV2X2xpc3RbMF0ubW9kcDsKKwkJKmRldmluZm9wID0gZGV2ID0gZGV2X2xpc3RbMF0uZGV2aW5m b3A7CisJCXJldHVybiAobW9kLT5sb2FkKFBBVEhfTE9BREVSX0VGSSwgZGV2LAorCQkJIGJ1ZnAs IGJ1ZnNpemUpKTsKKwl9CisJLyogVHdvIG9yIG1vcmUgY2FuZGlkYXRlIGV4aXN0LiAqLworCXN0 YXR1cyA9IGJzLT5DcmVhdGVFdmVudChFVlRfVElNRVIsIDAsIDAsIE5VTEwsICZ0aW1lcik7CisJ aWYgKHN0YXR1cyAhPSBFRklfU1VDQ0VTUykgeworCQlwcmludGYoIkNhbid0IGFsbG9jYXRlIHRp bWVyIGV2ZW50LlxuIik7CisJCXJldHVybiAoc3RhdHVzKTsKKwl9CisJcHJpbnRmKCIgIDA6IEF1 dG9TZWxlY3RlZCBQYXJ0aXRpb24gKERlZmF1bHQpOiAwXG4iKTsgCisJZm9yIChpID0gMDsgaSA8 IG5kZXZzOyBpKyspIHsKKwkJaWYgKGRldl9saXN0W2ldLmRldmluZm9wLT5wcmVmZXJyZWQgPT0g VFJVRSkKKwkJCWMgPSAnKic7CisJCWVsc2UKKwkJCWMgPSAnICc7CisJCXByaW50ZigiICVjJWM6 ICVzOiAlczogJWNcbiIsIGMsIGlkeDJjaGFyKGkrMSksCisJCSAgICBkZXZfbGlzdFtpXS5tb2Rw LT5uYW1lLAorCQkgICAgZGV2cGF0aF9zdHIoZGV2X2xpc3RbaV0uZGV2aW5mb3AtPmRldnBhdGgp LAorCQkJaWR4MmNoYXIoaSsxKSk7CisJfQorCS8qIE9uZSBhbHBoYS1udW0gc2VsZWN0aW9uIG9u bHkuIElzIHRoaXMgYmlnIGVub3VnaCA/PyAqLworCWJzLT5TZXRUaW1lcih0aW1lciwgVGltZXJQ ZXJpb2RpYywgMTAwMDAwMDApOyAKKwlldmVudHNbMF0gPSB0aW1lcjsKKwlldmVudHNbMV0gPSBj b25pbi0+V2FpdEZvcktleTsKKwl0aW1lX2xlZnQgPSBTRUxFQ1RfVElNRU9VVDsKKworCXdoaWxl ICgxKSB7CisJCWlmICh0aW1lX2xlZnQgPiAwKSB7CisJCQlwcmludGYoIlNlbGVjdCBmcm9tIDAg dG8gJWMuIFRpbWVvdXQgaW4gJTJkIHNlY29uZHMsIgorCQkJICAgICAgICIgW1NwYWNlXSB0byBw YXVzZSA6ICIsCisJCQkgICAgICAgaWR4MmNoYXIobmRldnMpLCB0aW1lX2xlZnQpOworCQl9CisJ CXN0YXR1cyA9IGJzLT5XYWl0Rm9yRXZlbnQoMiwgZXZlbnRzLCAmaWR4KTsKKwkJaWYgKHN0YXR1 cyAhPSBFRklfU1VDQ0VTUykgeworCQkJYnMtPkNsb3NlRXZlbnQodGltZXIpOworCQkJcmV0dXJu IChzdGF0dXMpOworCQl9CisJCWlmIChpZHggPT0gMCkgeworCQkJdGltZV9sZWZ0LS07CisJCQlp ZiAodGltZV9sZWZ0IDw9MCkgeworCQkJCXByaW50ZigiXG5UaW1lb3V0LiAiCisJCQkJICAgICAg ICJQYXJ0aXRpb24gaXMgQXV0b1NlbGVjdGVkLlxuIik7CisJCQkJbiA9IDA7CisJCQkJYnJlYWs7 CisJCQl9IGVsc2UgeworCQkJCW1vdmVfdG9fdG9sKCk7CisJCQl9CisJCX0KKwkJaWYgKGlkeCA9 PSAxKSB7CisJCQljID0gZ2V0Y2hhcigpOworCQkJaWYgKChjID09ICdcbicpIHx8IChjID09ICdc cicpKSB7CisJCQkJcHV0Y2hhcignXG4nKTsKKwkJCQluID0gMDsKKwkJCQlicmVhazsKKwkJCX0g ZWxzZSBpZiAoKHRpbWVfbGVmdCA+IDApICYmIChjID09ICcgJykpIHsKKwkJCQlicy0+U2V0VGlt ZXIodGltZXIsIFRpbWVyQ2FuY2VsLCAwKTsgCisJCQkJdGltZV9sZWZ0ID0gLTE7CisJCQkJcHJp bnRmKCJcblRpbWVyIHN0b3BlZWQuXG4gUGxlYXNlIEtleSBpbjogIik7CisJCQl9CisJCQluID0g Y2hhcjJpZHgoYyk7CisJCQlpZiAoKG4gPj0gMCkgJiYgKG4gPD0gbmRldnMpKSB7CisJCQkJYnMt PlNldFRpbWVyKHRpbWVyLCBUaW1lckNhbmNlbCwgMCk7IAorCQkJCXRpbWVfbGVmdCA9IC0xOwor CQkJCXByaW50ZigiXG4gJWMgaXMgc2VsZWN0ZWQuXG4iLCBjKTsKKwkJCQlpZiAobiA9PSAwKSB7 IC8qIEF1dG9TZWxlY3QgKi8KKwkJCQkJYnJlYWs7CisJCQkJfSBlbHNlIHsKKwkJCQkJbW9kID0g ZGV2X2xpc3Rbbi0xXS5tb2RwOworCQkJCQlkZXYgPSBkZXZfbGlzdFtuLTFdLmRldmluZm9wOwor CQkJCQlzdGF0dXMgPSBtb2QtPmxvYWQoUEFUSF9MT0FERVJfRUZJLAorCQkJCQkJCSAgIGRldiwg YnVmcCwgYnVmc2l6ZSk7CisJCQkJCWlmIChzdGF0dXMgPT0gRUZJX1NVQ0NFU1MpIHsKKwkJCQkJ CWJyZWFrOworCQkJCQl9CisJCQkJCXByaW50ZigiRmFpbGVkIHRvIGxvYWQgJyVzJ1xuIiwKKwkJ CQkJCSBQQVRIX0xPQURFUl9FRkkpOworCQkJCQlwcmludGYoIlBsZWFzZSBzZWxlY3QgYWdhaW46 ICIpOworCQkJCX0KKwkJCX0gZWxzZSB7CisJCQkJLyogSW52YWxpZCBjaGFyZWN0ZXIuICovCisJ CQkJbW92ZV90b190b2woKTsKKwkJCX0KKwkJfQorCX07CisJYnMtPkNsb3NlRXZlbnQodGltZXIp OworCWlmIChuID09IDApIHsgLyogQXV0b1NlbGVjdCAqLworCQlzdGF0dXMgPSBsb2FkX2xvYWRl cihtb2RwLCBkZXZpbmZvcCwgYnVmcCwgYnVmc2l6ZSwgVFJVRSk7CisJCWlmIChzdGF0dXMgIT0g RUZJX1NVQ0NFU1MpIHsKKwkJCXN0YXR1cyA9IGxvYWRfbG9hZGVyKG1vZHAsIGRldmluZm9wLCBi dWZwLCBidWZzaXplLAorCQkJICAgIEZBTFNFKTsKKwkJfQorCX0gZWxzZSB7CisJCSptb2RwID0g ZGV2X2xpc3Rbbi0xXS5tb2RwOworCQkqZGV2aW5mb3AgPSBkZXZfbGlzdFtuLTFdLmRldmluZm9w OworCQlzdGF0dXMgPSBFRklfU1VDQ0VTUzsKKwl9CisJcmV0dXJuIChzdGF0dXMpOworfQorCiAv KgogICogdHJ5X2Jvb3Qgb25seSByZXR1cm5zIGlmIGl0IGZhaWxzIHRvIGxvYWQgdGhlIGxvYWRl ci4gSWYgaXQgc3VjY2VlZHMKICAqIGl0IHNpbXBseSBib290cywgb3RoZXJ3aXNlIGl0IHJldHVy bnMgdGhlIHN0YXR1cyBvZiBsYXN0IEVGSSBjYWxsLgpAQCAtMzU4LDcgKzU3NSw3IEBACiB0cnlf Ym9vdCgpCiB7CiAJc2l6ZV90IGJ1ZnNpemUsIGxvYWRlcnNpemUsIGNtZHNpemU7Ci0Jdm9pZCAq YnVmLCAqbG9hZGVyYnVmOworCXZvaWQgKmJ1ZiA9IE5VTEwsICpsb2FkZXJidWYgPSBOVUxMOwog CWNoYXIgKmNtZDsKIAlkZXZfaW5mb190ICpkZXY7CiAJY29uc3QgYm9vdF9tb2R1bGVfdCAqbW9k OwpAQCAtMzY1LDE1ICs1ODIsMTMgQEAKIAlFRklfSEFORExFIGxvYWRlcmhhbmRsZTsKIAlFRklf TE9BREVEX0lNQUdFICpsb2FkZWRfaW1hZ2U7CiAJRUZJX1NUQVRVUyBzdGF0dXM7CisJaW50IG5k ZXZzOwogCi0Jc3RhdHVzID0gbG9hZF9sb2FkZXIoJm1vZCwgJmRldiwgJmxvYWRlcmJ1ZiwgJmxv YWRlcnNpemUsIFRSVUUpOworCW5kZXZzID0gbGlzdF9kZXZpY2VzKCk7CisJc3RhdHVzID0gc2Vs ZWN0X2Jvb3RkZXYobmRldnMsICZtb2QsICZkZXYsICZsb2FkZXJidWYsICZsb2FkZXJzaXplKTsJ CiAJaWYgKHN0YXR1cyAhPSBFRklfU1VDQ0VTUykgewotCQlzdGF0dXMgPSBsb2FkX2xvYWRlcigm bW9kLCAmZGV2LCAmbG9hZGVyYnVmLCAmbG9hZGVyc2l6ZSwKLQkJICAgIEZBTFNFKTsKLQkJaWYg KHN0YXR1cyAhPSBFRklfU1VDQ0VTUykgewotCQkJcHJpbnRmKCJGYWlsZWQgdG8gbG9hZCAnJXMn XG4iLCBQQVRIX0xPQURFUl9FRkkpOwotCQkJcmV0dXJuIChzdGF0dXMpOwotCQl9CisJCXByaW50 ZigiRmFpbGVkIHRvIGxvYWQgJyVzJ1xuIiwgUEFUSF9MT0FERVJfRUZJKTsKKwkJcmV0dXJuIChF RklfTk9UX0ZPVU5EKTsKIAl9CiAKIAkvKgpAQCAtNDIzLDYgKzYzOCw5IEBACiAJbG9hZGVkX2lt YWdlLT5Mb2FkT3B0aW9uc1NpemUgPSBjbWRzaXplOwogCWxvYWRlZF9pbWFnZS0+TG9hZE9wdGlv bnMgPSBjbWQ7CiAKKwlwcmludGYoIkJvb3QgZnJvbTogJXMgaW4gMSBzZWNvbmRcbiIsIGRldnBh dGhfc3RyKGRldi0+ZGV2cGF0aCkpOworCWJzLT5TdGFsbCgxMDAwMDAwKTsKKwogCURQUklOVEYo IlN0YXJ0aW5nICclcycgaW4gNSBzZWNvbmRzLi4uIiwgUEFUSF9MT0FERVJfRUZJKTsKIAlEU1RB TEwoMTAwMDAwMCk7CiAJRFBSSU5URigiLiIpOwpAQCAtNTU5LDIxICs3NzcsMTMgQEAKIAlEU1RB TEwoNTAwMDAwKTsKIH0KIAotRUZJX1NUQVRVUwotZWZpX21haW4oRUZJX0hBTkRMRSBYaW1hZ2Us IEVGSV9TWVNURU1fVEFCTEUgKlhzeXN0YWIpCitzdGF0aWMgRUZJX1NUQVRVUworaW5pdF9jb25z b2xlKCkKIHsKLQlFRklfSEFORExFICpoYW5kbGVzOwotCUVGSV9MT0FERURfSU1BR0UgKmltZzsK LQlFRklfREVWSUNFX1BBVEggKmltZ3BhdGg7CiAJRUZJX1NUQVRVUyBzdGF0dXM7CiAJRUZJX0NP TlNPTEVfQ09OVFJPTF9QUk9UT0NPTCAqQ29uc29sZUNvbnRyb2wgPSBOVUxMOwotCVNJTVBMRV9U RVhUX09VVFBVVF9JTlRFUkZBQ0UgKmNvbm91dCA9IE5VTEw7Ci0JVUlOVE4gaSwgbWF4X2RpbSwg YmVzdF9tb2RlLCBjb2xzLCByb3dzLCBoc2l6ZSwgbmhhbmRsZXM7CiAKLQkvKiBCYXNpYyBpbml0 aWFsaXphdGlvbiovCi0Jc3lzdGFiID0gWHN5c3RhYjsKLQlpbWFnZSA9IFhpbWFnZTsKLQlicyA9 IFhzeXN0YWItPkJvb3RTZXJ2aWNlczsKKwlVSU5UTiBpLCBtYXhfZGltLCBiZXN0X21vZGUsIGNv bHMsIHJvd3M7CiAKIAkvKiBTZXQgdXAgdGhlIGNvbnNvbGUsIHNvIHByaW50ZiB3b3Jrcy4gKi8K IAlzdGF0dXMgPSBicy0+TG9jYXRlUHJvdG9jb2woJkNvbnNvbGVDb250cm9sR1VJRCwgTlVMTCwK QEAgLTU4NCw4ICs3OTQsMTEgQEAKIAkvKgogCSAqIFJlc2V0IHRoZSBjb25zb2xlIGFuZCBmaW5k IHRoZSBiZXN0IHRleHQgbW9kZS4KIAkgKi8KKwljb25pbiA9IHN5c3RhYi0+Q29uSW47CiAJY29u b3V0ID0gc3lzdGFiLT5Db25PdXQ7CisJY29uaW4tPlJlc2V0KGNvbmluLCBUUlVFKTsKIAljb25v dXQtPlJlc2V0KGNvbm91dCwgVFJVRSk7CisKIAltYXhfZGltID0gYmVzdF9tb2RlID0gMDsKIAlm b3IgKGkgPSAwOyA7IGkrKykgewogCQlzdGF0dXMgPSBjb25vdXQtPlF1ZXJ5TW9kZShjb25vdXQs IGksICZjb2xzLCAmcm93cyk7CkBAIC01OTgsOSArODExLDMxIEBACiAJfQogCWlmIChtYXhfZGlt ID4gMCkKIAkJY29ub3V0LT5TZXRNb2RlKGNvbm91dCwgYmVzdF9tb2RlKTsKKworCWNvbm91dC0+ U2V0QXR0cmlidXRlKGNvbm91dCwgRUZJX1RFWFRfQVRUUihERUZBVUxUX0ZHQ09MT1IsCisJICAg IERFRkFVTFRfQkdDT0xPUikpOwogCWNvbm91dC0+RW5hYmxlQ3Vyc29yKGNvbm91dCwgVFJVRSk7 CiAJY29ub3V0LT5DbGVhclNjcmVlbihjb25vdXQpOwogCisJcmV0dXJuIChzdGF0dXMpOworfQor CitFRklfU1RBVFVTCitlZmlfbWFpbihFRklfSEFORExFIFhpbWFnZSwgRUZJX1NZU1RFTV9UQUJM RSAqWHN5c3RhYikKK3sKKwlFRklfSEFORExFICpoYW5kbGVzOworCUVGSV9MT0FERURfSU1BR0Ug KmltZzsKKwlFRklfREVWSUNFX1BBVEggKmltZ3BhdGg7CisJRUZJX1NUQVRVUyBzdGF0dXM7CisJ VUlOVE4gaSwgaHNpemUsIG5oYW5kbGVzOworCisJLyogQmFzaWMgaW5pdGlhbGl6YXRpb24qLwor CXN5c3RhYiA9IFhzeXN0YWI7CisJaW1hZ2UgPSBYaW1hZ2U7CisJYnMgPSBYc3lzdGFiLT5Cb290 U2VydmljZXM7CisKKwlpbml0X2NvbnNvbGUoKTsKKwogCXByaW50ZigiXG4+PiBGcmVlQlNEIEVG SSBib290IGJsb2NrXG4iKTsKIAlwcmludGYoIiAgIExvYWRlciBwYXRoOiAlc1xuXG4iLCBQQVRI X0xPQURFUl9FRkkpOwogCXByaW50ZigiICAgSW5pdGlhbGl6aW5nIG1vZHVsZXM6Iik7CkBAIC03 MTUsMTQgKzk1MCw1NyBAQAogdm9pZAogcHV0Y2hhcihpbnQgYykKIHsKKwllZmlfY29uc19wdXRj aGFyKGMpOworfQorCit2b2lkCitlZmlfY29uc19wdXRjaGFyKGludCBjKQorewogCUNIQVIxNiBi dWZbMl07CiAKIAlpZiAoYyA9PSAnXG4nKSB7CiAJCWJ1ZlswXSA9ICdccic7CiAJCWJ1ZlsxXSA9 IDA7Ci0JCXN5c3RhYi0+Q29uT3V0LT5PdXRwdXRTdHJpbmcoc3lzdGFiLT5Db25PdXQsIGJ1Zik7 CisJCWNvbm91dC0+T3V0cHV0U3RyaW5nKGNvbm91dCwgYnVmKTsKIAl9CiAJYnVmWzBdID0gYzsK IAlidWZbMV0gPSAwOwotCXN5c3RhYi0+Q29uT3V0LT5PdXRwdXRTdHJpbmcoc3lzdGFiLT5Db25P dXQsIGJ1Zik7CisJY29ub3V0LT5PdXRwdXRTdHJpbmcoY29ub3V0LCBidWYpOwogfQorCitpbnQK K2dldGNoYXIodm9pZCkKK3sKKwlyZXR1cm4gZWZpX2NvbnNfZ2V0Y2hhcigpOworfQorCisKK2lu dAorZWZpX2NvbnNfZ2V0Y2hhcigpCit7CisJRUZJX0lOUFVUX0tFWSBrZXk7CisJRUZJX1NUQVRV UyBzdGF0dXM7CisJVUlOVE4ganVuazsKKworCS8qIFRyeSB0byByZWFkIGEga2V5IHN0cm9rZS4g V2Ugd2FpdCBmb3Igb25lIGlmIG5vbmUgaXMgcGVuZGluZy4gKi8KKwlzdGF0dXMgPSBjb25pbi0+ UmVhZEtleVN0cm9rZShjb25pbiwgJmtleSk7CisJaWYgKHN0YXR1cyA9PSBFRklfTk9UX1JFQURZ KSB7CisJCWJzLT5XYWl0Rm9yRXZlbnQoMSwgJmNvbmluLT5XYWl0Rm9yS2V5LCAmanVuayk7CisJ CXN0YXR1cyA9IGNvbmluLT5SZWFkS2V5U3Ryb2tlKGNvbmluLCAma2V5KTsKKwl9CisJc3dpdGNo IChrZXkuU2NhbkNvZGUpIHsKKwljYXNlIDB4MTc6IC8qIEVTQyAqLworCQlyZXR1cm4gKDB4MWIp OyAgLyogZXNjICovCisJfQorCisJLyogdGhpcyBjYW4gcmV0dXJuICAqLworCXJldHVybiAoa2V5 LlVuaWNvZGVDaGFyKTsKK30KKworaW50CitlZmlfY29uc19wb2xsKCkKK3sKKwkvKiBUaGlzIGNh biBjbGVhciB0aGUgc2lnbmFsZWQgc3RhdGUuICovCisJcmV0dXJuIChicy0+Q2hlY2tFdmVudChj b25pbi0+V2FpdEZvcktleSkgPT0gRUZJX1NVQ0NFU1MpOworfQorCg== --Multipart=_Sat__9_Sep_2017_15_12_17_+0900_dSgJ8XyasnCX=vd0-- From owner-svn-src-head@freebsd.org Sat Sep 9 06:24:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B169E05730; Sat, 9 Sep 2017 06:24:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 38CBB81AAE; Sat, 9 Sep 2017 06:24:22 +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 v896OL6S059877; Sat, 9 Sep 2017 06:24:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v896OLjN059876; Sat, 9 Sep 2017 06:24:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201709090624.v896OLjN059876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 9 Sep 2017 06:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323348 - head/usr.bin/tail/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/tail/tests X-SVN-Commit-Revision: 323348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:24:22 -0000 Author: ngie Date: Sat Sep 9 06:24:21 2017 New Revision: 323348 URL: https://svnweb.freebsd.org/changeset/base/323348 Log: Unbreak :broken_pipe - Capture exit code in pipeline and test in output. - Drop awk use in favor of `sleep 2`. This helps guarantee the EPIPE behavior without the potential race. Modified: head/usr.bin/tail/tests/tail_test.sh Modified: head/usr.bin/tail/tests/tail_test.sh ============================================================================== --- head/usr.bin/tail/tests/tail_test.sh Sat Sep 9 06:04:05 2017 (r323347) +++ head/usr.bin/tail/tests/tail_test.sh Sat Sep 9 06:24:21 2017 (r323348) @@ -222,10 +222,10 @@ broken_pipe_head() } broken_pipe_body() { - atf_expect_fail "Can't seem to get testcase to work in test environment. Reproduces easily in interactive shell." - atf_check -o save:ints seq -f '%128g' 1 1000 - atf_check -s exit:1 -o ignore -e "inline:tail: stdout" tail -n 856 ints | awk '{ exit }' + atf_check -s ignore \ + -e "inline:tail: stdout\nexit code: 1\n" \ + -x '(tail -n 856 ints; echo exit code: $? >&2) | sleep 2' } @@ -243,5 +243,5 @@ atf_init_test_cases() atf_add_test_case longfile_rc135782 atf_add_test_case longfile_rc145782_longlines atf_add_test_case longfile_rn2500 - #atf_add_test_case broken_pipe + atf_add_test_case broken_pipe } From owner-svn-src-head@freebsd.org Sat Sep 9 06:29:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16B2E05963; Sat, 9 Sep 2017 06:29:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64F0E81C76; Sat, 9 Sep 2017 06:29:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v896TTUd060096; Sat, 9 Sep 2017 06:29:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v896TTdl060092; Sat, 9 Sep 2017 06:29:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709090629.v896TTdl060092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 9 Sep 2017 06:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323349 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 323349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:29:30 -0000 Author: hselasky Date: Sat Sep 9 06:29:29 2017 New Revision: 323349 URL: https://svnweb.freebsd.org/changeset/base/323349 Log: Properly implement poll_wait() in the LinuxKPI. This prevents direct use of the linux_poll_wakeup() function from unsafe contexts, which can lead to use-after-free issues. Instead of calling linux_poll_wakeup() directly use the wake_up() family of functions in the LinuxKPI to do this. Bump the FreeBSD version to force recompilation of external kernel modules. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/poll.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Sep 9 06:24:21 2017 (r323348) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Sep 9 06:29:29 2017 (r323349) @@ -72,6 +72,17 @@ struct dentry { struct file_operations; +struct linux_file_wait_queue { + struct wait_queue wq; + struct wait_queue_head *wqh; + atomic_t state; +#define LINUX_FWQ_STATE_INIT 0 +#define LINUX_FWQ_STATE_NOT_READY 1 +#define LINUX_FWQ_STATE_QUEUED 2 +#define LINUX_FWQ_STATE_READY 3 +#define LINUX_FWQ_STATE_MAX 4 +}; + struct linux_file { struct file *_file; const struct file_operations *f_op; @@ -97,6 +108,7 @@ struct linux_file { #define LINUX_KQ_FLAG_NEED_WRITE (1 << 3) /* protects f_selinfo.si_note */ spinlock_t f_kqlock; + struct linux_file_wait_queue f_wait_queue; }; #define file linux_file Modified: head/sys/compat/linuxkpi/common/include/linux/poll.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/poll.h Sat Sep 9 06:24:21 2017 (r323348) +++ head/sys/compat/linuxkpi/common/include/linux/poll.h Sat Sep 9 06:29:29 2017 (r323349) @@ -40,11 +40,8 @@ typedef struct poll_table_struct { } poll_table; -static inline void -poll_wait(struct linux_file *filp, wait_queue_head_t *wait_address, poll_table *p) -{ - /* NOP */ -} +extern void linux_poll_wait(struct linux_file *, wait_queue_head_t *, poll_table *); +#define poll_wait(...) linux_poll_wait(__VA_ARGS__) extern void linux_poll_wakeup(struct linux_file *); Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sat Sep 9 06:24:21 2017 (r323348) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sat Sep 9 06:29:29 2017 (r323349) @@ -1023,10 +1023,9 @@ linux_dev_poll(struct cdev *dev, int events, struct th file = td->td_fpop; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll != NULL) { - selrecord(td, &filp->f_selinfo); + if (filp->f_op->poll != NULL) revents = filp->f_op->poll(filp, NULL) & events; - } else + else revents = 0; return (revents); @@ -1034,7 +1033,93 @@ error: return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } +/* + * This function atomically updates the poll wakeup state and returns + * the previous state at the time of update. + */ +static uint8_t +linux_poll_wakeup_state(atomic_t *v, const uint8_t *pstate) +{ + int c, old; + + c = v->counter; + + while ((old = atomic_cmpxchg(v, c, pstate[c])) != c) + c = old; + + return (c); +} + + +static int +linux_poll_wakeup_callback(wait_queue_t *wq, unsigned int wq_state, int flags, void *key) +{ + static const uint8_t state[LINUX_FWQ_STATE_MAX] = { + [LINUX_FWQ_STATE_INIT] = LINUX_FWQ_STATE_INIT, /* NOP */ + [LINUX_FWQ_STATE_NOT_READY] = LINUX_FWQ_STATE_NOT_READY, /* NOP */ + [LINUX_FWQ_STATE_QUEUED] = LINUX_FWQ_STATE_READY, + [LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_READY, /* NOP */ + }; + struct linux_file *filp = container_of(wq, struct linux_file, f_wait_queue.wq); + + switch (linux_poll_wakeup_state(&filp->f_wait_queue.state, state)) { + case LINUX_FWQ_STATE_QUEUED: + linux_poll_wakeup(filp); + return (1); + default: + return (0); + } +} + void +linux_poll_wait(struct linux_file *filp, wait_queue_head_t *wqh, poll_table *p) +{ + static const uint8_t state[LINUX_FWQ_STATE_MAX] = { + [LINUX_FWQ_STATE_INIT] = LINUX_FWQ_STATE_NOT_READY, + [LINUX_FWQ_STATE_NOT_READY] = LINUX_FWQ_STATE_NOT_READY, /* NOP */ + [LINUX_FWQ_STATE_QUEUED] = LINUX_FWQ_STATE_QUEUED, /* NOP */ + [LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_QUEUED, + }; + + selrecord(curthread, &filp->f_selinfo); + + switch (linux_poll_wakeup_state(&filp->f_wait_queue.state, state)) { + case LINUX_FWQ_STATE_INIT: + /* NOTE: file handles can only belong to one wait-queue */ + filp->f_wait_queue.wqh = wqh; + filp->f_wait_queue.wq.func = &linux_poll_wakeup_callback; + add_wait_queue(wqh, &filp->f_wait_queue.wq); + atomic_set(&filp->f_wait_queue.state, LINUX_FWQ_STATE_QUEUED); + break; + default: + break; + } +} + +static void +linux_poll_wait_dequeue(struct linux_file *filp) +{ + static const uint8_t state[LINUX_FWQ_STATE_MAX] = { + [LINUX_FWQ_STATE_INIT] = LINUX_FWQ_STATE_INIT, /* NOP */ + [LINUX_FWQ_STATE_NOT_READY] = LINUX_FWQ_STATE_INIT, + [LINUX_FWQ_STATE_QUEUED] = LINUX_FWQ_STATE_INIT, + [LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_INIT, + }; + + seldrain(&filp->f_selinfo); + + switch (linux_poll_wakeup_state(&filp->f_wait_queue.state, state)) { + case LINUX_FWQ_STATE_NOT_READY: + case LINUX_FWQ_STATE_QUEUED: + case LINUX_FWQ_STATE_READY: + remove_wait_queue(filp->f_wait_queue.wqh, &filp->f_wait_queue.wq); + break; + default: + break; + } +} + +void linux_poll_wakeup(struct linux_file *filp) { /* this function should be NULL-safe */ @@ -1358,6 +1443,7 @@ linux_file_close(struct file *file, struct thread *td) filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); + linux_poll_wait_dequeue(filp); error = -filp->f_op->release(NULL, filp); funsetown(&filp->f_sigio); kfree(filp); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Sep 9 06:24:21 2017 (r323348) +++ head/sys/sys/param.h Sat Sep 9 06:29:29 2017 (r323349) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200043 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200044 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Sep 9 06:34:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0EBEE05D6D; Sat, 9 Sep 2017 06:34:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8D6B582111; Sat, 9 Sep 2017 06:34:21 +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 v896YK09064027; Sat, 9 Sep 2017 06:34:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v896YKpQ064023; Sat, 9 Sep 2017 06:34:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709090634.v896YKpQ064023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 9 Sep 2017 06:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323350 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 323350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:34:21 -0000 Author: hselasky Date: Sat Sep 9 06:34:20 2017 New Revision: 323350 URL: https://svnweb.freebsd.org/changeset/base/323350 Log: Remove unsafe access to the LinuxKPI file structure from ibcore. selwakeup() is now done by the wake_up() family of functions. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ucm.c head/sys/ofed/drivers/infiniband/core/ucma.c head/sys/ofed/drivers/infiniband/core/user_mad.c head/sys/ofed/drivers/infiniband/core/uverbs_main.c Modified: head/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ucm.c Sat Sep 9 06:29:29 2017 (r323349) +++ head/sys/ofed/drivers/infiniband/core/ucm.c Sat Sep 9 06:34:20 2017 (r323350) @@ -378,8 +378,6 @@ static int ib_ucm_event_handler(struct ib_cm_id *cm_id list_add_tail(&uevent->file_list, &ctx->file->events); list_add_tail(&uevent->ctx_list, &ctx->events); wake_up_interruptible(&ctx->file->poll_wait); - if (ctx->file->filp) - selwakeup(&ctx->file->filp->f_selinfo); mutex_unlock(&ctx->file->file_mutex); return 0; Modified: head/sys/ofed/drivers/infiniband/core/ucma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ucma.c Sat Sep 9 06:29:29 2017 (r323349) +++ head/sys/ofed/drivers/infiniband/core/ucma.c Sat Sep 9 06:34:20 2017 (r323350) @@ -287,8 +287,6 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id list_add_tail(&uevent->list, &ctx->file->event_list); wake_up_interruptible(&ctx->file->poll_wait); - if (ctx->file->filp) - selwakeup(&ctx->file->filp->f_selinfo); out: mutex_unlock(&ctx->file->mut); return ret; Modified: head/sys/ofed/drivers/infiniband/core/user_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/user_mad.c Sat Sep 9 06:29:29 2017 (r323349) +++ head/sys/ofed/drivers/infiniband/core/user_mad.c Sat Sep 9 06:34:20 2017 (r323350) @@ -236,7 +236,6 @@ static int queue_packet(struct ib_umad_file *file, packet->mad.hdr.id++) if (agent == __get_agent(file, packet->mad.hdr.id)) { list_add_tail(&packet->list, &file->recv_list); - selwakeup(&file->filp->f_selinfo); wake_up_interruptible(&file->recv_wait); ret = 0; break; Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Sat Sep 9 06:29:29 2017 (r323349) +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Sat Sep 9 06:34:20 2017 (r323350) @@ -519,8 +519,6 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq spin_unlock_irqrestore(&file->lock, flags); wake_up_interruptible(&file->poll_wait); - if (file->filp) - selwakeup(&file->filp->f_selinfo); kill_fasync(&file->async_queue, SIGIO, POLL_IN); } @@ -554,8 +552,6 @@ static void ib_uverbs_async_handler(struct ib_uverbs_f spin_unlock_irqrestore(&file->async_file->lock, flags); wake_up_interruptible(&file->async_file->poll_wait); - if (file->async_file->filp) - selwakeup(&file->async_file->filp->f_selinfo); kill_fasync(&file->async_file->async_queue, SIGIO, POLL_IN); } From owner-svn-src-head@freebsd.org Sat Sep 9 06:55:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E861CE06702; Sat, 9 Sep 2017 06:55:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 3B32582903; Sat, 9 Sep 2017 06:55:38 +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 mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C8D64D6A1CE; Sat, 9 Sep 2017 16:28:51 +1000 (AEST) Date: Sat, 9 Sep 2017 16:28:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Ngie Cooper (yaneurabeya)" cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323329 - head/sys/sys In-Reply-To: <75479AB5-BB64-4D5B-8FA0-474532E7B103@gmail.com> Message-ID: <20170909155623.F17598@besplex.bde.org> References: <201709082009.v88K9EGW006964@repo.freebsd.org> <75479AB5-BB64-4D5B-8FA0-474532E7B103@gmail.com> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=fu1ihy1R8jAR-iTdvv0A:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 06:55:39 -0000 On Fri, 8 Sep 2017, Ngie Cooper (yaneurabeya) wrote: >> On Sep 8, 2017, at 13:09, Mateusz Guzik wrote: >> ... >> Log: >> Allow __builtin_memset instead of bzero for small buffers of known size > > This change breaks all platforms that use gcc. If it=E2=80=99s not revert= ed in the next 3 hours, I=E2=80=99ll revert it. Not all. It works for me. My version of it is 15-20 years old and never always worked on old versions of FreeBSD The problem seems to be with inlining parameters. These are fairly broken by default in gcc-4.2.1, and the overrides in kern/pre.mk only work in some cases. -Os is completely broken (with the overrides, it at best gives a 20% pessimization for space, and with other overrides inlining tends to fail). I recently found a workaround: compile with -fno-inline-functions. So my full compiler flags are CONF_CFLAGS=3D[-march=3Di386] -Os -fno-inline-functions -fno-inline-functions-called-once. This should reduce problems with inlining. However, kernels still build with the bad default flags of -O2. > Please fix ASAP if possible: https://ci.freebsd.org/job/FreeBSD-head-risc= v64-build/3668/console . This also shows problems with uninitialized variables. But -Wno-uninitialized is the default for gcc-4.2.1. This breaks lots of warnings Maybe you have different nonstandard options to avoid the breakage. -Wno-uninitialized is set in kern.mk, and also in kern.pre.mk for cddl. (CDDL_CFLAGS apparerently gives a dumbed down subset of CWARNFLAGS to break many more warnings.) There is a problem getting flags passed to all Makefiles. CONF_CFLAGS (and all other makeoptions in config files) is broken for modules (since macros in the kernel Makefile are not inherited). This feature prevents me using modules even if I forget I don't like them. Flags in kern.mk are only broken for boot Makefiles which neglect to include kern.mk (that is, for all current boot Makefiles). Bruce From owner-svn-src-head@freebsd.org Sat Sep 9 07:09:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9ADFE06DA5; Sat, 9 Sep 2017 07:09:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A205583028; Sat, 9 Sep 2017 07:09:44 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 858BC1A0648; Sat, 9 Sep 2017 16:52:37 +1000 (AEST) Date: Sat, 9 Sep 2017 16:52:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Libby cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323192 - head/contrib/binutils/opcodes In-Reply-To: <201709051904.v85J48P2013715@repo.freebsd.org> Message-ID: <20170909163214.A17691@besplex.bde.org> References: <201709051904.v85J48P2013715@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=S1pSPPnuXjUizFS4LA0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 07:09:45 -0000 On Tue, 5 Sep 2017, Ryan Libby wrote: > Log: > gnu binutils: FSGSBASE assembly/disassembly > > Enable the in-tree binutils to assemble and disassemble amd64 FSGSBASE > instructions (rdfsbase, rdgsbase, wrfsbase, wrgsbase), used in the base > system since r322763. Thanks. > This gives one last gasp for in-tree gcc, and provides a small > enhancement for in-tree binutils objdump. After this, it will be necessary to use .byte. This is almost simpler for *fsbase too. ddb still doesn't understand this instruction or many other more important instructions. amd64 is most broken, but I rarely notice since I normally use i386. ddb still doesn't understand pc-relative addressing so for amd64 it displays addresses of global variables as raw offsets from %rip. Bruce From owner-svn-src-head@freebsd.org Sat Sep 9 07:14:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11177E07105; Sat, 9 Sep 2017 07:14:44 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (xvm-110-62.dc2.ghst.net [46.226.110.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F27383508; Sat, 9 Sep 2017 07:14:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.65] (host86-138-54-151.range86-138.btcentralplus.com [86.138.54.151]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id v897EYm4084821 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Sep 2017 07:14:35 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: d60e724c-75b0-4b63-9702-f4a9d2bf6793: Host host86-138-54-151.range86-138.btcentralplus.com [86.138.54.151] claimed to be [192.168.1.65] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323329 - head/sys/sys From: David Chisnall In-Reply-To: <201709082009.v88K9EGW006964@repo.freebsd.org> Date: Sat, 9 Sep 2017 08:14:30 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9BE7B1BD-DE1A-48FE-B247-A3CE7674648E@FreeBSD.org> References: <201709082009.v88K9EGW006964@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 07:14:44 -0000 On 8 Sep 2017, at 21:09, Mateusz Guzik wrote: >=20 > Author: mjg > Date: Fri Sep 8 20:09:14 2017 > New Revision: 323329 > URL: https://svnweb.freebsd.org/changeset/base/323329 >=20 > Log: > Allow __builtin_memset instead of bzero for small buffers of known = size This change seems redundant, because modern compilers already do this = optimisation. For example: #include =09 char buf[42]; =09 void bz(void) { bzero(buf, 42); } With clang 4.0 on x86 compiles to: pushq %rbp movq %rsp, %rbp xorps %xmm0, %xmm0 movups %xmm0, buf+26(%rip) movaps %xmm0, buf+16(%rip) movaps %xmm0, buf(%rip) popq %rbp retq On AArch64, it compiles to: adrp x8, buf add x8, x8, :lo12:buf strh wzr, [x8, #40] stp xzr, xzr, [x8, #24] stp xzr, xzr, [x8, #8] str xzr, [x8] ret Neither contains a call, both have inlined the zeroing. This change is = strictly worse, because the compiler has some carefully tuned heuristics = that are set per target for when to inline the memset / bzero and when = to call the function. These are based on both the size and the = alignment, including whether the target supports misaligned accesses and = whether misaligned accesses are cheap. None of this is captured by this = change. In the kernel, this optimisation is disabled by -ffreestanding, however = __builtin_memset will be turned into a memset call if the size is not = constant or if the memset call would be more efficient (as determined by = the aforementioned heuristics). Simply using __builtin_memset in all = cases should give better code, and is more likely to be forward = compatible with future ISAs where the arbitrary constant picked in this = patch may or may not be optimal. David From owner-svn-src-head@freebsd.org Sat Sep 9 07:21:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A46E5E07399; Sat, 9 Sep 2017 07:21:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id 715BE83837; Sat, 9 Sep 2017 07:21:28 +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 v897LR2J084297; Sat, 9 Sep 2017 07:21:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v897LRWA084296; Sat, 9 Sep 2017 07:21:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709090721.v897LRWA084296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 9 Sep 2017 07:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323351 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 323351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 07:21:28 -0000 Author: hselasky Date: Sat Sep 9 07:21:27 2017 New Revision: 323351 URL: https://svnweb.freebsd.org/changeset/base/323351 Log: Resolve IPv6 scope ID issues when using ip6_find_dev() in the LinuxKPI. Workaround problem that ifa_ifwithaddr() also matches the scope ID of the IPv6 address when searching for a maching IPv6 address. For now simply try all valid scope IDs until a match is found. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Modified: head/sys/compat/linuxkpi/common/include/linux/inetdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep 9 06:34:20 2017 (r323350) +++ head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep 9 07:21:27 2017 (r323351) @@ -62,22 +62,26 @@ ip6_dev_find(struct vnet *vnet, struct in6_addr addr) { struct sockaddr_in6 sin6; struct ifaddr *ifa; - struct ifnet *ifp; + struct ifnet *ifp = NULL; + int x; memset(&sin6, 0, sizeof(sin6)); sin6.sin6_addr = addr; sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; CURVNET_SET_QUIET(vnet); - ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); - CURVNET_RESTORE(); - if (ifa) { - ifp = ifa->ifa_ifp; - if_ref(ifp); - ifa_free(ifa); - } else { - ifp = NULL; + /* XXX need to search all scope ID's */ + for (x = 0; x <= V_if_index; x++) { + sin6.sin6_addr.s6_addr[3] = x; + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + if (ifa != NULL) { + ifp = ifa->ifa_ifp; + if_ref(ifp); + ifa_free(ifa); + break; + } } + CURVNET_RESTORE(); return (ifp); } From owner-svn-src-head@freebsd.org Sat Sep 9 07:41:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF5CE07ABF; Sat, 9 Sep 2017 07:41:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 0023583DD0; Sat, 9 Sep 2017 07:41:14 +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 mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 8EE72D4C470; Sat, 9 Sep 2017 17:41:11 +1000 (AEST) Date: Sat, 9 Sep 2017 17:41:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323346 - in head/sys: powerpc/powerpc riscv/riscv In-Reply-To: <201709090556.v895u4jT047914@repo.freebsd.org> Message-ID: <20170909165558.L17783@besplex.bde.org> References: <201709090556.v895u4jT047914@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=TndSgwv1mRtEoi0LMpgA:9 a=i2ew2XslFD7TePt7:21 a=TWx7WGl9SGVvKt4g:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 07:41:16 -0000 On Sat, 9 Sep 2017, Mateusz Guzik wrote: > Log: > Fix riscv and powerpc compilation after r323329. > > On these archs bzero is a C function, which triggers a compilation error > as the compiler tries to expand the macro. bzero() is a C function on all arches. It is just written in C on these archs. > Modified: head/sys/powerpc/powerpc/machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/machdep.c Sat Sep 9 05:50:47 2017 (r323345) > +++ head/sys/powerpc/powerpc/machdep.c Sat Sep 9 05:56:04 2017 (r323346) > @@ -417,43 +417,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs > (sizeof(struct callframe) - 3*sizeof(register_t))) & ~15UL); > } > > -void > -bzero(void *buf, size_t len) > [... 100+ more lines of patches] Ugh. All you have to do here is declare bzero correctly: void (bzero)(void *buf, size_t len) Since bzero() is now a macro, the old declaration is incorrect. > ... > @@ -555,3 +518,41 @@ DB_SHOW_COMMAND(spr, db_show_spr) > (unsigned long)spr); > } > #endif > + > +#undef bzero > +void > +bzero(void *buf, size_t len) The undef should work too. Why make the patch unreadable by moving everything? > Modified: head/sys/riscv/riscv/machdep.c > ============================================================================== > --- head/sys/riscv/riscv/machdep.c Sat Sep 9 05:50:47 2017 (r323345) > +++ head/sys/riscv/riscv/machdep.c Sat Sep 9 05:56:04 2017 (r323346) > @@ -151,16 +151,6 @@ cpu_idle_wakeup(int cpu) > return (0); > } > > -void > -bzero(void *buf, size_t len) > -{ > - uint8_t *p; > - > - p = buf; > - while(len-- > 0) > - *p++ = 0; > -} > - This is an underengineered C version, while the powerpc version is misoverengineered. The correct overengineering is to copy the libc version (at worst the MI version which is a bit like the powerpc kernel version) to libkern. > int > fill_regs(struct thread *td, struct reg *regs) > { > @@ -890,4 +880,15 @@ initriscv(struct riscv_bootparams *rvbp) > riscv_init_interrupts(); > > early_boot = 0; > +} > + > +#undef bzero > +void > +bzero(void *buf, size_t len) > +{ > + uint8_t *p; > + > + p = buf; > + while(len-- > 0) > + *p++ = 0; > } I guess moving it to the end is to keep the macro alive for the rest of the file. So just declare it correctly and don't use #undef or move anything. My old version of this has related complications: X Index: systm.h X =================================================================== X RCS file: /home/ncvs/src/sys/sys/systm.h,v X retrieving revision 1.208 X diff -u -2 -r1.208 systm.h X --- systm.h 17 Jun 2004 17:16:52 -0000 1.208 X +++ systm.h 7 Feb 2007 23:20:06 -0000 X @@ -140,45 +142,79 @@ X void backtrace(void); X void cpu_boot(int); X -void cpu_rootconf(void); X -extern uint32_t crc32_tab[]; X +void cpu_halt(void) __dead2; X +void cpu_reset(void) __dead2; X uint32_t crc32(const void *buf, size_t size); X +extern uint32_t crc32_tab[]; X void critical_enter(void); X void critical_exit(void); X +void hexdump(void *ptr, int length, const char *hdr, int flags); X +#define HD_COLUMN_MASK 0xff X +#define HD_DELIM_MASK 0xff00 X +#define HD_OMIT_COUNT (1 << 16) X +#define HD_OMIT_HEX (1 << 17) X +#define HD_OMIT_CHARS (1 << 18) X void init_param1(void); X void init_param2(long physpages); X void init_param3(long kmempages); X void tablefull(const char *); X -int kvprintf(char const *, void (*)(int, void*), void *, int, X - __va_list) __printflike(1, 0); X +int kvprintf(char const *, void (*)(int, void*), void *, int, __va_list) X + __printflike(1, 0); X void log(int, const char *, ...) __printflike(2, 3); X void log_console(struct uio *); X int printf(const char *, ...) __printflike(1, 2); X int snprintf(char *, size_t, const char *, ...) __printflike(3, 4); X -int sprintf(char *buf, const char *, ...) __printflike(2, 3); X +int sprintf(char *, const char *, ...) __printflike(2, 3); X +int sscanf(const char *, char const *, ...) __scanflike(2, 3); X +long strtol(const char *, char **, int) __nonnull(1); X +quad_t strtoq(const char *, char **, int) __nonnull(1); X +u_long strtoul(const char *, char **, int) __nonnull(1); X +u_quad_t strtouq(const char *, char **, int) __nonnull(1); X +void tprintf(struct proc *p, int pri, const char *, ...) X + __printflike(3, 4); X int uprintf(const char *, ...) __printflike(1, 2); X int vprintf(const char *, __va_list) __printflike(1, 0); X int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); X -int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0); X -int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); X +int vsnrprintf(char *, size_t, int, const char *, __va_list) X + __printflike(4, 0); X +int vsprintf(char *, const char *, __va_list) __printflike(2, 0); X +int vsscanf(const char *, char const *, __va_list) __scanflike(2, 0); X int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); X -int sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2); X -int vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2); X -long strtol(const char *, char **, int) __nonnull(1); X -u_long strtoul(const char *, char **, int) __nonnull(1); X -quad_t strtoq(const char *, char **, int) __nonnull(1); X -u_quad_t strtouq(const char *, char **, int) __nonnull(1); X -void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4); X -void hexdump(void *ptr, int length, const char *hdr, int flags); X -#define HD_COLUMN_MASK 0xff X -#define HD_DELIM_MASK 0xff00 X -#define HD_OMIT_COUNT (1 << 16) X -#define HD_OMIT_HEX (1 << 17) X -#define HD_OMIT_CHARS (1 << 18) Lots of unrelated style fixes in the same hunk. X X -#define ovbcopy(f, t, l) bcopy((f), (t), (l)) X +#define ovbcopy(f, t, l) bcopy((f), (t), (l)) Related style fix. X void bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2); X +#ifndef _BZERO_DECLARED X void bzero(void *buf, size_t len) __nonnull(1); X +#define _BZERO_DECLARED X +#endif Allow alternative implementations (perhaps as a pure macro). X + X +#if 1 X +#define bzero(p, n) ({ \ X + if (__builtin_constant_p(n) && (n) <= 32) \ X + __builtin_memset((p), 0, (n)); \ X + else \ X + (bzero)((p), (n)); \ X +}) X +#endif Hard-coding the threshold is wrong. 32 is for gcc-3 on at least i386. gcc-4 generates inline code up to 64 on both i386 and 32. The clang code for length 64 is bad on i386, but the exten bzero() is worse. clang's inline code then consists of 16 5-10 byte instructions to move 4 bytes each . gcc prefers string instructions above about 8 btes for gcc-3 and 16 bytes for gcc-4. "rep stosl" takes too long to start up, but gcc-3 prefers it. gcc-4 prefers several "stosl"s. This is still slower than ordinary store instructions provided the instruction fetcher can keep up with the latter. bzero() on i386 uses "rep stos*" in all cases, with extra pessimizations for the end condition. It seems best to change the 64 to 8 * sizeof(long). __builtin_memset() actually degrades to memset() above the threshold. memset() is slightly worse than bzero(). (It has silly optimizations done in libkern instead of here.) The magic 64 is basically the x86 threshold for gcc-4 and clang on certain (perhaps all) -march configurations. ("rep stosl" works better on newer arches, but it still takes too long to start up for counts below a few hundred bytes, and AVX methods are probably better starting at more like 64 bytes). Compilers know that that don't know what is best so I think they use a threshold of 64 for most cases. But this is very x86-dependent. We could also know that the riscv bzero() is especially slow and use a threshold of ininity so that it is never called (memset() would be called instead, and we know that it reduces to extern bzero() so actually reaches the slow bzero() slightly slower). X X -void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2); X +#if 0 X +static __inline void * X +memset(void *b, int c, size_t len) X +{ X + char *bb; X + X + if (c == 0) X + bzero(b, len); X + else X + for (bb = b; len--; ) X + *bb++ = c; X + return (b); X +} X +#endif Without the '#if 0', this would move the inline memset() from libkern.h to here. It is arguably a style bug for it to be in libkern.h, and it must be here for the bzero() in it to use the macro. -current has much worse messes for memset(). It still has the inline version in libkern. It also has an extern memset() in libkern/memset.c. The inline function is misnamed memset(), so it cannot be used to implement the extern memset(), so the code is duplicated and ifdefs tangles are needed to prevent duplicate definitions. X + X +void *memcpy(void *to, const void *from, size_t len) __nonnull(1) X + __nonnull(2); X +#if 1 X +#define memcpy(to, from, n) __builtin_memcpy((to), (from), (n)) X +#endif I also optimize memcpy(). This is simpler because the builtin falls back to an extern function with essentially the same name and no messes in its implementation (the x86 memcpy() is just intentionally suboptimal, since it was supposed to be only used for this fallback back when memcpy() gave the builtin). X X int copystr(const void * __restrict kfaddr, void * __restrict kdaddr, Bruce From owner-svn-src-head@freebsd.org Sat Sep 9 07:48:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2721E07FC8; Sat, 9 Sep 2017 07:48:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFFB2842FB; Sat, 9 Sep 2017 07:48:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v897mwEr092933; Sat, 9 Sep 2017 07:48:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v897mwKg092932; Sat, 9 Sep 2017 07:48:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709090748.v897mwKg092932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 07:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323352 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 323352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 07:49:00 -0000 Author: tuexen Date: Sat Sep 9 07:48:58 2017 New Revision: 323352 URL: https://svnweb.freebsd.org/changeset/base/323352 Log: The combination of IPv6 and SCTP is also supported. MFC after: 1 week Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sat Sep 9 07:21:27 2017 (r323351) +++ head/usr.bin/netstat/netstat.1 Sat Sep 9 07:48:58 2017 (r323352) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd September 9, 2017 .Dt NETSTAT 1 .Os .Sh NAME @@ -770,7 +770,7 @@ The following address families and protocols are recog .It Cm inet Pq Dv AF_INET .Cm divert , icmp , igmp , ip , ipsec , pim, sctp , tcp , udp .It Cm inet6 Pq Dv AF_INET6 -.Cm icmp6 , ip6 , ipsec6 , rip6 , tcp , udp +.Cm icmp6 , ip6 , ipsec6 , rip6 , sctp , tcp , udp .It Cm pfkey Pq Dv PF_KEY .Cm pfkey .It Cm netgraph , ng Pq Dv AF_NETGRAPH From owner-svn-src-head@freebsd.org Sat Sep 9 09:40:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A17EE0C19B; Sat, 9 Sep 2017 09:40:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id BD6AB2658; Sat, 9 Sep 2017 09:40:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id F3CFE425D9F; Sat, 9 Sep 2017 19:40:49 +1000 (AEST) Date: Sat, 9 Sep 2017 19:40:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323329 - head/sys/sys In-Reply-To: <9BE7B1BD-DE1A-48FE-B247-A3CE7674648E@FreeBSD.org> Message-ID: <20170909180554.A17984@besplex.bde.org> References: <201709082009.v88K9EGW006964@repo.freebsd.org> <9BE7B1BD-DE1A-48FE-B247-A3CE7674648E@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=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=USMd3rqED0NyYiGRO1kA:9 a=RbNcUileWBSlwGLN:21 a=B3oMvqzVwg8tgyhn:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 09:40:58 -0000 On Sat, 9 Sep 2017, David Chisnall wrote: > On 8 Sep 2017, at 21:09, Mateusz Guzik wrote: >> >> Author: mjg >> Date: Fri Sep 8 20:09:14 2017 >> New Revision: 323329 >> URL: https://svnweb.freebsd.org/changeset/base/323329 >> >> Log: >> Allow __builtin_memset instead of bzero for small buffers of known size > > This change seems redundant, because modern compilers already do this optimisation. For example: > > #include > > char buf[42]; > > void bz(void) > { > bzero(buf, 42); > } > > With clang 4.0 on x86 compiles to: > > pushq %rbp > movq %rsp, %rbp > xorps %xmm0, %xmm0 > movups %xmm0, buf+26(%rip) > movaps %xmm0, buf+16(%rip) > movaps %xmm0, buf(%rip) > popq %rbp > retq This is only a valid optimization for POSIX code. Compiling with -std=c99 turns it off, even though the non-C99 is included. Note that -std is broken in CFLAGS for the kernel. It is c99 (actually iso9899:1999). Userland uses the correct standard gnu99. -std=c99 breaks other gnu features like unnamed struct/unions which are then unbroken bogusly using -fms-extensions. > Neither contains a call, both have inlined the zeroing. This change is strictly worse, because the compiler has some carefully tuned heuristics that are set per target for when to inline the memset / bzero and when to call the function. These are based on both the size and the alignment, including whether the target supports misaligned accesses and whether misaligned accesses are cheap. None of this is captured by this change. It is strictly better than plain bzero() in the kernel, and makes no difference in userland. > In the kernel, this optimisation is disabled by -ffreestanding, however __builtin_memset will be turned into a memset call if the size is not constant or if the memset call would be more efficient (as determined by the aforementioned heuristics). Simply using __builtin_memset in all cases should give better code, and is more likely to be forward compatible with future ISAs where the arbitrary constant picked in this patch may or may not be optimal. Compilers don't really understand this. In the kernel, extern memset() is strictly worse than extern bzero(), since memset() is just a wrapper around bzero(). Thus simply using __builtin_memset() gives worse strictly code in all cases that are not inlined. Not a large amount worse since the wrapper only does an extra branch and function call when it reduces to bzero(). memset() is just slow in other cases. The constant is not arbitrary, but is hard-coded to the x86 value which is more arbitrary. x86 compilers know that they don't really understand memory so they hard-code a conservative value of 64. It is only possible do better by compiling for a specific arch and knowing how good or bad the extern function is. 64 is about the smallest value above which the extern function could possibly do significantly better by knowing or doing more. Usually it does slightly worse near 64 and also higher since it knows less, especially if the compilation was for a specific arch (clang seems to have even more methods than my benchmarks for this -- hundreds instead of tens --, while x86 kernels have only one method optimized for 25-year old arches and now OK again on new arches with fast string instructions (above a few hundred bytes). Bruce From owner-svn-src-head@freebsd.org Sat Sep 9 10:54:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F11AE0F2EF; Sat, 9 Sep 2017 10:54:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6C7FF63AED; Sat, 9 Sep 2017 10:54:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89AsDYC070003; Sat, 9 Sep 2017 10:54:13 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89AsDlZ070001; Sat, 9 Sep 2017 10:54:13 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091054.v89AsDlZ070001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 10:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323353 - in head/sys: conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: conf dev/usb/controller X-SVN-Commit-Revision: 323353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 10:54:14 -0000 Author: mw Date: Sat Sep 9 10:54:13 2017 New Revision: 323353 URL: https://svnweb.freebsd.org/changeset/base/323353 Log: Add support for xhci in Armada 3700 and 7k/8k This driver will be used by Marvell Armada 3700 and 7k/8k SoC families. The same, generic xhci device also appears in Armada 380, so we are reusing driver. This patch also adds xhci_mv.c entry to the arm64 files list. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12252 Modified: head/sys/conf/files.arm64 head/sys/dev/usb/controller/xhci_mv.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 9 07:48:58 2017 (r323352) +++ head/sys/conf/files.arm64 Sat Sep 9 10:54:13 2017 (r323353) @@ -179,6 +179,7 @@ dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt +dev/usb/controller/xhci_mv.c optional xhci_mv fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Modified: head/sys/dev/usb/controller/xhci_mv.c ============================================================================== --- head/sys/dev/usb/controller/xhci_mv.c Sat Sep 9 07:48:58 2017 (r323352) +++ head/sys/dev/usb/controller/xhci_mv.c Sat Sep 9 10:54:13 2017 (r323353) @@ -74,6 +74,8 @@ static device_detach_t xhci_detach; static struct ofw_compat_data compat_data[] = { {"marvell,armada-380-xhci", true}, + {"marvell,armada3700-xhci", true}, + {"marvell,armada-8k-xhci", true}, {NULL, false} }; From owner-svn-src-head@freebsd.org Sat Sep 9 10:58:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73BC1E0F64A; Sat, 9 Sep 2017 10:58:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 41E5663D1A; Sat, 9 Sep 2017 10:58:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89AwjRP070218; Sat, 9 Sep 2017 10:58:45 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89AwjIw070217; Sat, 9 Sep 2017 10:58:45 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091058.v89AwjIw070217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 10:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323354 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 323354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 10:58:46 -0000 Author: mw Date: Sat Sep 9 10:58:45 2017 New Revision: 323354 URL: https://svnweb.freebsd.org/changeset/base/323354 Log: Enable compilation of Marvell XHCI driver in arm64 GENERIC Enabled driver can be used on boards equipped with Marvell Armada 3700/7k/8k SoCs. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12253 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 9 10:54:13 2017 (r323353) +++ head/sys/arm64/conf/GENERIC Sat Sep 9 10:58:45 2017 (r323354) @@ -159,6 +159,7 @@ device dwcotg # DWC OTG controller device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) +device xhci_mv # Marvell XHCI USB interface device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da From owner-svn-src-head@freebsd.org Sat Sep 9 11:00:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71B6E0F75A; Sat, 9 Sep 2017 11:00:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C3C63EA4; Sat, 9 Sep 2017 11:00:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89B08T2070368; Sat, 9 Sep 2017 11:00:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89B07LZ070354; Sat, 9 Sep 2017 11:00:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709091100.v89B07LZ070354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 9 Sep 2017 11:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323355 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/f... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contri... X-SVN-Commit-Revision: 323355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:00:09 -0000 Author: avg Date: Sat Sep 9 11:00:07 2017 New Revision: 323355 URL: https://svnweb.freebsd.org/changeset/base/323355 Log: MFV r323107: 8414 Implemented zpool scrub pause/resume illumos/illumos-gate@1702cce751c5cb7ead878d0205a6c90b027e3de8 https://github.com/illumos/illumos-gate/commit/1702cce751c5cb7ead878d0205a6c90b027e3de8 FreeBSD note: rather than merging the zpool.8 update I copied the zpool scrub section from the illumos zpool.1m to FreeBSD zpool.8 almost verbatim. Now that the illumos page uses the mdoc format, it was an easier option. Perhaps the change is not in perfect compliance with the FreeBSD style, but I think that it is acceptible. https://www.illumos.org/issues/8414 This issue tracks the port of scrub pause from ZoL: https://github.com/zfsonlinux/zfs/pull/6167 Currently, there is no way to pause a scrub. Pausing may be useful when the pool is busy with other I/O to preserve bandwidth. Description This patch adds the ability to pause and resume scrubbing. This is achieved by maintaining a persistent on-disk scrub state. While the state is 'paused' we do not scrub any more blocks. We do however perform regular scan housekeeping such as freeing async destroyed and deadlist blocks while paused. Motivation and Context Scrub pausing can be an I/O intensive operation and people have been asking for the ability to pause a scrub for a while. This allows one to preserve scrub progress while freeing up bandwidth for other I/O. Reviewed by: George Melikov Reviewed by: Brian Behlendorf Reviewed by: Brad Lewis Reviewed by: Serapheim Dimitropoulos Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Alek Pinchuk MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 9 10:58:45 2017 (r323354) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 9 11:00:07 2017 (r323355) @@ -19,14 +19,15 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs -.\" Copyright (c) 2013 by Delphix. All Rights Reserved. .\" Copyright (c) 2012, Glen Barber +.\" Copyright (c) 2013 by Delphix. All Rights Reserved. +.\" Copyright 2017 Nexenta Systems, Inc. +.\" Copyright (c) 2017 Datto Inc. .\" .\" $FreeBSD$ .\" -.Dd July 26, 2014 +.Dd September 08, 2017 .Dt ZPOOL 8 .Os .Sh NAME @@ -153,7 +154,7 @@ .Op Ar new_device .Nm .Cm scrub -.Op Fl s +.Op Fl s | Fl p .Ar pool ... .Nm .Cm set @@ -1543,42 +1544,53 @@ manner. .It Xo .Nm .Cm scrub -.Op Fl s +.Op Fl s | Fl p .Ar pool ... .Xc .Pp -Begins a scrub. The scrub examines all data in the specified pools to verify -that it checksums correctly. For replicated (mirror or -.No raidz ) -devices, -.Tn ZFS -automatically repairs any damage discovered during the scrub. The -.Qq Nm Cm status +Begins a scrub or resumes a paused scrub. +The scrub examines all data in the specified pools to verify that it checksums +correctly. +For replicated +.Pq mirror or raidz +devices, ZFS automatically repairs any damage discovered during the scrub. +The +.Nm zpool Cm status command reports the progress of the scrub and summarizes the results of the scrub upon completion. .Pp -Scrubbing and resilvering are very similar operations. The difference is that -resilvering only examines data that -.Tn ZFS -knows to be out of date (for example, when attaching a new device to a mirror -or replacing an existing device), whereas scrubbing examines all data to -discover silent errors due to hardware faults or disk failure. +Scrubbing and resilvering are very similar operations. +The difference is that resilvering only examines data that ZFS knows to be out +of date +.Po +for example, when attaching a new device to a mirror or replacing an existing +device +.Pc , +whereas scrubbing examines all data to discover silent errors due to hardware +faults or disk failure. .Pp -Because scrubbing and resilvering are -.Tn I/O Ns -intensive -operations, -.Tn ZFS -only allows one at a time. If a scrub is already in progress, the -.Qq Nm Cm scrub -command returns an error. To start a new scrub, you have to stop the old scrub -with the -.Qq Nm Cm scrub Fl s -command first. If a resilver is in progress, -.Tn ZFS -does not allow a scrub to be started until the resilver completes. -.Bl -tag -width indent +Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows +one at a time. +If a scrub is paused, the +.Nm zpool Cm scrub +resumes it. +If a resilver is in progress, ZFS does not allow a scrub to be started until the +resilver completes. +.Bl -tag -width Ds .It Fl s Stop scrubbing. +.El +.Bl -tag -width Ds +.It Fl p +Pause scrubbing. +Scrub pause state and progress are periodically synced to disk. +If the system is restarted or pool is exported during a paused scrub, +even after import, scrub will remain paused until it is resumed. +Once resumed the scrub will pick up from the place where it was last +checkpointed to disk. +To resume a paused scrub issue +.Nm zpool Cm scrub +again. .El .It Xo .Nm Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Sep 9 11:00:07 2017 (r323355) @@ -27,6 +27,7 @@ * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. * Copyright 2016 Igor Kozhukhov . * Copyright 2016 Nexenta Systems, Inc. + * Copyright (c) 2017 Datto Inc. */ #include @@ -252,7 +253,7 @@ get_usage(zpool_help_t idx) case HELP_REOPEN: return (gettext("\treopen \n")); case HELP_SCRUB: - return (gettext("\tscrub [-s] ...\n")); + return (gettext("\tscrub [-s | -p] ...\n")); case HELP_STATUS: return (gettext("\tstatus [-vx] [-T d|u] [pool] ... [interval " "[count]]\n")); @@ -3825,6 +3826,7 @@ typedef struct scrub_cbdata { int cb_type; int cb_argc; char **cb_argv; + pool_scrub_cmd_t cb_scrub_cmd; } scrub_cbdata_t; int @@ -3842,15 +3844,16 @@ scrub_callback(zpool_handle_t *zhp, void *data) return (1); } - err = zpool_scan(zhp, cb->cb_type); + err = zpool_scan(zhp, cb->cb_type, cb->cb_scrub_cmd); return (err != 0); } /* - * zpool scrub [-s] ... + * zpool scrub [-s | -p] ... * * -s Stop. Stops any in-progress scrub. + * -p Pause. Pause in-progress scrub. */ int zpool_do_scrub(int argc, char **argv) @@ -3859,13 +3862,17 @@ zpool_do_scrub(int argc, char **argv) scrub_cbdata_t cb; cb.cb_type = POOL_SCAN_SCRUB; + cb.cb_scrub_cmd = POOL_SCRUB_NORMAL; /* check options */ - while ((c = getopt(argc, argv, "s")) != -1) { + while ((c = getopt(argc, argv, "sp")) != -1) { switch (c) { case 's': cb.cb_type = POOL_SCAN_NONE; break; + case 'p': + cb.cb_scrub_cmd = POOL_SCRUB_PAUSE; + break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -3873,6 +3880,13 @@ zpool_do_scrub(int argc, char **argv) } } + if (cb.cb_type == POOL_SCAN_NONE && + cb.cb_scrub_cmd == POOL_SCRUB_PAUSE) { + (void) fprintf(stderr, gettext("invalid option combination: " + "-s and -p are mutually exclusive\n")); + usage(B_FALSE); + } + cb.cb_argc = argc; cb.cb_argv = argv; argc -= optind; @@ -3901,7 +3915,7 @@ typedef struct status_cbdata { void print_scan_status(pool_scan_stat_t *ps) { - time_t start, end; + time_t start, end, pause; uint64_t elapsed, mins_left, hours_left; uint64_t pass_exam, examined, total; uint_t rate; @@ -3919,6 +3933,7 @@ print_scan_status(pool_scan_stat_t *ps) start = ps->pss_start_time; end = ps->pss_end_time; + pause = ps->pss_pass_scrub_pause; zfs_nicenum(ps->pss_processed, processed_buf, sizeof (processed_buf)); assert(ps->pss_func == POOL_SCAN_SCRUB || @@ -3961,8 +3976,17 @@ print_scan_status(pool_scan_stat_t *ps) * Scan is in progress. */ if (ps->pss_func == POOL_SCAN_SCRUB) { - (void) printf(gettext("scrub in progress since %s"), - ctime(&start)); + if (pause == 0) { + (void) printf(gettext("scrub in progress since %s"), + ctime(&start)); + } else { + char buf[32]; + struct tm *p = localtime(&pause); + (void) strftime(buf, sizeof (buf), "%a %b %e %T %Y", p); + (void) printf(gettext("scrub paused since %s\n"), buf); + (void) printf(gettext("\tscrub started on %s"), + ctime(&start)); + } } else if (ps->pss_func == POOL_SCAN_RESILVER) { (void) printf(gettext("resilver in progress since %s"), ctime(&start)); @@ -3974,6 +3998,7 @@ print_scan_status(pool_scan_stat_t *ps) /* elapsed time for this pass */ elapsed = time(NULL) - ps->pss_pass_start; + elapsed -= ps->pss_pass_scrub_spent_paused; elapsed = elapsed ? elapsed : 1; pass_exam = ps->pss_pass_exam ? ps->pss_pass_exam : 1; rate = pass_exam / elapsed; @@ -3983,19 +4008,25 @@ print_scan_status(pool_scan_stat_t *ps) zfs_nicenum(examined, examined_buf, sizeof (examined_buf)); zfs_nicenum(total, total_buf, sizeof (total_buf)); - zfs_nicenum(rate, rate_buf, sizeof (rate_buf)); /* * do not print estimated time if hours_left is more than 30 days + * or we have a paused scrub */ - (void) printf(gettext(" %s scanned out of %s at %s/s"), - examined_buf, total_buf, rate_buf); - if (hours_left < (30 * 24)) { - (void) printf(gettext(", %lluh%um to go\n"), - (u_longlong_t)hours_left, (uint_t)(mins_left % 60)); + if (pause == 0) { + zfs_nicenum(rate, rate_buf, sizeof (rate_buf)); + (void) printf(gettext("\t%s scanned out of %s at %s/s"), + examined_buf, total_buf, rate_buf); + if (hours_left < (30 * 24)) { + (void) printf(gettext(", %lluh%um to go\n"), + (u_longlong_t)hours_left, (uint_t)(mins_left % 60)); + } else { + (void) printf(gettext( + ", (scan is slow, no estimated time)\n")); + } } else { - (void) printf(gettext( - ", (scan is slow, no estimated time)\n")); + (void) printf(gettext("\t%s scanned out of %s\n"), + examined_buf, total_buf); } if (ps->pss_func == POOL_SCAN_RESILVER) { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Sep 9 10:58:45 2017 (r323354) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Sep 9 11:00:07 2017 (r323355) @@ -28,6 +28,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Nexenta Systems, Inc. + * Copyright (c) 2017 Datto Inc. */ #ifndef _LIBZFS_H @@ -129,6 +130,7 @@ typedef enum zfs_error { EZFS_DIFF, /* general failure of zfs diff */ EZFS_DIFFDATA, /* bad zfs diff data */ EZFS_POOLREADONLY, /* pool is in read-only mode */ + EZFS_SCRUB_PAUSED, /* scrub currently paused */ EZFS_UNKNOWN } zfs_error_t; @@ -241,7 +243,7 @@ typedef struct splitflags { /* * Functions to manipulate pool and vdev state */ -extern int zpool_scan(zpool_handle_t *, pool_scan_func_t); +extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t); extern int zpool_clear(zpool_handle_t *, const char *, nvlist_t *); extern int zpool_reguid(zpool_handle_t *); extern int zpool_reopen(zpool_handle_t *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Sep 9 11:00:07 2017 (r323355) @@ -25,6 +25,7 @@ * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov + * Copyright (c) 2017 Datto Inc. */ #include @@ -1841,22 +1842,39 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *con * Scan the pool. */ int -zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func) +zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func, pool_scrub_cmd_t cmd) { zfs_cmd_t zc = { 0 }; char msg[1024]; + int err; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); zc.zc_cookie = func; + zc.zc_flags = cmd; - if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0 || - (errno == ENOENT && func != POOL_SCAN_NONE)) + if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0) return (0); + err = errno; + + /* ECANCELED on a scrub means we resumed a paused scrub */ + if (err == ECANCELED && func == POOL_SCAN_SCRUB && + cmd == POOL_SCRUB_NORMAL) + return (0); + + if (err == ENOENT && func != POOL_SCAN_NONE && cmd == POOL_SCRUB_NORMAL) + return (0); + if (func == POOL_SCAN_SCRUB) { - (void) snprintf(msg, sizeof (msg), - dgettext(TEXT_DOMAIN, "cannot scrub %s"), zc.zc_name); + if (cmd == POOL_SCRUB_PAUSE) { + (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, + "cannot pause scrubbing %s"), zc.zc_name); + } else { + assert(cmd == POOL_SCRUB_NORMAL); + (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, + "cannot scrub %s"), zc.zc_name); + } } else if (func == POOL_SCAN_NONE) { (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, "cannot cancel scrubbing %s"), @@ -1865,7 +1883,7 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func) assert(!"unexpected result"); } - if (errno == EBUSY) { + if (err == EBUSY) { nvlist_t *nvroot; pool_scan_stat_t *ps = NULL; uint_t psc; @@ -1874,14 +1892,18 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func) ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); (void) nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &psc); - if (ps && ps->pss_func == POOL_SCAN_SCRUB) - return (zfs_error(hdl, EZFS_SCRUBBING, msg)); - else + if (ps && ps->pss_func == POOL_SCAN_SCRUB) { + if (cmd == POOL_SCRUB_PAUSE) + return (zfs_error(hdl, EZFS_SCRUB_PAUSED, msg)); + else + return (zfs_error(hdl, EZFS_SCRUBBING, msg)); + } else { return (zfs_error(hdl, EZFS_RESILVERING, msg)); - } else if (errno == ENOENT) { + } + } else if (err == ENOENT) { return (zfs_error(hdl, EZFS_NO_SCRUB, msg)); } else { - return (zpool_standard_error(hdl, errno, msg)); + return (zpool_standard_error(hdl, err, msg)); } } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Sat Sep 9 11:00:07 2017 (r323355) @@ -24,6 +24,7 @@ * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov + * Copyright (c) 2017 Datto Inc. */ /* @@ -224,6 +225,9 @@ libzfs_error_description(libzfs_handle_t *hdl) case EZFS_POSTSPLIT_ONLINE: return (dgettext(TEXT_DOMAIN, "disk was split from this pool " "into a new one")); + case EZFS_SCRUB_PAUSED: + return (dgettext(TEXT_DOMAIN, "scrub is paused; " + "use 'zpool scrub' to resume")); case EZFS_SCRUBBING: return (dgettext(TEXT_DOMAIN, "currently scrubbing; " "use 'zpool scrub -s' to cancel current scrub")); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sat Sep 9 11:00:07 2017 (r323355) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright (c) 2017 Datto Inc. */ #include @@ -211,6 +212,9 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_itor_t func, vo dmu_buf_t *dbuf = NULL; mutex_enter(&bpo->bpo_lock); + + if (!bpobj_hasentries(bpo)) + goto out; if (free) dmu_buf_will_dirty(bpo->bpo_dbuf, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Sep 9 11:00:07 2017 (r323355) @@ -22,6 +22,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Gary Mills * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2017 Datto Inc. */ #include @@ -310,6 +311,8 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu scn->scn_phys.scn_queue_obj = 0; } + scn->scn_phys.scn_flags &= ~DSF_SCRUB_PAUSED; + /* * If we were "restarted" from a stopped state, don't bother * with anything else. @@ -393,6 +396,91 @@ dsl_scan_cancel(dsl_pool_t *dp) dsl_scan_cancel_sync, NULL, 3, ZFS_SPACE_CHECK_RESERVED)); } +boolean_t +dsl_scan_is_paused_scrub(const dsl_scan_t *scn) +{ + if (dsl_scan_scrubbing(scn->scn_dp) && + scn->scn_phys.scn_flags & DSF_SCRUB_PAUSED) + return (B_TRUE); + + return (B_FALSE); +} + +static int +dsl_scrub_pause_resume_check(void *arg, dmu_tx_t *tx) +{ + pool_scrub_cmd_t *cmd = arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_scan_t *scn = dp->dp_scan; + + if (*cmd == POOL_SCRUB_PAUSE) { + /* can't pause a scrub when there is no in-progress scrub */ + if (!dsl_scan_scrubbing(dp)) + return (SET_ERROR(ENOENT)); + + /* can't pause a paused scrub */ + if (dsl_scan_is_paused_scrub(scn)) + return (SET_ERROR(EBUSY)); + } else if (*cmd != POOL_SCRUB_NORMAL) { + return (SET_ERROR(ENOTSUP)); + } + + return (0); +} + +static void +dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx) +{ + pool_scrub_cmd_t *cmd = arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + spa_t *spa = dp->dp_spa; + dsl_scan_t *scn = dp->dp_scan; + + if (*cmd == POOL_SCRUB_PAUSE) { + /* can't pause a scrub when there is no in-progress scrub */ + spa->spa_scan_pass_scrub_pause = gethrestime_sec(); + scn->scn_phys.scn_flags |= DSF_SCRUB_PAUSED; + dsl_scan_sync_state(scn, tx); + } else { + ASSERT3U(*cmd, ==, POOL_SCRUB_NORMAL); + if (dsl_scan_is_paused_scrub(scn)) { + /* + * We need to keep track of how much time we spend + * paused per pass so that we can adjust the scrub rate + * shown in the output of 'zpool status' + */ + spa->spa_scan_pass_scrub_spent_paused += + gethrestime_sec() - spa->spa_scan_pass_scrub_pause; + spa->spa_scan_pass_scrub_pause = 0; + scn->scn_phys.scn_flags &= ~DSF_SCRUB_PAUSED; + dsl_scan_sync_state(scn, tx); + } + } +} + +/* + * Set scrub pause/resume state if it makes sense to do so + */ +int +dsl_scrub_set_pause_resume(const dsl_pool_t *dp, pool_scrub_cmd_t cmd) +{ + return (dsl_sync_task(spa_name(dp->dp_spa), + dsl_scrub_pause_resume_check, dsl_scrub_pause_resume_sync, &cmd, 3, + ZFS_SPACE_CHECK_RESERVED)); +} + +boolean_t +dsl_scan_scrubbing(const dsl_pool_t *dp) +{ + dsl_scan_t *scn = dp->dp_scan; + + if (scn->scn_phys.scn_state == DSS_SCANNING && + scn->scn_phys.scn_func == POOL_SCAN_SCRUB) + return (B_TRUE); + + return (B_FALSE); +} + static void dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t *zb, dnode_phys_t *dnp, dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype, dmu_tx_t *tx); @@ -435,14 +523,14 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu_tx_t *tx) extern int zfs_vdev_async_write_active_min_dirty_percent; static boolean_t -dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_phys_t *zb) +dsl_scan_check_suspend(dsl_scan_t *scn, const zbookmark_phys_t *zb) { /* we never skip user/group accounting objects */ if (zb && (int64_t)zb->zb_object < 0) return (B_FALSE); - if (scn->scn_pausing) - return (B_TRUE); /* we're already pausing */ + if (scn->scn_suspending) + return (B_TRUE); /* we're already suspending */ if (!ZB_IS_ZERO(&scn->scn_phys.scn_bookmark)) return (B_FALSE); /* we're resuming */ @@ -452,7 +540,7 @@ dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_ return (B_FALSE); /* - * We pause if: + * We suspend if: * - we have scanned for the maximum time: an entire txg * timeout (default 5 sec) * or @@ -475,19 +563,19 @@ dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_ dirty_pct >= zfs_vdev_async_write_active_min_dirty_percent)) || spa_shutting_down(scn->scn_dp->dp_spa)) { if (zb) { - dprintf("pausing at bookmark %llx/%llx/%llx/%llx\n", + dprintf("suspending at bookmark %llx/%llx/%llx/%llx\n", (longlong_t)zb->zb_objset, (longlong_t)zb->zb_object, (longlong_t)zb->zb_level, (longlong_t)zb->zb_blkid); scn->scn_phys.scn_bookmark = *zb; } - dprintf("pausing at DDT bookmark %llx/%llx/%llx/%llx\n", + dprintf("suspending at DDT bookmark %llx/%llx/%llx/%llx\n", (longlong_t)scn->scn_phys.scn_ddt_bookmark.ddb_class, (longlong_t)scn->scn_phys.scn_ddt_bookmark.ddb_type, (longlong_t)scn->scn_phys.scn_ddt_bookmark.ddb_checksum, (longlong_t)scn->scn_phys.scn_ddt_bookmark.ddb_cursor); - scn->scn_pausing = B_TRUE; + scn->scn_suspending = B_TRUE; return (B_TRUE); } return (B_FALSE); @@ -625,7 +713,7 @@ dsl_scan_check_resume(dsl_scan_t *scn, const dnode_phy /* * If we found the block we're trying to resume from, or * we went past it to a different object, zero it out to - * indicate that it's OK to start checking for pausing + * indicate that it's OK to start checking for suspending * again. */ if (bcmp(zb, &scn->scn_phys.scn_bookmark, sizeof (*zb)) == 0 || @@ -728,7 +816,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, d /* * We also always visit user/group accounting * objects, and never skip them, even if we are - * pausing. This is necessary so that the space + * suspending. This is necessary so that the space * deltas from this txg get integrated. */ dsl_scan_visitdnode(scn, ds, osp->os_type, @@ -784,7 +872,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t /* ASSERT(pbuf == NULL || arc_released(pbuf)); */ - if (dsl_scan_check_pause(scn, zb)) + if (dsl_scan_check_suspend(scn, zb)) return; if (dsl_scan_check_resume(scn, dnp, zb)) @@ -1121,14 +1209,14 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_ char *dsname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); dsl_dataset_name(ds, dsname); zfs_dbgmsg("scanned dataset %llu (%s) with min=%llu max=%llu; " - "pausing=%u", + "suspending=%u", (longlong_t)dsobj, dsname, (longlong_t)scn->scn_phys.scn_cur_min_txg, (longlong_t)scn->scn_phys.scn_cur_max_txg, - (int)scn->scn_pausing); + (int)scn->scn_suspending); kmem_free(dsname, ZFS_MAX_DATASET_NAME_LEN); - if (scn->scn_pausing) + if (scn->scn_suspending) goto out; /* @@ -1292,13 +1380,13 @@ dsl_scan_ddt(dsl_scan_t *scn, dmu_tx_t *tx) dsl_scan_ddt_entry(scn, ddb->ddb_checksum, &dde, tx); n++; - if (dsl_scan_check_pause(scn, NULL)) + if (dsl_scan_check_suspend(scn, NULL)) break; } - zfs_dbgmsg("scanned %llu ddt entries with class_max = %u; pausing=%u", - (longlong_t)n, (int)scn->scn_phys.scn_ddt_class_max, - (int)scn->scn_pausing); + zfs_dbgmsg("scanned %llu ddt entries with class_max = %u; " + "suspending=%u", (longlong_t)n, + (int)scn->scn_phys.scn_ddt_class_max, (int)scn->scn_suspending); ASSERT(error == 0 || error == ENOENT); ASSERT(error != ENOENT || @@ -1341,7 +1429,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) scn->scn_phys.scn_cur_min_txg = scn->scn_phys.scn_min_txg; scn->scn_phys.scn_cur_max_txg = scn->scn_phys.scn_max_txg; dsl_scan_ddt(scn, tx); - if (scn->scn_pausing) + if (scn->scn_suspending) return; } @@ -1353,7 +1441,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) dsl_scan_visit_rootbp(scn, NULL, &dp->dp_meta_rootbp, tx); spa_set_rootblkptr(dp->dp_spa, &dp->dp_meta_rootbp); - if (scn->scn_pausing) + if (scn->scn_suspending) return; if (spa_version(dp->dp_spa) < SPA_VERSION_DSL_SCRUB) { @@ -1363,22 +1451,22 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) dsl_scan_visitds(scn, dp->dp_origin_snap->ds_object, tx); } - ASSERT(!scn->scn_pausing); + ASSERT(!scn->scn_suspending); } else if (scn->scn_phys.scn_bookmark.zb_objset != ZB_DESTROYED_OBJSET) { /* - * If we were paused, continue from here. Note if the - * ds we were paused on was deleted, the zb_objset may + * If we were suspended, continue from here. Note if the + * ds we were suspended on was deleted, the zb_objset may * be -1, so we will skip this and find a new objset * below. */ dsl_scan_visitds(scn, scn->scn_phys.scn_bookmark.zb_objset, tx); - if (scn->scn_pausing) + if (scn->scn_suspending) return; } /* - * In case we were paused right at the end of the ds, zero the + * In case we were suspended right at the end of the ds, zero the * bookmark so we don't think that we're still trying to resume. */ bzero(&scn->scn_phys.scn_bookmark, sizeof (zbookmark_phys_t)); @@ -1410,14 +1498,14 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx) dsl_scan_visitds(scn, dsobj, tx); zap_cursor_fini(&zc); - if (scn->scn_pausing) + if (scn->scn_suspending) return; } zap_cursor_fini(&zc); } static boolean_t -dsl_scan_free_should_pause(dsl_scan_t *scn) +dsl_scan_free_should_suspend(dsl_scan_t *scn) { uint64_t elapsed_nanosecs; @@ -1441,7 +1529,7 @@ dsl_scan_free_block_cb(void *arg, const blkptr_t *bp, if (!scn->scn_is_bptree || (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_OBJSET)) { - if (dsl_scan_free_should_pause(scn)) + if (dsl_scan_free_should_suspend(scn)) return (SET_ERROR(ERESTART)); } @@ -1464,7 +1552,8 @@ dsl_scan_active(dsl_scan_t *scn) return (B_FALSE); if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING || + if ((scn->scn_phys.scn_state == DSS_SCANNING && + !dsl_scan_is_paused_scrub(scn)) || (scn->scn_async_destroying && !scn->scn_async_stalled)) return (B_TRUE); @@ -1519,12 +1608,12 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) return; scn->scn_visited_this_txg = 0; - scn->scn_pausing = B_FALSE; + scn->scn_suspending = B_FALSE; scn->scn_sync_start_time = gethrtime(); spa->spa_scrub_active = B_TRUE; /* - * First process the async destroys. If we pause, don't do + * First process the async destroys. If we suspend, don't do * any scrubbing or resilvering. This ensures that there are no * async destroys while we are scanning, so the scan code doesn't * have to worry about traversing it. It is also faster to free the @@ -1641,7 +1730,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) return; if (scn->scn_done_txg == tx->tx_txg) { - ASSERT(!scn->scn_pausing); + ASSERT(!scn->scn_suspending); /* finished with scan. */ zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); dsl_scan_done(scn, B_TRUE, tx); @@ -1650,6 +1739,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) return; } + if (dsl_scan_is_paused_scrub(scn)) + return; + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1684,7 +1776,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) (longlong_t)scn->scn_visited_this_txg, (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); - if (!scn->scn_pausing) { + if (!scn->scn_suspending) { scn->scn_done_txg = tx->tx_txg + 1; zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", tx->tx_txg, scn->scn_done_txg); @@ -1893,11 +1985,15 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, return (0); } -/* Called by the ZFS_IOC_POOL_SCAN ioctl to start a scrub or resilver */ +/* + * Called by the ZFS_IOC_POOL_SCAN ioctl to start a scrub or resilver. + * Can also be called to resume a paused scrub. + */ int dsl_scan(dsl_pool_t *dp, pool_scan_func_t func) { spa_t *spa = dp->dp_spa; + dsl_scan_t *scn = dp->dp_scan; /* * Purge all vdev caches and probe all devices. We do this here @@ -1911,6 +2007,16 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func) vdev_reopen(spa->spa_root_vdev); spa->spa_scrub_reopen = B_FALSE; (void) spa_vdev_state_exit(spa, NULL, 0); + + if (func == POOL_SCAN_SCRUB && dsl_scan_is_paused_scrub(scn)) { + /* got scrub start cmd, resume paused scrub */ + int err = dsl_scrub_set_pause_resume(scn->scn_dp, + POOL_SCRUB_NORMAL); + if (err == 0) + return (ECANCELED); + + return (SET_ERROR(err)); + } return (dsl_sync_task(spa_name(spa), dsl_scan_setup_check, dsl_scan_setup_sync, &func, 0, ZFS_SPACE_CHECK_NONE)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 9 11:00:07 2017 (r323355) @@ -28,6 +28,7 @@ * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Toomas Soome + * Copyright (c) 2017 Datto Inc. */ /* @@ -6048,6 +6049,16 @@ spa_vdev_setfru(spa_t *spa, uint64_t guid, const char * SPA Scanning * ========================================================================== */ +int +spa_scrub_pause_resume(spa_t *spa, pool_scrub_cmd_t cmd) +{ + ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == 0); + + if (dsl_scan_resilvering(spa->spa_dsl_pool)) + return (SET_ERROR(EBUSY)); + + return (dsl_scrub_set_pause_resume(spa->spa_dsl_pool, cmd)); +} int spa_scan_stop(spa_t *spa) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Sep 9 11:00:07 2017 (r323355) @@ -26,6 +26,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright (c) 2017 Datto Inc. */ #include @@ -2145,6 +2146,11 @@ spa_scan_stat_init(spa_t *spa) { /* data not stored on disk */ spa->spa_scan_pass_start = gethrestime_sec(); + if (dsl_scan_is_paused_scrub(spa->spa_dsl_pool->dp_scan)) + spa->spa_scan_pass_scrub_pause = spa->spa_scan_pass_start; + else + spa->spa_scan_pass_scrub_pause = 0; + spa->spa_scan_pass_scrub_spent_paused = 0; spa->spa_scan_pass_exam = 0; vdev_scan_stat_init(spa->spa_root_vdev); } @@ -2175,6 +2181,8 @@ spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps) /* data not stored on disk */ ps->pss_pass_start = spa->spa_scan_pass_start; ps->pss_pass_exam = spa->spa_scan_pass_exam; + ps->pss_pass_scrub_pause = spa->spa_scan_pass_scrub_pause; + ps->pss_pass_scrub_spent_paused = spa->spa_scan_pass_scrub_spent_paused; return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Sat Sep 9 11:00:07 2017 (r323355) @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2017 Datto Inc. */ #ifndef _SYS_DSL_SCAN_H @@ -70,6 +71,7 @@ typedef struct dsl_scan_phys { typedef enum dsl_scan_flags { DSF_VISIT_DS_AGAIN = 1<<0, + DSF_SCRUB_PAUSED = 1<<1, } dsl_scan_flags_t; /* @@ -82,8 +84,8 @@ typedef enum dsl_scan_flags { * * The following members of this structure direct the behavior of the scan: * - * scn_pausing - a scan that cannot be completed in a single txg or - * has exceeded its allotted time will need to pause. + * scn_suspending - a scan that cannot be completed in a single txg or + * has exceeded its allotted time will need to suspend. * When this flag is set the scanner will stop traversing * the pool and write out the current state to disk. * @@ -105,7 +107,7 @@ typedef enum dsl_scan_flags { typedef struct dsl_scan { struct dsl_pool *scn_dp; - boolean_t scn_pausing; + boolean_t scn_suspending; uint64_t scn_restart_txg; uint64_t scn_done_txg; uint64_t scn_sync_start_time; @@ -115,8 +117,6 @@ typedef struct dsl_scan { boolean_t scn_is_bptree; boolean_t scn_async_destroying; boolean_t scn_async_stalled; - - /* for debugging / information */ uint64_t scn_visited_this_txg; dsl_scan_phys_t scn_phys; @@ -127,6 +127,8 @@ void dsl_scan_fini(struct dsl_pool *dp); void dsl_scan_sync(struct dsl_pool *, dmu_tx_t *); int dsl_scan_cancel(struct dsl_pool *); int dsl_scan(struct dsl_pool *, pool_scan_func_t); +boolean_t dsl_scan_scrubbing(const struct dsl_pool *dp); +int dsl_scrub_set_pause_resume(const struct dsl_pool *dp, pool_scrub_cmd_t cmd); void dsl_resilver_restart(struct dsl_pool *, uint64_t txg); boolean_t dsl_scan_resilvering(struct dsl_pool *dp); boolean_t dsl_dataset_unstable(struct dsl_dataset *ds); @@ -137,6 +139,7 @@ void dsl_scan_ds_snapshotted(struct dsl_dataset *ds, s void dsl_scan_ds_clone_swapped(struct dsl_dataset *ds1, struct dsl_dataset *ds2, struct dmu_tx *tx); boolean_t dsl_scan_active(dsl_scan_t *scn); +boolean_t dsl_scan_is_paused_scrub(const dsl_scan_t *scn); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Sep 9 11:00:07 2017 (r323355) @@ -25,6 +25,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright (c) 2017 Datto Inc. */ #ifndef _SYS_SPA_H @@ -695,6 +696,7 @@ extern void spa_l2cache_drop(spa_t *spa); /* scanning */ extern int spa_scan(spa_t *spa, pool_scan_func_t func); extern int spa_scan_stop(spa_t *spa); +extern int spa_scrub_pause_resume(spa_t *spa, pool_scrub_cmd_t flag); /* spa syncing */ extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Sep 9 11:00:07 2017 (r323355) @@ -25,6 +25,7 @@ * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2017 Datto Inc. */ #ifndef _SYS_SPA_IMPL_H @@ -193,6 +194,8 @@ struct spa { uint8_t spa_scrub_started; /* started since last boot */ uint8_t spa_scrub_reopen; /* scrub doing vdev_reopen */ uint64_t spa_scan_pass_start; /* start time per pass/reboot */ + uint64_t spa_scan_pass_scrub_pause; /* scrub pause time */ + uint64_t spa_scan_pass_scrub_spent_paused; /* total paused */ uint64_t spa_scan_pass_exam; /* examined bytes per pass */ kmutex_t spa_async_lock; /* protect async state */ kthread_t *spa_async_thread; /* thread doing async task */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Sep 9 11:00:07 2017 (r323355) @@ -33,6 +33,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Toomas Soome * Copyright 2017 RackTop Systems. + * Copyright (c) 2017 Datto Inc. */ /* @@ -1727,6 +1728,7 @@ zfs_ioc_pool_tryimport(zfs_cmd_t *zc) * inputs: * zc_name name of the pool * zc_cookie scan func (pool_scan_func_t) + * zc_flags scrub pause/resume flag (pool_scrub_cmd_t) */ static int zfs_ioc_pool_scan(zfs_cmd_t *zc) @@ -1737,7 +1739,12 @@ zfs_ioc_pool_scan(zfs_cmd_t *zc) if ((error = spa_open(zc->zc_name, &spa, FTAG)) != 0) return (error); - if (zc->zc_cookie == POOL_SCAN_NONE) + if (zc->zc_flags >= POOL_SCRUB_FLAGS_END) + return (SET_ERROR(EINVAL)); + + if (zc->zc_flags == POOL_SCRUB_PAUSE) + error = spa_scrub_pause_resume(spa, POOL_SCRUB_PAUSE); + else if (zc->zc_cookie == POOL_SCAN_NONE) error = spa_scan_stop(spa); else error = spa_scan(spa, zc->zc_cookie); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Sep 9 10:58:45 2017 (r323354) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Sep 9 11:00:07 2017 (r323355) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 9 11:01:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECE63E0F8A3; Sat, 9 Sep 2017 11:01:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BBEEB64208; Sat, 9 Sep 2017 11:01:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89B1ib6074218; Sat, 9 Sep 2017 11:01:44 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89B1i4Y074217; Sat, 9 Sep 2017 11:01:44 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091101.v89B1i4Y074217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323356 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 323356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:01:46 -0000 Author: mw Date: Sat Sep 9 11:01:44 2017 New Revision: 323356 URL: https://svnweb.freebsd.org/changeset/base/323356 Log: Add support for AHCI in Armada 3700 This patch simply AHCI generic driver by extending compatible list. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12254 Modified: head/sys/dev/ahci/ahci_generic.c Modified: head/sys/dev/ahci/ahci_generic.c ============================================================================== --- head/sys/dev/ahci/ahci_generic.c Sat Sep 9 11:00:07 2017 (r323355) +++ head/sys/dev/ahci/ahci_generic.c Sat Sep 9 11:01:44 2017 (r323356) @@ -60,9 +60,10 @@ __FBSDID("$FreeBSD$"); #include static struct ofw_compat_data compat_data[] = { - {"generic-ahci", 1}, - {"snps,dwc-ahci", 1}, - {NULL, 0} + {"generic-ahci", 1}, + {"snps,dwc-ahci", 1}, + {"marvell,armada-3700-ahci", 1}, + {NULL, 0} }; static int From owner-svn-src-head@freebsd.org Sat Sep 9 11:07:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBB2E0FDAD; Sat, 9 Sep 2017 11:07:00 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EE4D3645C1; Sat, 9 Sep 2017 11:06:59 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89B6xvp074480; Sat, 9 Sep 2017 11:06:59 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89B6wli074478; Sat, 9 Sep 2017 11:06:58 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091106.v89B6wli074478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323357 - in head/sys: conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: conf dev/usb/controller X-SVN-Commit-Revision: 323357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:07:00 -0000 Author: mw Date: Sat Sep 9 11:06:58 2017 New Revision: 323357 URL: https://svnweb.freebsd.org/changeset/base/323357 Log: Add support for Armada 3700 EHCI This patch reuses ehci_mv driver by adding a support for the new compatible string and adding ehci_mv.c to list of available options for arm64 platforms. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12255 Modified: head/sys/conf/files.arm64 head/sys/dev/usb/controller/ehci_mv.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 9 11:01:44 2017 (r323356) +++ head/sys/conf/files.arm64 Sat Sep 9 11:06:58 2017 (r323357) @@ -176,6 +176,7 @@ dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 +dev/usb/controller/ehci_mv.c optional ehci_mv fdt dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt Modified: head/sys/dev/usb/controller/ehci_mv.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mv.c Sat Sep 9 11:01:44 2017 (r323356) +++ head/sys/dev/usb/controller/ehci_mv.c Sat Sep 9 11:06:58 2017 (r323357) @@ -73,7 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include +#if !defined(__aarch64__) #include +#endif #include #define EHCI_VENDORID_MRVL 0x1286 @@ -100,9 +102,10 @@ static void *ih_err; #define MV_USB_DEVICE_UNDERFLOW (1 << 3) static struct ofw_compat_data compat_data[] = { - {"mrvl,usb-ehci", true}, - {"marvell,orion-ehci", true}, - {NULL, false} + {"mrvl,usb-ehci", true}, + {"marvell,orion-ehci", true}, + {"marvell,armada-3700-ehci", true}, + {NULL, false} }; static void @@ -174,7 +177,8 @@ mv_ehci_attach(device_t self) device_get_name(self)); rid = 0; - if (!ofw_bus_is_compatible(self, "marvell,orion-ehci")) { + if (!(ofw_bus_is_compatible(self, "marvell,orion-ehci") || + ofw_bus_is_compatible(self, "marvell,armada-3700-ehci"))) { irq_err = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (irq_err == NULL) { @@ -207,7 +211,8 @@ mv_ehci_attach(device_t self) sprintf(sc->sc_vendor, "Marvell"); - if (!ofw_bus_is_compatible(self, "marvell,orion-ehci")) { + if (!(ofw_bus_is_compatible(self, "marvell,orion-ehci") || + ofw_bus_is_compatible(self, "marvell,armada-3700-ehci"))) { err = bus_setup_intr(self, irq_err, INTR_TYPE_BIO, err_intr, NULL, sc, &ih_err); if (err) { @@ -365,5 +370,5 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(ehci_mv, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci_mv, usb, 1, 1, 1); From owner-svn-src-head@freebsd.org Sat Sep 9 11:14:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74277E102B8; Sat, 9 Sep 2017 11:14:00 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1726064A97; Sat, 9 Sep 2017 11:13:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 8B2EB185234; Sat, 9 Sep 2017 14:13:56 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ww4GX6AxIk-DuFuSPA9; Sat, 09 Sep 2017 14:13:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1504955636; bh=iLJRtWqVXA6f/20PQrhlMZbbOtwAau/KDXClqwQtKd8=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=idURqReEJIt4qr5nwvcwdrng31Ov7ntGNpZX1X1sRwhSUBeS36g4Ho22qeMV3rPtg af9hfCPtxglxXm8kocDeIjOtFN/zObOBTpg0jaegxeQjj8sj+b+KIqwc4GT7GpjBKi oMhKmAq+Vs2oP7/INSom8Tikid3DjwL8gqF5wuE0= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HxIs9oc2QJ-DtB8H00g; Sat, 09 Sep 2017 14:13:55 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1504955636; bh=iLJRtWqVXA6f/20PQrhlMZbbOtwAau/KDXClqwQtKd8=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=idURqReEJIt4qr5nwvcwdrng31Ov7ntGNpZX1X1sRwhSUBeS36g4Ho22qeMV3rPtg af9hfCPtxglxXm8kocDeIjOtFN/zObOBTpg0jaegxeQjj8sj+b+KIqwc4GT7GpjBKi oMhKmAq+Vs2oP7/INSom8Tikid3DjwL8gqF5wuE0= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r323351 - head/sys/compat/linuxkpi/common/include/linux To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709090721.v897LRWA084296@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <1b752f11-2ec8-4c07-d53a-9e32a5fcf56c@yandex.ru> Date: Sat, 9 Sep 2017 14:10:09 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201709090721.v897LRWA084296@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uM0Lw8OWixNWN3KGnXXfo8EBDuLuhWhFV" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:14:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uM0Lw8OWixNWN3KGnXXfo8EBDuLuhWhFV Content-Type: multipart/mixed; boundary="6sld1W72nU0TTXlieE9kjsANimh2dWr46"; protected-headers="v1" From: "Andrey V. Elsukov" To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1b752f11-2ec8-4c07-d53a-9e32a5fcf56c@yandex.ru> Subject: Re: svn commit: r323351 - head/sys/compat/linuxkpi/common/include/linux References: <201709090721.v897LRWA084296@repo.freebsd.org> In-Reply-To: <201709090721.v897LRWA084296@repo.freebsd.org> --6sld1W72nU0TTXlieE9kjsANimh2dWr46 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.09.2017 10:21, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Sep 9 07:21:27 2017 > New Revision: 323351 > URL: https://svnweb.freebsd.org/changeset/base/323351 >=20 > Log: > Resolve IPv6 scope ID issues when using ip6_find_dev() in the LinuxKP= I. > =20 > Workaround problem that ifa_ifwithaddr() also matches the scope ID of= > the IPv6 address when searching for a maching IPv6 address. For now > simply try all valid scope IDs until a match is found. > =20 > MFC after: 1 week > Sponsored by: Mellanox Technologies >=20 > Modified: > head/sys/compat/linuxkpi/common/include/linux/inetdevice.h >=20 > Modified: head/sys/compat/linuxkpi/common/include/linux/inetdevice.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/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep = 9 06:34:20 2017 (r323350) > +++ head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep = 9 07:21:27 2017 (r323351) > @@ -62,22 +62,26 @@ ip6_dev_find(struct vnet *vnet, struct in6_addr add= r) > { > struct sockaddr_in6 sin6; > struct ifaddr *ifa; > - struct ifnet *ifp; > + struct ifnet *ifp =3D NULL; > + int x; > =20 > memset(&sin6, 0, sizeof(sin6)); > sin6.sin6_addr =3D addr; > sin6.sin6_len =3D sizeof(sin6); > sin6.sin6_family =3D AF_INET6; > CURVNET_SET_QUIET(vnet); > - ifa =3D ifa_ifwithaddr((struct sockaddr *)&sin6); > - CURVNET_RESTORE(); > - if (ifa) { > - ifp =3D ifa->ifa_ifp; > - if_ref(ifp); > - ifa_free(ifa); > - } else { > - ifp =3D NULL; > + /* XXX need to search all scope ID's */ > + for (x =3D 0; x <=3D V_if_index; x++) { > + sin6.sin6_addr.s6_addr[3] =3D x; This doesn't look right. We use s6_addr16[1] to keep scope zone id. And if_index value should be converted into network byte order. It is quite usual to have more that 255 interfaces. And what is more important, you must not use this code for global IPv6 addresses. --=20 WBR, Andrey V. Elsukov --6sld1W72nU0TTXlieE9kjsANimh2dWr46-- --uM0Lw8OWixNWN3KGnXXfo8EBDuLuhWhFV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlmzzBEACgkQAcXqBBDI oXqS1gf/XUB8rlcPl7LxzAUBeSsiOhKkBOLWsPvmhrZnvjzjOwtau7hmqb5h8Ofg U/aXp4StREcM8pV4bodObDWI6MCmwriDFgCAUhaTDjufi/WdWruBwEkNQCTM6az7 XVEV2CwktjayckbE19usPVHo8V9JR1fmiOUiiAYhr5NUYp1Xf/QwKzKYVb1YWUJG PCpIjMXdWQduRRreBLKJsI6nLfOwdQ1E+ISTMlsX6HU5NWWFA3O0+E6PVm5J63Rb TVR9Fka3eAO/yqM2RssvwrX60yNQmiq1XU2aC2AFr97VMaF06X3ASXUR2JRV6znV rOncsFmAt/KODRXc8bfEikAaYC4O1Q== =mqOK -----END PGP SIGNATURE----- --uM0Lw8OWixNWN3KGnXXfo8EBDuLuhWhFV-- From owner-svn-src-head@freebsd.org Sat Sep 9 11:16:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0EACE104EE; Sat, 9 Sep 2017 11:16:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7007864C7F; Sat, 9 Sep 2017 11:16:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BGA9X078681; Sat, 9 Sep 2017 11:16:10 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89BGA6f078680; Sat, 9 Sep 2017 11:16:10 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091116.v89BGA6f078680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323358 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 323358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:16:11 -0000 Author: mw Date: Sat Sep 9 11:16:10 2017 New Revision: 323358 URL: https://svnweb.freebsd.org/changeset/base/323358 Log: Enable compilation of Marvell EHCI driver in arm64 GENERIC Enabled driver can be used on boards equipped with Marvell Armada 3700 SoC. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12256 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 9 11:06:58 2017 (r323357) +++ head/sys/arm64/conf/GENERIC Sat Sep 9 11:16:10 2017 (r323358) @@ -158,6 +158,7 @@ device aw_usbphy # Allwinner USB PHY device dwcotg # DWC OTG controller device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) +device ehci_mv # Marvell EHCI USB interface device xhci # XHCI PCI->USB interface (USB 3.0) device xhci_mv # Marvell XHCI USB interface device usb # USB Bus (required) From owner-svn-src-head@freebsd.org Sat Sep 9 11:42:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675ACE116AE; Sat, 9 Sep 2017 11:42:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2876F6586A; Sat, 9 Sep 2017 11:42:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BgXCr090595; Sat, 9 Sep 2017 11:42:33 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89BgX8e090592; Sat, 9 Sep 2017 11:42:33 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091142.v89BgX8e090592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323359 - in head/sys: conf dev/uart modules/uart X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: conf dev/uart modules/uart X-SVN-Commit-Revision: 323359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:42:34 -0000 Author: mw Date: Sat Sep 9 11:42:32 2017 New Revision: 323359 URL: https://svnweb.freebsd.org/changeset/base/323359 Log: Introduce UART driver module for Armada 3700 This patch adds support for UART in Armada 3700 family. It exposes both low-level UART interface, as well as standard driver methods. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12250 Added: head/sys/dev/uart/uart_dev_mvebu.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/uart/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 9 11:16:10 2017 (r323358) +++ head/sys/conf/files Sat Sep 9 11:42:32 2017 (r323359) @@ -3053,6 +3053,7 @@ dev/uart/uart_bus_puc.c optional uart puc dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc Added: head/sys/dev/uart/uart_dev_mvebu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_mvebu.c Sat Sep 9 11:42:32 2017 (r323359) @@ -0,0 +1,615 @@ +/*- + * Copyright (c) 2017 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. +*/ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "uart_if.h" + +#define UART_RBR 0x00 /* Receiver Buffer */ +#define RBR_BRK_DET (1 << 15) /* Break Detect */ +#define RBR_FRM_ERR_DET (1 << 14) /* Frame Error Detect */ +#define RBR_PAR_ERR_DET (1 << 13) /* Parity Error Detect */ +#define RBR_OVR_ERR_DET (1 << 12) /* Overrun Error */ + +#define UART_TSH 0x04 /* Transmitter Holding Register */ + +#define UART_CTRL 0x08 /* Control Register */ +#define CTRL_SOFT_RST (1 << 31) /* Soft Reset */ +#define CTRL_TX_FIFO_RST (1 << 15) /* TX FIFO Reset */ +#define CTRL_RX_FIFO_RST (1 << 14) /* RX FIFO Reset */ +#define CTRL_ST_MIRR_EN (1 << 13) /* Status Mirror Enable */ +#define CTRL_LPBK_EN (1 << 12) /* Loopback Mode Enable */ +#define CTRL_SND_BRK_SEQ (1 << 11) /* Send Break Sequence */ +#define CTRL_PAR_EN (1 << 10) /* Parity Enable */ +#define CTRL_TWO_STOP (1 << 9) /* Two Stop Bits */ +#define CTRL_TX_HALF_INT (1 << 8) /* TX Half-Full Interrupt Enable */ +#define CTRL_RX_HALF_INT (1 << 7) /* RX Half-Full Interrupt Enable */ +#define CTRL_TX_EMPT_INT (1 << 6) /* TX Empty Interrupt Enable */ +#define CTRL_TX_RDY_INT (1 << 5) /* TX Ready Interrupt Enable */ +#define CTRL_RX_RDY_INT (1 << 4) /* RX Ready Interrupt Enable */ +#define CTRL_BRK_DET_INT (1 << 3) /* Break Detect Interrupt Enable */ +#define CTRL_FRM_ERR_INT (1 << 2) /* Frame Error Interrupt Enable */ +#define CTRL_PAR_ERR_INT (1 << 1) /* Parity Error Interrupt Enable */ +#define CTRL_OVR_ERR_INT (1 << 0) /* Overrun Error Interrupt Enable */ +#define CTRL_INTR_MASK 0x1ff +#define CTRL_TX_IDLE_INT CTRL_TX_RDY_INT +#define CTRL_IPEND_MASK (CTRL_OVR_ERR_INT | CTRL_BRK_DET_INT | \ + CTRL_RX_RDY_INT) + +#define UART_STAT 0x0c /* Status Register */ +#define STAT_TX_FIFO_EMPT (1 << 13) /* TX FIFO Empty */ +#define STAT_RX_FIFO_EMPT (1 << 12) /* RX FIFO Empty */ +#define STAT_TX_FIFO_FULL (1 << 11) /* TX FIFO Full */ +#define STAT_TX_FIFO_HALF (1 << 10) /* TX FIFO Half Full */ +#define STAT_RX_TOGL (1 << 9) /* RX Toogled */ +#define STAT_RX_FIFO_FULL (1 << 8) /* RX FIFO Full */ +#define STAT_RX_FIFO_HALF (1 << 7) /* RX FIFO Half Full */ +#define STAT_TX_EMPT (1 << 6) /* TX Empty */ +#define STAT_TX_RDY (1 << 5) /* TX Ready */ +#define STAT_RX_RDY (1 << 4) /* RX Ready */ +#define STAT_BRK_DET (1 << 3) /* Break Detect */ +#define STAT_FRM_ERR (1 << 2) /* Frame Error */ +#define STAT_PAR_ERR (1 << 1) /* Parity Error */ +#define STAT_OVR_ERR (1 << 0) /* Overrun Error */ +#define STAT_TX_IDLE STAT_TX_RDY +#define STAT_TRANS_MASK (STAT_OVR_ERR | STAT_BRK_DET | STAT_RX_RDY) + +#define UART_CCR 0x10 /* Clock Control Register */ +#define CCR_BAUDRATE_DIV 0x3ff /* Baud Rate Divisor */ + +#define DEFAULT_RCLK 25804800 +#define ONE_FRAME_TIME 87 + +#define stat_ipend_trans(i) ( \ + (i & STAT_OVR_ERR) << 16 | \ + (i & STAT_BRK_DET) << 14 | \ + (i & STAT_RX_RDY) << 14) + +/* + * For debugging purposes + */ +#ifdef EARLY_PRINTF +#if defined(SOCDEV_PA) && defined(SOCDEV_VA) +#define UART_REG_OFFSET 0x12000 +static void +uart_mvebu_early_putc(int c) +{ + volatile uint32_t *tsh; + volatile uint32_t *stat; + + tsh = (uint32_t *)(SOCDEV_VA + UART_REG_OFFSET + UART_TSH); + stat = (uint32_t *)(SOCDEV_VA + UART_REG_OFFSET + UART_STAT); + + while(!(*stat & STAT_TX_RDY)) + ; + + *tsh = c & 0xff; +} + +early_putc_t *early_putc = uart_mvebu_early_putc; +#endif +#endif + +/* + * Low-level UART interface. + */ +static int uart_mvebu_probe(struct uart_bas *); +static void uart_mvebu_init(struct uart_bas *, int, int, int, int); +static void uart_mvebu_putc(struct uart_bas *, int); +static int uart_mvebu_rxready(struct uart_bas *); +static int uart_mvebu_getc(struct uart_bas *, struct mtx *); + +static struct uart_ops uart_mvebu_ops = { + .probe = uart_mvebu_probe, + .init = uart_mvebu_init, + .term = NULL, + .putc = uart_mvebu_putc, + .rxready = uart_mvebu_rxready, + .getc = uart_mvebu_getc, +}; + +static int +uart_mvebu_probe(struct uart_bas *bas) +{ + + return (0); +} + +static int +uart_mvebu_divisor(int rclk, int baudrate) +{ + int divisor; + + if (baudrate == 0) + return (0); + + divisor = (rclk >> 4) / baudrate; + if (divisor <= 1 || divisor >= 1024) + return (0); + + return (divisor); +} + +static int +uart_mvebu_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + uint32_t ctrl = 0; + uint32_t ccr; + int divisor, ret = 0; + + /* Reset UART */ + ctrl = uart_getreg(bas, UART_CTRL); + uart_setreg(bas, UART_CTRL, ctrl | CTRL_TX_FIFO_RST | CTRL_RX_FIFO_RST | + CTRL_LPBK_EN); + uart_barrier(bas); + + switch (stopbits) { + case 2: + ctrl |= CTRL_TWO_STOP; + break; + case 1: + default: + ctrl &=~ CTRL_TWO_STOP; + } + + switch (parity) { + case 3: /* Even parity bit */ + ctrl |= CTRL_PAR_EN; + break; + default: + ctrl &=~ CTRL_PAR_EN; + } + + /* Set baudrate. */ + if (baudrate > 0) { + divisor = uart_mvebu_divisor(bas->rclk, baudrate); + if (divisor == 0) { + ret = EINVAL; + } else { + ccr = uart_getreg(bas, UART_CCR); + ccr &=~CCR_BAUDRATE_DIV; + + uart_setreg(bas, UART_CCR, ccr | divisor); + uart_barrier(bas); + } + } + + /* Set mirroring of status bits */ + ctrl |= CTRL_ST_MIRR_EN; + + uart_setreg(bas, UART_CTRL, ctrl); + uart_barrier(bas); + + return (ret); +} + +static void +uart_mvebu_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + /* Set default frequency */ + bas->rclk = DEFAULT_RCLK; + + /* Mask interrupts */ + uart_setreg(bas, UART_CTRL, uart_getreg(bas, UART_CTRL) & + ~CTRL_INTR_MASK); + uart_barrier(bas); + + uart_mvebu_param(bas, baudrate, databits, stopbits, parity); +} + +static void +uart_mvebu_putc(struct uart_bas *bas, int c) +{ + while (uart_getreg(bas, UART_STAT) & STAT_TX_FIFO_FULL) + ; + uart_setreg(bas, UART_TSH, c & 0xff); +} + +static int +uart_mvebu_rxready(struct uart_bas *bas) +{ + if (uart_getreg(bas, UART_STAT) & STAT_RX_RDY) + return 1; + return 0; +} + +static int +uart_mvebu_getc(struct uart_bas *bas, struct mtx *hwmtx) +{ + int c; + + uart_lock(hwmtx); + while (!(uart_getreg(bas, UART_STAT) & STAT_RX_RDY)) + ; + + c = uart_getreg(bas, UART_RBR) & 0xff; + uart_unlock(hwmtx); + + return c; +} + +/* + * UART driver methods implementation. + */ +struct uart_mvebu_softc { + struct uart_softc base; + uint16_t intrm; +}; + +static int uart_mvebu_bus_attach(struct uart_softc *); +static int uart_mvebu_bus_detach(struct uart_softc *); +static int uart_mvebu_bus_flush(struct uart_softc *, int); +static int uart_mvebu_bus_getsig(struct uart_softc *); +static int uart_mvebu_bus_ioctl(struct uart_softc *, int, intptr_t); +static int uart_mvebu_bus_ipend(struct uart_softc *); +static int uart_mvebu_bus_param(struct uart_softc *, int, int, int, int); +static int uart_mvebu_bus_probe(struct uart_softc *); +static int uart_mvebu_bus_receive(struct uart_softc *); +static int uart_mvebu_bus_setsig(struct uart_softc *, int); +static int uart_mvebu_bus_transmit(struct uart_softc *); +static void uart_mvebu_bus_grab(struct uart_softc *); +static void uart_mvebu_bus_ungrab(struct uart_softc *); + +static kobj_method_t uart_mvebu_methods[] = { + KOBJMETHOD(uart_attach, uart_mvebu_bus_attach), + KOBJMETHOD(uart_detach, uart_mvebu_bus_detach), + KOBJMETHOD(uart_flush, uart_mvebu_bus_flush), + KOBJMETHOD(uart_getsig, uart_mvebu_bus_getsig), + KOBJMETHOD(uart_ioctl, uart_mvebu_bus_ioctl), + KOBJMETHOD(uart_ipend, uart_mvebu_bus_ipend), + KOBJMETHOD(uart_param, uart_mvebu_bus_param), + KOBJMETHOD(uart_probe, uart_mvebu_bus_probe), + KOBJMETHOD(uart_receive, uart_mvebu_bus_receive), + KOBJMETHOD(uart_setsig, uart_mvebu_bus_setsig), + KOBJMETHOD(uart_transmit, uart_mvebu_bus_transmit), + KOBJMETHOD(uart_grab, uart_mvebu_bus_grab), + KOBJMETHOD(uart_ungrab, uart_mvebu_bus_ungrab), + { 0, 0 } +}; + +struct uart_class uart_mvebu_class = { + "mvebu-uart", + uart_mvebu_methods, + sizeof(struct uart_mvebu_softc), + .uc_ops = &uart_mvebu_ops, + .uc_range = 0x14, + .uc_rclk = DEFAULT_RCLK, + .uc_rshift = 0, + .uc_riowidth = 4 +}; + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-3700-uart", (uintptr_t)&uart_mvebu_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + +static int +uart_mvebu_bus_attach(struct uart_softc *sc) +{ + struct uart_bas *bas; + int ctrl; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + ctrl = uart_getreg(bas, UART_CTRL); + + /* Enable interrupts */ + ctrl &=~ CTRL_INTR_MASK; + ctrl |= CTRL_IPEND_MASK; + + /* Set interrupts */ + uart_setreg(bas, UART_CTRL, ctrl); + uart_barrier(bas); + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_mvebu_bus_detach(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_mvebu_bus_flush(struct uart_softc *sc, int what) +{ + struct uart_bas *bas; + int ctrl, ret = 0; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + ctrl = uart_getreg(bas, UART_CTRL); + + switch (what) { + case UART_FLUSH_RECEIVER: + uart_setreg(bas, UART_CTRL, ctrl | CTRL_RX_FIFO_RST); + uart_barrier(bas); + break; + + case UART_FLUSH_TRANSMITTER: + uart_setreg(bas, UART_CTRL, ctrl | CTRL_TX_FIFO_RST); + uart_barrier(bas); + break; + + default: + ret = EINVAL; + break; + } + + /* Back to normal operation */ + if (!ret) { + uart_setreg(bas, UART_CTRL, ctrl); + uart_barrier(bas); + } + + uart_unlock(sc->sc_hwmtx); + return (ret); +} + +static int +uart_mvebu_bus_getsig(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_mvebu_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + struct uart_bas *bas; + int ctrl, ret = 0; + int divisor, baudrate; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + switch (request) { + case UART_IOCTL_BREAK: + ctrl = uart_getreg(bas, UART_CTRL); + if (data) + ctrl |= CTRL_SND_BRK_SEQ; + else + ctrl &=~ CTRL_SND_BRK_SEQ; + uart_setreg(bas, UART_CTRL, ctrl); + uart_barrier(bas); + break; + + case UART_IOCTL_BAUD: + divisor = uart_getreg(bas, UART_CCR) & CCR_BAUDRATE_DIV; + baudrate = bas->rclk/(divisor * 16); + *(int *)data = baudrate; + break; + + default: + ret = ENOTTY; + break; + } + uart_unlock(sc->sc_hwmtx); + + return (ret); +} + +static int +uart_mvebu_bus_ipend(struct uart_softc *sc) +{ + struct uart_bas *bas; + int ipend, ctrl, ret = 0; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + ipend = uart_getreg(bas, UART_STAT); + ctrl = uart_getreg(bas, UART_CTRL); + + if (((ipend & STAT_TX_IDLE) == STAT_TX_IDLE) && + (ctrl & CTRL_TX_IDLE_INT) == CTRL_TX_IDLE_INT) { + /* Disable TX IDLE Interrupt generation */ + uart_setreg(bas, UART_CTRL, ctrl & ~CTRL_TX_IDLE_INT); + uart_barrier(bas); + + /* SER_INT_TXIDLE means empty TX FIFO. Wait until it cleans */ + while(!(uart_getreg(bas, UART_STAT) & STAT_TX_FIFO_EMPT)) + DELAY(ONE_FRAME_TIME/2); + + ret |= SER_INT_TXIDLE; + } + + ret |= stat_ipend_trans(ipend & STAT_TRANS_MASK); + + uart_unlock(sc->sc_hwmtx); + + return (ret); +} + +static int +uart_mvebu_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + int ret; + + uart_lock(sc->sc_hwmtx); + ret = uart_mvebu_param(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_unlock(sc->sc_hwmtx); + + return (ret); +} + +static int +uart_mvebu_bus_probe(struct uart_softc *sc) +{ + if (!ofw_bus_status_okay(sc->sc_dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(sc->sc_dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(sc->sc_dev, "Marvell Armada 3700 UART"); + + sc->sc_txfifosz = 32; + sc->sc_rxfifosz = 64; + sc->sc_hwiflow = 0; + sc->sc_hwoflow = 0; + + return (0); +} + +int +uart_mvebu_bus_receive(struct uart_softc *sc) +{ + struct uart_bas *bas; + uint32_t xc; + int rx, er; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + while (!(uart_getreg(bas, UART_STAT) & STAT_RX_FIFO_EMPT)) { + if (uart_rx_full(sc)) { + sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; + break; + } + + xc = uart_getreg(bas, UART_RBR); + rx = xc & 0xff; + er = xc & 0xf000; + /* + * Formula which translates marvell error bits + * Only valid when CTRL_ST_MIRR_EN is set + */ + er = (er & RBR_BRK_DET) >> 7 | + (er & RBR_FRM_ERR_DET) >> 5 | + (er & RBR_PAR_ERR_DET) >> 2 | + (er & RBR_OVR_ERR_DET) >> 2; + + uart_rx_put(sc, rx | er); + uart_barrier(bas); + } + /* + * uart_if.m says that receive interrupt + * should be cleared, so we need to reset + * RX FIFO + */ + + if (!(uart_getreg(bas, UART_STAT) & STAT_RX_FIFO_EMPT)) { + uart_mvebu_bus_flush(sc, UART_FLUSH_RECEIVER); + } + + uart_unlock(sc->sc_hwmtx); + return (0); +} + +static int +uart_mvebu_bus_setsig(struct uart_softc *sc, int sig) +{ + /* Not supported by hardware */ + return (0); +} + +int +uart_mvebu_bus_transmit(struct uart_softc *sc) +{ + struct uart_bas *bas; + int i, ctrl; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + /* Turn off all interrupts during send */ + ctrl = uart_getreg(bas, UART_CTRL); + uart_setreg(bas, UART_CTRL, ctrl & ~CTRL_INTR_MASK); + uart_barrier(bas); + + for (i = 0; i < sc->sc_txdatasz; i++) { + uart_setreg(bas, UART_TSH, sc->sc_txbuf[i] & 0xff); + uart_barrier(bas); + } + + /* + * Make sure that interrupt is generated + * when FIFO can get more data. + */ + uart_setreg(bas, UART_CTRL, ctrl | CTRL_TX_IDLE_INT); + uart_barrier(bas); + + /* Mark busy */ + sc->sc_txbusy = 1; + + uart_unlock(sc->sc_hwmtx); + return (0); +} + +static void +uart_mvebu_bus_grab(struct uart_softc *sc) +{ + struct uart_mvebu_softc *msc = (struct uart_mvebu_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + uint32_t ctrl; + + /* Mask all interrupts */ + uart_lock(sc->sc_hwmtx); + ctrl = uart_getreg(bas, UART_CTRL); + msc->intrm = ctrl & CTRL_INTR_MASK; + uart_setreg(bas, UART_CTRL, ctrl & ~CTRL_INTR_MASK); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +uart_mvebu_bus_ungrab(struct uart_softc *sc) +{ + struct uart_mvebu_softc *msc = (struct uart_mvebu_softc *)sc; + struct uart_bas *bas = &sc->sc_bas; + uint32_t ctrl; + + /* Restore interrupts */ + uart_lock(sc->sc_hwmtx); + ctrl = uart_getreg(bas, UART_CTRL) & ~CTRL_INTR_MASK; + uart_setreg(bas, UART_CTRL, ctrl | msc->intrm); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Sat Sep 9 11:16:10 2017 (r323358) +++ head/sys/modules/uart/Makefile Sat Sep 9 11:42:32 2017 (r323359) @@ -30,7 +30,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ - uart_dev_z8530.c \ + uart_dev_z8530.c uart_dev_mvebu.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ From owner-svn-src-head@freebsd.org Sat Sep 9 11:46:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22527E118CA; Sat, 9 Sep 2017 11:46:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E141B65A72; Sat, 9 Sep 2017 11:46:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BkY4C090784; Sat, 9 Sep 2017 11:46:34 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89BkYI0090783; Sat, 9 Sep 2017 11:46:34 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091146.v89BkYI0090783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323360 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 323360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:46:36 -0000 Author: mw Date: Sat Sep 9 11:46:34 2017 New Revision: 323360 URL: https://svnweb.freebsd.org/changeset/base/323360 Log: Add support for uart_mvebu driver arm64 GENERIC config This patch enables console output on Armada 3700 SoCs with kernel GENERIC. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12251 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 9 11:42:32 2017 (r323359) +++ head/sys/arm64/conf/GENERIC Sat Sep 9 11:46:34 2017 (r323360) @@ -147,6 +147,7 @@ device dwmmc # Serial (COM) ports device uart # Generic UART driver +device uart_mvebu # Armada 3700 UART driver device uart_ns8250 # ns8250-type UART driver device uart_snps device pl011 From owner-svn-src-head@freebsd.org Sat Sep 9 11:49:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B3A8E11A95; Sat, 9 Sep 2017 11:49:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3AD8D65C16; Sat, 9 Sep 2017 11:49:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BnaTZ091070; Sat, 9 Sep 2017 11:49:36 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89BnafW091068; Sat, 9 Sep 2017 11:49:36 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091149.v89BnafW091068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323361 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 323361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:49:37 -0000 Author: mw Date: Sat Sep 9 11:49:36 2017 New Revision: 323361 URL: https://svnweb.freebsd.org/changeset/base/323361 Log: Store virtual address of buffer in mvneta_rx_ring Now the virtual address of received buffer is taken from a software ring. Thanks to this, we can use the NETA driver on 64 bits architecture and avoid 32-bit buf_cookie descriptor field limitation. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12257 Modified: head/sys/dev/neta/if_mvneta.c head/sys/dev/neta/if_mvnetavar.h Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Sat Sep 9 11:46:34 2017 (r323360) +++ head/sys/dev/neta/if_mvneta.c Sat Sep 9 11:49:36 2017 (r323361) @@ -3008,7 +3008,7 @@ mvneta_rx_queue(struct mvneta_softc *sc, int q, int np * bytecnt cover MH, PKT, CRC */ pktlen = r->bytecnt - ETHER_CRC_LEN - MVNETA_HWHEADER_SIZE; - pktbuf = (uint8_t *)r->bufptr_va + MVNETA_PACKET_OFFSET + + pktbuf = (uint8_t *)rx->rxbuf_virt_addr[rx->dma] + MVNETA_PACKET_OFFSET + MVNETA_HWHEADER_SIZE; /* Prefetch mbuf data. */ @@ -3135,7 +3135,7 @@ mvneta_rx_queue_refill(struct mvneta_softc *sc, int q) rxbuf->m = m; r = &rx->desc[rx->cpu]; r->bufptr_pa = segs.ds_addr; - r->bufptr_va = (uint32_t)m->m_data; + rx->rxbuf_virt_addr[rx->cpu] = m->m_data; rx->cpu = rx_counter_adv(rx->cpu, 1); } Modified: head/sys/dev/neta/if_mvnetavar.h ============================================================================== --- head/sys/dev/neta/if_mvnetavar.h Sat Sep 9 11:46:34 2017 (r323360) +++ head/sys/dev/neta/if_mvnetavar.h Sat Sep 9 11:49:36 2017 (r323361) @@ -118,6 +118,9 @@ struct mvneta_rx_ring { bus_dmamap_t desc_map; bus_addr_t desc_pa; + /* Virtual address of the RX buffer */ + void *rxbuf_virt_addr[MVNETA_RX_RING_CNT]; + /* Managment entries for each of descritors */ struct mvneta_buf rxbuf[MVNETA_RX_RING_CNT]; From owner-svn-src-head@freebsd.org Sat Sep 9 11:54:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B5AE11F30; Sat, 9 Sep 2017 11:54:06 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 0DF4C6618A; Sat, 9 Sep 2017 11:54:05 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89Bs5oD094978; Sat, 9 Sep 2017 11:54:05 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Bs4b9094975; Sat, 9 Sep 2017 11:54:04 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091154.v89Bs4b9094975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323362 - in head/sys: conf dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: conf dev/neta X-SVN-Commit-Revision: 323362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:54:06 -0000 Author: mw Date: Sat Sep 9 11:54:04 2017 New Revision: 323362 URL: https://svnweb.freebsd.org/changeset/base/323362 Log: Add support for Armada 3700 in the NETA driver This patch enables using NETA driver on Marvell Armada 3700 SoC by introducing new compatible string, modifying clock source obtaining and also excluding unnecessary parts. The driver is added as a build option for arm64 platforms as well. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12258 Modified: head/sys/conf/files.arm64 head/sys/dev/neta/if_mvneta.c head/sys/dev/neta/if_mvneta_fdt.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 9 11:49:36 2017 (r323361) +++ head/sys/conf/files.arm64 Sat Sep 9 11:54:04 2017 (r323362) @@ -167,6 +167,8 @@ dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt dev/mmc/host/dwmmc_hisi.c optional dwmmc fdt soc_hisi_hi6220 +dev/neta/if_mvneta_fdt.c optional neta fdt +dev/neta/if_mvneta.c optional neta mdio mii dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Sat Sep 9 11:49:36 2017 (r323361) +++ head/sys/dev/neta/if_mvneta.c Sat Sep 9 11:54:04 2017 (r323362) @@ -74,9 +74,12 @@ __FBSDID("$FreeBSD$"); #include -#include #include + +#if !defined(__aarch64__) +#include #include +#endif #include "if_mvnetareg.h" #include "if_mvnetavar.h" @@ -92,6 +95,18 @@ __FBSDID("$FreeBSD$"); #define DASSERT(x) KASSERT((x), (#x)) +#define A3700_TCLK_250MHZ 250000000 + +STATIC uint32_t +mvneta_get_clk() +{ +#if defined(__aarch64__) + return (A3700_TCLK_250MHZ); +#else + return (get_tclk()); +#endif +} + /* Device Register Initialization */ STATIC int mvneta_initreg(struct ifnet *); @@ -464,7 +479,7 @@ mvneta_dma_create(struct mvneta_softc *sc) error = mvneta_ring_alloc_tx_queue(sc, q); if (error != 0) { device_printf(sc->dev, - "Failed to allocate DMA safe memory for TxQ: %d\n", q); + "Failed to allocate DMA safe memory for TxQ: %zu\n", q); goto fail; } } @@ -512,7 +527,7 @@ mvneta_dma_create(struct mvneta_softc *sc) for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { if (mvneta_ring_alloc_rx_queue(sc, q) != 0) { device_printf(sc->dev, - "Failed to allocate DMA safe memory for RxQ: %d\n", q); + "Failed to allocate DMA safe memory for RxQ: %zu\n", q); goto fail; } } @@ -533,7 +548,9 @@ mvneta_attach(device_t self) device_t child; int ifm_target; int q, error; +#if !defined(__aarch64__) uint32_t reg; +#endif sc = device_get_softc(self); sc->dev = self; @@ -556,6 +573,7 @@ mvneta_attach(device_t self) MVNETA_WRITE(sc, MVNETA_PRXINIT, 0x00000001); MVNETA_WRITE(sc, MVNETA_PTXINIT, 0x00000001); +#if !defined(__aarch64__) /* * Disable port snoop for buffers and descriptors * to avoid L2 caching of both without DRAM copy. @@ -568,6 +586,7 @@ mvneta_attach(device_t self) reg &= ~MVNETA_PSNPCFG_BUFSNP_MASK; MVNETA_WRITE(sc, MVNETA_PSNPCFG, reg); } +#endif /* * MAC address @@ -1363,7 +1382,7 @@ mvneta_ring_init_rx_queue(struct mvneta_softc *sc, int rx = MVNETA_RX_RING(sc, q); rx->dma = rx->cpu = 0; rx->queue_th_received = MVNETA_RXTH_COUNT; - rx->queue_th_time = (get_tclk() / 1000) / 10; /* 0.1 [ms] */ + rx->queue_th_time = (mvneta_get_clk() / 1000) / 10; /* 0.1 [ms] */ /* Initialize LRO */ rx->lro_enabled = FALSE; @@ -3344,7 +3363,7 @@ sysctl_set_queue_rxthtime(SYSCTL_HANDLER_ARGS) mvneta_rx_lockq(sc, arg->queue); rx = MVNETA_RX_RING(sc, arg->queue); time_mvtclk = rx->queue_th_time; - time_us = ((uint64_t)time_mvtclk * 1000ULL * 1000ULL) / get_tclk(); + time_us = ((uint64_t)time_mvtclk * 1000ULL * 1000ULL) / mvneta_get_clk(); mvneta_rx_unlockq(sc, arg->queue); mvneta_sc_unlock(sc); @@ -3362,7 +3381,7 @@ sysctl_set_queue_rxthtime(SYSCTL_HANDLER_ARGS) return (EINVAL); } time_mvtclk = - (uint64_t)get_tclk() * (uint64_t)time_us / (1000ULL * 1000ULL); + (uint64_t)mvneta_get_clk() * (uint64_t)time_us / (1000ULL * 1000ULL); rx->queue_th_time = time_mvtclk; reg = MVNETA_PRXITTH_RITT(rx->queue_th_time); MVNETA_WRITE(sc, MVNETA_PRXITTH(arg->queue), reg); Modified: head/sys/dev/neta/if_mvneta_fdt.c ============================================================================== --- head/sys/dev/neta/if_mvneta_fdt.c Sat Sep 9 11:49:36 2017 (r323361) +++ head/sys/dev/neta/if_mvneta_fdt.c Sat Sep 9 11:54:04 2017 (r323362) @@ -83,6 +83,12 @@ DRIVER_MODULE(mvneta, simplebus, mvneta_fdt_driver, mv static int mvneta_fdt_phy_acquire(device_t); +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-370-neta", true}, + {"marvell,armada-3700-neta", true}, + {NULL, false} +}; + static int mvneta_fdt_probe(device_t dev) { @@ -90,7 +96,7 @@ mvneta_fdt_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "marvell,armada-370-neta")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "NETA controller"); From owner-svn-src-head@freebsd.org Sat Sep 9 11:56:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C74EE121BA; Sat, 9 Sep 2017 11:56:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 49E5A66353; Sat, 9 Sep 2017 11:56:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BumdU095121; Sat, 9 Sep 2017 11:56:48 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Bum8k095120; Sat, 9 Sep 2017 11:56:48 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091156.v89Bum8k095120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323363 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 323363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 11:56:49 -0000 Author: mw Date: Sat Sep 9 11:56:48 2017 New Revision: 323363 URL: https://svnweb.freebsd.org/changeset/base/323363 Log: Enable compilation of Marvell NETA controller with arm64 GENERIC This patch enables network operation on Marvell Armada 3700 SoC. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12259 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 9 11:54:04 2017 (r323362) +++ head/sys/arm64/conf/GENERIC Sat Sep 9 11:56:48 2017 (r323363) @@ -119,6 +119,7 @@ options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support # Ethernet NICs +device mdio device mii device miibus # MII bus support device awg # Allwinner EMAC Gigabit Ethernet @@ -126,6 +127,7 @@ device axgbe # AMD Opteron A1100 integrated NIC device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device neta # Marvell NETA Controller device smc # SMSC LAN91C111 device vnic # Cavium ThunderX NIC device al_eth # Annapurna Alpine Ethernet NIC From owner-svn-src-head@freebsd.org Sat Sep 9 12:50:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30339E14D53; Sat, 9 Sep 2017 12:50:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id F346967CA6; Sat, 9 Sep 2017 12:50:13 +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 v89CoDN6015760; Sat, 9 Sep 2017 12:50:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89CoDeF015759; Sat, 9 Sep 2017 12:50:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709091250.v89CoDeF015759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 9 Sep 2017 12:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323364 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 323364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 12:50:14 -0000 Author: hselasky Date: Sat Sep 9 12:50:12 2017 New Revision: 323364 URL: https://svnweb.freebsd.org/changeset/base/323364 Log: Only search the scope ID in ip6_find_dev() for IPv6 addresses which have a scope ID. Change size of the searched scope ID to the full 16-bits. There can typically be more than 255 interfaces. Suggested by: ae @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Modified: head/sys/compat/linuxkpi/common/include/linux/inetdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep 9 11:56:48 2017 (r323363) +++ head/sys/compat/linuxkpi/common/include/linux/inetdevice.h Sat Sep 9 12:50:12 2017 (r323364) @@ -61,7 +61,7 @@ static inline struct net_device * ip6_dev_find(struct vnet *vnet, struct in6_addr addr) { struct sockaddr_in6 sin6; - struct ifaddr *ifa; + struct ifaddr *ifa = NULL; struct ifnet *ifp = NULL; int x; @@ -70,16 +70,22 @@ ip6_dev_find(struct vnet *vnet, struct in6_addr addr) sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; CURVNET_SET_QUIET(vnet); - /* XXX need to search all scope ID's */ - for (x = 0; x <= V_if_index; x++) { - sin6.sin6_addr.s6_addr[3] = x; - ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); - if (ifa != NULL) { - ifp = ifa->ifa_ifp; - if_ref(ifp); - ifa_free(ifa); - break; + if (IN6_IS_SCOPE_LINKLOCAL(&addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&addr)) { + /* XXX need to search all scope ID's */ + for (x = 0; x <= V_if_index && x < 65536; x++) { + sin6.sin6_addr.s6_addr16[1] = htons(x); + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + if (ifa != NULL) + break; } + } else { + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6); + } + if (ifa != NULL) { + ifp = ifa->ifa_ifp; + if_ref(ifp); + ifa_free(ifa); } CURVNET_RESTORE(); return (ifp); From owner-svn-src-head@freebsd.org Sat Sep 9 12:51:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A615E14E6D; Sat, 9 Sep 2017 12:51:20 +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 EAFA268155; Sat, 9 Sep 2017 12:51:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 C14832600CA; Sat, 9 Sep 2017 14:51:17 +0200 (CEST) Subject: Re: svn commit: r323351 - head/sys/compat/linuxkpi/common/include/linux To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709090721.v897LRWA084296@repo.freebsd.org> <1b752f11-2ec8-4c07-d53a-9e32a5fcf56c@yandex.ru> From: Hans Petter Selasky Message-ID: <00d891a5-3fb7-5562-7f3d-645083779492@selasky.org> Date: Sat, 9 Sep 2017 14:48:52 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1b752f11-2ec8-4c07-d53a-9e32a5fcf56c@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 12:51:20 -0000 On 09/09/17 13:10, Andrey V. Elsukov wrote: > On 09.09.2017 10:21, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Sat Sep 9 07:21:27 2017 >> New Revision: 323351 >> URL: https://svnweb.freebsd.org/changeset/base/323351 >> > > This doesn't look right. We use s6_addr16[1] to keep scope zone id. > And if_index value should be converted into network byte order. It is > quite usual to have more that 255 interfaces. > > And what is more important, you must not use this code for global IPv6 > addresses. > Hi, Thank you for your comments. This function is only used for interface specific addresses. Anyway, I'll make the requested changes! https://svnweb.freebsd.org/changeset/base/323364 --HPS From owner-svn-src-head@freebsd.org Sat Sep 9 13:18:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7118BE16105; Sat, 9 Sep 2017 13:18:34 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3C2B668AE0; Sat, 9 Sep 2017 13:18:34 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89DIXoR027791; Sat, 9 Sep 2017 13:18:33 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89DIXDj027788; Sat, 9 Sep 2017 13:18:33 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201709091318.v89DIXDj027788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Sat, 9 Sep 2017 13:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323365 - in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client X-SVN-Group: head X-SVN-Commit-Author: jonathan X-SVN-Commit-Paths: in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client X-SVN-Commit-Revision: 323365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 13:18:34 -0000 Author: jonathan Date: Sat Sep 9 13:18:32 2017 New Revision: 323365 URL: https://svnweb.freebsd.org/changeset/base/323365 Log: Remove redundant source and object files. Reviewed by: bdrewery, ngie MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12208 Modified: head/cddl/lib/libzpool/Makefile head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 head/usr.bin/svn/lib/libsvn_client/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Sat Sep 9 12:50:12 2017 (r323364) +++ head/cddl/lib/libzpool/Makefile Sat Sep 9 13:18:32 2017 (r323365) @@ -26,7 +26,7 @@ ATOMIC_SRCS= opensolaris_atomic.c LIB= zpool -ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c trim_map.c +ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/} KERNEL_SRCS= kernel.c taskq.c util.c LIST_SRCS= list.c Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 12:50:12 2017 (r323364) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 13:18:32 2017 (r323365) @@ -9,7 +9,6 @@ DEFAULT_VECTOR= bfd_elf64_x86_64_freebsd_vec SRCS+= elf64-x86-64.c \ efi-app-x86_64.c \ - efi-app-ia32.c \ elf64.c \ elf64-gen.c \ elf64-target.h \ Modified: head/usr.bin/svn/lib/libsvn_client/Makefile ============================================================================== --- head/usr.bin/svn/lib/libsvn_client/Makefile Sat Sep 9 12:50:12 2017 (r323364) +++ head/usr.bin/svn/lib/libsvn_client/Makefile Sat Sep 9 13:18:32 2017 (r323365) @@ -12,7 +12,7 @@ SRCS= add.c blame.c cat.c changelist.c checkout.c cle copy_foreign.c ctx.c delete.c deprecated.c diff.c \ diff_local.c diff_summarize.c export.c externals.c import.c \ info.c iprops.c list.c locking_commands.c log.c merge.c \ - mergeinfo.c mtcc.c patch.c log.c prop_commands.c \ + mergeinfo.c mtcc.c patch.c prop_commands.c \ ra.c relocate.c repos_diff.c resolved.c revert.c revisions.c \ status.c switch.c update.c upgrade.c url.c util.c version.c From owner-svn-src-head@freebsd.org Sat Sep 9 15:07:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAC17E1BAD6; Sat, 9 Sep 2017 15:07:17 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478C56C4C7; Sat, 9 Sep 2017 15:07:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.229.166.35]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MZgdm-1eA1im29gE-00LRwx; Sat, 09 Sep 2017 17:07:14 +0200 Date: Sat, 9 Sep 2017 17:07:06 +0200 From: "O. Hartmann" To: Jonathan Anderson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323365 - in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client Message-ID: <20170909170657.1e7688bb@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201709091318.v89DIXDj027788@repo.freebsd.org> References: <201709091318.v89DIXDj027788@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/qAh2J2K3bz7pjzgVx9L.U00"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:pcg869ANfR19ePvUaw6xesFQ/GtQn9KzB/FWf0ffDgukKtL4Jx4 Mepx6vVNOo+5KMDd+lmzNpDvmgv4EvbLAMEVvpVvv4sVFf4Z47FfkZS5l3ftPCjrWcDStxS lCmh6RTsqVl+UgAz0fBd6RXAuWXi4/+xoNfR//qaQOWhflv9DEf+1aMdooKSUViiNKuFBoi fDqzHMzr4xPHa9WNz5JSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:vI3MTO+CqqM=:X9bNFiauvZ9mtxmH+Wc3wJ 1q6SnVSDrlKnzXeiT5jolqGG7kGqZ3iI4JaiCSqV2KCM9jT3iS+oDMW8GjCHWPAuMFPZQ3f46 +fbbuSmHb3Yic2Vvp4aGwkqrk8LotAFRCbH6gJLSLzuggFc8kyRIJ2M69snOWQMHXNvAQYi14 x/5eSPf5wii+k8fb5yvESYirVIilU/UCdjFgFWGR1Qi76B2qYhNt8LyLH6+lAfFqROJYKLJpH CV8cWWx1Ctz2DRkO9ayGcx6aPRRcP2KruJkSyARVHikZn9i1d8pspw/gFUxlWfIlKtEv7CpFw ae/Ojcp+0x3Wu2cvEdajAG956DtKmUW74mwkcvuxTt2lLSHP9vUbvp2R21F58nM/DOaMMGcKv cH6j8G3QMMLlt/zMb0PfYuCrSoXFp0nYrhtkWl9sPqNkHbxr8Dk+sm6U8tu16bRqe58h46BSh IT0f2ImyUcX10ZMXJJHSDtKtq8K9zP7UMbELGlbgvi3BIy7Sth/93l7W0bTP/3v8Ba5UyMwJE W32aq+ZZNiOUj28KEUaCUz+mBoITwVjGfEPtSiGYOiPFZ000s+41hmr2UjzLCEe7G6FcQb4bW 16HmVGvIT6gB6BsMt5fkRR9Nn8+0MbcS6g8xpiR62J7LsofHiNc30ibMrvV4MRKH83zhgV4/8 wfus09Yhn+8ncAa49rlgasFi/i0KdR66v2dqSuXdiyDJ0pzXmn0NyIWito7f2JdbX/bal/JVw VDvyIV9KmHwm9mrgVhad2+ScLPd8lUMdX0vvQ1a6q/hEgrKICncCnw5y0di6iAZ2oLFq8514W X4jWPOo1fxPRIGS1rcLwWvFISSDwA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 15:07:17 -0000 --Sig_/qAh2J2K3bz7pjzgVx9L.U00 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 9 Sep 2017 13:18:33 +0000 (UTC) Jonathan Anderson schrieb: This bug has just been introduced in the transition r323342 -> r323365: [...] building shared library libncurses.so.8 --- lib/libgeom__L --- /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libsbuf.a(sub= r_sbuf.o): relocation R_X86_64_32 against `_DefaultRuneLocale' can not be used when ma= king a shared object; recompile with -fPIC /usr/obj/usr/src/tmp/usr/lib/libsbuf.a: could = not read symbols: Bad value cc: error: linker command failed with exit code 1 (use -= v to see invocation) *** [libgeom.so.5] Error code 1 make[4]: stopped in /usr/src/lib/libgeom .ERROR_TARGET=3D'libgeom.so.5' .ERROR_META_FILE=3D'/usr/obj/usr/src/lib/libgeom/libgeom.so.5.meta' .MAKE.LEVEL=3D'4' MAKEFILE=3D'' .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes ve= rbose' _ERROR_CMD=3D'@echo building shared library libgeom.so.5; @rm -f libgeom.so= .5 libgeom.so; @sh /usr/src/tools/install.sh -l s libgeom.so.5 libgeom.so; cc -target x86_64-unknown-freebsd12.0 --sysroot=3D/usr/obj/usr/src/tmp -B/usr/obj/usr/= src/tmp/usr/bin -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings -Wl,--warn-sha= red-textrel -o libgeom.so.5 -Wl,-soname,libgeom.so.5 `NM=3D'nm' NMFLAGS=3D'' lorder ge= om_getxml.pico geom_stats.pico geom_xml2tree.pico geom_ctl.pico geom_util.pico | tsort -q= ` -lbsdxml -lsbuf;' .CURDIR=3D'/usr/src/lib/libgeom' > Author: jonathan > Date: Sat Sep 9 13:18:32 2017 > New Revision: 323365 > URL: https://svnweb.freebsd.org/changeset/base/323365 >=20 > Log: > Remove redundant source and object files. > =20 > Reviewed by: bdrewery, ngie > MFC after: 1 week > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D12208 >=20 > Modified: > head/cddl/lib/libzpool/Makefile > head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 > head/usr.bin/svn/lib/libsvn_client/Makefile >=20 > Modified: head/cddl/lib/libzpool/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/lib/libzpool/Makefile Sat Sep 9 12:50:12 2017 (r323364) > +++ head/cddl/lib/libzpool/Makefile Sat Sep 9 13:18:32 2017 (r323365) > @@ -26,7 +26,7 @@ ATOMIC_SRCS=3D opensolaris_atomic.c > =20 > LIB=3D zpool > =20 > -ZFS_COMMON_SRCS=3D ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c trim_map.c > +ZFS_COMMON_SRCS=3D ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c > ZFS_SHARED_SRCS=3D ${ZFS_SHARED_OBJS:C/.o$/.c/} > KERNEL_SRCS=3D kernel.c taskq.c util.c > LIST_SRCS=3D list.c >=20 > Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 12:50:12 > 2017 (r323364) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat > Sep 9 13:18:32 2017 (r323365) @@ -9,7 +9,6 @@ DEFAULT_VECTOR=3D > bfd_elf64_x86_64_freebsd_vec=20 > SRCS+=3D elf64-x86-64.c \ > efi-app-x86_64.c \ > - efi-app-ia32.c \ > elf64.c \ > elf64-gen.c \ > elf64-target.h \ >=20 > Modified: head/usr.bin/svn/lib/libsvn_client/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/svn/lib/libsvn_client/Makefile Sat Sep 9 12:50:12 2017 > (r323364) +++ head/usr.bin/svn/lib/libsvn_client/Makefile Sat Sep 9 13:1= 8:32 > 2017 (r323365) @@ -12,7 +12,7 @@ SRCS=3D add.c blame.c cat.c > changelist.c checkout.c cle copy_foreign.c ctx.c delete.c deprecated.c di= ff.c \ > diff_local.c diff_summarize.c export.c externals.c import.c \ > info.c iprops.c list.c locking_commands.c log.c merge.c \ > - mergeinfo.c mtcc.c patch.c log.c prop_commands.c \ > + mergeinfo.c mtcc.c patch.c prop_commands.c \ > ra.c relocate.c repos_diff.c resolved.c revert.c revisions.c \ > status.c switch.c update.c upgrade.c url.c util.c version.c > =20 > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/qAh2J2K3bz7pjzgVx9L.U00 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWbQDmgAKCRDS528fyFhY lEZkAf4qBnZwvj3rz4AvbMmSQ/+rWSF9vwivtQ92bxWFzGHKvyN2o+crItBm1oJR UfucXd+ZVKCzjhtLFoV8gFGxFU4vAf0VYEcwhbxZyVsFao3EbIaEuGuJOFGNTvEN ooscotShgl7VgsqOd91xVMb+AivIfj6dprOcy1H+H/S9yl9IGSnZ =EWqH -----END PGP SIGNATURE----- --Sig_/qAh2J2K3bz7pjzgVx9L.U00-- From owner-svn-src-head@freebsd.org Sat Sep 9 16:04:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47BA6E1EB0B; Sat, 9 Sep 2017 16:04:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 155716E203; Sat, 9 Sep 2017 16:04:51 +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 v89G4oJ4097039; Sat, 9 Sep 2017 16:04:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89G4os5097038; Sat, 9 Sep 2017 16:04:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709091604.v89G4os5097038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 9 Sep 2017 16:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323367 - head/sys/boot/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/common X-SVN-Commit-Revision: 323367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 16:04:51 -0000 Author: imp Date: Sat Sep 9 16:04:49 2017 New Revision: 323367 URL: https://svnweb.freebsd.org/changeset/base/323367 Log: Mark init_chroot and init_script variables as deprecated. Modified: head/sys/boot/common/loader.8 Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sat Sep 9 14:30:16 2017 (r323366) +++ head/sys/boot/common/loader.8 Sat Sep 9 16:04:49 2017 (r323367) @@ -487,6 +487,13 @@ That happens before entering single-user mode or multi mode (but after executing the .Va init_script if enabled). +This functionality has been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +It will be removed in +.Fx 13.0 . .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. @@ -508,6 +515,13 @@ if the script terminates with a non-zero exit code, or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). +This functionality has been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +It will be removed in +.Fx 13.0 . .It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is From owner-svn-src-head@freebsd.org Sat Sep 9 17:35:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73FA9E2337D; Sat, 9 Sep 2017 17:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E11F70E9E; Sat, 9 Sep 2017 17:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89HZJU2034085; Sat, 9 Sep 2017 17:35:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89HZJV4034082; Sat, 9 Sep 2017 17:35:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709091735.v89HZJV4034082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 Sep 2017 17:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323368 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 323368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 17:35:20 -0000 Author: kib Date: Sat Sep 9 17:35:19 2017 New Revision: 323368 URL: https://svnweb.freebsd.org/changeset/base/323368 Log: Add a vm_page_change_lock() helper, the common code to not relock page lock if both old and new pages use the same underlying lock. Convert existing places to use the helper instead of inlining it. Use the optimization in vm_object_page_remove(). Suggested and reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Sep 9 16:04:49 2017 (r323367) +++ head/sys/vm/vm_object.c Sat Sep 9 17:35:19 2017 (r323368) @@ -1917,6 +1917,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t int options) { vm_page_t p, next; + struct mtx *mtx; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1927,6 +1928,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t vm_object_pip_add(object, 1); again: p = vm_page_find_least(object, start); + mtx = NULL; /* * Here, the variable "p" is either (1) the page with the least pindex @@ -1943,7 +1945,7 @@ again: * however, be invalidated if the option OBJPR_CLEANONLY is * not specified. */ - vm_page_lock(p); + vm_page_change_lock(p, &mtx); if (vm_page_xbusied(p)) { VM_OBJECT_WUNLOCK(object); vm_page_busy_sleep(p, "vmopax", true); @@ -1957,7 +1959,7 @@ again: p->valid = 0; vm_page_undirty(p); } - goto next; + continue; } if (vm_page_busied(p)) { VM_OBJECT_WUNLOCK(object); @@ -1971,14 +1973,14 @@ again: if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_write(p); if (p->dirty) - goto next; + continue; } if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); vm_page_free(p); -next: - vm_page_unlock(p); } + if (mtx != NULL) + mtx_unlock(mtx); vm_object_pip_wakeup(object); } @@ -2001,7 +2003,7 @@ next: void vm_object_page_noreuse(vm_object_t object, vm_pindex_t start, vm_pindex_t end) { - struct mtx *mtx, *new_mtx; + struct mtx *mtx; vm_page_t p, next; VM_OBJECT_ASSERT_LOCKED(object); @@ -2018,17 +2020,7 @@ vm_object_page_noreuse(vm_object_t object, vm_pindex_t mtx = NULL; for (; p != NULL && (p->pindex < end || end == 0); p = next) { next = TAILQ_NEXT(p, listq); - - /* - * Avoid releasing and reacquiring the same page lock. - */ - new_mtx = vm_page_lockptr(p); - if (mtx != new_mtx) { - if (mtx != NULL) - mtx_unlock(mtx); - mtx = new_mtx; - mtx_lock(mtx); - } + vm_page_change_lock(p, &mtx); vm_page_deactivate_noreuse(p); } if (mtx != NULL) Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Sep 9 16:04:49 2017 (r323367) +++ head/sys/vm/vm_page.c Sat Sep 9 17:35:19 2017 (r323368) @@ -938,6 +938,23 @@ vm_page_flash(vm_page_t m) } /* + * Avoid releasing and reacquiring the same page lock. + */ +void +vm_page_change_lock(vm_page_t m, struct mtx **mtx) +{ + struct mtx *mtx1; + + mtx1 = vm_page_lockptr(m); + if (*mtx == mtx1) + return; + if (*mtx != NULL) + mtx_unlock(*mtx); + *mtx = mtx1; + mtx_lock(mtx1); +} + +/* * Keep page from being freed by the page daemon * much of the same effect as wiring, except much lower * overhead and should be used only for *very* temporary @@ -970,20 +987,11 @@ vm_page_unhold(vm_page_t mem) void vm_page_unhold_pages(vm_page_t *ma, int count) { - struct mtx *mtx, *new_mtx; + struct mtx *mtx; mtx = NULL; for (; count != 0; count--) { - /* - * Avoid releasing and reacquiring the same page lock. - */ - new_mtx = vm_page_lockptr(*ma); - if (mtx != new_mtx) { - if (mtx != NULL) - mtx_unlock(mtx); - mtx = new_mtx; - mtx_lock(mtx); - } + vm_page_change_lock(*ma, &mtx); vm_page_unhold(*ma); ma++; } @@ -2023,7 +2031,7 @@ vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options) { - struct mtx *m_mtx, *new_mtx; + struct mtx *m_mtx; vm_object_t object; vm_paddr_t pa; vm_page_t m, m_run; @@ -2066,16 +2074,7 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, } else KASSERT(m_run != NULL, ("m_run == NULL")); - /* - * Avoid releasing and reacquiring the same page lock. - */ - new_mtx = vm_page_lockptr(m); - if (m_mtx != new_mtx) { - if (m_mtx != NULL) - mtx_unlock(m_mtx); - m_mtx = new_mtx; - mtx_lock(m_mtx); - } + vm_page_change_lock(m, &m_mtx); m_inc = 1; retry: if (m->wire_count != 0 || m->hold_count != 0) @@ -2225,7 +2224,7 @@ static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, vm_paddr_t high) { - struct mtx *m_mtx, *new_mtx; + struct mtx *m_mtx; struct spglist free; vm_object_t object; vm_paddr_t pa; @@ -2246,13 +2245,7 @@ vm_page_reclaim_run(int req_class, u_long npages, vm_p /* * Avoid releasing and reacquiring the same page lock. */ - new_mtx = vm_page_lockptr(m); - if (m_mtx != new_mtx) { - if (m_mtx != NULL) - mtx_unlock(m_mtx); - m_mtx = new_mtx; - mtx_lock(m_mtx); - } + vm_page_change_lock(m, &m_mtx); retry: if (m->wire_count != 0 || m->hold_count != 0) error = EBUSY; @@ -2365,12 +2358,7 @@ retry: * The new page must be deactivated * before the object is unlocked. */ - new_mtx = vm_page_lockptr(m_new); - if (m_mtx != new_mtx) { - mtx_unlock(m_mtx); - m_mtx = new_mtx; - mtx_lock(m_mtx); - } + vm_page_change_lock(m_new, &m_mtx); vm_page_deactivate(m_new); } else { m->flags &= ~PG_ZERO; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Sep 9 16:04:49 2017 (r323367) +++ head/sys/vm/vm_page.h Sat Sep 9 17:35:19 2017 (r323368) @@ -470,6 +470,7 @@ vm_page_t vm_page_alloc_contig(vm_object_t object, vm_ u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); +void vm_page_change_lock(vm_page_t m, struct mtx **mtx); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count); From owner-svn-src-head@freebsd.org Sat Sep 9 18:03:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC89E24781; Sat, 9 Sep 2017 18:03:42 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7625871BE4; Sat, 9 Sep 2017 18:03:42 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89I3f6S046165; Sat, 9 Sep 2017 18:03:41 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89I3fQl046159; Sat, 9 Sep 2017 18:03:41 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709091803.v89I3fQl046159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 9 Sep 2017 18:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323369 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:03:42 -0000 Author: scottl Date: Sat Sep 9 18:03:40 2017 New Revision: 323369 URL: https://svnweb.freebsd.org/changeset/base/323369 Log: Start separating the LSI drivers into per-queue structures. No functional change. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mpr/mpr.c Sat Sep 9 18:03:40 2017 (r323369) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -716,6 +717,10 @@ mpr_iocfacts_free(struct mpr_softc *sc) } if (sc->buffer_dmat != NULL) bus_dma_tag_destroy(sc->buffer_dmat); + + mpr_pci_free_interrupts(sc); + free(sc->queues, M_MPR); + sc->queues = NULL; } /* @@ -1136,8 +1141,24 @@ static int mpr_alloc_queues(struct mpr_softc *sc) { bus_addr_t queues_busaddr; + struct mpr_queue *q; uint8_t *queues; - int qsize, fqsize, pqsize; + int qsize, fqsize, pqsize, nq, i; + + nq = MIN(sc->msi_msgs, mp_ncpus); + sc->msi_msgs = nq; + mpr_dprint(sc, MPR_INIT|MPR_XINFO, "Allocating %d I/O queues\n", nq); + + sc->queues = malloc(sizeof(struct mpr_queue) * nq, M_MPR, M_NOWAIT|M_ZERO); + if (sc->queues == NULL) + return (ENOMEM); + + for (i = 0; i < nq; i++) { + q = &sc->queues[i]; + mpr_dprint(sc, MPR_INIT, "Configuring queue %d %p\n", i, q); + q->sc = sc; + q->qnum = i; + } /* * The reply free queue contains 4 byte entries in multiples of 16 and Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mpr/mpr_pci.c Sat Sep 9 18:03:40 2017 (r323369) @@ -290,6 +290,7 @@ int mpr_pci_setup_interrupts(struct mpr_softc *sc) { device_t dev; + struct mpr_queue *q; void *ihandler; int i, error, rid, initial_rid; @@ -309,18 +310,19 @@ mpr_pci_setup_interrupts(struct mpr_softc *sc) } for (i = 0; i < sc->msi_msgs; i++) { + q = &sc->queues[i]; rid = i + initial_rid; - sc->mpr_irq_rid[i] = rid; - sc->mpr_irq[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->mpr_irq_rid[i], RF_ACTIVE); - if (sc->mpr_irq[i] == NULL) { + q->irq_rid = rid; + q->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &q->irq_rid, RF_ACTIVE); + if (q->irq == NULL) { mpr_dprint(sc, MPR_ERROR|MPR_INIT, "Cannot allocate interrupt RID %d\n", rid); break; } - error = bus_setup_intr(dev, sc->mpr_irq[i], - INTR_TYPE_BIO | INTR_MPSAFE, NULL, mpr_intr_msi, - sc, &sc->mpr_intrhand[i]); + error = bus_setup_intr(dev, q->irq, + INTR_TYPE_BIO | INTR_MPSAFE, NULL, ihandler, + sc, &q->intrhand); if (error) { mpr_dprint(sc, MPR_ERROR|MPR_INIT, "Cannot setup interrupt RID %d\n", rid); @@ -347,23 +349,35 @@ mpr_pci_detach(device_t dev) return (0); } -static void -mpr_pci_free(struct mpr_softc *sc) +void +mpr_pci_free_interrupts(struct mpr_softc *sc) { + struct mpr_queue *q; int i; - if (sc->mpr_parent_dmat != NULL) { - bus_dma_tag_destroy(sc->mpr_parent_dmat); - } + if (sc->queues == NULL) + return; for (i = 0; i < sc->msi_msgs; i++) { - if (sc->mpr_irq[i] != NULL) { - bus_teardown_intr(sc->mpr_dev, sc->mpr_irq[i], - sc->mpr_intrhand[i]); + q = &sc->queues[i]; + if (q->irq != NULL) { + bus_teardown_intr(sc->mpr_dev, q->irq, + q->intrhand); bus_release_resource(sc->mpr_dev, SYS_RES_IRQ, - sc->mpr_irq_rid[i], sc->mpr_irq[i]); + q->irq_rid, q->irq); } } +} + +static void +mpr_pci_free(struct mpr_softc *sc) +{ + + if (sc->mpr_parent_dmat != NULL) { + bus_dma_tag_destroy(sc->mpr_parent_dmat); + } + + mpr_pci_free_interrupts(sc); if (sc->mpr_flags & MPR_FLAGS_MSI) pci_release_msi(sc->mpr_dev); Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mpr/mprvar.h Sat Sep 9 18:03:40 2017 (r323369) @@ -264,6 +264,26 @@ struct mpr_event_handle { uint8_t mask[16]; }; +struct mpr_queue { + struct mpr_softc *sc; + int qnum; + MPI2_REPLY_DESCRIPTORS_UNION *post_queue; + int replypostindex; +#ifdef notyet + ck_ring_buffer_t *ringmem; + ck_ring_buffer_t *chainmem; + ck_ring_t req_ring; + ck_ring_t chain_ring; +#endif + bus_dma_tag_t buffer_dmat; + int io_cmds_highwater; + int chain_free_lowwater; + int chain_alloc_fail; + struct resource *irq; + void *intrhand; + int irq_rid; +}; + struct mpr_softc { device_t mpr_dev; struct cdev *mpr_cdev; @@ -307,6 +327,7 @@ struct mpr_softc { struct mpr_prp_page *prps; struct callout periodic; struct callout device_check_callout; + struct mpr_queue *queues; struct mprsas_softc *sassc; char tmp_string[MPR_STRING_LENGTH]; @@ -338,9 +359,6 @@ struct mpr_softc { struct mtx mpr_mtx; struct intr_config_hook mpr_ich; - struct resource *mpr_irq[MPR_MSI_COUNT]; - void *mpr_intrhand[MPR_MSI_COUNT]; - int mpr_irq_rid[MPR_MSI_COUNT]; uint8_t *req_frames; bus_addr_t req_busaddr; @@ -702,6 +720,7 @@ mpr_unmask_intr(struct mpr_softc *sc) } int mpr_pci_setup_interrupts(struct mpr_softc *sc); +void mpr_pci_free_interrupts(struct mpr_softc *sc); int mpr_pci_restore(struct mpr_softc *sc); void mpr_get_tunables(struct mpr_softc *sc); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mps/mps.c Sat Sep 9 18:03:40 2017 (r323369) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -700,6 +701,10 @@ mps_iocfacts_free(struct mps_softc *sc) } if (sc->buffer_dmat != NULL) bus_dma_tag_destroy(sc->buffer_dmat); + + mps_pci_free_interrupts(sc); + free(sc->queues, M_MPT2); + sc->queues = NULL; } /* @@ -1109,8 +1114,24 @@ static int mps_alloc_queues(struct mps_softc *sc) { bus_addr_t queues_busaddr; + struct mps_queue *q; uint8_t *queues; - int qsize, fqsize, pqsize; + int qsize, fqsize, pqsize, nq, i; + + nq = MIN(sc->msi_msgs, mp_ncpus); + sc->msi_msgs = nq; + mps_dprint(sc, MPS_INIT|MPS_XINFO, "Allocating %d I/O queues\n", nq); + + sc->queues = malloc(sizeof(struct mps_queue) * nq, M_MPT2, M_NOWAIT|M_ZERO); + if (sc->queues == NULL) + return (ENOMEM); + + for (i = 0; i < nq; i++) { + q = &sc->queues[i]; + mps_dprint(sc, MPS_INIT, "Configuring queue %d %p\n", i, q); + q->sc = sc; + q->qnum = i; + } /* * The reply free queue contains 4 byte entries in multiples of 16 and Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mps/mps_pci.c Sat Sep 9 18:03:40 2017 (r323369) @@ -275,6 +275,7 @@ int mps_pci_setup_interrupts(struct mps_softc *sc) { device_t dev; + struct mps_queue *q; void *ihandler; int i, error, rid, initial_rid; @@ -294,18 +295,19 @@ mps_pci_setup_interrupts(struct mps_softc *sc) } for (i = 0; i < sc->msi_msgs; i++) { + q = &sc->queues[i]; rid = i + initial_rid; - sc->mps_irq_rid[i] = rid; - sc->mps_irq[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->mps_irq_rid[i], RF_ACTIVE); - if (sc->mps_irq[i] == NULL) { + q->irq_rid = rid; + q->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &q->irq_rid, RF_ACTIVE); + if (q->irq == NULL) { mps_dprint(sc, MPS_ERROR|MPS_INIT, "Cannot allocate interrupt RID%d\n", rid); break; } - error = bus_setup_intr(dev, sc->mps_irq[i], + error = bus_setup_intr(dev, q->irq, INTR_TYPE_BIO | INTR_MPSAFE, NULL, ihandler, - sc, &sc->mps_intrhand[i]); + sc, &q->intrhand); if (error) { mps_dprint(sc, MPS_ERROR|MPS_INIT, "Cannot setup interrupt RID %d\n", rid); @@ -333,23 +335,35 @@ mps_pci_detach(device_t dev) return (0); } -static void -mps_pci_free(struct mps_softc *sc) +void +mps_pci_free_interrupts(struct mps_softc *sc) { + struct mps_queue *q; int i; - if (sc->mps_parent_dmat != NULL) { - bus_dma_tag_destroy(sc->mps_parent_dmat); - } + if (sc->queues == NULL) + return; for (i = 0; i < sc->msi_msgs; i++) { - if (sc->mps_irq[i] != NULL) { - bus_teardown_intr(sc->mps_dev, sc->mps_irq[i], - sc->mps_intrhand[i]); + q = &sc->queues[i]; + if (q->irq != NULL) { + bus_teardown_intr(sc->mps_dev, q->irq, + q->intrhand); bus_release_resource(sc->mps_dev, SYS_RES_IRQ, - sc->mps_irq_rid[i], sc->mps_irq[i]); + q->irq_rid, q->irq); } } +} + +static void +mps_pci_free(struct mps_softc *sc) +{ + + if (sc->mps_parent_dmat != NULL) { + bus_dma_tag_destroy(sc->mps_parent_dmat); + } + + mps_pci_free_interrupts(sc); if (sc->mps_flags & MPS_FLAGS_MSI) pci_release_msi(sc->mps_dev); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sat Sep 9 17:35:19 2017 (r323368) +++ head/sys/dev/mps/mpsvar.h Sat Sep 9 18:03:40 2017 (r323369) @@ -260,6 +260,26 @@ struct mps_event_handle { u32 mask[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; }; +struct mps_queue { + struct mps_softc *sc; + int qnum; + MPI2_REPLY_DESCRIPTORS_UNION *post_queue; + int replypostindex; +#ifdef notyet + ck_ring_buffer_t *ringmem; + ck_ring_buffer_t *chainmem; + ck_ring_t req_ring; + ck_ring_t chain_ring; +#endif + bus_dma_tag_t buffer_dmat; + int io_cmds_highwater; + int chain_free_lowwater; + int chain_alloc_fail; + struct resource *irq; + void *intrhand; + int irq_rid; +}; + struct mps_softc { device_t mps_dev; struct cdev *mps_cdev; @@ -294,6 +314,7 @@ struct mps_softc { struct mps_chain *chains; struct callout periodic; struct callout device_check_callout; + struct mps_queue *queues; struct mpssas_softc *sassc; char tmp_string[MPS_STRING_LENGTH]; @@ -324,9 +345,6 @@ struct mps_softc { struct mtx mps_mtx; struct intr_config_hook mps_ich; - struct resource *mps_irq[MPS_MSI_COUNT]; - void *mps_intrhand[MPS_MSI_COUNT]; - int mps_irq_rid[MPS_MSI_COUNT]; uint8_t *req_frames; bus_addr_t req_busaddr; @@ -671,6 +689,7 @@ mps_unmask_intr(struct mps_softc *sc) } int mps_pci_setup_interrupts(struct mps_softc *sc); +void mps_pci_free_interrupts(struct mps_softc *sc); int mps_pci_restore(struct mps_softc *sc); void mps_get_tunables(struct mps_softc *sc); From owner-svn-src-head@freebsd.org Sat Sep 9 18:09:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F90E24BFC; Sat, 9 Sep 2017 18:09:39 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 B7BB371ED8; Sat, 9 Sep 2017 18:09:39 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [10.199.2.39] (unknown [50.235.236.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 48B7D192892; Sat, 9 Sep 2017 18:09:32 +0000 (UTC) Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart To: Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709091142.v89BgX8e090592@repo.freebsd.org> From: Sean Bruno Message-ID: Date: Sat, 9 Sep 2017 12:09:28 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201709091142.v89BgX8e090592@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6Dt3Hsk6OrCFUmMSfNb8pEq9XSsW9i7IE" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:09:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6Dt3Hsk6OrCFUmMSfNb8pEq9XSsW9i7IE Content-Type: multipart/mixed; boundary="lfDhL4kMvW0CDDEweKGpHGXUlcCmL10F8"; protected-headers="v1" From: Sean Bruno To: Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart References: <201709091142.v89BgX8e090592@repo.freebsd.org> In-Reply-To: <201709091142.v89BgX8e090592@repo.freebsd.org> --lfDhL4kMvW0CDDEweKGpHGXUlcCmL10F8 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09/09/17 05:42, Marcin Wojtas wrote: > Author: mw > Date: Sat Sep 9 11:42:32 2017 > New Revision: 323359 > URL: https://svnweb.freebsd.org/changeset/base/323359 >=20 > Log: > Introduce UART driver module for Armada 3700 > =20 > This patch adds support for UART in Armada 3700 family. > It exposes both low-level UART interface, as well as > standard driver methods. > =20 > Submitted by: Patryk Duda > Obtained from: Semihalf > Sponsored by: Semihalf > Differential Revision: https://reviews.freebsd.org/D12250 >=20 > Added: > head/sys/dev/uart/uart_dev_mvebu.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/modules/uart/Makefile Hrm ... I seem to be getting a compile failure after this: cc -target x86_64-unknown-freebsd12.0 --sysroot=3D/var/tmp/usr/src/tmp -B/var/tmp/usr/src/tmp/usr/bin -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. -I/usr/src/sys -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/var/tmp/usr/src/sys/GENERIC-NODEBUG -MD -MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=3Diso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o uart_dev_mvebu.o In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39: /usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: 'ofw_bus_if.h' file not found #include "ofw_bus_if.h" ^~~~~~~~~~~~~~ 1 error generated. *** Error code 1 Is there supposed to be processing of ofw_bus_if.m somewhere that is currently missed? sean --lfDhL4kMvW0CDDEweKGpHGXUlcCmL10F8-- --6Dt3Hsk6OrCFUmMSfNb8pEq9XSsW9i7IE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlm0LltfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZ17Af+IJZNPK10XJrgKPztNYgEiEF85xLnHaWASjb82jSqwKqBM2qFBpAVoCFb OckGlkYn5Yx1+Fn+D5G/9C2NBQoJgGkphZTah8tmoL+ZN0pYseH5pzya9W3btmXs noOG/zAmhbo1S1aUDkv08tPsKqgeA7aRUbKMaTBczyq1BVMGUCOhX148MBYc/nMa JmqdVtdh4m90ZpOWbTt90QqQLhmILQonVpsBzDirtxksaiJTO0IGYbdnrMLoAf7z tH20cXSvGxCFhSVNoZPH2FHyBcV7OXzDMcpOVT9p9nQcjY6qMuVU6//DcouXrlM1 Y+7WJ6QfwIMtveAtT/brJdNKSgqSPw== =slfm -----END PGP SIGNATURE----- --6Dt3Hsk6OrCFUmMSfNb8pEq9XSsW9i7IE-- From owner-svn-src-head@freebsd.org Sat Sep 9 18:21:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E89E00948 for ; Sat, 9 Sep 2017 18:21:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 DCB1C727AD for ; Sat, 9 Sep 2017 18:21:11 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 878a9e27-958b-11e7-950d-03a3531dacf2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 878a9e27-958b-11e7-950d-03a3531dacf2; Sat, 09 Sep 2017 18:20:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v89IK1Fh004297; Sat, 9 Sep 2017 12:20:01 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1504981201.32063.59.camel@freebsd.org> Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart From: Ian Lepore To: Sean Bruno , Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 09 Sep 2017 12:20:01 -0600 In-Reply-To: References: <201709091142.v89BgX8e090592@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:21:12 -0000 On Sat, 2017-09-09 at 12:09 -0600, Sean Bruno wrote: > > On 09/09/17 05:42, Marcin Wojtas wrote: > > > > Author: mw > > Date: Sat Sep  9 11:42:32 2017 > > New Revision: 323359 > > URL: https://svnweb.freebsd.org/changeset/base/323359 > > > > Log: > >   Introduce UART driver module for Armada 3700 > >    > >   This patch adds support for UART in Armada 3700 family. > >   It exposes both low-level UART interface, as well as > >   standard driver methods. > >    > >   Submitted by: Patryk Duda > >   Obtained from: Semihalf > >   Sponsored by: Semihalf > >   Differential Revision: https://reviews.freebsd.org/D12250 > > > > Added: > >   head/sys/dev/uart/uart_dev_mvebu.c   (contents, props changed) > > Modified: > >   head/sys/conf/files > >   head/sys/modules/uart/Makefile > > Hrm ... I seem to be getting a compile failure after this: > > cc -target x86_64-unknown-freebsd12.0 --sysroot=/var/tmp/usr/src/tmp > -B/var/tmp/usr/src/tmp/usr/bin  -O2 -pipe  -fno-strict-aliasing > -Werror > -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS > -include > /var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. -I/usr/src/sys > -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > -I/var/tmp/usr/src/sys/GENERIC-NODEBUG   -MD > -MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=kernel > -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack- > protector > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict- > prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-error-address-of-packed-member  -mno-aes -mno-avx > -std=iso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o > uart_dev_mvebu.o > In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39: > /usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: > 'ofw_bus_if.h' > file not found > #include "ofw_bus_if.h" >          ^~~~~~~~~~~~~~ > 1 error generated. > *** Error code 1 > > Is there supposed to be processing of ofw_bus_if.m somewhere that is > currently missed? > > sean > ofw_bus_if.h needs to be added to SRCS= in the module makefile.  Over the years I learned to grep the c files for _if.h to figure out what generated files to add to a module makefile, but ofw_bus_if.h is insidious -- it gets included from ofw_bus_subr.h so nobody includes it directly and it always gets missed in new module makefiles. -- Ian From owner-svn-src-head@freebsd.org Sat Sep 9 18:35:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DCE5E014E1; Sat, 9 Sep 2017 18:35:23 +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 1436272F47; Sat, 9 Sep 2017 18:35:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v89IZIDQ050635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Sep 2017 21:35:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v89IZIDQ050635 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v89IZIf8050631; Sat, 9 Sep 2017 21:35:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 9 Sep 2017 21:35:18 +0300 From: Konstantin Belousov To: Jonathan Anderson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323365 - in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client Message-ID: <20170909183518.GV1700@kib.kiev.ua> References: <201709091318.v89DIXDj027788@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201709091318.v89DIXDj027788@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:35:23 -0000 On Sat, Sep 09, 2017 at 01:18:33PM +0000, Jonathan Anderson wrote: > Author: jonathan > Date: Sat Sep 9 13:18:32 2017 > New Revision: 323365 > URL: https://svnweb.freebsd.org/changeset/base/323365 > > Log: > Remove redundant source and object files. > Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 > ============================================================================== > --- head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 12:50:12 2017 (r323364) > +++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 13:18:32 2017 (r323365) > @@ -9,7 +9,6 @@ DEFAULT_VECTOR= bfd_elf64_x86_64_freebsd_vec > > SRCS+= elf64-x86-64.c \ > efi-app-x86_64.c \ > - efi-app-ia32.c \ > elf64.c \ > elf64-gen.c \ > elf64-target.h \ Why did you claimed that x86 efi binfmt is redundant ? From owner-svn-src-head@freebsd.org Sat Sep 9 18:39:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05BBE01920; Sat, 9 Sep 2017 18:39:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACAA73214; Sat, 9 Sep 2017 18:39:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89IdtQG058312; Sat, 9 Sep 2017 18:39:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Idtcv058308; Sat, 9 Sep 2017 18:39:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709091839.v89Idtcv058308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 9 Sep 2017 18:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323370 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:39:56 -0000 Author: scottl Date: Sat Sep 9 18:39:55 2017 New Revision: 323370 URL: https://svnweb.freebsd.org/changeset/base/323370 Log: Remove the unnecessary use of a temporary string buffer. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mpr/mpr_sas.c Sat Sep 9 18:39:55 2017 (r323370) @@ -2257,7 +2257,7 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb u8 scsi_status = mpi_reply->SCSIStatus; char *desc_ioc_state = NULL; char *desc_scsi_status = NULL; - char *desc_scsi_state = sc->tmp_string; + char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); if (log_info == 0x31170000) @@ -2362,19 +2362,19 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb break; } - desc_scsi_state[0] = '\0'; + desc_scsi_state = "\0"; if (!scsi_state) desc_scsi_state = " "; if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - strcat(desc_scsi_state, "response info "); + desc_scsi_state = "response info "; if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - strcat(desc_scsi_state, "state terminated "); + desc_scsi_state = "state terminated "; if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - strcat(desc_scsi_state, "no status "); + desc_scsi_state = "no status "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - strcat(desc_scsi_state, "autosense failed "); + desc_scsi_state = "autosense failed "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - strcat(desc_scsi_state, "autosense valid "); + desc_scsi_state = "autosense valid "; mpr_dprint(sc, MPR_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); @@ -2960,8 +2960,8 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mp */ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mpr_dprint(sc, MPR_INFO, - "Controller reported %s status for target %u SMID %u, " - "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + "Controller reported %s target %u SMID %u, loginfo %x\n", + ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mpr/mprvar.h Sat Sep 9 18:39:55 2017 (r323370) @@ -74,7 +74,6 @@ #define IFAULT_IOP_OVER_TEMP_THRESHOLD_EXCEEDED 0x2810 #define MPR_SCSI_RI_INVALID_FRAME (0x00000002) -#define MPR_STRING_LENGTH 64 #define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ @@ -330,7 +329,6 @@ struct mpr_softc { struct mpr_queue *queues; struct mprsas_softc *sassc; - char tmp_string[MPR_STRING_LENGTH]; TAILQ_HEAD(, mpr_command) req_list; TAILQ_HEAD(, mpr_command) high_priority_req_list; TAILQ_HEAD(, mpr_chain) chain_list; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mps/mps_sas.c Sat Sep 9 18:39:55 2017 (r323370) @@ -1987,7 +1987,7 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb u8 scsi_status = mpi_reply->SCSIStatus; char *desc_ioc_state = NULL; char *desc_scsi_status = NULL; - char *desc_scsi_state = sc->tmp_string; + char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); if (log_info == 0x31170000) @@ -2089,19 +2089,19 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb break; } - desc_scsi_state[0] = '\0'; + desc_scsi_state = "\0"; if (!scsi_state) desc_scsi_state = " "; if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - strcat(desc_scsi_state, "response info "); + desc_scsi_state = "response info "; if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - strcat(desc_scsi_state, "state terminated "); + desc_scsi_state = "state terminated "; if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - strcat(desc_scsi_state, "no status "); + desc_scsi_state = "no status "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - strcat(desc_scsi_state, "autosense failed "); + desc_scsi_state = "autosense failed "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - strcat(desc_scsi_state, "autosense valid "); + desc_scsi_state = "autosense valid "; mps_dprint(sc, MPS_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); @@ -2490,8 +2490,8 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mp */ mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mps_dprint(sc, MPS_INFO, - "Controller reported %s status for target %u SMID %u, " - "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + "Controller reported %s target %u SMID %u, loginfo %x\n", + ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mps/mpsvar.h Sat Sep 9 18:39:55 2017 (r323370) @@ -56,7 +56,6 @@ #define MPS_MISSING_CHECK_DELAY 10 /* 10 seconds between missing check */ #define MPS_SCSI_RI_INVALID_FRAME (0x00000002) -#define MPS_STRING_LENGTH 64 #define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ @@ -317,7 +316,6 @@ struct mps_softc { struct mps_queue *queues; struct mpssas_softc *sassc; - char tmp_string[MPS_STRING_LENGTH]; TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_command) high_priority_req_list; TAILQ_HEAD(, mps_chain) chain_list; From owner-svn-src-head@freebsd.org Sat Sep 9 18:45:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A50B6E01E8E; Sat, 9 Sep 2017 18:45:43 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 817F47368B; Sat, 9 Sep 2017 18:45:43 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [10.199.2.39] (unknown [50.235.236.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1C0FB192892; Sat, 9 Sep 2017 18:45:42 +0000 (UTC) Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart To: Ian Lepore , Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709091142.v89BgX8e090592@repo.freebsd.org> <1504981201.32063.59.camel@freebsd.org> From: Sean Bruno Message-ID: <2ace05fc-4dc9-494a-8e6f-27fa9f1ebf97@freebsd.org> Date: Sat, 9 Sep 2017 12:45:39 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1504981201.32063.59.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PgrKGr1XvWJIgXJwnbfB34GqW9lVosu4S" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 18:45:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PgrKGr1XvWJIgXJwnbfB34GqW9lVosu4S Content-Type: multipart/mixed; boundary="0fNMiaW6nTqH0BK6WHVE3vIsC7pmuKBku"; protected-headers="v1" From: Sean Bruno To: Ian Lepore , Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2ace05fc-4dc9-494a-8e6f-27fa9f1ebf97@freebsd.org> Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart References: <201709091142.v89BgX8e090592@repo.freebsd.org> <1504981201.32063.59.camel@freebsd.org> In-Reply-To: <1504981201.32063.59.camel@freebsd.org> --0fNMiaW6nTqH0BK6WHVE3vIsC7pmuKBku Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09/09/17 12:20, Ian Lepore wrote: > On Sat, 2017-09-09 at 12:09 -0600, Sean Bruno wrote: >> >> On 09/09/17 05:42, Marcin Wojtas wrote: >>> >>> Author: mw >>> Date: Sat Sep 9 11:42:32 2017 >>> New Revision: 323359 >>> URL: https://svnweb.freebsd.org/changeset/base/323359 >>> >>> Log: >>> Introduce UART driver module for Armada 3700 >>> =20 >>> This patch adds support for UART in Armada 3700 family. >>> It exposes both low-level UART interface, as well as >>> standard driver methods. >>> =20 >>> Submitted by: Patryk Duda >>> Obtained from: Semihalf >>> Sponsored by: Semihalf >>> Differential Revision: https://reviews.freebsd.org/D12250 >>> >>> Added: >>> head/sys/dev/uart/uart_dev_mvebu.c (contents, props changed) >>> Modified: >>> head/sys/conf/files >>> head/sys/modules/uart/Makefile >> >> Hrm ... I seem to be getting a compile failure after this: >> >> cc -target x86_64-unknown-freebsd12.0 --sysroot=3D/var/tmp/usr/src/tmp= >> -B/var/tmp/usr/src/tmp/usr/bin -O2 -pipe -fno-strict-aliasing >> -Werror >> -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS >> -include >> /var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. -I/usr/src/sys >> -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer >> -I/var/tmp/usr/src/sys/GENERIC-NODEBUG -MD >> -MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=3Dkernel >> -mno-red-zone -mno-mmx -mno-sse -msoft-float >> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack- >> protector >> -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict- >> prototypes >> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef >> -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ >> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >> -Wno-error-tautological-compare -Wno-error-empty-body >> -Wno-error-parentheses-equality -Wno-error-unused-function >> -Wno-error-pointer-sign -Wno-error-shift-negative-value >> -Wno-error-address-of-packed-member -mno-aes -mno-avx >> -std=3Diso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o >> uart_dev_mvebu.o >> In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39: >> /usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: >> 'ofw_bus_if.h' >> file not found >> #include "ofw_bus_if.h" >> ^~~~~~~~~~~~~~ >> 1 error generated. >> *** Error code 1 >> >> Is there supposed to be processing of ofw_bus_if.m somewhere that is >> currently missed? >> >> sean >> >=20 > ofw_bus_if.h needs to be added to SRCS=3D in the module makefile. Over= > the years I learned to grep the c files for _if.h to figure out what > generated files to add to a module makefile, but ofw_bus_if.h is > insidious -- it gets included from ofw_bus_subr.h so nobody includes it= > directly and it always gets missed in new module makefiles. >=20 > -- Ian >=20 >=20 >=20 Oh, the SRCS entry *is* in sys/modules/uart/Makefile but not for x86 archs. Should this even be built for x86? sean --0fNMiaW6nTqH0BK6WHVE3vIsC7pmuKBku-- --PgrKGr1XvWJIgXJwnbfB34GqW9lVosu4S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlm0NtNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /Lbo5wgAju2u5HWee3e7GKUDrioMpkKcnARpy3Pw89SKT6dKYKBtPccmVFQ2MtGY qt1wI5ymW4haoejOpNId0P2m0ZMCwllWUgEjV4LMLcE7T46cYxtxALCmATj16iRU E6VY51c5UkpMli2pPHW2swKuSuY0scyrxFrLR6yAx06ldoz6eAh78+GcL4hJYTfK B6PYACo9VQRyREjzys9NjKXTsUx3aCHA1GQTmEfwlS9YVsHNASu697cFGs4JihSf 9CBPXAsQNRykrEL02kPLgxBWDqvDFy3556kvyQIcQgkQj0HqME/l7u9P239h+lUR BSctRbjbeoP1jPYr1c4SWdc5d/6Ywg== =c15W -----END PGP SIGNATURE----- --PgrKGr1XvWJIgXJwnbfB34GqW9lVosu4S-- From owner-svn-src-head@freebsd.org Sat Sep 9 19:07:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A56BDE030D2 for ; Sat, 9 Sep 2017 19:07:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from nov-007-i455.relay.mailchannels.net (nov-007-i455.relay.mailchannels.net [46.232.183.9]) (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 0F387741CF for ; Sat, 9 Sep 2017 19:07:33 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E8D178A8D2E for ; Sat, 9 Sep 2017 19:07:23 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.129.235]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id 55F848A8C74 for ; Sat, 9 Sep 2017 19:07:23 +0000 (UTC) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.20.62.11]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.14); Sat, 09 Sep 2017 19:07:23 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: _forwarded-from|73.78.92.27 X-MailChannels-Auth-Id: duocircle X-Thread-Absorbed: 599d761829e42281_1504984043743_275650447 X-MC-Loop-Signature: 1504984043743:1295852346 X-MC-Ingress-Time: 1504984043742 X-MHO-User: 1926c2ac-9592-11e7-83af-a91f44540cb3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 1926c2ac-9592-11e7-83af-a91f44540cb3; Sat, 09 Sep 2017 19:07:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v89J7FEh004368; Sat, 9 Sep 2017 13:07:15 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1504984035.32063.61.camel@freebsd.org> Subject: Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart From: Ian Lepore To: Sean Bruno , Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 09 Sep 2017 13:07:15 -0600 In-Reply-To: <2ace05fc-4dc9-494a-8e6f-27fa9f1ebf97@freebsd.org> References: <201709091142.v89BgX8e090592@repo.freebsd.org> <1504981201.32063.59.camel@freebsd.org> <2ace05fc-4dc9-494a-8e6f-27fa9f1ebf97@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:07:35 -0000 On Sat, 2017-09-09 at 12:45 -0600, Sean Bruno wrote: >=20 > On 09/09/17 12:20, Ian Lepore wrote: > >=20 > > On Sat, 2017-09-09 at 12:09 -0600, Sean Bruno wrote: > > >=20 > > >=20 > > > On 09/09/17 05:42, Marcin Wojtas wrote: > > > >=20 > > > >=20 > > > > Author: mw > > > > Date: Sat Sep=A0=A09 11:42:32 2017 > > > > New Revision: 323359 > > > > URL: https://svnweb.freebsd.org/changeset/base/323359 > > > >=20 > > > > Log: > > > > =A0 Introduce UART driver module for Armada 3700 > > > > =A0=A0 > > > > =A0 This patch adds support for UART in Armada 3700 family. > > > > =A0 It exposes both low-level UART interface, as well as > > > > =A0 standard driver methods. > > > > =A0=A0 > > > > =A0 Submitted by: Patryk Duda > > > > =A0 Obtained from: Semihalf > > > > =A0 Sponsored by: Semihalf > > > > =A0 Differential Revision: https://reviews.freebsd.org/D12250 > > > >=20 > > > > Added: > > > > =A0 head/sys/dev/uart/uart_dev_mvebu.c=A0=A0=A0(contents, props > > > > changed) > > > > Modified: > > > > =A0 head/sys/conf/files > > > > =A0 head/sys/modules/uart/Makefile > > > Hrm ... I seem to be getting a compile failure after this: > > >=20 > > > cc -target x86_64-unknown-freebsd12.0 -- > > > sysroot=3D/var/tmp/usr/src/tmp > > > -B/var/tmp/usr/src/tmp/usr/bin=A0=A0-O2 -pipe=A0=A0-fno-strict-alia= sing > > > -Werror > > > -D_KERNEL -DKLD_MODULE -nostdinc=A0=A0=A0-DHAVE_KERNEL_OPTION_HEADE= RS > > > -include > > > /var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. > > > -I/usr/src/sys > > > -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame- > > > pointer > > > -I/var/tmp/usr/src/sys/GENERIC-NODEBUG=A0=A0=A0-MD > > > -MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=3Dkernel > > > -mno-red-zone -mno-mmx -mno-sse -msoft-float > > > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack- > > > protector > > > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict- > > > prototypes > > > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > > > -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ > > > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown- > > > pragmas > > > -Wno-error-tautological-compare -Wno-error-empty-body > > > -Wno-error-parentheses-equality -Wno-error-unused-function > > > -Wno-error-pointer-sign -Wno-error-shift-negative-value > > > -Wno-error-address-of-packed-member=A0=A0-mno-aes -mno-avx > > > -std=3Diso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o > > > uart_dev_mvebu.o > > > In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39: > > > /usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: > > > 'ofw_bus_if.h' > > > file not found > > > #include "ofw_bus_if.h" > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0^~~~~~~~~~~~~~ > > > 1 error generated. > > > *** Error code 1 > > >=20 > > > Is there supposed to be processing of ofw_bus_if.m somewhere that > > > is > > > currently missed? > > >=20 > > > sean > > >=20 > > ofw_bus_if.h needs to be added to SRCS=3D in the module > > makefile.=A0=A0Over > > the years I learned to grep the c files for _if.h to figure out > > what > > generated files to add to a module makefile, but ofw_bus_if.h is > > insidious -- it gets included from ofw_bus_subr.h so nobody > > includes it > > directly and it always gets missed in new module makefiles. > >=20 > > -- Ian > >=20 > >=20 > >=20 >=20 > Oh, the SRCS entry *is* in sys/modules/uart/Makefile but not for x86 > archs.=A0=A0Should this even be built for x86? >=20 > sean >=20 No, this driver is specific to Marvell arm systems. =A0Mostly, arm uart drivers don't get listed in modules/uart becuase they're compiled in as console drivers. =A0A few arm systems have video consoles and uart as a module might have more value. -- Ian From owner-svn-src-head@freebsd.org Sat Sep 9 19:19:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AB5EE03B26; Sat, 9 Sep 2017 19:19:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1909774986; Sat, 9 Sep 2017 19:19:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89JJE4Z075011; Sat, 9 Sep 2017 19:19:14 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89JJE8Z075009; Sat, 9 Sep 2017 19:19:14 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201709091919.v89JJE8Z075009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 9 Sep 2017 19:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323371 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 323371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:19:15 -0000 Author: sbruno Date: Sat Sep 9 19:19:13 2017 New Revision: 323371 URL: https://svnweb.freebsd.org/changeset/base/323371 Log: r323359 instroduced an ARMv8 only uart(4) device to the tree but placed the driver in a place where it will be built for all targets. x86 doesn't have all the required build bits for this device. Move the uart(4) device mvebu to arm64 only. Modified: head/sys/conf/files head/sys/conf/files.arm64 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 9 18:39:55 2017 (r323370) +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart puc dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r323370) +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r323371) @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_arm64.c optional uart +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 dev/usb/controller/ehci_mv.c optional ehci_mv fdt From owner-svn-src-head@freebsd.org Sat Sep 9 19:38:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A795E04F34; Sat, 9 Sep 2017 19:38:58 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4EE75757; Sat, 9 Sep 2017 19:38:57 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id qlabd5bcWI8mCqlacdDhAi; Sat, 09 Sep 2017 13:38:51 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=Y_1cZOKe_NUHg5NTziwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3273666C; Sat, 9 Sep 2017 12:38:49 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v89JcmZA025348; Sat, 9 Sep 2017 12:38:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709091938.v89JcmZA025348@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Sean Bruno cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323371 - head/sys/conf In-Reply-To: Message from Sean Bruno of "Sat, 09 Sep 2017 19:19:14 -0000." <201709091919.v89JJE8Z075009@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Sep 2017 12:38:48 -0700 X-CMAE-Envelope: MS4wfCeAl8zHTdPQl6fJfgRQz4RpYFNWo14gSjGQdVP2TO0HOSTypGpVT8N32Z+BHT8W1m1CznFFSO4egxlBjbesLJ1mRBqOozh5/v5tabRUJP4ovx4OSZfE 0STp3JvBU9Cutgtqym2MhbWjOrtlZqdTIgMKwhYccjR43pGTpzVMjEdPgU0iSQcjJcpgd9k48ej7gTJBxhVRZqD+gLiNteXFRpsff2TjWUZVuIkZcFzWeF3z fHbklrOnZJPwtbPbLTnHJeF7f2D5GxJ8R/sskoN6HUyDHIps6c6VOCJXyO8YoFDr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:38:58 -0000 In message <201709091919.v89JJE8Z075009@repo.freebsd.org>, Sean Bruno writes: > Author: sbruno > Date: Sat Sep 9 19:19:13 2017 > New Revision: 323371 > URL: https://svnweb.freebsd.org/changeset/base/323371 > > Log: > r323359 instroduced an ARMv8 only uart(4) device to the tree but placed > the driver in a place where it will be built for all targets. x86 doesn't > have all the required build bits for this device. > > Move the uart(4) device mvebu to arm64 only. > > Modified: > head/sys/conf/files > head/sys/conf/files.arm64 > > Modified: head/sys/conf/files > ============================================================================= > = > --- head/sys/conf/files Sat Sep 9 18:39:55 2017 (r323370) > +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart puc > dev/uart/uart_bus_scc.c optional uart scc > dev/uart/uart_core.c optional uart > dev/uart/uart_dbg.c optional uart gdb > -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/uart/uart_dev_quicc.c optional uart quicc > > Modified: head/sys/conf/files.arm64 > ============================================================================= > = > --- head/sys/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r323370) > +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r323371) > @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt > dev/psci/psci.c optional psci > dev/psci/psci_arm64.S optional psci > dev/uart/uart_cpu_arm64.c optional uart > +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 > dev/usb/controller/ehci_mv.c optional ehci_mv fdt > Hi Sean, Don't forget sys/modules/uart/Makefile. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 9 19:49:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A66E05AFD; Sat, 9 Sep 2017 19:49:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6268076052; Sat, 9 Sep 2017 19:49:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89JnoZh087584; Sat, 9 Sep 2017 19:49:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Jno0s087583; Sat, 9 Sep 2017 19:49:50 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709091949.v89Jno0s087583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 19:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323372 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:49:51 -0000 Author: tuexen Date: Sat Sep 9 19:49:50 2017 New Revision: 323372 URL: https://svnweb.freebsd.org/changeset/base/323372 Log: Savely remove a chunk from the control queue. This bug was found by Coverity scanning the usrsctp library. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Sep 9 19:19:13 2017 (r323371) +++ head/sys/netinet/sctp_input.c Sat Sep 9 19:49:50 2017 (r323372) @@ -3133,14 +3133,14 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct * make sure that we have a covered ECNE in the control chunk part. * If so remove it. */ - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *nchk; struct sctp_ecne_chunk *ecne; int override; uint32_t cwr_tsn; cwr_tsn = ntohl(cp->tsn); override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; - TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { + TAILQ_FOREACH_SAFE(chk, &stcb->asoc.control_send_queue, sctp_next, nchk) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { continue; } From owner-svn-src-head@freebsd.org Sat Sep 9 19:52:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE73EE05E56 for ; Sat, 9 Sep 2017 19:52:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7A776464 for ; Sat, 9 Sep 2017 19:52:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id y123so11383508iod.0 for ; Sat, 09 Sep 2017 12:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d2Wt00sfBtf+6b6akBJ1SMqwbyYBG7haa9gl1MibHkI=; b=mNhpY3izKUVE/0nPp4cEcWWf7R+0A5c4GtNQ9DUdPEFimEOGPkP0SbuODjzY4EG114 KoQyTBXhVTCdfiuFaRSMi9oVnEB2PXulDuv5ianvUG/iPYvx5+UBb2xuflhbU3OmHj/0 iOWlRDpW0u/GEfbsMhhaukpiNp9rxGp/pt3SjF8gG17BpT9GcZfqxWvsO5MbJhM/ZMSf 3Kj5shkWYnY4tx87t+rjFNc4D+B5RFr/y8MKyoUKVN+r11ZexmCthCCxkGfh3Key+u17 1U7+5XYdPgRd+GOWA0xbSPNlVDgsvSSiYiLm/Xa392pVYgDCNwxLJkZjTI6qdVkbzfOk h0ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=d2Wt00sfBtf+6b6akBJ1SMqwbyYBG7haa9gl1MibHkI=; b=rfjkBSbb4TvCBPpaKHPtlw3U0EE6ndNXmHDv/Xr8o1gk8202iqic8PlbVnSgJFOT0Q ayM2qesDk6YyhOJeRhLG8uPLJP/dWjTGZCM4UH9boZpEUBIXmt+63J1kaxAvXLehRWCO ma5hGNYQr/um0fieapPdJaZ2XoEnqBSqnvtFmLhjIgFNB4IJRJnpz9VWx0qI8MZLQQu0 ifX5iG1Dtx8zebdpKsxJaq5Zowus47XsIduCB9RtkgLQ/c4ohAV6QAUjZP6KokhnptbW UqPzcPi2hEznNVg2qu0h24BrBQd7SNL8+G+Ij741RK6LnEvZ9CUEaxthlx9Y4TGKXpv9 O1dA== X-Gm-Message-State: AHPjjUi2U1c4nr+E8uHTPVqClRtoJw3jbsvjLEuQoTvrUtDBVampAaIY 4lrmEDHkLeh1beaZzDbDmenaPWSKd8iU X-Google-Smtp-Source: AOwi7QAZbHVQi5fwLw3rG1BfzalekBS9roKqFWvajQPkKL9W1iXFkhzy+4uQubYwXKdBVj4zwTxmqWBT/zv+6Jf5SS0= X-Received: by 10.107.41.138 with SMTP id p132mr9353432iop.282.1504986719865; Sat, 09 Sep 2017 12:51:59 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Sat, 9 Sep 2017 12:51:59 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:d5ae:f1f3:42c8:b0f7] In-Reply-To: <201709091919.v89JJE8Z075009@repo.freebsd.org> References: <201709091919.v89JJE8Z075009@repo.freebsd.org> From: Warner Losh Date: Sat, 9 Sep 2017 13:51:59 -0600 X-Google-Sender-Auth: f8VnReZjnJxe6-MmmB9lRdvuSEY Message-ID: Subject: Re: svn commit: r323371 - head/sys/conf To: Sean Bruno Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:52:00 -0000 On Sat, Sep 9, 2017 at 1:19 PM, Sean Bruno wrote: > Author: sbruno > Date: Sat Sep 9 19:19:13 2017 > New Revision: 323371 > URL: https://svnweb.freebsd.org/changeset/base/323371 > > Log: > r323359 instroduced an ARMv8 only uart(4) device to the tree but placed > the driver in a place where it will be built for all targets. x86 > doesn't > have all the required build bits for this device. > > Move the uart(4) device mvebu to arm64 only. > > Modified: > head/sys/conf/files > head/sys/conf/files.arm64 > > Modified: head/sys/conf/files > ============================================================ > ================== > --- head/sys/conf/files Sat Sep 9 18:39:55 2017 (r323370) > +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart puc > dev/uart/uart_bus_scc.c optional uart scc > dev/uart/uart_core.c optional uart > dev/uart/uart_dbg.c optional uart gdb > -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/uart/uart_dev_quicc.c optional uart quicc > > Modified: head/sys/conf/files.arm64 > ============================================================ > ================== > --- head/sys/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r323370) > +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r323371) > @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional > pci fdt > dev/psci/psci.c optional psci > dev/psci/psci_arm64.S optional psci > dev/uart/uart_cpu_arm64.c optional uart > +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 > dev/usb/controller/ehci_mv.c optional ehci_mv fdt > > This is a bad change since we may support running the mvebu in 32-bit mode, in which case we'd need it duplicated. There's no harm in it being in the global files file, as it won't show up automatically. Warner From owner-svn-src-head@freebsd.org Sat Sep 9 19:56:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC24BE06288; Sat, 9 Sep 2017 19:56:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com [IPv6:2607:f8b0:400e:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 707087682D; Sat, 9 Sep 2017 19:56:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x230.google.com with SMTP id i130so2204746pgc.3; Sat, 09 Sep 2017 12:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=5M7eZ8wpcNC4t+CD7pyOFwDwAo05cIBTaZd26kgXlY4=; b=PgfR+AwaEa5lO5us64ltLPY4iQUR4QGD54JVBnmP3C/oWqqGPmHNd1rA3VUMshH/rE 46RNBuB6XYCHfmrcmDCemPR76Fuk2ceutb4MWXV6ftheI6Sk9/syGoCs9aMCG8V/gFX3 7yojDf38Ne4f8s5WGzm7cVokc6lX83ug4ydDRoBDWc6O27votlXJ2cg7XwXyDDre3lgQ 9uLaehYfCdkVkJ6YavukVWAPSGPvePtMDi1GfHT9wULaWtgLK/AgGa4QGV3OYcVUOU2p 5NPCIYVFRQn9rNgSdzz//2BurB5JAuANB/5UqZSRKQtr73UyqtKm7eJjpsjk+06UNWHU Hrmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=5M7eZ8wpcNC4t+CD7pyOFwDwAo05cIBTaZd26kgXlY4=; b=dpybygNSEg/icKYnG1iPP25oIor0d7+3XrcdFzvgZ/KFp5CvWl6r4s6evjUcLeph0K gQo8aOg080ZTRpVlFZ11SJ/uWCP5QGRb1u8ORws+znkqx1TBu+T04NiNMTHx9y5vuotO eYjN3O1fMoysAG+n1SZGoixwBWUav0lRwmXGKbVhQ7XZTYDZDoo6QAaxXlE422v95oOz spcAu1EikWqB4cSRulK+9zjh5oBujU0Mj+w0beIBVUVEQZI/5jBZVpmijDS1PEjJgb5d x2DB3mbVg/Z/4k3VtXGS0fHhD9fAG+Aj81Z5w52QOKfh+ePjUZd/g3TtY0z3BMeAjiQb 7yiA== X-Gm-Message-State: AHPjjUikC9v/13qstw8isYQsEQbPZG+8fINn84CofYL3xfSchrlMx2+g 2uWkjEgKy9PXePb38as= X-Google-Smtp-Source: ADKCNb7tnHBSSQBY2a2WEIInlj97+2C51eNMYnTaQqi69ucJwXaHGT5p7Yjwvrb8b+fg/IjaaTnEZQ== X-Received: by 10.84.128.14 with SMTP id 14mr1256449pla.329.1504986981933; Sat, 09 Sep 2017 12:56:21 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b1sm8146161pgn.55.2017.09.09.12.56.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 09 Sep 2017 12:56:21 -0700 (PDT) Subject: Re: svn commit: r323365 - in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_84766824-3FB8-413C-A0A7-5790AB322672"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170909183518.GV1700@kib.kiev.ua> Date: Sat, 9 Sep 2017 12:56:20 -0700 Cc: Jonathan Anderson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <23674A3F-E627-4873-8BB6-4F5ADD7E3EA7@gmail.com> References: <201709091318.v89DIXDj027788@repo.freebsd.org> <20170909183518.GV1700@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:56:22 -0000 --Apple-Mail=_84766824-3FB8-413C-A0A7-5790AB322672 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 9, 2017, at 11:35, Konstantin Belousov = wrote: >=20 > On Sat, Sep 09, 2017 at 01:18:33PM +0000, Jonathan Anderson wrote: >> Author: jonathan >> Date: Sat Sep 9 13:18:32 2017 >> New Revision: 323365 >> URL: https://svnweb.freebsd.org/changeset/base/323365 >>=20 >> Log: >> Remove redundant source and object files. >=20 >> Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 = 12:50:12 2017 (r323364) >> +++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 = 13:18:32 2017 (r323365) >> @@ -9,7 +9,6 @@ DEFAULT_VECTOR=3D bfd_elf64_x86_64_freebsd_vec >>=20 >> SRCS+=3D elf64-x86-64.c \ >> efi-app-x86_64.c \ >> - efi-app-ia32.c \ >> elf64.c \ >> elf64-gen.c \ >> elf64-target.h \ > Why did you claimed that x86 efi binfmt is redundant ? It=E2=80=99s redundant because of how the Makefile gets = .include=E2=80=99d (amd64 requires i386=E2=80=99s Makefile). Cheers, -Ngie $ grep -r efi-app gnu/usr.bin/binutils/libbfd/ gnu/usr.bin/binutils/libbfd/Makefile.amd64: efi-app-x86_64.c \ gnu/usr.bin/binutils/libbfd/Makefile.amd64: efi-app-ia32.c \ gnu/usr.bin/binutils/libbfd/Makefile.i386: efi-app-ia32.c \ $ grep include gnu/usr.bin/binutils/libbfd/Makefile.amd64 .include "${.CURDIR}/Makefile.i386=E2=80=9D --Apple-Mail=_84766824-3FB8-413C-A0A7-5790AB322672 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZtEdkAAoJEPWDqSZpMIYVRrsQAJNDmTk7iueZrIGfFoOeUmB4 H+XJy1FAv4wdnkflVG7IK9MI1N+Y9w0ZcpA3rNqs/sOdHGRIbbJw6wy4LBH6g9XI DmX5ncV1DgYmHjSGllCvNBpEk+FA72AcjdPTni7K8T5ty6ag69xnnCwVg6FcwBUV eBSi808/1HJKrsh/4x3zQZA6PB5IZw0FjBtV2L2pPSN51SrfQ/ZkdHrtixyEV1i5 FQPs8YeF+Nz/fy9RHz6BS1f0+s9Qceji+Yf99/L6Q4Xmb0DwiUzUnlmFZ0USe8uP 6ewKE8y4+VzIfoy/2LfCWPUZn65QL47O7AH469aSlmA9QoyQ3RkNstBOL+oLB3QT OD1oN6FU7O0aQiU4MIkpufm0s0+fkBIzqo/fzJ2SEqVGfQvYyZxf2Osw3oPYgAu+ 2LAmhr0QymLwA681QecTd6D6z3iLaGgEVoeLWQwMZPJWho3sDYcKaF2Mh723r2bD eNezEoxj0Mh9bYKtkKjHCvifRNV+SWzs5oG0K6GkdAuMcwKdUO1qa0GSRmWZ443F p1QGPfXtXLcgmrOIsJsXw0J3crx57FRtAK1an4obbyk3j9zhJzkqmur8jAGm68ck 3nSZg2UrY1DcyWgr+7p4Z212PHuXSowOHktmNj/24A6bQnSGmtY236KtHBwh332+ RvYXuhtXCTbu9nJPYeRF =xvO1 -----END PGP SIGNATURE----- --Apple-Mail=_84766824-3FB8-413C-A0A7-5790AB322672-- From owner-svn-src-head@freebsd.org Sat Sep 9 19:57:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFD88E06548; Sat, 9 Sep 2017 19:57:54 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 8B6FD76A3D; Sat, 9 Sep 2017 19:57:53 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [10.199.2.39] (unknown [50.235.236.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 8074E192892; Sat, 9 Sep 2017 19:57:52 +0000 (UTC) Subject: Re: svn commit: r323371 - head/sys/conf To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201709091919.v89JJE8Z075009@repo.freebsd.org> From: Sean Bruno Message-ID: <67e6ff1d-e552-7b3a-e1ea-4e21867d7602@freebsd.org> Date: Sat, 9 Sep 2017 13:57:49 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lNmPICpLFC8TD0hLfJSMNX0G62GAgn1JT" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:57:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lNmPICpLFC8TD0hLfJSMNX0G62GAgn1JT Content-Type: multipart/mixed; boundary="oWOsgCogkfsiSNU8pbOlPQImQKsGG87rw"; protected-headers="v1" From: Sean Bruno To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <67e6ff1d-e552-7b3a-e1ea-4e21867d7602@freebsd.org> Subject: Re: svn commit: r323371 - head/sys/conf References: <201709091919.v89JJE8Z075009@repo.freebsd.org> In-Reply-To: --oWOsgCogkfsiSNU8pbOlPQImQKsGG87rw Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09/09/17 13:51, Warner Losh wrote: >=20 >=20 > On Sat, Sep 9, 2017 at 1:19 PM, Sean Bruno > wrote: >=20 > Author: sbruno > Date: Sat Sep 9 19:19:13 2017 > New Revision: 323371 > URL: https://svnweb.freebsd.org/changeset/base/323371 > >=20 > Log: > r323359 instroduced an ARMv8 only uart(4) device to the tree but > placed > the driver in a place where it will be built for all targets. x8= 6 > doesn't > have all the required build bits for this device. >=20 > Move the uart(4) device mvebu to arm64 only. >=20 > Modified: > head/sys/conf/files > head/sys/conf/files.arm64 >=20 > Modified: head/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/conf/files Sat Sep 9 18:39:55 2017 (r323370) > +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional > uart puc > dev/uart/uart_bus_scc.c optional uart scc > dev/uart/uart_core.c optional uart > dev/uart/uart_dbg.c optional uart gdb > -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart > uart_snps > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/uart/uart_dev_quicc.c optional uart quicc >=20 > Modified: head/sys/conf/files.arm64 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/conf/files.arm64 Sat Sep 9 18:39:55 2017 =20 > (r323370) > +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 =20 > (r323371) > @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional = > pci fdt > dev/psci/psci.c optional psci > dev/psci/psci_arm64.S optional psci > dev/uart/uart_cpu_arm64.c optional uart > +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > dev/uart/uart_dev_pl011.c optional uart pl011 > dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt > soc_hisi_hi6220 > dev/usb/controller/ehci_mv.c optional ehci_mv fdt >=20 >=20 > This is a bad change since we may support running the mvebu in 32-bit > mode, in which case we'd need it duplicated. >=20 > There's no harm in it being in the global files file, as it won't show > up automatically. >=20 > Warner >=20 I moved it around like this to unbreak the x86 build. I see explicit restrictions on the header inclusion in sys/modules/uart that would keep this from compiling on x86 and caused the breakage. I don't see an obvious way to get this device to build on 32bit and 64bit arm (unless files.arm is included automagically). Does this make sense? sean --oWOsgCogkfsiSNU8pbOlPQImQKsGG87rw-- --lNmPICpLFC8TD0hLfJSMNX0G62GAgn1JT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlm0R71fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LazCAgAkT53vjYBfFyEEYHlHUBarzl713SAPZXAzLqibFBS2s7QfObr2EOy7yi7 hT/0pDv2TJFTV8J2tUM3ZAAcrgkJKt3LMnT8bo1ERIFEB5SaL2s4yJFN7+scN8lp 3tUWNpvonGhnSd0187gX7J7NEy5Q9gRG497uMyRfx58hFukpsMTGIev/DfyvWbrr W7/9v6Mc/GLbmtysBlwKyHQZHR+xuOHm4y6YJ2FTiYVvVHUJVCYhy5/ITpF8/cC/ 9VFrRzgNufnttkbVYXMoKAPT7CqVctmPfqyTLcQQOSAaP4paQVLzknQ8O8/4OPpL 5JvOJED8UmnoDogFSiEviG3M9dAsGg== =BjoF -----END PGP SIGNATURE----- --lNmPICpLFC8TD0hLfJSMNX0G62GAgn1JT-- From owner-svn-src-head@freebsd.org Sat Sep 9 19:58:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B8B0E065FD; Sat, 9 Sep 2017 19:58:19 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 B284176B11; Sat, 9 Sep 2017 19:58:18 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [10.199.2.39] (unknown [50.235.236.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1A776192892; Sat, 9 Sep 2017 19:58:16 +0000 (UTC) Subject: Re: svn commit: r323371 - head/sys/conf To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709091938.v89JcmZA025348@slippy.cwsent.com> From: Sean Bruno Message-ID: Date: Sat, 9 Sep 2017 13:58:15 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201709091938.v89JcmZA025348@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 19:58:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX Content-Type: multipart/mixed; boundary="6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL"; protected-headers="v1" From: Sean Bruno To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r323371 - head/sys/conf References: <201709091938.v89JcmZA025348@slippy.cwsent.com> In-Reply-To: <201709091938.v89JcmZA025348@slippy.cwsent.com> --6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09/09/17 13:38, Cy Schubert wrote: > In message <201709091919.v89JJE8Z075009@repo.freebsd.org>, Sean Bruno=20 > writes: >> Author: sbruno >> Date: Sat Sep 9 19:19:13 2017 >> New Revision: 323371 >> URL: https://svnweb.freebsd.org/changeset/base/323371 >> >> Log: >> r323359 instroduced an ARMv8 only uart(4) device to the tree but pla= ced >> the driver in a place where it will be built for all targets. x86 d= oesn't >> have all the required build bits for this device. >> =20 >> Move the uart(4) device mvebu to arm64 only. >> >> Modified: >> head/sys/conf/files >> head/sys/conf/files.arm64 >> >> Modified: head/sys/conf/files >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files Sat Sep 9 18:39:55 2017 (r323370) >> +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) >> @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart puc >> dev/uart/uart_bus_scc.c optional uart scc >> dev/uart/uart_core.c optional uart >> dev/uart/uart_dbg.c optional uart gdb >> -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu >> dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps= >> dev/uart/uart_dev_pl011.c optional uart pl011 >> dev/uart/uart_dev_quicc.c optional uart quicc >> >> Modified: head/sys/conf/files.arm64 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r323370) >> +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r323371) >> @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt >> dev/psci/psci.c optional psci >> dev/psci/psci_arm64.S optional psci >> dev/uart/uart_cpu_arm64.c optional uart >> +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu >> dev/uart/uart_dev_pl011.c optional uart pl011 >> dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220= >> dev/usb/controller/ehci_mv.c optional ehci_mv fdt >> >=20 > Hi Sean, >=20 > Don't forget sys/modules/uart/Makefile. >=20 >=20 In what way should it be changed? sean --6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL-- --TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlm0R9dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LY3tAgAkLvNTDr0gE/n2wkHNk8Y+VFgN/BMkmFS1Cf0wOIARPonEMtiDNMYPRj2 IqTaciXb8tWvjnTJMgiX/GpHf8uvU7xOHMmwNThWBJs5IHCqF4gcZimUtIEdvWWp KFZDCBjQUPVO788PyJgNXxBMN/c2/d0ih07119un5kv8mRvvzPQ7GUe2dZxd+szW YVM2Sxswl51utwNgC4joAIEE+a8QkIvhGveTEXoiX0pi1XMn1Mnq63qA0rIBbacS vNq5agxC0iLaBGYou5kvRm9RpvHb3d1yCkV0Y9ayQb+JwQKBevQ1pWgf7iy5O4Je 7jEtxWKwv3BCEfKeo6a8GpPA4L+caA== =uzHg -----END PGP SIGNATURE----- --TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX-- From owner-svn-src-head@freebsd.org Sat Sep 9 20:02:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83B9AE06AFA for ; Sat, 9 Sep 2017 20:02:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC1576F4C for ; Sat, 9 Sep 2017 20:02:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id d16so11392200ioj.3 for ; Sat, 09 Sep 2017 13:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jp1q6kOGjVT3NXidsb+bPLZNpzq1OvQ1cGmFGwbZaUM=; b=QczmXrayYywQzwqBZJWhU+NCSXTsMBXpQKnCnTIYRTkyM8tQNjqrmiithgQ+dEBNDu 6ficjs4gnjI9zIs9mRV5vPslMnwfdb8cQKNJHwlgq+CER02agRIYK43ahUNWPNcEkb6Q UPHDq2Ad82cCMjtIf8WjsHWq5Zc0/XJiOYZH+GUri+WH3/3cXnt9G84f8QHUS+zed10/ HsbTIqy4GgS6ixEyu79fZvFlJpkWvzppv1yGDEugG8o8BWpHt7CYH0qNjaXZj6FIFm0Q 9qOyTljcf1JsKufKOEY9+xCyXouyFLCnlf2Ee2r51D5JIZIVFnqEaSB63a4NDZXPgqnA xJtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jp1q6kOGjVT3NXidsb+bPLZNpzq1OvQ1cGmFGwbZaUM=; b=pzmTio1nCdvmCbNuOauY/iRcZmcqy4wCfscMEa59o1f82U/Dxyj7YFRe6IFwbf9+sU cdJMLbUJKoghjDE1UiqVVi2a/wyoky06Ncr467MOngZg834wN2uEJ/KO7fYMoJA98anr QUfGnjJfgKhRn5me5tXa3cjA6Q9/NNEiiaTZ3MalqrJNUbwyfW4MA8xZ0YIrtRRcjFL0 wRW3XX/h0+QV2ef3x/LmVwwHj1uWqJKzMlg/1F1krgWiSG8z3sktZ3Zck0EINL9+i7dT 3+BpEFXl5GzK1d2E3e6IJFZRoDvaHOMZHnXP2cdFK8bFyG8nI1rlED+79wtEMuDsKrFm DqQQ== X-Gm-Message-State: AHPjjUhDhI4H9pMhq+l5offI+60UE5LCsQbcPIZbBEgqkmvWIjnPDPes K3jOgU6K1Zfw6cv1Rej1HQDnZlikQKYY X-Google-Smtp-Source: AOwi7QBZoXjs47fPu5ODTpOyHognGH8dBOM5xw7WKjTcnSUWeczKqw1WpAwa9AvrJHLWYzdT+fjCRBcbUrtTyCyo0og= X-Received: by 10.107.7.161 with SMTP id g33mr8655859ioi.169.1504987326494; Sat, 09 Sep 2017 13:02:06 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Sat, 9 Sep 2017 13:02:05 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:d5ae:f1f3:42c8:b0f7] In-Reply-To: <67e6ff1d-e552-7b3a-e1ea-4e21867d7602@freebsd.org> References: <201709091919.v89JJE8Z075009@repo.freebsd.org> <67e6ff1d-e552-7b3a-e1ea-4e21867d7602@freebsd.org> From: Warner Losh Date: Sat, 9 Sep 2017 14:02:05 -0600 X-Google-Sender-Auth: yMDM2SZuvAQ1U2WQ-MRpNJWFbLg Message-ID: Subject: Re: svn commit: r323371 - head/sys/conf To: Sean Bruno Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:02:07 -0000 On Sat, Sep 9, 2017 at 1:57 PM, Sean Bruno wrote: > > > On 09/09/17 13:51, Warner Losh wrote: > > > > > > On Sat, Sep 9, 2017 at 1:19 PM, Sean Bruno > > wrote: > > > > Author: sbruno > > Date: Sat Sep 9 19:19:13 2017 > > New Revision: 323371 > > URL: https://svnweb.freebsd.org/changeset/base/323371 > > > > > > Log: > > r323359 instroduced an ARMv8 only uart(4) device to the tree but > > placed > > the driver in a place where it will be built for all targets. x86 > > doesn't > > have all the required build bits for this device. > > > > Move the uart(4) device mvebu to arm64 only. > > > > Modified: > > head/sys/conf/files > > head/sys/conf/files.arm64 > > > > Modified: head/sys/conf/files > > ============================================================ > ================== > > --- head/sys/conf/files Sat Sep 9 18:39:55 2017 (r323370) > > +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > > @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional > > uart puc > > dev/uart/uart_bus_scc.c optional uart scc > > dev/uart/uart_core.c optional uart > > dev/uart/uart_dbg.c optional uart gdb > > -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > > dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart > > uart_snps > > dev/uart/uart_dev_pl011.c optional uart pl011 > > dev/uart/uart_dev_quicc.c optional uart quicc > > > > Modified: head/sys/conf/files.arm64 > > ============================================================ > ================== > > --- head/sys/conf/files.arm64 Sat Sep 9 18:39:55 2017 > > (r323370) > > +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 > > (r323371) > > @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional > > pci fdt > > dev/psci/psci.c optional psci > > dev/psci/psci_arm64.S optional psci > > dev/uart/uart_cpu_arm64.c optional uart > > +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > > dev/uart/uart_dev_pl011.c optional uart pl011 > > dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt > > soc_hisi_hi6220 > > dev/usb/controller/ehci_mv.c optional ehci_mv fdt > > > > > > This is a bad change since we may support running the mvebu in 32-bit > > mode, in which case we'd need it duplicated. > > > > There's no harm in it being in the global files file, as it won't show > > up automatically. > > > > Warner > > > > > I moved it around like this to unbreak the x86 build. > > I see explicit restrictions on the header inclusion in sys/modules/uart > that would keep this from compiling on x86 and caused the breakage. > > I don't see an obvious way to get this device to build on 32bit and > 64bit arm (unless files.arm is included automagically). > > Does this make sense? > No. -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu This should only be enabled in kernel configs that have both 'uart' AND 'uart_mvebu' in them. What enabled uart_mvebu? I don't see it in GENERIC. Warner From owner-svn-src-head@freebsd.org Sat Sep 9 20:07:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AF6FE06F71; Sat, 9 Sep 2017 20:07:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 EE84877342; Sat, 9 Sep 2017 20:07:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89K75Sm095822; Sat, 9 Sep 2017 20:07:05 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89K75Lh095820; Sat, 9 Sep 2017 20:07:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201709092007.v89K75Lh095820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 9 Sep 2017 20:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323373 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 323373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:07:06 -0000 Author: sbruno Date: Sat Sep 9 20:07:04 2017 New Revision: 323373 URL: https://svnweb.freebsd.org/changeset/base/323373 Log: revert r323371 in prepartion for a proper fix Submitted by: imp Modified: head/sys/conf/files head/sys/conf/files.arm64 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 9 19:49:50 2017 (r323372) +++ head/sys/conf/files Sat Sep 9 20:07:04 2017 (r323373) @@ -3053,6 +3053,7 @@ dev/uart/uart_bus_puc.c optional uart puc dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 9 19:49:50 2017 (r323372) +++ head/sys/conf/files.arm64 Sat Sep 9 20:07:04 2017 (r323373) @@ -176,7 +176,6 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_arm64.c optional uart -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu dev/uart/uart_dev_pl011.c optional uart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 dev/usb/controller/ehci_mv.c optional ehci_mv fdt From owner-svn-src-head@freebsd.org Sat Sep 9 20:08:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7C6E07103; Sat, 9 Sep 2017 20:08:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC883774AA; Sat, 9 Sep 2017 20:08:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89K8Qq7095914; Sat, 9 Sep 2017 20:08:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89K8Qqi095913; Sat, 9 Sep 2017 20:08:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709092008.v89K8Qqi095913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 20:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323374 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:08:28 -0000 Author: tuexen Date: Sat Sep 9 20:08:26 2017 New Revision: 323374 URL: https://svnweb.freebsd.org/changeset/base/323374 Log: Silence a Coverity warning from scanning the usrsctp library. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Sep 9 20:07:04 2017 (r323373) +++ head/sys/netinet/sctp_pcb.c Sat Sep 9 20:08:26 2017 (r323374) @@ -2919,9 +2919,9 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *ad */ /* got to be root to get at low ports */ if (ntohs(lport) < IPPORT_RESERVED) { - if (p && (error = + if ((p != NULL) && ((error = priv_check(p, PRIV_NETINET_RESERVEDPORT) - )) { + ) != 0)) { SCTP_INP_DECR_REF(inp); SCTP_INP_WUNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); From owner-svn-src-head@freebsd.org Sat Sep 9 20:14:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6F65E076E8; Sat, 9 Sep 2017 20:14:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 747CB7796E; Sat, 9 Sep 2017 20:14:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89KEIeD099702; Sat, 9 Sep 2017 20:14:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89KEITK099701; Sat, 9 Sep 2017 20:14:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709092014.v89KEITK099701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 9 Sep 2017 20:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323375 - head/sys/modules/uart X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/uart X-SVN-Commit-Revision: 323375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:14:19 -0000 Author: imp Date: Sat Sep 9 20:14:18 2017 New Revision: 323375 URL: https://svnweb.freebsd.org/changeset/base/323375 Log: Don't build uart_dev_mvebu unless we're on arm64. This module is specific to a single Marvel board that we currently only support in 64-bit mode. Remove it from the build otherwise. It likely should be completely removed, but this unbreaks x86 building. Noticed by: sbruno@ Modified: head/sys/modules/uart/Makefile Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Sat Sep 9 20:08:26 2017 (r323374) +++ head/sys/modules/uart/Makefile Sat Sep 9 20:14:18 2017 (r323375) @@ -25,12 +25,16 @@ _uart_cpu=uart_cpu_${MACHINE}.c uart_cpu_machine= ${_uart_cpu} .endif +.if ${MACHINE} == "arm64" +uart_dev_mvebu=uart_dev_mvebu.c +.endif + KMOD= uart SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ - uart_dev_z8530.c uart_dev_mvebu.c \ + uart_dev_z8530.c ${uart_dev_mvebu} \ uart_if.c uart_if.h uart_subr.c uart_tty.c SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ From owner-svn-src-head@freebsd.org Sat Sep 9 20:18:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A20EE079F1; Sat, 9 Sep 2017 20:18:38 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B19C077B76; Sat, 9 Sep 2017 20:18:37 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id qmD0d5lytI8mCqmD1dDmdy; Sat, 09 Sep 2017 14:18:31 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=_ERJipgIuWFNPIYiP5kA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E474E70B; Sat, 9 Sep 2017 13:18:29 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v89KITuF019603; Sat, 9 Sep 2017 13:18:29 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709092018.v89KITuF019603@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Sean Bruno cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323371 - head/sys/conf In-Reply-To: Message from Sean Bruno of "Sat, 09 Sep 2017 13:58:15 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Sep 2017 13:18:29 -0700 X-CMAE-Envelope: MS4wfCAGIxBsd+rkV1yC0ehBChGE9MmKvxbjPTD9/D1+gNhaAtZTtHalesFOV7Y5th690CxtSIyT452bhUWordRcP+Kwp0NCcOBdENypRxqfTfutqor1M1y7 2+mzgvCchUL024XZaxvfOtOV9DB47mm19fRu+4aIUIjVfQ0CLXmtybKOt3yK2W8PzEVMWyzJEeYe+EVsAGglfORMn/RgOL02i4uQj2+RIe5kQqY9nS/tXcTp Gp8Iugh1j030p/DUB578y72Qj4qYUfT/XO+d0yvHyMzIFZXZC75pUCNSrRacSp9q X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:18:38 -0000 In message , Sean Bruno write s: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX > Content-Type: multipart/mixed; boundary="6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL"; > protected-headers="v1" > From: Sean Bruno > To: Cy Schubert > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: > Subject: Re: svn commit: r323371 - head/sys/conf > References: <201709091938.v89JcmZA025348@slippy.cwsent.com> > In-Reply-To: <201709091938.v89JcmZA025348@slippy.cwsent.com> > > --6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > > > On 09/09/17 13:38, Cy Schubert wrote: > > In message <201709091919.v89JJE8Z075009@repo.freebsd.org>, Sean Bruno=20 > > writes: > >> Author: sbruno > >> Date: Sat Sep 9 19:19:13 2017 > >> New Revision: 323371 > >> URL: https://svnweb.freebsd.org/changeset/base/323371 > >> > >> Log: > >> r323359 instroduced an ARMv8 only uart(4) device to the tree but pla= > ced > >> the driver in a place where it will be built for all targets. x86 d= > oesn't > >> have all the required build bits for this device. > >> =20 > >> Move the uart(4) device mvebu to arm64 only. > >> > >> Modified: > >> head/sys/conf/files > >> head/sys/conf/files.arm64 > >> > >> Modified: head/sys/conf/files > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=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/conf/files Sat Sep 9 18:39:55 2017 (r323370) > >> +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > >> @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart p > uc > >> dev/uart/uart_bus_scc.c optional uart scc > >> dev/uart/uart_core.c optional uart > >> dev/uart/uart_dbg.c optional uart gdb > >> -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > >> dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_s > nps= > > >> dev/uart/uart_dev_pl011.c optional uart pl011 > >> dev/uart/uart_dev_quicc.c optional uart quicc > >> > >> Modified: head/sys/conf/files.arm64 > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=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/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r32337 > 0) > >> +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r32337 > 1) > >> @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt > >> dev/psci/psci.c optional psci > >> dev/psci/psci_arm64.S optional psci > >> dev/uart/uart_cpu_arm64.c optional uart > >> +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > >> dev/uart/uart_dev_pl011.c optional uart pl011 > >> dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6 > 220= > > >> dev/usb/controller/ehci_mv.c optional ehci_mv fdt > >> > >=20 > > Hi Sean, > >=20 > > Don't forget sys/modules/uart/Makefile. > >=20 > >=20 > > > In what way should it be changed? To fix this: --- uart_dev_mvebu.o --- In file included from /opt/src/svn-current/sys/dev/uart/uart_dev_mvebu.c:39: /opt/src/svn-current/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: 'ofw_bus_if.h' file not found #include "ofw_bus_if.h" ^~~~~~~~~~~~~~ 1 error generated. *** [uart_dev_mvebu.o] Error code 1 make[4]: stopped in /opt/src/svn-current/sys/modules/uart 1 error make[4]: stopped in /opt/src/svn-current/sys/modules/uart *** [all_subdir_uart] Error code 2 make[3]: stopped in /opt/src/svn-current/sys/modules --- all_subdir_udf_iconv --- ctfconvert -L VERSION -g udf_iconv.o A failure has been detected in another branch of the parallel make make[4]: stopped in /opt/src/svn-current/sys/modules/udf_iconv *** [all_subdir_udf_iconv] Error code 2 make[3]: stopped in /opt/src/svn-current/sys/modules 2 errors make[3]: stopped in /opt/src/svn-current/sys/modules *** [modules-all] Error code 2 make[2]: stopped in /export/obj/opt/src/svn-current/sys/PROD2 1 error make[2]: stopped in /export/obj/opt/src/svn-current/sys/PROD2 *** [buildkernel] Error code 2 make[1]: stopped in /opt/src/svn-current 1 error make[1]: stopped in /opt/src/svn-current *** [buildkernel] Error code 2 make: stopped in /opt/src/svn-current 1 error make: stopped in /opt/src/svn-current cwfw# How about something kind of like this but maybe more specific to armv8? Index: Makefile =================================================================== --- Makefile (revision 323371) +++ Makefile (working copy) @@ -8,6 +8,7 @@ .if ${MACHINE_CPUARCH} == "arm" uart_dev_lpc= uart_dev_lpc.c +uart_dev_mvebu= uart_dev_mvebu.c .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ @@ -30,7 +31,7 @@ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ - uart_dev_z8530.c uart_dev_mvebu.c \ + uart_dev_z8530.c ${uart_dev_mvebu} \ uart_if.c uart_if.h uart_subr.c uart_tty.c SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 9 20:21:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F475E07D26; Sat, 9 Sep 2017 20:21:29 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7AA77C05D; Sat, 9 Sep 2017 20:21:28 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id qmFjdkEV9DJTWqmFkdi1LS; Sat, 09 Sep 2017 14:21:21 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=YL_OPB7AbxHosn8tsFUA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3E8A5713; Sat, 9 Sep 2017 13:21:19 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v89KLImc020571; Sat, 9 Sep 2017 13:21:18 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709092021.v89KLImc020571@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Sean Bruno , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323371 - head/sys/conf In-Reply-To: Message from Cy Schubert of "Sat, 09 Sep 2017 13:18:29 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Sep 2017 13:21:18 -0700 X-CMAE-Envelope: MS4wfJrcMEMy/qhJTwKt8tmPgiE4+9wPmkGwuhQq4kWkTXiTtRE6ZITV9WFdIugGQC+qREw+OboVkkhad7/CMb3pqNM15GBrwvPpfzn5ZKcwrSBOaqgf00bJ 1tJTzfU5TPmgXdzbunS0qp8IiFpoOkMknQH2KnXAX6pGWBfEoW/j7uX2tO1QcyPN5xziT0n1ushcHKeLiLCFDWdgM2dDE7dg9XVvNPyhXZJYXCUrn+Z1RxxP leDaYRq4rnjMoN3M4/xFpsSEMC6iW4wuOaRJndBnwW6f2mamIyOo/X4rPsbWQWpk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:21:29 -0000 Cy Schubert writes: > In message , Sean Bruno > write > s: > > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > > --TihrB0CKT3jqUaMs7S3eH1inAg6bsh5sX > > Content-Type: multipart/mixed; boundary="6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL" > ; > > protected-headers="v1" > > From: Sean Bruno > > To: Cy Schubert > > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > > svn-src-head@freebsd.org > > Message-ID: > > Subject: Re: svn commit: r323371 - head/sys/conf > > References: <201709091938.v89JcmZA025348@slippy.cwsent.com> > > In-Reply-To: <201709091938.v89JcmZA025348@slippy.cwsent.com> > > > > --6nk2xUFgscbwBqdTs6JuLWhnhbTJx5KiL > > Content-Type: text/plain; charset=utf-8 > > Content-Language: en-US > > Content-Transfer-Encoding: quoted-printable > > > > > > > > On 09/09/17 13:38, Cy Schubert wrote: > > > In message <201709091919.v89JJE8Z075009@repo.freebsd.org>, Sean Bruno=20 > > > writes: > > >> Author: sbruno > > >> Date: Sat Sep 9 19:19:13 2017 > > >> New Revision: 323371 > > >> URL: https://svnweb.freebsd.org/changeset/base/323371 > > >> > > >> Log: > > >> r323359 instroduced an ARMv8 only uart(4) device to the tree but pla= > > ced > > >> the driver in a place where it will be built for all targets. x86 d= > > oesn't > > >> have all the required build bits for this device. > > >> =20 > > >> Move the uart(4) device mvebu to arm64 only. > > >> > > >> Modified: > > >> head/sys/conf/files > > >> head/sys/conf/files.arm64 > > >> > > >> Modified: head/sys/conf/files > > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > = > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > = > > =3D=3D=3D=3D=3D=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/conf/files Sat Sep 9 18:39:55 2017 (r323370) > > >> +++ head/sys/conf/files Sat Sep 9 19:19:13 2017 (r323371) > > >> @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c optional uart p > > uc > > >> dev/uart/uart_bus_scc.c optional uart scc > > >> dev/uart/uart_core.c optional uart > > >> dev/uart/uart_dbg.c optional uart gdb > > >> -dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > > >> dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_s > > nps= > > > > >> dev/uart/uart_dev_pl011.c optional uart pl011 > > >> dev/uart/uart_dev_quicc.c optional uart quicc > > >> > > >> Modified: head/sys/conf/files.arm64 > > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > = > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > = > > =3D=3D=3D=3D=3D=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/conf/files.arm64 Sat Sep 9 18:39:55 2017 (r32337 > > 0) > > >> +++ head/sys/conf/files.arm64 Sat Sep 9 19:19:13 2017 (r32337 > > 1) > > >> @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c optional > pci fdt > > >> dev/psci/psci.c optional psci > > >> dev/psci/psci_arm64.S optional psci > > >> dev/uart/uart_cpu_arm64.c optional uart > > >> +dev/uart/uart_dev_mvebu.c optional uart uart_mvebu > > >> dev/uart/uart_dev_pl011.c optional uart pl011 > > >> dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6 > > 220= > > > > >> dev/usb/controller/ehci_mv.c optional ehci_mv fdt > > >> > > >=20 > > > Hi Sean, > > >=20 > > > Don't forget sys/modules/uart/Makefile. > > >=20 > > >=20 > > > > > > In what way should it be changed? > > To fix this: > > --- uart_dev_mvebu.o --- > In file included from /opt/src/svn-current/sys/dev/uart/uart_dev_mvebu.c:39: > /opt/src/svn-current/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: > 'ofw_bus_if.h' file not found > #include "ofw_bus_if.h" > ^~~~~~~~~~~~~~ > 1 error generated. > *** [uart_dev_mvebu.o] Error code 1 > > make[4]: stopped in /opt/src/svn-current/sys/modules/uart > 1 error > > make[4]: stopped in /opt/src/svn-current/sys/modules/uart > *** [all_subdir_uart] Error code 2 > > make[3]: stopped in /opt/src/svn-current/sys/modules > --- all_subdir_udf_iconv --- > ctfconvert -L VERSION -g udf_iconv.o > A failure has been detected in another branch of the parallel make > > make[4]: stopped in /opt/src/svn-current/sys/modules/udf_iconv > *** [all_subdir_udf_iconv] Error code 2 > > make[3]: stopped in /opt/src/svn-current/sys/modules > 2 errors > > make[3]: stopped in /opt/src/svn-current/sys/modules > *** [modules-all] Error code 2 > > make[2]: stopped in /export/obj/opt/src/svn-current/sys/PROD2 > 1 error > > make[2]: stopped in /export/obj/opt/src/svn-current/sys/PROD2 > *** [buildkernel] Error code 2 > > make[1]: stopped in /opt/src/svn-current > 1 error > > make[1]: stopped in /opt/src/svn-current > *** [buildkernel] Error code 2 > > make: stopped in /opt/src/svn-current > 1 error > > make: stopped in /opt/src/svn-current > cwfw# > > How about something kind of like this but maybe more specific to armv8? > > Index: Makefile > =================================================================== > --- Makefile (revision 323371) > +++ Makefile (working copy) > @@ -8,6 +8,7 @@ > > .if ${MACHINE_CPUARCH} == "arm" > uart_dev_lpc= uart_dev_lpc.c > +uart_dev_mvebu= uart_dev_mvebu.c > .endif > > .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ > @@ -30,7 +31,7 @@ > uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ > uart_core.c ${uart_cpu_machine} uart_dbg.c \ > ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c > \ > - uart_dev_z8530.c uart_dev_mvebu.c \ > + uart_dev_z8530.c ${uart_dev_mvebu} \ > uart_if.c uart_if.h uart_subr.c uart_tty.c > > SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} > \ Looks like Warner fixed it. Thanks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 9 20:22:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0108DE07DF1; Sat, 9 Sep 2017 20:22:19 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AD6227C21F; Sat, 9 Sep 2017 20:22:18 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id qmGed5mvCI8mCqmGfdDnAO; Sat, 09 Sep 2017 14:22:17 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=nen-iglbejSXTePDd9kA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5A60771B; Sat, 9 Sep 2017 13:22:16 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v89KMGmg020867; Sat, 9 Sep 2017 13:22:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709092022.v89KMGmg020867@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323375 - head/sys/modules/uart In-Reply-To: Message from Warner Losh of "Sat, 09 Sep 2017 20:14:18 -0000." <201709092014.v89KEITK099701@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Sep 2017 13:22:16 -0700 X-CMAE-Envelope: MS4wfFYHoWQmski4URc2O/zObSDfzMW0HKmVh980evTogTfTury1kRAsqOeTkNZ7YYYo+myUgmzzIDubjKXnk2oroffIR4NtJTVwX0teuH0RWgDjpMBpEYO7 0/PETKXwfOBvovRZ5bnhLExbLdBGLXM5XZi9dls4lpYwVp68gwPWLGBcaEcHeCWaa+mZC58ePPNT6AgW/ejv5PTbWm1SSwhQ2vau1O6e+6+Ygo5+ZMamWas8 jVZvh393KsgtRfpB7XVLswjJBPM11P17R6OOy9hwL9oZpx+K2UyN+wZwao9yKdXp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:22:19 -0000 In message <201709092014.v89KEITK099701@repo.freebsd.org>, Warner Losh writes: > Author: imp > Date: Sat Sep 9 20:14:18 2017 > New Revision: 323375 > URL: https://svnweb.freebsd.org/changeset/base/323375 > > Log: > Don't build uart_dev_mvebu unless we're on arm64. > > This module is specific to a single Marvel board that we currently > only support in 64-bit mode. Remove it from the build otherwise. It > likely should be completely removed, but this unbreaks x86 building. > > Noticed by: sbruno@ > > Modified: > head/sys/modules/uart/Makefile > > Modified: head/sys/modules/uart/Makefile > ============================================================================= > = > --- head/sys/modules/uart/Makefile Sat Sep 9 20:08:26 2017 (r32337 > 4) > +++ head/sys/modules/uart/Makefile Sat Sep 9 20:14:18 2017 (r32337 > 5) > @@ -25,12 +25,16 @@ _uart_cpu=uart_cpu_${MACHINE}.c > uart_cpu_machine= ${_uart_cpu} > .endif > > +.if ${MACHINE} == "arm64" > +uart_dev_mvebu=uart_dev_mvebu.c > +.endif > + > KMOD= uart > SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard > .c \ > uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ > uart_core.c ${uart_cpu_machine} uart_dbg.c \ > ${uart_dev_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c > \ > - uart_dev_z8530.c uart_dev_mvebu.c \ > + uart_dev_z8530.c ${uart_dev_mvebu} \ > uart_if.c uart_if.h uart_subr.c uart_tty.c > > SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} > \ > Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 9 20:44:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E82BE0913D; Sat, 9 Sep 2017 20:44:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4917CE94; Sat, 9 Sep 2017 20:44:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89KiuWJ012267; Sat, 9 Sep 2017 20:44:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89KiuxX012266; Sat, 9 Sep 2017 20:44:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709092044.v89KiuxX012266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 20:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323376 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:44:57 -0000 Author: tuexen Date: Sat Sep 9 20:44:56 2017 New Revision: 323376 URL: https://svnweb.freebsd.org/changeset/base/323376 Log: Fix locking issues found by Coverity scanning the usrsctp library. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Sep 9 20:14:18 2017 (r323375) +++ head/sys/netinet/sctp_usrreq.c Sat Sep 9 20:44:56 2017 (r323376) @@ -1959,6 +1959,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); } else { id->assoc_value = stcb->asoc.vrf_id; + SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_assoc_value); } break; @@ -3063,7 +3064,6 @@ flags_out: if (event_type > 0) { if (stcb) { event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type); - SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || @@ -3077,6 +3077,9 @@ flags_out: } } } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } if (error == 0) { *optsize = sizeof(struct sctp_event); } @@ -3647,12 +3650,16 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; #endif - SCTP_TCB_UNLOCK(stcb); - *optsize = sizeof(struct sctp_prstatus); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (error == 0) { + *optsize = sizeof(struct sctp_prstatus); + } break; } case SCTP_PR_ASSOC_STATUS: @@ -3675,11 +3682,15 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[policy]; sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[policy]; } - SCTP_TCB_UNLOCK(stcb); - *optsize = sizeof(struct sctp_prstatus); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; + } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (error == 0) { + *optsize = sizeof(struct sctp_prstatus); } break; } From owner-svn-src-head@freebsd.org Sat Sep 9 20:51:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3850E0972C; Sat, 9 Sep 2017 20:51:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B177A7D23D; Sat, 9 Sep 2017 20:51:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89KpsYR014088; Sat, 9 Sep 2017 20:51:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Kps09014087; Sat, 9 Sep 2017 20:51:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709092051.v89Kps09014087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 20:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323377 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 323377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 20:51:56 -0000 Author: tuexen Date: Sat Sep 9 20:51:54 2017 New Revision: 323377 URL: https://svnweb.freebsd.org/changeset/base/323377 Log: Fix a locking issue found by Coverity scanning the usrsctp library. MFC after: 3 days Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat Sep 9 20:44:56 2017 (r323376) +++ head/sys/netinet6/sctp6_usrreq.c Sat Sep 9 20:51:54 2017 (r323377) @@ -879,7 +879,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb) { - SCTP_TCB_UNLOCK(stcb); + SCTP_TCB_LOCK(stcb); } SCTP_INP_RUNLOCK(inp); } else { From owner-svn-src-head@freebsd.org Sat Sep 9 21:03:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 538C5E0A0AD; Sat, 9 Sep 2017 21:03:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF177D994; Sat, 9 Sep 2017 21:03:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89L3fgm020658; Sat, 9 Sep 2017 21:03:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89L3fxa020657; Sat, 9 Sep 2017 21:03:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709092103.v89L3fxa020657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 9 Sep 2017 21:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323378 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 21:03:42 -0000 Author: tuexen Date: Sat Sep 9 21:03:40 2017 New Revision: 323378 URL: https://svnweb.freebsd.org/changeset/base/323378 Log: Fix MTU computation. Coverity scanning usrsctp pointed to this code... MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Sep 9 20:51:54 2017 (r323377) +++ head/sys/netinet/sctp_output.c Sat Sep 9 21:03:40 2017 (r323378) @@ -4277,11 +4277,13 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); - if (net->port) { - mtu -= sizeof(struct udphdr); - } - if (mtu && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu > 0) { + if (net->port) { + mtu -= sizeof(struct udphdr); + } + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } net->mtu = mtu; } } else if (ro->ro_rt == NULL) { @@ -4633,13 +4635,14 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); - if (mtu && - (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); - net->mtu = mtu; + if (mtu > 0) { if (net->port) { - net->mtu -= sizeof(struct udphdr); + mtu -= sizeof(struct udphdr); } + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } } else if (ifp) { if (ND_IFINFO(ifp)->linkmtu && @@ -12421,7 +12424,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, resv_in_first = SCTP_DATA_CHUNK_OVERHEAD(stcb); sp->data = sp->tail_mbuf = NULL; if (sp->length == 0) { - *error = 0; goto skip_copy; } if (srcv->sinfo_keynumber_valid) { @@ -13152,7 +13154,7 @@ skip_preblock: if (strm->last_msg_incomplete == 0) { do_a_copy_in: sp = sctp_copy_it_in(stcb, asoc, srcv, uio, net, max_len, user_marks_eor, &error); - if ((sp == NULL) || (error)) { + if (error) { goto out; } SCTP_TCB_SEND_LOCK(stcb); From owner-svn-src-head@freebsd.org Sat Sep 9 21:33:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249F7E0B7E0; Sat, 9 Sep 2017 21:33:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id E79D17E657; Sat, 9 Sep 2017 21:33:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89LXi6a032829; Sat, 9 Sep 2017 21:33:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89LXilv032828; Sat, 9 Sep 2017 21:33:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709092133.v89LXilv032828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 9 Sep 2017 21:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323379 - head/sys/boot/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/common X-SVN-Commit-Revision: 323379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 21:33:45 -0000 Author: imp Date: Sat Sep 9 21:33:43 2017 New Revision: 323379 URL: https://svnweb.freebsd.org/changeset/base/323379 Log: It's been pointed out that init_script at least is useful w/o re-rooting. Remove deprecation notice for it. init_chroot likely is still better served with reroot. Modified: head/sys/boot/common/loader.8 Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sat Sep 9 21:03:40 2017 (r323378) +++ head/sys/boot/common/loader.8 Sat Sep 9 21:33:43 2017 (r323379) @@ -487,13 +487,11 @@ That happens before entering single-user mode or multi mode (but after executing the .Va init_script if enabled). -This functionality has been eclipsed by rerooting. +This functionality has generally been eclipsed by rerooting. See .Xr reboot 8 .Fl r for details. -It will be removed in -.Fx 13.0 . .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. @@ -515,13 +513,11 @@ if the script terminates with a non-zero exit code, or if a SIGTERM is delivered to the .Xr init 8 process (PID 1). -This functionality has been eclipsed by rerooting. +This functionality has generally been eclipsed by rerooting. See .Xr reboot 8 .Fl r for details. -It will be removed in -.Fx 13.0 . .It Va init_shell Defines the shell binary to be used for executing the various shell scripts. The default is From owner-svn-src-head@freebsd.org Sat Sep 9 21:51:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24556E0C790; Sat, 9 Sep 2017 21:51:12 +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 A3C6F7EE02; Sat, 9 Sep 2017 21:51:11 +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 v89Lp0MD094748 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 10 Sep 2017 00:51:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v89Lp0MD094748 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v89Lp0PP094747; Sun, 10 Sep 2017 00:51:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 10 Sep 2017 00:51:00 +0300 From: Konstantin Belousov To: "Ngie Cooper (yaneurabeya)" Cc: Jonathan Anderson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323365 - in head: cddl/lib/libzpool gnu/usr.bin/binutils/libbfd usr.bin/svn/lib/libsvn_client Message-ID: <20170909215100.GX1700@kib.kiev.ua> References: <201709091318.v89DIXDj027788@repo.freebsd.org> <20170909183518.GV1700@kib.kiev.ua> <23674A3F-E627-4873-8BB6-4F5ADD7E3EA7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23674A3F-E627-4873-8BB6-4F5ADD7E3EA7@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 21:51:12 -0000 On Sat, Sep 09, 2017 at 12:56:20PM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Sep 9, 2017, at 11:35, Konstantin Belousov wrote: > > > > On Sat, Sep 09, 2017 at 01:18:33PM +0000, Jonathan Anderson wrote: > >> Author: jonathan > >> Date: Sat Sep 9 13:18:32 2017 > >> New Revision: 323365 > >> URL: https://svnweb.freebsd.org/changeset/base/323365 > >> > >> Log: > >> Remove redundant source and object files. > > > >> Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 > >> ============================================================================== > >> --- head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 12:50:12 2017 (r323364) > >> +++ head/gnu/usr.bin/binutils/libbfd/Makefile.amd64 Sat Sep 9 13:18:32 2017 (r323365) > >> @@ -9,7 +9,6 @@ DEFAULT_VECTOR= bfd_elf64_x86_64_freebsd_vec > >> > >> SRCS+= elf64-x86-64.c \ > >> efi-app-x86_64.c \ > >> - efi-app-ia32.c \ > >> elf64.c \ > >> elf64-gen.c \ > >> elf64-target.h \ > > Why did you claimed that x86 efi binfmt is redundant ? > > It???s redundant because of how the Makefile gets .include???d (amd64 requires i386???s Makefile). > Cheers, > -Ngie > > $ grep -r efi-app gnu/usr.bin/binutils/libbfd/ > gnu/usr.bin/binutils/libbfd/Makefile.amd64: efi-app-x86_64.c \ > gnu/usr.bin/binutils/libbfd/Makefile.amd64: efi-app-ia32.c \ > gnu/usr.bin/binutils/libbfd/Makefile.i386: efi-app-ia32.c \ > $ grep include gnu/usr.bin/binutils/libbfd/Makefile.amd64 > .include "${.CURDIR}/Makefile.i386??? Then, why peigen.c was left in the SRCS ? From owner-svn-src-head@freebsd.org Sat Sep 9 22:02:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89C9E0D39B; Sat, 9 Sep 2017 22:02:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810197F778; Sat, 9 Sep 2017 22:02:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89M2a4K044900; Sat, 9 Sep 2017 22:02:36 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89M2a94044894; Sat, 9 Sep 2017 22:02:36 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709092202.v89M2a94044894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 9 Sep 2017 22:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323380 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 09 Sep 2017 22:02:37 -0000 Author: scottl Date: Sat Sep 9 22:02:36 2017 New Revision: 323380 URL: https://svnweb.freebsd.org/changeset/base/323380 Log: Convert some in-line printing of diagnostic into tables. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_table.c head/sys/dev/mpr/mpr_table.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_table.c head/sys/dev/mps/mps_table.h Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mpr/mpr_sas.c Sat Sep 9 22:02:36 2017 (r323380) @@ -2204,44 +2204,6 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union return; } -static void -mpr_response_code(struct mpr_softc *sc, u8 response_code) -{ - char *desc; - - switch (response_code) { - case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: - desc = "task management request completed"; - break; - case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: - desc = "invalid frame"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: - desc = "task management request not supported"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_FAILED: - desc = "task management request failed"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: - desc = "task management request succeeded"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: - desc = "invalid lun"; - break; - case 0xA: - desc = "overlapped tag attempted"; - break; - case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: - desc = "task queued, however not sent to target"; - break; - default: - desc = "unknown"; - break; - } - mpr_dprint(sc, MPR_XINFO, "response_code(0x%01x): %s\n", response_code, - desc); -} - /** * mpr_sc_failed_io_info - translated non-succesfull SCSI_IO request */ @@ -2257,125 +2219,16 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb u8 scsi_status = mpi_reply->SCSIStatus; char *desc_ioc_state = NULL; char *desc_scsi_status = NULL; - char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); if (log_info == 0x31170000) return; - switch (ioc_status) { - case MPI2_IOCSTATUS_SUCCESS: - desc_ioc_state = "success"; - break; - case MPI2_IOCSTATUS_INVALID_FUNCTION: - desc_ioc_state = "invalid function"; - break; - case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: - desc_ioc_state = "scsi recovered error"; - break; - case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: - desc_ioc_state = "scsi invalid dev handle"; - break; - case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: - desc_ioc_state = "scsi device not there"; - break; - case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: - desc_ioc_state = "scsi data overrun"; - break; - case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: - desc_ioc_state = "scsi data underrun"; - break; - case MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR: - desc_ioc_state = "scsi io data error"; - break; - case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: - desc_ioc_state = "scsi protocol error"; - break; - case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: - desc_ioc_state = "scsi task terminated"; - break; - case MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: - desc_ioc_state = "scsi residual mismatch"; - break; - case MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED: - desc_ioc_state = "scsi task mgmt failed"; - break; - case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: - desc_ioc_state = "scsi ioc terminated"; - break; - case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: - desc_ioc_state = "scsi ext terminated"; - break; - case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: - desc_ioc_state = "eedp guard error"; - break; - case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: - desc_ioc_state = "eedp ref tag error"; - break; - case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: - desc_ioc_state = "eedp app tag error"; - break; - case MPI2_IOCSTATUS_INSUFFICIENT_POWER: - desc_ioc_state = "insufficient power"; - break; - default: - desc_ioc_state = "unknown"; - break; - } + desc_ioc_state = mpr_describe_table(mpr_iocstatus_string, + ioc_status); + desc_scsi_status = mpr_describe_table(mpr_scsi_status_string, + scsi_status); - switch (scsi_status) { - case MPI2_SCSI_STATUS_GOOD: - desc_scsi_status = "good"; - break; - case MPI2_SCSI_STATUS_CHECK_CONDITION: - desc_scsi_status = "check condition"; - break; - case MPI2_SCSI_STATUS_CONDITION_MET: - desc_scsi_status = "condition met"; - break; - case MPI2_SCSI_STATUS_BUSY: - desc_scsi_status = "busy"; - break; - case MPI2_SCSI_STATUS_INTERMEDIATE: - desc_scsi_status = "intermediate"; - break; - case MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET: - desc_scsi_status = "intermediate condmet"; - break; - case MPI2_SCSI_STATUS_RESERVATION_CONFLICT: - desc_scsi_status = "reservation conflict"; - break; - case MPI2_SCSI_STATUS_COMMAND_TERMINATED: - desc_scsi_status = "command terminated"; - break; - case MPI2_SCSI_STATUS_TASK_SET_FULL: - desc_scsi_status = "task set full"; - break; - case MPI2_SCSI_STATUS_ACA_ACTIVE: - desc_scsi_status = "aca active"; - break; - case MPI2_SCSI_STATUS_TASK_ABORTED: - desc_scsi_status = "task aborted"; - break; - default: - desc_scsi_status = "unknown"; - break; - } - - desc_scsi_state = "\0"; - if (!scsi_state) - desc_scsi_state = " "; - if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - desc_scsi_state = "response info "; - if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - desc_scsi_state = "state terminated "; - if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - desc_scsi_state = "no status "; - if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - desc_scsi_state = "autosense failed "; - if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - desc_scsi_state = "autosense valid "; - mpr_dprint(sc, MPR_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); if (targ->encl_level_valid) { @@ -2383,12 +2236,15 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb "connector name (%4s)\n", targ->encl_level, targ->encl_slot, targ->connector_name); } - /* We can add more detail about underflow data here + + /* + * We can add more detail about underflow data here * TO-DO - * */ + */ mpr_dprint(sc, MPR_XINFO, "\tscsi_status(%s)(0x%02x), " - "scsi_state(%s)(0x%02x)\n", desc_scsi_status, scsi_status, - desc_scsi_state, scsi_state); + "scsi_state %b\n", desc_scsi_status, scsi_status, + scsi_state, "\20" "\1AutosenseValid" "\2AutosenseFailed" + "\3NoScsiStatus" "\4Terminated" "\5Response InfoValid"); if (sc->mpr_debug & MPR_XINFO && scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { @@ -2400,7 +2256,10 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { response_info = le32toh(mpi_reply->ResponseInfo); response_bytes = (u8 *)&response_info; - mpr_response_code(sc,response_bytes[0]); + mpr_dprint(sc, MPR_XINFO, "response code(0x%01x): %s\n", + response_bytes[0], + mpr_describe_table(mpr_scsi_taskmgmt_string, + response_bytes[0])); } } @@ -2960,10 +2819,10 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mp */ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mpr_dprint(sc, MPR_INFO, - "Controller reported %s target %u SMID %u, loginfo %x\n", - ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == - MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : - "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, + "Controller reported %s tgt %u SMID %u loginfo %x\n", + mpr_describe_table(mpr_iocstatus_string, + le16toh(rep->IOCStatus) & MPI2_IOCSTATUS_MASK), + target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); mpr_dprint(sc, MPR_XINFO, "SCSIStatus %x SCSIState %x xfercount %u\n", Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mpr/mpr_table.c Sat Sep 9 22:02:36 2017 (r323380) @@ -208,6 +208,57 @@ struct mpr_table_lookup mpr_pcie_linkrate_names[] = { {"LinkRate Unknown", 0x00} }; +struct mpr_table_lookup mpr_iocstatus_string[] = { + {"success", MPI2_IOCSTATUS_SUCCESS}, + {"invalid function", MPI2_IOCSTATUS_INVALID_FUNCTION}, + {"scsi recovered error", MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR}, + {"scsi invalid dev handle", MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE}, + {"scsi device not there", MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE}, + {"scsi data overrun", MPI2_IOCSTATUS_SCSI_DATA_OVERRUN}, + {"scsi data underrun", MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN}, + {"scsi io data error", MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR}, + {"scsi protocol error", MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR}, + {"scsi task terminated", MPI2_IOCSTATUS_SCSI_TASK_TERMINATED}, + {"scsi residual mismatch", MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH}, + {"scsi task mgmt failed", MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED}, + {"scsi ioc terminated", MPI2_IOCSTATUS_SCSI_IOC_TERMINATED}, + {"scsi ext terminated", MPI2_IOCSTATUS_SCSI_EXT_TERMINATED}, + {"eedp guard error", MPI2_IOCSTATUS_EEDP_GUARD_ERROR}, + {"eedp ref tag error", MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR}, + {"eedp app tag error", MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR}, + {NULL, 0}, + {"unknown", 0x00} +}; + +struct mpr_table_lookup mpr_scsi_status_string[] = { + {"good", MPI2_SCSI_STATUS_GOOD}, + {"check condition", MPI2_SCSI_STATUS_CHECK_CONDITION}, + {"condition met", MPI2_SCSI_STATUS_CONDITION_MET}, + {"busy", MPI2_SCSI_STATUS_BUSY}, + {"intermediate", MPI2_SCSI_STATUS_INTERMEDIATE}, + {"intermediate condmet", MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET}, + {"reservation conflict", MPI2_SCSI_STATUS_RESERVATION_CONFLICT}, + {"command terminated", MPI2_SCSI_STATUS_COMMAND_TERMINATED}, + {"task set full", MPI2_SCSI_STATUS_TASK_SET_FULL}, + {"aca active", MPI2_SCSI_STATUS_ACA_ACTIVE}, + {"task aborted", MPI2_SCSI_STATUS_TASK_ABORTED}, + {NULL, 0}, + {"unknown", 0x00} +}; + +struct mpr_table_lookup mpr_scsi_taskmgmt_string[] = { + {"task mgmt request completed", MPI2_SCSITASKMGMT_RSP_TM_COMPLETE}, + {"invalid frame", MPI2_SCSITASKMGMT_RSP_INVALID_FRAME}, + {"task mgmt request not supp", MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED}, + {"task mgmt request failed", MPI2_SCSITASKMGMT_RSP_TM_FAILED}, + {"task mgmt request_succeeded", MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED}, + {"invalid lun", MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN}, + {"overlapped tag attempt", 0xA}, + {"task queued on IOC", MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC}, + {NULL, 0}, + {"unknown", 0x00} +}; + void mpr_describe_devinfo(uint32_t devinfo, char *string, int len) { Modified: head/sys/dev/mpr/mpr_table.h ============================================================================== --- head/sys/dev/mpr/mpr_table.h Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mpr/mpr_table.h Sat Sep 9 22:02:36 2017 (r323380) @@ -41,6 +41,9 @@ extern struct mpr_table_lookup mpr_event_names[]; extern struct mpr_table_lookup mpr_phystatus_names[]; extern struct mpr_table_lookup mpr_linkrate_names[]; extern struct mpr_table_lookup mpr_pcie_linkrate_names[]; +extern struct mpr_table_lookup mpr_iocstatus_string[]; +extern struct mpr_table_lookup mpr_scsi_status_string[]; +extern struct mpr_table_lookup mpr_scsi_taskmgmt_string[]; void mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *); void mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mps/mps_sas.c Sat Sep 9 22:02:36 2017 (r323380) @@ -1935,43 +1935,6 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union return; } -static void -mps_response_code(struct mps_softc *sc, u8 response_code) -{ - char *desc; - - switch (response_code) { - case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: - desc = "task management request completed"; - break; - case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: - desc = "invalid frame"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: - desc = "task management request not supported"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_FAILED: - desc = "task management request failed"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: - desc = "task management request succeeded"; - break; - case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: - desc = "invalid lun"; - break; - case 0xA: - desc = "overlapped tag attempted"; - break; - case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: - desc = "task queued, however not sent to target"; - break; - default: - desc = "unknown"; - break; - } - mps_dprint(sc, MPS_XINFO, "response_code(0x%01x): %s\n", - response_code, desc); -} /** * mps_sc_failed_io_info - translated non-succesfull SCSI_IO request */ @@ -1985,132 +1948,28 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb MPI2_IOCSTATUS_MASK; u8 scsi_state = mpi_reply->SCSIState; u8 scsi_status = mpi_reply->SCSIStatus; - char *desc_ioc_state = NULL; - char *desc_scsi_status = NULL; - char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); + const char *desc_ioc_state, *desc_scsi_status; if (log_info == 0x31170000) return; - switch (ioc_status) { - case MPI2_IOCSTATUS_SUCCESS: - desc_ioc_state = "success"; - break; - case MPI2_IOCSTATUS_INVALID_FUNCTION: - desc_ioc_state = "invalid function"; - break; - case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: - desc_ioc_state = "scsi recovered error"; - break; - case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: - desc_ioc_state = "scsi invalid dev handle"; - break; - case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: - desc_ioc_state = "scsi device not there"; - break; - case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: - desc_ioc_state = "scsi data overrun"; - break; - case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: - desc_ioc_state = "scsi data underrun"; - break; - case MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR: - desc_ioc_state = "scsi io data error"; - break; - case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: - desc_ioc_state = "scsi protocol error"; - break; - case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: - desc_ioc_state = "scsi task terminated"; - break; - case MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: - desc_ioc_state = "scsi residual mismatch"; - break; - case MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED: - desc_ioc_state = "scsi task mgmt failed"; - break; - case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: - desc_ioc_state = "scsi ioc terminated"; - break; - case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: - desc_ioc_state = "scsi ext terminated"; - break; - case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: - desc_ioc_state = "eedp guard error"; - break; - case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: - desc_ioc_state = "eedp ref tag error"; - break; - case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: - desc_ioc_state = "eedp app tag error"; - break; - default: - desc_ioc_state = "unknown"; - break; - } + desc_ioc_state = mps_describe_table(mps_iocstatus_string, + ioc_status); + desc_scsi_status = mps_describe_table(mps_scsi_status_string, + scsi_status); - switch (scsi_status) { - case MPI2_SCSI_STATUS_GOOD: - desc_scsi_status = "good"; - break; - case MPI2_SCSI_STATUS_CHECK_CONDITION: - desc_scsi_status = "check condition"; - break; - case MPI2_SCSI_STATUS_CONDITION_MET: - desc_scsi_status = "condition met"; - break; - case MPI2_SCSI_STATUS_BUSY: - desc_scsi_status = "busy"; - break; - case MPI2_SCSI_STATUS_INTERMEDIATE: - desc_scsi_status = "intermediate"; - break; - case MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET: - desc_scsi_status = "intermediate condmet"; - break; - case MPI2_SCSI_STATUS_RESERVATION_CONFLICT: - desc_scsi_status = "reservation conflict"; - break; - case MPI2_SCSI_STATUS_COMMAND_TERMINATED: - desc_scsi_status = "command terminated"; - break; - case MPI2_SCSI_STATUS_TASK_SET_FULL: - desc_scsi_status = "task set full"; - break; - case MPI2_SCSI_STATUS_ACA_ACTIVE: - desc_scsi_status = "aca active"; - break; - case MPI2_SCSI_STATUS_TASK_ABORTED: - desc_scsi_status = "task aborted"; - break; - default: - desc_scsi_status = "unknown"; - break; - } - - desc_scsi_state = "\0"; - if (!scsi_state) - desc_scsi_state = " "; - if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - desc_scsi_state = "response info "; - if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - desc_scsi_state = "state terminated "; - if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - desc_scsi_state = "no status "; - if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - desc_scsi_state = "autosense failed "; - if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - desc_scsi_state = "autosense valid "; - mps_dprint(sc, MPS_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); - /* We can add more detail about underflow data here + + /* + *We can add more detail about underflow data here * TO-DO - * */ + */ mps_dprint(sc, MPS_XINFO, "\tscsi_status(%s)(0x%02x), " - "scsi_state(%s)(0x%02x)\n", desc_scsi_status, scsi_status, - desc_scsi_state, scsi_state); + "scsi_state %b\n", desc_scsi_status, scsi_status, + scsi_state, "\20" "\1AutosenseValid" "\2AutosenseFailed" + "\3NoScsiStatus" "\4Terminated" "\5Response InfoValid"); if (sc->mps_debug & MPS_XINFO && scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { @@ -2122,7 +1981,10 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { response_info = le32toh(mpi_reply->ResponseInfo); response_bytes = (u8 *)&response_info; - mps_response_code(sc,response_bytes[0]); + mps_dprint(sc, MPS_XINFO, "response code(0x%1x): %s\n", + response_bytes[0], + mps_describe_table(mps_scsi_taskmgmt_string, + response_bytes[0])); } } @@ -2490,10 +2352,10 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mp */ mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mps_dprint(sc, MPS_INFO, - "Controller reported %s target %u SMID %u, loginfo %x\n", - ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == - MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : - "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, + "Controller reported %s tgt %u SMID %u loginfo %x\n", + mps_describe_table(mps_iocstatus_string, + le16toh(rep->IOCStatus) & MPI2_IOCSTATUS_MASK), + target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); mps_dprint(sc, MPS_XINFO, "SCSIStatus %x SCSIState %x xfercount %u\n", Modified: head/sys/dev/mps/mps_table.c ============================================================================== --- head/sys/dev/mps/mps_table.c Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mps/mps_table.c Sat Sep 9 22:02:36 2017 (r323380) @@ -185,6 +185,57 @@ struct mps_table_lookup mps_sasdev_reason[] = { {"Unknown", 0x00} }; +struct mps_table_lookup mps_iocstatus_string[] = { + {"success", MPI2_IOCSTATUS_SUCCESS}, + {"invalid function", MPI2_IOCSTATUS_INVALID_FUNCTION}, + {"scsi recovered error", MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR}, + {"scsi invalid dev handle", MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE}, + {"scsi device not there", MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE}, + {"scsi data overrun", MPI2_IOCSTATUS_SCSI_DATA_OVERRUN}, + {"scsi data underrun", MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN}, + {"scsi io data error", MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR}, + {"scsi protocol error", MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR}, + {"scsi task terminated", MPI2_IOCSTATUS_SCSI_TASK_TERMINATED}, + {"scsi residual mismatch", MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH}, + {"scsi task mgmt failed", MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED}, + {"scsi ioc terminated", MPI2_IOCSTATUS_SCSI_IOC_TERMINATED}, + {"scsi ext terminated", MPI2_IOCSTATUS_SCSI_EXT_TERMINATED}, + {"eedp guard error", MPI2_IOCSTATUS_EEDP_GUARD_ERROR}, + {"eedp ref tag error", MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR}, + {"eedp app tag error", MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR}, + {NULL, 0}, + {"unknown", 0x00} +}; + +struct mps_table_lookup mps_scsi_status_string[] = { + {"good", MPI2_SCSI_STATUS_GOOD}, + {"check condition", MPI2_SCSI_STATUS_CHECK_CONDITION}, + {"condition met", MPI2_SCSI_STATUS_CONDITION_MET}, + {"busy", MPI2_SCSI_STATUS_BUSY}, + {"intermediate", MPI2_SCSI_STATUS_INTERMEDIATE}, + {"intermediate condmet", MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET}, + {"reservation conflict", MPI2_SCSI_STATUS_RESERVATION_CONFLICT}, + {"command terminated", MPI2_SCSI_STATUS_COMMAND_TERMINATED}, + {"task set full", MPI2_SCSI_STATUS_TASK_SET_FULL}, + {"aca active", MPI2_SCSI_STATUS_ACA_ACTIVE}, + {"task aborted", MPI2_SCSI_STATUS_TASK_ABORTED}, + {NULL, 0}, + {"unknown", 0x00} +}; + +struct mps_table_lookup mps_scsi_taskmgmt_string[] = { + {"task mgmt request completed", MPI2_SCSITASKMGMT_RSP_TM_COMPLETE}, + {"invalid frame", MPI2_SCSITASKMGMT_RSP_INVALID_FRAME}, + {"task mgmt request not supp", MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED}, + {"task mgmt request failed", MPI2_SCSITASKMGMT_RSP_TM_FAILED}, + {"task mgmt request_succeeded", MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED}, + {"invalid lun", MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN}, + {"overlapped tag attempt", 0xA}, + {"task queued on IOC", MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC}, + {NULL, 0}, + {"unknown", 0x00} +}; + void mps_describe_devinfo(uint32_t devinfo, char *string, int len) { Modified: head/sys/dev/mps/mps_table.h ============================================================================== --- head/sys/dev/mps/mps_table.h Sat Sep 9 21:33:43 2017 (r323379) +++ head/sys/dev/mps/mps_table.h Sat Sep 9 22:02:36 2017 (r323380) @@ -40,6 +40,9 @@ void mps_describe_devinfo(uint32_t devinfo, char *stri extern struct mps_table_lookup mps_event_names[]; extern struct mps_table_lookup mps_phystatus_names[]; extern struct mps_table_lookup mps_linkrate_names[]; +extern struct mps_table_lookup mps_iocstatus_string[]; +extern struct mps_table_lookup mps_scsi_status_string[]; +extern struct mps_table_lookup mps_scsi_taskmgmt_string[]; void mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *); void mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *);