Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
Dne 20.07.2016 v 17:45 Nathan Whitehorn napsal(a): > > > On 07/20/16 04:28, Michal Meloun wrote: >> Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a): >>> >>> >>> On 07/19/16 04:13, Michal Meloun wrote: Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a): Hi Nathan, I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so please don’t expect quick response. > Could you please describe what this change is in more detail? Short description is appended. > It breaks a lot of encapsulations we have worked very hard to > maintain, > moves ARM code into MI parts of the kernel, and the OFW parts violate > IEEE 1275 (the Open Firmware standard). In particular, there is no > guarantee that the interrupts for a newbus (or OF) device are > encoded in > a property called "interrupts" (or, indeed, in any property at > all) on > that node and there are many, many device trees where that is not the > case (e.g. ones with interrupt maps, as well as Apple hardware). By > putting that knowledge into the OF root bus device, which we have > tried > to keep it out of, this enforces a standard that doesn't actually > exist. Imho, this patch doesn’t change anything in this area. Only handling of “interrupts” property is changed, all other cases are unchanged (I hope). Also, INTRNG code is currently shared by ARM, ARM64 and MIPS. >>> >>> But "interrupts" isn't a generic part of OF. This makes it one, >>> incorrectly. >> How? Can you be little more exact ? > > Because it puts knowledge into ofwbus that expects that children at > arbitrary levels of nesting have interrupts defined by an "interrupts" > property. You could patch this through on sub-devices, of course, but > that's already done correctly by the existing ofw_bus_map_intr() code > in a much more robust way that doesn't involve trying to guess how > sub-buses and devices have chosen to allocate resources. Why reinvent > the wheel all the way through the bus hierarchy? Nope, the code only expect that „interrupts" property is default way hot to get interrupt description. Any device or bus in the hierarchy can fill appropriate resource list, or terminate call at any level. > >>> > I'm hesitant to ask for reversion on something that landed 6 weeks > ago > without me noticing, but this needs a lot more architectural work > before > any parts of the kernel should use it. > -Nathan I think that it’s too late. This patch series consist of r301451 (https://reviews.freebsd.org/D6632), r301453, r301539 and 301543. And new GPIO interrupts are currently used (by in tree drivers or in development trees). >>> >>> Well, then we need in-place rearchitecture. >>> The root of problem is that standard way of delivering interrupt resource to consumer driver doesn’t works in OFW world. So we have some fact: - the format of interrupt property is dependent of interrupt controller and only interrupt controller can parse it. - the interrupt property can have more data than just interrupt number. - single interrupt controller must be able to handle multiple format of interrupt description. In pre-patchset era, simplebus enumerates children and attempts to set memory and interrupts to resource list for them. But the interrupt controllers are not yet populated so nobody can parse interrupt property. Moreover, in all cases (parsed or not), we cannot store complete interrupt description into resource list. >>> >>> We have done this for many years on PowerPC and sparc64 with delayed >>> configuration of interrupts and a look-up table. This handles >>> complicated bus configurations better than this code and requires no >>> changes outside of a few MD files. That is why the (now partially >>> duplicated) OFW_BUS_MAP_INTR() function exists. That one also has >>> the benefit of still working when used in conjunction with, e.g., >>> devices with an interrupt-map-mask property. >>> The patch simply postpones reading of interrupt property to bus_alloc_resource() (called by consumer driver) time. Due to this, we can: - parse interrupt property. The interrupt driver must exist at this time. >>> >>> This only works with some types of interrupt properties, not all, >>> and breaks if the interrupt driver hasn't attached yet (which it >>> can't be guaranteed to -- some PPC systems have interrupt drivers >>> that live on the PCI bus, for example). >> How you can allocate (and reserve it in rman) interrupt if is not >> mapped (so you have not real IRQ number for it). Just for notice - >> multiple virtual IRQs can be mapped into single real IRQ. > > The core idea is to think of the full interrupt specifier -- the > interrupt parent and the full byte string in the device tree -- as the > IRQ rather th
Re: svn commit: r303096 - head/sys/kern
On 07/20/16 18:44, Gleb Smirnoff wrote: Author: glebius Date: Wed Jul 20 16:44:22 2016 New Revision: 303096 URL: https://svnweb.freebsd.org/changeset/base/303096 Log: Revert r303037. It re-introduces the panic with TCP timers. Agreed by:rrs, re (gjb) Modified: head/sys/kern/kern_timeout.c Hi, The panic with TCP timers can also be fixes calling callout_stop() twice instead of once. First time out call it it will return 1,0,-1. Second time only 0 or -1. --HPS ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303096 - head/sys/kern
On 07/21/16 10:12, Hans Petter Selasky wrote: On 07/20/16 18:44, Gleb Smirnoff wrote: Author: glebius Date: Wed Jul 20 16:44:22 2016 New Revision: 303096 URL: https://svnweb.freebsd.org/changeset/base/303096 Log: Revert r303037. It re-introduces the panic with TCP timers. Agreed by:rrs, re (gjb) Modified: head/sys/kern/kern_timeout.c Hi, The panic with TCP timers can also be fixes calling callout_stop() twice instead of once. s/fixes/fixed First time out call it it will return 1,0,-1. Second time only 0 or -1. First call will return 1,0,-1 and second time it will return 0 or -1, which is what you are looking for. --HPS ___ 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-unsubscr...@freebsd.org"
svn commit: r303132 - head/usr.sbin/ctld
Author: trasz Date: Thu Jul 21 08:22:25 2016 New Revision: 303132 URL: https://svnweb.freebsd.org/changeset/base/303132 Log: Add documentation for "ctld -u", the UCL configuration file format. Submitted by: jceel@ Reviewed by: wblock@ MFC after:3 days Differential Revision:https://reviews.freebsd.org/D7222 Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.8 Modified: head/usr.sbin/ctld/ctl.conf.5 == --- head/usr.sbin/ctld/ctl.conf.5 Thu Jul 21 06:09:47 2016 (r303131) +++ head/usr.sbin/ctld/ctl.conf.5 Thu Jul 21 08:22:25 2016 (r303132) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2015 +.Dd July 21, 2016 .Dt CTL.CONF 5 .Os .Sh NAME @@ -481,6 +481,97 @@ target naa.50015178f369f092 { lun 0 example_1 } .Ed +.Pp +An equivalent configuration in UCL format, for use with +.Fl u : +.Bd -literal +auth-group { + ag0 { + chap-mutual = [ + { + user = "user" + secret = "secretsecret" + mutual-user = "mutualuser" + mutual-secret = "mutualsecret" + }, + { + user = "user2" + secret = "secret2secret2" + mutual-user = "mutualuser" + mutual-secret = "mutualsecret" + } + ] + } + + ag1 { + auth-type = none + initiator-name = [ + "iqn.2012-06.com.example:initiatorhost1", + "iqn.2012-06.com.example:initiatorhost2" + ] + initiator-portal = [192.168.1.1/24, "[2001:db8::de:ef]"] + } +} + +portal-group { + pg0 { + discovery-auth-group = no-authentication + listen = [ + 0.0.0.0:3260, + "[::]:3260", + "[fe80::be:ef]:3261" + ] + } +} + +lun { + example_0 { + path = /dev/zvol/tank/example_0 + blocksize = 4096 + size = "4G" + } + + example_1 { + path = /dev/zvol/tank/example_1 + options { + naa = "0x50015178f369f093" + } + } + + example_2 { + path = /dev/zvol/tank/example_2 + options { + vendor = "FreeBSD" + } + } +} + +target { + "iqn.2012-06.com.example:target0" { + alias = "Example target" + auth-group = no-authentication + lun = [ + { number = 0, name = example_0 }, + ] + } + + "iqn.2012-06.com.example:target1" { + auth-group = ag0 + portal-group { name = pg0 } + lun = [ + { number = 0, name = example_1 }, + { number = 1, name = example_2 } + ] + } + + naa.50015178f369f092 { + port = isp0 + lun = [ + { number = 0, name = example_1 } + ] + } +} +.Ed .Sh SEE ALSO .Xr ctl 4 , .Xr ctladm 8 , Modified: head/usr.sbin/ctld/ctld.8 == --- head/usr.sbin/ctld/ctld.8 Thu Jul 21 06:09:47 2016(r303131) +++ head/usr.sbin/ctld/ctld.8 Thu Jul 21 08:22:25 2016(r303132) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 22, 2015 +.Dd July 21, 2016 .Dt CTLD 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm .Op Fl d .Op Fl f Ar config-file +.Op Fl u .Sh DESCRIPTION The .Nm @@ -84,6 +85,8 @@ The daemon sends verbose debug output to put itself in the background. The daemon will also not fork and will exit after processing one connection. This option is only intended for debugging the target. +.It Fl u +Use UCL configuration file format instead of the traditional non-UCL format. .El .Sh FILES .Bl -tag -width ".Pa /var/run/ctld.pid" -compact ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303123 - head/sys/cam
On Thu, 21 Jul 2016 03:11:35 + (UTC) Warner Losh wrote: > Author: imp > Date: Thu Jul 21 03:11:35 2016 > New Revision: 303123 > URL: https://svnweb.freebsd.org/changeset/base/303123 > > Log: > Fix mismerge and include the nvme support. > Also, print out the name of any CCB's functions that's not > supported. > MFC after: 1 week > > Modified: > head/sys/cam/cam_xpt.c > > Modified: head/sys/cam/cam_xpt.c > == > --- head/sys/cam/cam_xpt.cThu Jul 21 00:53:14 2016 > (r303122) +++ head/sys/cam/cam_xpt.c Thu Jul 21 03:11:35 > 2016 (r303123) @@ -1033,6 +1033,8 @@ > xpt_announce_periph(struct cam_periph *p else if > (path->device->protocol == PROTO_SEMB) semb_print_ident( > (struct sep_identify_data > *)&path->device->ident_data); > + else if (path->device->protocol == PROTO_NVME) > + nvme_print_ident(path->device->nvme_cdata, > path->device->nvme_data); This breaks kernel configs with scbus but not nvme. This seems to be most of the non-x86 configs. linking kernel.full cam_xpt.o: In function `xpt_announce_periph': /usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:1037: undefined reference to `nvme_print_ident' cam_xpt.o: In function `xpt_denounce_periph': /usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:1092: undefined reference to `nvme_print_ident' cam_xpt.o: In function `xpt_run_devq': /usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3331: undefined reference to `nvme_op_string' /usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3331: undefined reference to `nvme_cmd_string' cam_xpt.o: In function `xpt_bus_register': /usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3927: undefined reference to `nvme_get_xport' --- kernel.full --- *** [kernel.full] Error code 1 Andrew ___ 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-unsubscr...@freebsd.org"
svn commit: r303133 - head/sys/dev/uart
Author: andrew Date: Thu Jul 21 09:32:55 2016 New Revision: 303133 URL: https://svnweb.freebsd.org/changeset/base/303133 Log: Add support for arm64 to uart_dev_acpi by using the _HID property to find the uart class to use in a similar way as the fdt driver. Obtained from:ABT Systems Ltd MFC after:1 month Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D7248 Added: head/sys/dev/uart/uart_cpu_acpi.h (contents, props changed) Modified: head/sys/dev/uart/uart_bus_acpi.c head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_bus_acpi.c == --- head/sys/dev/uart/uart_bus_acpi.c Thu Jul 21 08:22:25 2016 (r303132) +++ head/sys/dev/uart/uart_bus_acpi.c Thu Jul 21 09:32:55 2016 (r303133) @@ -39,6 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include +#include static int uart_acpi_probe(device_t dev); @@ -57,6 +62,7 @@ static driver_t uart_acpi_driver = { sizeof(struct uart_softc), }; +#if defined(__i386__) || defined(__amd64__) static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ @@ -67,6 +73,27 @@ static struct isa_pnp_id acpi_ns8250_ids {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ {0} }; +#endif + +#ifdef __aarch64__ +static struct uart_class * +uart_acpi_find_device(device_t dev) +{ + struct acpi_uart_compat_data **cd; + ACPI_HANDLE h; + + if ((h = acpi_get_handle(dev)) == NULL) + return (NULL); + + SET_FOREACH(cd, uart_acpi_class_and_device_set) { + if (acpi_MatchHid(h, (*cd)->hid)) { + return ((*cd)->clas); + } + } + + return (NULL); +} +#endif static int uart_acpi_probe(device_t dev) @@ -77,12 +104,18 @@ uart_acpi_probe(device_t dev) parent = device_get_parent(dev); sc = device_get_softc(dev); +#if defined(__i386__) || defined(__amd64__) if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) { sc->sc_class = &uart_ns8250_class; return (uart_bus_probe(dev, 0, 0, 0, 0)); } /* Add checks for non-ns8250 IDs here. */ +#elif defined(__aarch64__) + if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL) + return (uart_bus_probe(dev, 2, 0, 0, 0)); +#endif + return (ENXIO); } Added: head/sys/dev/uart/uart_cpu_acpi.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_cpu_acpi.h Thu Jul 21 09:32:55 2016 (r303133) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2015 Michal Meloun + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_UART_CPU_ACPI_H_ +#define _DEV_UART_CPU_ACPI_H_ + +#include + +struct uart_class; + +struct acpi_uart_compat_data { + const char *hid; + struct uart_class *clas; +}; + +/* + * If your UART driver implements only uart_class and uses uart_cpu_acpi.c + * for device instantiation, then use UART_ACPI_CLASS_AND_DEVICE for its + * declaration + */ +SET_DECLARE(uart_acpi_class_and_device_set, struct acpi_uart_compat_data); +#define UART_ACPI_CLASS_AND_DEVICE(data) \ + DATA_SET(
svn commit: r303134 - head/share/man/man7
Author: kib Date: Thu Jul 21 09:37:17 2016 New Revision: 303134 URL: https://svnweb.freebsd.org/changeset/base/303134 Log: Improve typesetting. Reviewed by: bapt No objections from: emaste Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D7261 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 == --- head/share/man/man7/arch.7 Thu Jul 21 09:32:55 2016(r303133) +++ head/share/man/man7/arch.7 Thu Jul 21 09:37:17 2016(r303134) @@ -47,7 +47,7 @@ On all supported architectures, .It float Ta 4 .It double Ta 8 .El -.Bl -column -offset indent ".Sy Architecture" ".Sy sizeof(void *)" ".Sy "sizeof(long double)" +.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy "sizeof(long double)" .It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) .It amd64 Ta 8 Ta 16 .It arm Ta 4 Ta 8 @@ -66,7 +66,7 @@ On all supported architectures, .It sparc64 Ta 8 Ta 16 .El .Ss Endianness and Char Signedness -.Bl -column -offset indent ".Sy Architecture" ".Sy Endianness" ".Sy "char Signedness" +.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy "char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness .It amd64 Ta little Ta signed .It arm Ta little Ta unsigned @@ -85,7 +85,7 @@ On all supported architectures, .It sparc64 Ta bigTa signed .El .Ss Page Size -.Bl -column -offset indent ".Sy Architecture" ".Sy Page Sizes" +.Bl -column -offset indent "Sy Architecture" "Sy Page Sizes" .It Sy Architecture Ta Sy Page Sizes .It amd64 Ta 4K, 2M, 1G .It arm Ta 4K @@ -104,7 +104,7 @@ On all supported architectures, .It sparc64 Ta 8K .El .Ss Floating Point -.Bl -column -offset indent ".Sy Architecture" ".Sy float, double" ".Sy long double" +.Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double" .It Sy Architecture Ta Sy float, double Ta Sy long double .It amd64 Ta hard Ta hard, 80 bit .It arm Ta soft Ta soft, double precision @@ -134,16 +134,18 @@ cc -x c -Dm -E /dev/null .Ed .Pp Common type size and endianness macros: -.Bl -column -offset indent "BYTE_ORDER" ".Sy Meaning" +.Bl -column -offset indent "BYTE_ORDER" "Sy Meaning" .It Sy Macro Ta Sy Meaning .It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int .It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer .It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN . -.Dv PDP11_ENDIAN is not used on FreeBSD. +.Dv PDP11_ENDIAN +is not used on +.Fx . .El .Pp Architecture-specific macros: -.Bl -column -offset indent ".Sy Architecture" ".Sy Predefined macros" +.Bl -column -offset indent "Sy Architecture" "Sy Predefined macros" .It Sy Architecture Ta Sy Predefined macros .It amd64 Ta Dv __amd64__, Dv __x86_64__ .It arm Ta Dv __arm__ ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303133 - head/sys/dev/uart
On Thu, 21 Jul 2016 09:32:56 + (UTC) Andrew Turner wrote: > Author: andrew > Date: Thu Jul 21 09:32:55 2016 > New Revision: 303133 > URL: https://svnweb.freebsd.org/changeset/base/303133 > > Log: > Add support for arm64 to uart_dev_acpi by using the _HID property > to find the uart class to use in a similar way as the fdt driver. > Reviewed by: jhb > Obtained from: ABT Systems Ltd > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D7248 Andrew ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
On Wed, 20 Jul 2016 13:28:53 +0200 Michal Meloun wrote: > Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a): > > 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(), > > but is both problematically more general and less flexible (it has > > requirements on timing of PIC attachment vs. driver resource > > allocation) > OFW_BUS_MAP_INTR() can parse only OFW based data and expect that > parsed data are magicaly stored within the call. > The new method, bus_map_intr(), can parse data from multiple sources > (OFW, UEFI / ACPI, synthetic[gpio device + pin number]). It also > returns parsed data back to caller. > And no, it doesn't add any additional timing requirements . I've been looking at ACPI on arm64. So far I have not found the need for this with ACPI as we don't need to send the data to the interrupt controller driver to be parsed in the way OFW/FDT needs to. Andrew ___ 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-unsubscr...@freebsd.org"
svn commit: r303142 - head/lib/libc/gen
Author: ache Date: Thu Jul 21 12:53:36 2016 New Revision: 303142 URL: https://svnweb.freebsd.org/changeset/base/303142 Log: 1) GLOB_BRACE was somewhat broken. First it repeatedly calls glob0() in globexp1() recursive calls, but glob0() was not supposed to be called repeatedly in the original code. It finalize results by possible adding original pattern for no match case, may return GLOB_NOMATCH error and by sorting all things. Original pattern adding or GLOB_NOMATCH error can happens each time glob0() called repeatedly, and sorting happens for one item only, all things are never sorted. Second, f.e. "a{a" pattern does not match "a{a" file but match "a" file instead (just one example, there are many). Third, some errors (f.e. for limits or overflow) can be ignored by GLOB_BRACE code because it forces return (0). Add non-finalizing flag to glob0() and make globexp0() wrapper around recursively called globexp1() to finalize things like glob0() does. Reorganize braces code to work correctly. 2) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING (ARG_MAX) limit, use final string length, not malloced space for it. 3) Revive DEBUG-ifdefed section. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c == --- head/lib/libc/gen/glob.cThu Jul 21 12:50:23 2016(r303141) +++ head/lib/libc/gen/glob.cThu Jul 21 12:53:36 2016(r303142) @@ -128,8 +128,6 @@ struct glob_limit { #defineRBRACE L'}' #defineCOMMA L',' -#ifndef DEBUG - #defineM_QUOTE 0x80ULL #defineM_PROTECT 0x40ULL #defineM_MASK 0xffULL @@ -137,18 +135,6 @@ struct glob_limit { typedef uint_fast64_t Char; -#else - -#defineM_QUOTE 0x80 -#defineM_PROTECT 0x40 -#defineM_MASK 0xff -#defineM_CHAR 0x7f - -typedef char Char; - -#endif - - #defineCHAR(c) ((Char)((c)&M_CHAR)) #defineMETA(c) ((Char)((c)|M_QUOTE)) #defineUNPROT(c) ((c) & ~M_PROTECT) @@ -171,7 +157,7 @@ static const Char *g_strchr(const Char * static Char*g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob0(const Char *, glob_t *, struct glob_limit *, int); static int glob1(Char *, glob_t *, struct glob_limit *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, struct glob_limit *); @@ -180,8 +166,9 @@ static int glob3(Char *, Char *, Char * static int globextend(const Char *, glob_t *, struct glob_limit *, int); static const Char * globtilde(const Char *, Char *, size_t, glob_t *); +static int globexp0(const Char *, glob_t *, struct glob_limit *); static int globexp1(const Char *, glob_t *, struct glob_limit *); -static int globexp2(const Char *, const Char *, glob_t *, int *, +static int globexp2(const Char *, const Char *, glob_t *, struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG @@ -260,9 +247,49 @@ glob(const char * __restrict pattern, in *bufnext = EOS; if (flags & GLOB_BRACE) - return (globexp1(patbuf, pglob, &limit)); + return (globexp0(patbuf, pglob, &limit)); else - return (glob0(patbuf, pglob, &limit)); + return (glob0(patbuf, pglob, &limit, 1)); +} + +static int +globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) +{ + int rv; + size_t oldpathc; + + /* Protect a single {}, for find(1), like csh */ + if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + return (glob0(pattern, pglob, limit, 1)); + } + + oldpathc = pglob->gl_pathc; + + if ((rv = globexp1(pattern, pglob, limit)) != 0) + return rv; + /* +* If there was no match we are going to append the pattern +* if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified +* and the pattern did not contain any magic characters +* GLOB_NOMAGIC is there just for compatibility with csh. +*/ + if (pglob->gl_pathc == oldpathc) { + if (((pglob->gl_flags & GLOB_NOCHECK) || + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR + return (globextend(pattern, pglob, limit, 1)); + else + return (GLOB_NOMATCH); + } + if (!(pg
svn commit: r303143 - in head/sys: dev/uart modules/uart
Author: andrew Date: Thu Jul 21 13:01:35 2016 New Revision: 303143 URL: https://svnweb.freebsd.org/changeset/base/303143 Log: Fix the build: * Add acpi_if.h to the SRC list in the uart module * Only include new acpi headers when they are needed Obtained from:ABT Systems Ltd MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_bus_acpi.c head/sys/modules/uart/Makefile Modified: head/sys/dev/uart/uart_bus_acpi.c == --- head/sys/dev/uart/uart_bus_acpi.c Thu Jul 21 12:53:36 2016 (r303142) +++ head/sys/dev/uart/uart_bus_acpi.c Thu Jul 21 13:01:35 2016 (r303143) @@ -41,9 +41,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __aarch64__ #include #include #include +#endif static int uart_acpi_probe(device_t dev); Modified: head/sys/modules/uart/Makefile == --- head/sys/modules/uart/Makefile Thu Jul 21 12:53:36 2016 (r303142) +++ head/sys/modules/uart/Makefile Thu Jul 21 13:01:35 2016 (r303143) @@ -32,7 +32,8 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u uart_dev_z8530.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c -SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ +SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ + pci_if.h \ power_if.h pccarddevs.h serdev_if.h SRCS+= opt_platform.h opt_uart.h ___ 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-unsubscr...@freebsd.org"
svn commit: r303144 - head/sys/arm/allwinner
Author: manu Date: Thu Jul 21 13:26:39 2016 New Revision: 303144 URL: https://svnweb.freebsd.org/changeset/base/303144 Log: We need the GIC to be attached so attach later at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE Reviewed by: andrew MFC after:1 week Differential Revision:https://reviews.freebsd.org/D7080 Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Thu Jul 21 13:01:35 2016 (r303143) +++ head/sys/arm/allwinner/a10_gpio.c Thu Jul 21 13:26:39 2016 (r303144) @@ -743,4 +743,4 @@ static driver_t a10_gpio_driver = { }; EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0, -BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); ___ 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-unsubscr...@freebsd.org"
svn commit: r303145 - head/sys/arm/allwinner
Author: manu Date: Thu Jul 21 13:28:07 2016 New Revision: 303145 URL: https://svnweb.freebsd.org/changeset/base/303145 Log: axp209 needs aw_nmi so attach a bit earlier Reviewed by: andrew Differential Revision:https://reviews.freebsd.org/D7081 Modified: head/sys/arm/allwinner/aw_nmi.c Modified: head/sys/arm/allwinner/aw_nmi.c == --- head/sys/arm/allwinner/aw_nmi.c Thu Jul 21 13:26:39 2016 (r303144) +++ head/sys/arm/allwinner/aw_nmi.c Thu Jul 21 13:28:07 2016 (r303145) @@ -401,4 +401,4 @@ static driver_t aw_nmi_driver = { static devclass_t aw_nmi_devclass; EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver, -aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
On 7/21/16, 3:34 AM, "owner-src-committ...@freebsd.org on behalf of Michal Meloun" wrote: > The API is part of still unstable, experimental INTRNG, so its not fixed we > we can > change it at any time, I think. If INTRNG is unstable and experimental, why is it in the GENERIC kernel for arm64? Or, is the entire arm64 architecture considered unstable and experimental in 11.0? (I'm not trying to take sides; these are honest questions.) Jonathan ___ 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-unsubscr...@freebsd.org"
svn commit: r303146 - head/usr.bin/sed
Author: pfg Date: Thu Jul 21 14:17:36 2016 New Revision: 303146 URL: https://svnweb.freebsd.org/changeset/base/303146 Log: sed(1): Appease older GCC. Modified: head/usr.bin/sed/process.c Modified: head/usr.bin/sed/process.c == --- head/usr.bin/sed/process.c Thu Jul 21 13:28:07 2016(r303145) +++ head/usr.bin/sed/process.c Thu Jul 21 14:17:36 2016(r303146) @@ -97,11 +97,12 @@ process(void) { struct s_command *cp; SPACE tspace; - size_t oldpsl = 0; + size_t oldpsl; char *p; int oldpsanl; p = NULL; + oldpsanl = oldpsl = 0; for (linenum = 0; mf_fgets(&PS, REPLACE);) { pd = 0; ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303123 - head/sys/cam
Hello Warner, This break every kernel build that don't have nvme(4). On Thu, 21 Jul 2016 03:11:35 + (UTC) Warner Losh wrote: > Author: imp > Date: Thu Jul 21 03:11:35 2016 > New Revision: 303123 > URL: https://svnweb.freebsd.org/changeset/base/303123 > > Log: > Fix mismerge and include the nvme support. > Also, print out the name of any CCB's functions that's not supported. > > MFC after: 1 week > > Modified: > head/sys/cam/cam_xpt.c > > Modified: head/sys/cam/cam_xpt.c > == > --- head/sys/cam/cam_xpt.cThu Jul 21 00:53:14 2016(r303122) > +++ head/sys/cam/cam_xpt.cThu Jul 21 03:11:35 2016(r303123) > @@ -1033,6 +1033,8 @@ xpt_announce_periph(struct cam_periph *p > else if (path->device->protocol == PROTO_SEMB) > semb_print_ident( > (struct sep_identify_data *)&path->device->ident_data); > + else if (path->device->protocol == PROTO_NVME) > + nvme_print_ident(path->device->nvme_cdata, > path->device->nvme_data); > else > printf("Unknown protocol device\n"); > if (path->device->serial_num_len > 0) { > @@ -1086,6 +1088,8 @@ xpt_denounce_periph(struct cam_periph *p > else if (path->device->protocol == PROTO_SEMB) > semb_print_ident_short( > (struct sep_identify_data *)&path->device->ident_data); > + else if (path->device->protocol == PROTO_NVME) > + nvme_print_ident(path->device->nvme_cdata, > path->device->nvme_data); > else > printf("Unknown protocol device"); > if (path->device->serial_num_len > 0) > @@ -2516,6 +2520,10 @@ xpt_action_default(union ccb *start_ccb) > if (start_ccb->ccb_h.func_code == XPT_ATA_IO) > start_ccb->ataio.resid = 0; > /* FALLTHROUGH */ > + case XPT_NVME_IO: > + if (start_ccb->ccb_h.func_code == XPT_NVME_IO) > + start_ccb->nvmeio.resid = 0; > + /* FALLTHROUGH */ > case XPT_RESET_DEV: > case XPT_ENG_EXEC: > case XPT_SMP_IO: > @@ -2655,6 +2663,8 @@ call_sim: > cgd->inq_data = dev->inq_data; > cgd->ident_data = dev->ident_data; > cgd->inq_flags = dev->inq_flags; > + cgd->nvme_data = dev->nvme_data; > + cgd->nvme_cdata = dev->nvme_cdata; > cgd->ccb_h.status = CAM_REQ_CMP; > cgd->serial_num_len = dev->serial_num_len; > if ((dev->serial_num_len > 0) > @@ -3011,8 +3021,10 @@ call_sim: > case XPT_TERM_IO: > case XPT_ENG_INQ: > /* XXX Implement */ > - printf("%s: CCB type %#x not supported\n", __func__, > -start_ccb->ccb_h.func_code); > + xpt_print_path(start_ccb->ccb_h.path); > + printf("%s: CCB type %#x %s not supported\n", __func__, > + start_ccb->ccb_h.func_code, > + xpt_action_name(start_ccb->ccb_h.func_code)); > start_ccb->ccb_h.status = CAM_PROVIDE_FAIL; > if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) { > xpt_done(start_ccb); > @@ -3315,6 +3327,13 @@ xpt_run_devq(struct cam_devq *devq) >ata_cmd_string(&work_ccb->ataio.cmd, > cdb_str, sizeof(cdb_str; > break; > + case XPT_NVME_IO: > + CAM_DEBUG(work_ccb->ccb_h.path, > + CAM_DEBUG_CDB,("%s. NCB: %s\n", > + nvme_op_string(&work_ccb->nvmeio.cmd), > + nvme_cmd_string(&work_ccb->nvmeio.cmd, > + cdb_str, sizeof(cdb_str; > + break; > default: > break; > } > @@ -3904,6 +3923,9 @@ xpt_bus_register(struct cam_sim *sim, de > case XPORT_SATA: > new_bus->xport = ata_get_xport(); > break; > + case XPORT_NVME: > + new_bus->xport = nvme_get_xport(); > + break; > default: > new_bus->xport = &xport_default; > break; -- Emmanuel Vadot ___ 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-unsubscr...@freebsd.org"
svn commit: r303147 - head/contrib/binutils/bfd
Author: pfg Date: Thu Jul 21 15:26:21 2016 New Revision: 303147 URL: https://svnweb.freebsd.org/changeset/base/303147 Log: binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic. From OpenBSD's log: Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html, but expressed differently so there are no GPLv3 issues. Obtained from:OpenBSD (CVS rev. 1.7) MFC after:1 month Modified: head/contrib/binutils/bfd/elfxx-mips.c Modified: head/contrib/binutils/bfd/elfxx-mips.c == --- head/contrib/binutils/bfd/elfxx-mips.c Thu Jul 21 14:17:36 2016 (r303146) +++ head/contrib/binutils/bfd/elfxx-mips.c Thu Jul 21 15:26:21 2016 (r303147) @@ -4801,7 +4801,7 @@ mips_elf_create_dynamic_relocation (bfd /* We must now calculate the dynamic symbol table index to use in the relocation. */ if (h != NULL - && (!h->root.def_regular + && (sec == NULL || !h->root.def_regular || (info->shared && !info->symbolic && !h->root.forced_local))) { indx = h->root.dynindx; ___ 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-unsubscr...@freebsd.org"
svn commit: r303150 - head/sys/dev/flash
Author: adrian Date: Thu Jul 21 15:48:41 2016 New Revision: 303150 URL: https://svnweb.freebsd.org/changeset/base/303150 Log: [mx25l] add new device id. Tested: * (submitter) TP-Link TL-WR1043nd v3 Submitted by: t...@enoti.me Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c == --- head/sys/dev/flash/mx25l.c Thu Jul 21 15:42:19 2016(r303149) +++ head/sys/dev/flash/mx25l.c Thu Jul 21 15:48:41 2016(r303150) @@ -133,6 +133,9 @@ struct mx25l_flash_ident flash_devices[] /* Atmel */ { "at25df641", 0x1f, 0x4800, 64 * 1024, 128, FL_ERASE_4K }, + + /* GigaDevice */ + { "gd25q64",0xc8, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, }; static uint8_t ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
On 07/21/16 00:34, Michal Meloun wrote: Dne 20.07.2016 v 17:45 Nathan Whitehorn napsal(a): On 07/20/16 04:28, Michal Meloun wrote: Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a): On 07/19/16 04:13, Michal Meloun wrote: Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a): Hi Nathan, I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so please don’t expect quick response. Could you please describe what this change is in more detail? Short description is appended. It breaks a lot of encapsulations we have worked very hard to maintain, moves ARM code into MI parts of the kernel, and the OFW parts violate IEEE 1275 (the Open Firmware standard). In particular, there is no guarantee that the interrupts for a newbus (or OF) device are encoded in a property called "interrupts" (or, indeed, in any property at all) on that node and there are many, many device trees where that is not the case (e.g. ones with interrupt maps, as well as Apple hardware). By putting that knowledge into the OF root bus device, which we have tried to keep it out of, this enforces a standard that doesn't actually exist. Imho, this patch doesn’t change anything in this area. Only handling of “interrupts” property is changed, all other cases are unchanged (I hope). Also, INTRNG code is currently shared by ARM, ARM64 and MIPS. But "interrupts" isn't a generic part of OF. This makes it one, incorrectly. How? Can you be little more exact ? Because it puts knowledge into ofwbus that expects that children at arbitrary levels of nesting have interrupts defined by an "interrupts" property. You could patch this through on sub-devices, of course, but that's already done correctly by the existing ofw_bus_map_intr() code in a much more robust way that doesn't involve trying to guess how sub-buses and devices have chosen to allocate resources. Why reinvent the wheel all the way through the bus hierarchy? Nope, the code only expect that „interrupts" property is default way hot to get interrupt description. Any device or bus in the hierarchy can fill appropriate resource list, or terminate call at any level. "interrupts" should not be the default -- it's part of the OF bindings for the bus and is used (notably) by simplebus. The issue of cross-correlating RIDs is a much larger problem, however. [snip] The patch simply postpones reading of interrupt property to bus_alloc_resource() (called by consumer driver) time. Due to this, we can: - parse interrupt property. The interrupt driver must exist at this time. This only works with some types of interrupt properties, not all, and breaks if the interrupt driver hasn't attached yet (which it can't be guaranteed to -- some PPC systems have interrupt drivers that live on the PCI bus, for example). How you can allocate (and reserve it in rman) interrupt if is not mapped (so you have not real IRQ number for it). Just for notice - multiple virtual IRQs can be mapped into single real IRQ. The core idea is to think of the full interrupt specifier -- the interrupt parent and the full byte string in the device tree -- as the IRQ rather than the interrupt pin on some chip (which is usually, but not always, the first word in that byte string). The "virtual" IRQ number is just a compression of that longer piece of data, which usually can't fit in an rman resource. I understand. While this approach can works (and actually works) for single sourced OFW world, it immediately fails if you must be able to parse data from different sources (which uses different encoding) (OFW, UEFI / ACPI, GPIO...) within one system. On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), OFW systems (Macs, some IBM hardware), systems with no device trees at all (old-style PS3), and systems with a mixture of device tree and no device tree (new-style PS3). On these, there is a mixture of "real" interrupts and GPIO-type interrupts. There is no limitation that this be used only for device-tree-type systems. The system requires two things: an interrupt domain key and an arbitrary unique byte string describing the interrupt. When running with a device tree, these are set to the phandle of the interrupt-parent and the contents of the device tree interrupt specifier, respectively, and the system was of course developed with that in mind. But they don't need to be, and often aren't. You could make the domain an element of an enum (where "ACPI" is a choice, for instance -- this is what PS3 does), or set it to a pointer to a device_t, or really anything you like. Similarly, the interrupt specifier is totally free-form. You could, for instance, set it to one of the structures introduced in r301453 if you wanted to. I would have zero problems with changing the prototype of the existing dev/ofw function to something more generic in name, like: bus_map_intr(device_t dev, uintptr_t iparent, size_t intrlen, void *intr) instead of the
svn commit: r303151 - in head/sys: dev/pty kern sys
Author: kib Date: Thu Jul 21 16:34:56 2016 New Revision: 303151 URL: https://svnweb.freebsd.org/changeset/base/303151 Log: Provide counter_warning(9) KPI which allows to issue limited number of warnings for some kernel events, mostly intended for the use of obsoleted or otherwise undersired interfaces. This is an abstracted and race-expelled code from compat pty driver. Requested and reviewed by:jhb Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D7270 Modified: head/sys/dev/pty/pty.c head/sys/kern/subr_prf.c head/sys/sys/systm.h Modified: head/sys/dev/pty/pty.c == --- head/sys/dev/pty/pty.c Thu Jul 21 15:48:41 2016(r303150) +++ head/sys/dev/pty/pty.c Thu Jul 21 16:34:56 2016(r303151) @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); * binary emulation. */ -static unsigned int pty_warningcnt = 1; +static unsigned pty_warningcnt = 1; SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW, - &pty_warningcnt, 0, - "Warnings that will be triggered upon legacy PTY allocation"); +&pty_warningcnt, 0, +"Warnings that will be triggered upon legacy PTY allocation"); static int ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) @@ -77,12 +77,7 @@ ptydev_fdopen(struct cdev *dev, int ffla } /* Raise a warning when a legacy PTY has been allocated. */ - if (pty_warningcnt > 0) { - pty_warningcnt--; - log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", - td->td_proc->p_pid, td->td_name, - pty_warningcnt ? "" : " - not logging anymore"); - } + counted_warning(&pty_warningcnt, "is using legacy pty devices"); return (0); } Modified: head/sys/kern/subr_prf.c == --- head/sys/kern/subr_prf.cThu Jul 21 15:48:41 2016(r303150) +++ head/sys/kern/subr_prf.cThu Jul 21 16:34:56 2016(r303151) @@ -1196,3 +1196,22 @@ sbuf_hexdump(struct sbuf *sb, const void } } +void +counted_warning(unsigned *counter, const char *msg) +{ + struct thread *td; + unsigned c; + + for (;;) { + c = *counter; + if (c == 0) + break; + if (atomic_cmpset_int(counter, c, c - 1)) { + td = curthread; + log(LOG_INFO, "pid %d (%s) %s%s\n", + td->td_proc->p_pid, td->td_name, msg, + c > 1 ? "" : " - not logging anymore"); + break; + } + } +} Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hThu Jul 21 15:48:41 2016(r303150) +++ head/sys/sys/systm.hThu Jul 21 16:34:56 2016(r303151) @@ -447,4 +447,6 @@ voidintr_prof_stack_use(struct thread * extern void (*softdep_ast_cleanup)(void); +void counted_warning(unsigned *counter, const char *msg); + #endif /* !_SYS_SYSTM_H_ */ ___ 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-unsubscr...@freebsd.org"
svn commit: r303153 - head/share/man/man7
Author: kib Date: Thu Jul 21 16:58:53 2016 New Revision: 303153 URL: https://svnweb.freebsd.org/changeset/base/303153 Log: Remove spurious but harmless double-quote. Noted by: jhb Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 == --- head/share/man/man7/arch.7 Thu Jul 21 16:56:04 2016(r303152) +++ head/share/man/man7/arch.7 Thu Jul 21 16:58:53 2016(r303153) @@ -47,7 +47,7 @@ On all supported architectures, .It float Ta 4 .It double Ta 8 .El -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy "sizeof(long double)" +.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" .It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) .It amd64 Ta 8 Ta 16 .It arm Ta 4 Ta 8 @@ -66,7 +66,7 @@ On all supported architectures, .It sparc64 Ta 8 Ta 16 .El .Ss Endianness and Char Signedness -.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy "char Signedness" +.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness .It amd64 Ta little Ta signed .It arm Ta little Ta unsigned ___ 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-unsubscr...@freebsd.org"
svn commit: r303154 - head/sys/kern
Author: kib Date: Thu Jul 21 17:07:06 2016 New Revision: 303154 URL: https://svnweb.freebsd.org/changeset/base/303154 Log: Declare aio requests on files from local filesystems safe. Two notes: - I allow AIO on reclaimed vnodes, since it is deterministically terminated fast. - devfs mounts are marked as MNT_LOCAL, but device vnodes have type VCHR, so the slow device io is not allowed. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D7273 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c == --- head/sys/kern/vfs_aio.c Thu Jul 21 16:58:53 2016(r303153) +++ head/sys/kern/vfs_aio.c Thu Jul 21 17:07:06 2016(r303154) @@ -1664,7 +1664,10 @@ aio_queue_file(struct file *fp, struct k struct aioliojob *lj; struct kaioinfo *ki; struct kaiocb *job2; + struct vnode *vp; + struct mount *mp; int error, opcode; + bool safe; lj = job->lio; ki = job->userproc->p_aioinfo; @@ -1685,7 +1688,16 @@ aio_queue_file(struct file *fp, struct k goto done; #endif queueit: - if (!enable_aio_unsafe) + safe = false; + if (fp->f_type == DTYPE_VNODE) { + vp = fp->f_vnode; + if (vp->v_type == VREG || vp->v_type == VDIR) { + mp = fp->f_vnode->v_mount; + if (mp == NULL || (mp->mnt_flag & MNT_LOCAL) != 0) + safe = true; + } + } + if (!(safe || enable_aio_unsafe)) return (EOPNOTSUPP); if (opcode == LIO_SYNC) { ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303151 - in head/sys: dev/pty kern sys
Hi, I get the issues below with GCC 6.1 [...] ===> lib/libsbuf (obj,all,install) /home/rb743/opt/new17/bin/riscv64-unknown-freebsd11.0-gcc -isystem /home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/include -L/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/lib --sysroot=/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp -B/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/bin -O2 -pipe -msoft-float -MD -MF.depend.subr_prf.o -MTsubr_prf.o -std=gnu99 -fstack-protector-strong -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 -Wno-error=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno -error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address -Wno-error=unused-const-variable= -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=misleading-indentation -Wno-error=tautological-compare -c /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c -o subr_prf.o /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1200:1: error: no previous prototype for 'counted_warning' [-Werror=missing-prototypes] counted_warning(unsigned *counter, const char *msg) ^~~ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c: In function 'counted_warning': /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:7: error: implicit declaration of function 'atomic_cmpset_int' [-Werror=implicit-function-declaration] if (atomic_cmpset_int(counter, c, c - 1)) { ^ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:3: error: nested extern declaration of 'atomic_cmpset_int' [-Werror=nested-externs] if (atomic_cmpset_int(counter, c, c - 1)) { ^~ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: error: 'curthread' undeclared (first use in this function) td = curthread; ^ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: note: each undeclared identifier is reported only once for each function it appears in /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: error: implicit declaration of function 'log' [-Werror=implicit-function-declaration] log(LOG_INFO, "pid %d (%s) %s%s\n", ^~~ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: error: incompatible implicit declaration of built-in function 'log' [-Werror] /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: note: include '' or provide a declaration of 'log' /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:8: error: 'LOG_INFO' undeclared (first use in this function) log(LOG_INFO, "pid %d (%s) %s%s\n", ^~~~ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1212:10: error: dereferencing pointer to incomplete type 'struct thread' td->td_proc->p_pid, td->td_name, msg, ^~ /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: error: too many arguments to function 'log' log(LOG_INFO, "pid %d (%s) %s%s\n", ^~~ cc1: all warnings being treated as errors *** [subr_prf.o] Error code 1 bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf 1 error bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf *** [lib/libsbuf__L] Error code 2 bmake[3]: stopped in /home/rb743/dev/freebsd-riscv 1 error bmake[3]: stopped in /home/rb743/dev/freebsd-riscv *** [libraries] Error code 2 bmake[2]: stopped in /home/rb743/dev/freebsd-riscv 1 error bmake[2]: stopped in /home/rb743/dev/freebsd-riscv *** [_libraries] Error code 2 bmake[1]: stopped in /home/rb743/dev/freebsd-riscv 1 error bmake[1]: stopped in /home/rb743/dev/freebsd-riscv *** [buildworld] Error code 2 make: stopped in /home/rb743/dev/freebsd-riscv make: stopped in /home/rb743/dev/freebsd-riscv 0 vica:/home/rb743/dev/freebsd-riscv > On Thu, Jul 21, 2016 at 04:34:57PM +, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 21 16:34:56 2016 > New Revision: 303151 > URL: https://svnweb.freebsd.org/changeset/base/303151 > > Log: > Provide counter_warning(9) KPI which allows to issue limited number of > warnings for some kernel events, mostly intended for the use of > obsoleted or otherwise undersired interfaces. > > This is an abstracted and race-expelled code from compat pty driver. > > Requested and re
svn commit: r303155 - head/sys/kern
Author: kib Date: Thu Jul 21 17:59:30 2016 New Revision: 303155 URL: https://svnweb.freebsd.org/changeset/base/303155 Log: Hide counted_warning(9) under #ifdef _KERNEL braces, to allow building subr_prf.c in userspace for libsbuf. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c == --- head/sys/kern/subr_prf.cThu Jul 21 17:07:06 2016(r303154) +++ head/sys/kern/subr_prf.cThu Jul 21 17:59:30 2016(r303155) @@ -1196,6 +1196,7 @@ sbuf_hexdump(struct sbuf *sb, const void } } +#ifdef _KERNEL void counted_warning(unsigned *counter, const char *msg) { @@ -1215,3 +1216,4 @@ counted_warning(unsigned *counter, const } } } +#endif ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303151 - in head/sys: dev/pty kern sys
On Thu, Jul 21, 2016 at 06:52:25PM +0100, Ruslan Bukin wrote: > Hi, > > I get the issues below with GCC 6.1 > > [...] > ===> lib/libsbuf (obj,all,install) > /home/rb743/opt/new17/bin/riscv64-unknown-freebsd11.0-gcc -isystem > /home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/include > -L/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/lib > --sysroot=/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp > -B/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/bin > -O2 -pipe -msoft-float -MD -MF.depend.subr_prf.o -MTsubr_prf.o -std=gnu99 > -fstack-protector-strong -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 > -Wno-error=unused-function -Wno-error=enum-compare > -Wno-error=logical-not-parentheses -Wno-error=bool-compare > -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered > -Wno-error=cast-align -W no-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address -Wno-error=unused-const-variable= -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=misleading-indentation -Wno-error=tautological-compare -c /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c -o subr_prf.o > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1200:1: > error: no previous prototype for 'counted_warning' > [-Werror=missing-prototypes] > counted_warning(unsigned *counter, const char *msg) > ^~~ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c: In > function 'counted_warning': > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:7: > error: implicit declaration of function 'atomic_cmpset_int' > [-Werror=implicit-function-declaration] >if (atomic_cmpset_int(counter, c, c - 1)) { >^ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:3: > error: nested extern declaration of 'atomic_cmpset_int' > [-Werror=nested-externs] >if (atomic_cmpset_int(counter, c, c - 1)) { >^~ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: > error: 'curthread' undeclared (first use in this function) > td = curthread; > ^ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: > note: each undeclared identifier is reported only once for each function it > appears in > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: > error: implicit declaration of function 'log' > [-Werror=implicit-function-declaration] > log(LOG_INFO, "pid %d (%s) %s%s\n", > ^~~ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: > error: incompatible implicit declaration of built-in function 'log' [-Werror] > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: > note: include '' or provide a declaration of 'log' > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:8: > error: 'LOG_INFO' undeclared (first use in this function) > log(LOG_INFO, "pid %d (%s) %s%s\n", > ^~~~ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1212:10: > error: dereferencing pointer to incomplete type 'struct thread' > td->td_proc->p_pid, td->td_name, msg, > ^~ > /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: > error: too many arguments to function 'log' > log(LOG_INFO, "pid %d (%s) %s%s\n", > ^~~ > cc1: all warnings being treated as errors > *** [subr_prf.o] Error code 1 > > bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf > 1 error > > bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf > *** [lib/libsbuf__L] Error code 2 > > bmake[3]: stopped in /home/rb743/dev/freebsd-riscv > 1 error > > bmake[3]: stopped in /home/rb743/dev/freebsd-riscv > *** [libraries] Error code 2 > > bmake[2]: stopped in /home/rb743/dev/freebsd-riscv > 1 error > > bmake[2]: stopped in /home/rb743/dev/freebsd-riscv > *** [_libraries] Error code 2 > > bmake[1]: stopped in /home/rb743/dev/freebsd-riscv > 1 error > > bmake[1]: stopped in /home/rb743/dev/freebsd-riscv > *** [buildworld] Error code 2 > > make: stopped in /home/rb743/dev/freebsd-riscv > > make: stopped in /home/rb743/dev/freebsd-riscv This should be fixed with r303155. ___ 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-unsubscr...@freebsd.org"
svn commit: r303156 - head/crypto/heimdal/lib/roken
Author: emaste Date: Thu Jul 21 18:12:39 2016 New Revision: 303156 URL: https://svnweb.freebsd.org/changeset/base/303156 Log: Remove duplicate symbols from libroken version-script.map Upstream commit r24759 (efed563) prefixed some symbols with rk_, but introduced 6 duplicate symbols in the version script (because the rk_-prefixed versions of the symbols were already present). Modified: head/crypto/heimdal/lib/roken/version-script.map Modified: head/crypto/heimdal/lib/roken/version-script.map == --- head/crypto/heimdal/lib/roken/version-script.mapThu Jul 21 17:59:30 2016(r303155) +++ head/crypto/heimdal/lib/roken/version-script.mapThu Jul 21 18:12:39 2016(r303156) @@ -123,17 +123,12 @@ HEIMDAL_ROKEN_1.0 { rk_strptime; rk_strsep_copy; rk_strsvis; - rk_strsvis; rk_strsvisx; rk_strunvis; - rk_strunvis; rk_strunvisx; rk_strupr; rk_strvis; - rk_strvis; rk_strvisx; - rk_strvisx; - rk_svis; rk_svis; rk_timegm; rk_timevaladd; @@ -148,7 +143,6 @@ HEIMDAL_ROKEN_1.0 { rk_vasnprintf; rk_vasprintf; rk_vis; - rk_vis; rk_vsnprintf; rk_vstrcollect; rk_wait_for_process; ___ 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-unsubscr...@freebsd.org"
svn commit: r303157 - head/contrib/libcxxrt
Author: emaste Date: Thu Jul 21 18:20:35 2016 New Revision: 303157 URL: https://svnweb.freebsd.org/changeset/base/303157 Log: libcxxrt: add padding in __cxa_allocate_* to fix alignment The addition of the referenceCount to __cxa_allocate_exception put the unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte alignment. In order to avoid changing the current __cxa_exception ABI (and thus breaking its consumers), add explicit padding in the allocation routines (and account for it when freeing). This is intended as a lower-risk change for FreeBSD 11. A "more correct" fix should be prepared for upstream and -CURRENT. Reviewed by: dim MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D7271 Modified: head/contrib/libcxxrt/exception.cc Modified: head/contrib/libcxxrt/exception.cc == --- head/contrib/libcxxrt/exception.cc Thu Jul 21 18:12:39 2016 (r303156) +++ head/contrib/libcxxrt/exception.cc Thu Jul 21 18:20:35 2016 (r303157) @@ -572,6 +572,19 @@ static void free_exception(char *e) } } +#ifdef __LP64__ +/** + * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte + * alignment but it was broken by the addition of the referenceCount. + * The unwindHeader is at offset 0x58 in __cxa_exception. In order to keep + * compatibility with consumers of the broken __cxa_exception, explicitly add + * padding on allocation (and account for it on free). + */ +static const int exception_alignment_padding = 8; +#else +static const int exception_alignment_padding = 0; +#endif + /** * Allocates an exception structure. Returns a pointer to the space that can * be used to store an object of thrown_size bytes. This function will use an @@ -580,16 +593,19 @@ static void free_exception(char *e) */ extern "C" void *__cxa_allocate_exception(size_t thrown_size) { - size_t size = thrown_size + sizeof(__cxa_exception); + size_t size = exception_alignment_padding + sizeof(__cxa_exception) + + thrown_size; char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_exception); + return buffer + exception_alignment_padding + sizeof(__cxa_exception); } extern "C" void *__cxa_allocate_dependent_exception(void) { - size_t size = sizeof(__cxa_dependent_exception); + size_t size = exception_alignment_padding + + sizeof(__cxa_dependent_exception); char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_dependent_exception); + return buffer + exception_alignment_padding + + sizeof(__cxa_dependent_exception); } /** @@ -617,7 +633,8 @@ extern "C" void __cxa_free_exception(voi } } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } static void releaseException(__cxa_exception *exception) @@ -644,7 +661,8 @@ void __cxa_free_dependent_exception(void { releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } /** ___ 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-unsubscr...@freebsd.org"
svn commit: r303158 - head/lib/libmd
Author: emaste Date: Thu Jul 21 18:47:51 2016 New Revision: 303158 URL: https://svnweb.freebsd.org/changeset/base/303158 Log: libmd: strip local absolute symbols (to link with lld) Old versions of gas produce an invalid section index. That is ignored by old versions of ld, but prevents a link with lld. Submitted by: Rafael Ávila de Espíndola (earlier version) Reviewed by: allanjude Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D6789 Modified: head/lib/libmd/Makefile Modified: head/lib/libmd/Makefile == --- head/lib/libmd/Makefile Thu Jul 21 18:20:35 2016(r303157) +++ head/lib/libmd/Makefile Thu Jul 21 18:47:51 2016(r303158) @@ -93,6 +93,7 @@ SRCS+=rmd160.S CFLAGS+= -DRMD160_ASM .endif .if exists(${MACHINE_ARCH}/skein_block_asm.s) +AFLAGS += --strip-local-absolute SRCS+= skein_block_asm.s CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 .endif ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303151 - in head/sys: dev/pty kern sys
On 7/21/2016 9:34 AM, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 21 16:34:56 2016 > New Revision: 303151 > URL: https://svnweb.freebsd.org/changeset/base/303151 > > Log: > Provide counter_warning(9) KPI which allows to issue limited number of > warnings for some kernel events, mostly intended for the use of > obsoleted or otherwise undersired interfaces. > > This is an abstracted and race-expelled code from compat pty driver. This is great. Thanks for this. -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r303160 - head/etc/ntp
Author: cy Date: Thu Jul 21 19:27:04 2016 New Revision: 303160 URL: https://svnweb.freebsd.org/changeset/base/303160 Log: Update leap-seconds to leap-seconds.3676752000. As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16: UTC TIME STEP on the 1st of January 2017 A positive leap second will be introduced at the end of December 2016. The sequence of dates of the UTC second markers will be: 2016 December 31, 23h 59m 59s 2016 December 31, 23h 59m 60s 2017 January 1, 0h 0m 0s The difference between UTC and the International Atomic Time TAI is: from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC : UTC-TAI = - 36s from 2017 January 1, 0h UTC, until further notice: UTC-TAI = - 37s Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000 See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16 MFC after:1 week Relnotes: yes Modified: head/etc/ntp/leap-seconds Modified: head/etc/ntp/leap-seconds == --- head/etc/ntp/leap-seconds Thu Jul 21 19:18:49 2016(r303159) +++ head/etc/ntp/leap-seconds Thu Jul 21 19:27:04 2016(r303160) @@ -130,7 +130,7 @@ # Washington, DC # jeffrey.prilla...@usno.navy.mil # -# Last Update of leap second values: 11 Jan 2016 +# Last Update of leap second values: 6 Jul 2016 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -138,7 +138,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3661459200 +#$ 3676752000 # # The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line @@ -170,10 +170,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 51 -# File expires on: 1 Dec 2016 +# Updated through IERS Bulletin C 52 +# File expires on: 1 Jun 2017 # -#@ 3689539200 +#@ 3705264000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -202,6 +202,7 @@ 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 # # the following special comment contains the # hash value of the data in this file computed @@ -217,5 +218,5 @@ # the hash line is also ignored in the # computation. # -#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421 +#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 # ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r303120 - head/sys/kern
Thanks! On Wednesday, July 20, 2016 05:53:57 PM Conrad Meyer wrote: > Sure — r303122. > > Conrad > > On Wed, Jul 20, 2016 at 4:09 PM, John Baldwin wrote: > > On Wednesday, July 20, 2016 10:51:33 PM Conrad E. Meyer wrote: > >> Author: cem > >> Date: Wed Jul 20 22:51:33 2016 > >> New Revision: 303120 > >> URL: https://svnweb.freebsd.org/changeset/base/303120 > >> > >> Log: > >> imgact_elf: Rename the segment iterator to match reality > >> > >> The each_writable_segment routine evaluates segments on a slightly > >> little more > >> nuanced metric than simply "writable" or not. Rename the function to > >> more > >> closely match its behavior (each_dumpable_segment). > >> > >> Suggested by: jhb > >> Sponsored by: EMC / Isilon Storage Division > > > > Please do the same rename in gcore's elfcore.c as well. > > > > -- > > John Baldwin > -- John Baldwin ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
On Thursday, July 21, 2016 01:37:42 PM Andrew Turner wrote: > On Wed, 20 Jul 2016 13:28:53 +0200 > Michal Meloun wrote: > > Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a): > > > 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(), > > > but is both problematically more general and less flexible (it has > > > requirements on timing of PIC attachment vs. driver resource > > > allocation) > > OFW_BUS_MAP_INTR() can parse only OFW based data and expect that > > parsed data are magicaly stored within the call. > > The new method, bus_map_intr(), can parse data from multiple sources > > (OFW, UEFI / ACPI, synthetic[gpio device + pin number]). It also > > returns parsed data back to caller. > > And no, it doesn't add any additional timing requirements . > > I've been looking at ACPI on arm64. So far I have not found the need > for this with ACPI as we don't need to send the data to the interrupt > controller driver to be parsed in the way OFW/FDT needs to. ACPI though has a gross hack where we call BUS_CONFIG_INTR on the IRQ in bus_alloc_resource(). What I had advocated in the discussions leading up to this was to have some sort of opaque structure containing a set of properties (the sort of thing bus_map_resource and make_dev_s use) that was passed up at bus_setup_intr() time. I think it should now be passed up at bus_alloc_resource() time instead, but it would allow bus drivers to "decorate" a SYS_RES_IRQ request as it goes up the device tree with properties that the interrupt controller can then associate with the IRQ cookie it allocates in its own code. I would let the particular structure have different layouts for different resource types. On x86 we would replace bus_config_intr by passing the level and trigger-mode in this structure. However, I could also see allowing the memattr to be set for a SYS_RES_MEMORY resource so you could have a much shorter way than an explicit bus_map_resource to map an entire BAR as WC for example: struct alloc_resource_args { size_t len; union { struct { enum intr_trigger trigger; enum intr_polarity polarity; } irq; struct { vm_memattr_t memattr; } memory; } } ... union alloc_resource_args args; init_alloc_resource_args(&args, sizeof(args)); args.memattr = VM_MEMATTR_WRITE_COMBINING; /* Uses WC for the implicit mapping. */ res = bus_alloc_resource(, &args); ... foobus_alloc_resource(..., union alloc_resource_args *args) { union alloc_resource_args args2; switch (type) { case SYS_RES_IRQ: if (args == NULL) { init_alloc_resource_args(&args2, sizeof(args2)); args = &args2; } /* Replace call to BUS_CONFIG_INTR on ACPI: */ if (args->irq.polarity == INTR_POLARITY_CONFORMING && device_has_polarity_from_CRS) args->irq.polarity = polarity_from_CRS; ... } However, you could associate arbitrary data with a resource request by adding more members to the approriate struct in the union. -- John Baldwin ___ 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-unsubscr...@freebsd.org"
svn commit: r303164 - in head: lib/libc/sys share/man/man4 sys/kern
Author: jhb Date: Thu Jul 21 22:49:47 2016 New Revision: 303164 URL: https://svnweb.freebsd.org/changeset/base/303164 Log: Add more documentation regarding unsafe AIO requests. The asynchronous I/O changes made previously result in different behavior out of the box. Previously all AIO requests failed with ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO requests complete and others ("unsafe" requests) fail with EOPNOTSUPP. Reword the introductory paragraph in aio(4) to add a general description of AIO before describing the vfs.aio.enable_unsafe sysctl. Remove the ENOSYS error description from aio_fsync(2), aio_read(2), and aio_write(2) and replace it with a description of EOPNOTSUPP. Remove the ENOSYS error description from aio_mlock(2). Log a message to the system log the first time a process requests an "unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on the log message used for processes using the legacy pty devices. Reviewed by: kib (earlier version) MFC after:1 week Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D7151 Modified: head/lib/libc/sys/aio_fsync.2 head/lib/libc/sys/aio_mlock.2 head/lib/libc/sys/aio_read.2 head/lib/libc/sys/aio_write.2 head/share/man/man4/aio.4 head/sys/kern/vfs_aio.c Modified: head/lib/libc/sys/aio_fsync.2 == --- head/lib/libc/sys/aio_fsync.2 Thu Jul 21 22:13:40 2016 (r303163) +++ head/lib/libc/sys/aio_fsync.2 Thu Jul 21 22:49:47 2016 (r303164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -107,10 +107,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_fsync -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous file synchronization operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .It Bq Er EINVAL A value of the .Fa op Modified: head/lib/libc/sys/aio_mlock.2 == --- head/lib/libc/sys/aio_mlock.2 Thu Jul 21 22:13:40 2016 (r303163) +++ head/lib/libc/sys/aio_mlock.2 Thu Jul 21 22:49:47 2016 (r303164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -102,10 +102,6 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_mlock -system call is not supported. .El .Pp If the request is successfully enqueued, but subsequently cancelled Modified: head/lib/libc/sys/aio_read.2 == --- head/lib/libc/sys/aio_read.2Thu Jul 21 22:13:40 2016 (r303163) +++ head/lib/libc/sys/aio_read.2Thu Jul 21 22:49:47 2016 (r303164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -125,10 +125,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_read -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous read operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .El .Pp The following conditions may be synchronously detected when the Modified: head/lib/libc/sys/aio_write.2 == --- head/lib/libc/sys/aio_write.2 Thu Jul 21 22:13:40 2016 (r303163) +++ head/lib/libc/sys/aio_write.2 Thu Jul 21 22:49:47 2016 (r303164) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -129,10 +129,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_write -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous write operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .El .Pp The following conditions may be synchronously detected when the Modified: head/share/man/man4/aio.4 == --- head/share/man/man4/aio.4 Thu Jul 21 22:13:40 2016(r303163) +++ head/share/man/man4/aio.4 Thu Jul 21 22:49:47 2016(r303164) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$
svn commit: r303165 - head/sys/conf
Author: imp Date: Thu Jul 21 23:29:13 2016 New Revision: 303165 URL: https://svnweb.freebsd.org/changeset/base/303165 Log: Fix cam builds w/o nvme. This is a stop-gap fix until the real fix of dynamically loading XPTs is done and tested. MFC After: 1 week Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Thu Jul 21 22:49:47 2016(r303164) +++ head/sys/conf/files Thu Jul 21 23:29:13 2016(r303165) @@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.coptional scbus nvme +cam/nvme/nvme_all.coptional scbus cam/nvme/nvme_da.c optional scbus nvme da !nvd -cam/nvme/nvme_xpt.coptional scbus nvme +cam/nvme/nvme_xpt.coptional scbus cam/scsi/scsi_xpt.coptional scbus cam/scsi/scsi_all.coptional scbus cam/scsi/scsi_cd.c optional cd ___ 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-unsubscr...@freebsd.org"
svn commit: r303166 - head/sys/modules/cam
Author: imp Date: Thu Jul 21 23:29:16 2016 New Revision: 303166 URL: https://svnweb.freebsd.org/changeset/base/303166 Log: Add opt_ddb.h. MFC after: 1 week Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile == --- head/sys/modules/cam/Makefile Thu Jul 21 23:29:13 2016 (r303165) +++ head/sys/modules/cam/Makefile Thu Jul 21 23:29:16 2016 (r303166) @@ -14,6 +14,7 @@ SRCS+=opt_cd.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h +SRCS+= opt_ddb.h SRCS+= device_if.h bus_if.h vnode_if.h SRCS+= cam.c SRCS+= cam_compat.c ___ 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-unsubscr...@freebsd.org"
svn commit: r303171 - in head/sys: netinet netinet6
Author: karels Date: Fri Jul 22 02:11:49 2016 New Revision: 303171 URL: https://svnweb.freebsd.org/changeset/base/303171 Log: Fix per-connection L2 caching in fast path r301217 re-added per-connection L2 caching from a previous change, but it omitted caching in the fast path. Add it. Reviewed By: gallatin Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D7239 Modified: head/sys/netinet/if_ether.c head/sys/netinet6/nd6.c Modified: head/sys/netinet/if_ether.c == --- head/sys/netinet/if_ether.c Fri Jul 22 01:16:56 2016(r303170) +++ head/sys/netinet/if_ether.c Fri Jul 22 02:11:49 2016(r303171) @@ -607,7 +607,7 @@ arpresolve(struct ifnet *ifp, int is_gw, } IF_AFDATA_RLOCK(ifp); - la = lla_lookup(LLTABLE(ifp), LLE_UNLOCKED, dst); + la = lla_lookup(LLTABLE(ifp), plle ? LLE_EXCLUSIVE : LLE_UNLOCKED, dst); if (la != NULL && (la->r_flags & RLLE_VALID) != 0) { /* Entry found, let's copy lle info */ bcopy(la->r_linkdata, desten, la->r_hdrlen); @@ -619,9 +619,16 @@ arpresolve(struct ifnet *ifp, int is_gw, la->r_skip_req = 0; /* Notify that entry was used */ LLE_REQ_UNLOCK(la); } + if (plle) { + LLE_ADDREF(la); + *plle = la; + LLE_WUNLOCK(la); + } IF_AFDATA_RUNLOCK(ifp); return (0); } + if (plle && la) + LLE_WUNLOCK(la); IF_AFDATA_RUNLOCK(ifp); return (arpresolve_full(ifp, is_gw, la == NULL ? LLE_CREATE : 0, m, dst, Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Fri Jul 22 01:16:56 2016(r303170) +++ head/sys/netinet6/nd6.c Fri Jul 22 02:11:49 2016(r303171) @@ -,7 +,8 @@ nd6_resolve(struct ifnet *ifp, int is_gw } IF_AFDATA_RLOCK(ifp); - ln = nd6_lookup(&dst6->sin6_addr, LLE_UNLOCKED, ifp); + ln = nd6_lookup(&dst6->sin6_addr, plle ? LLE_EXCLUSIVE : LLE_UNLOCKED, + ifp); if (ln != NULL && (ln->r_flags & RLLE_VALID) != 0) { /* Entry found, let's copy lle info */ bcopy(ln->r_linkdata, desten, ln->r_hdrlen); @@ -2235,9 +2236,15 @@ nd6_resolve(struct ifnet *ifp, int is_gw ln->lle_hittime = time_uptime; LLE_REQ_UNLOCK(ln); } + if (plle) { + LLE_ADDREF(ln); + *plle = ln; + LLE_WUNLOCK(ln); + } IF_AFDATA_RUNLOCK(ifp); return (0); - } + } else if (plle && ln) + LLE_WUNLOCK(ln); IF_AFDATA_RUNLOCK(ifp); return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle)); ___ 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-unsubscr...@freebsd.org"
svn commit: r303178 - head/sys/dev/hyperv/vmbus
Author: sephe Date: Fri Jul 22 03:30:00 2016 New Revision: 303178 URL: https://svnweb.freebsd.org/changeset/base/303178 Log: hyperv/vmbus: Cosmetic bufring cleanup. MFC after:1 week Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D7267 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c == --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 03:26:01 2016 (r303177) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 03:30:00 2016 (r303178) @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include #include #include @@ -35,8 +34,14 @@ #include "hv_vmbus_priv.h" /* Amount of space to write to */ -#defineHV_BYTES_AVAIL_TO_WRITE(r, w, z) ((w) >= (r))? \ - ((z) - ((w) - (r))):((r) - (w)) +#defineHV_BYTES_AVAIL_TO_WRITE(r, w, z)\ + ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w)) + +static uint32_tcopy_to_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, + uint32_t start_write_offset, const uint8_t *src, + uint32_t src_len); +static uint32_t copy_from_ring_buffer(hv_vmbus_ring_buffer_info *ring_info, + char *dest, uint32_t dest_len, uint32_t start_read_offset); static int hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS) @@ -54,40 +59,30 @@ hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS) write_avail = HV_BYTES_AVAIL_TO_WRITE(read_index, write_index, sz); read_avail = sz - write_avail; - snprintf(rbi_stats, sizeof(rbi_stats), - "r_idx:%d " - "w_idx:%d " - "int_mask:%d " - "r_avail:%d " - "w_avail:%d", - read_index, write_index, interrupt_mask, - read_avail, write_avail); - return (sysctl_handle_string(oidp, rbi_stats, - sizeof(rbi_stats), req)); + snprintf(rbi_stats, sizeof(rbi_stats), + "r_idx:%d w_idx:%d int_mask:%d r_avail:%d w_avail:%d", + read_index, write_index, interrupt_mask, read_avail, write_avail); + return sysctl_handle_string(oidp, rbi_stats, sizeof(rbi_stats), req); } void -hv_ring_buffer_stat( - struct sysctl_ctx_list *ctx, - struct sysctl_oid_list *tree_node, - hv_vmbus_ring_buffer_info *rbi, - const char *desc) +hv_ring_buffer_stat(struct sysctl_ctx_list *ctx, +struct sysctl_oid_list *tree_node, hv_vmbus_ring_buffer_info *rbi, +const char *desc) { SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO, - "ring_buffer_stats", - CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, rbi, 0, - hv_rbi_sysctl_stats, "A", desc); + "ring_buffer_stats", CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, + rbi, 0, hv_rbi_sysctl_stats, "A", desc); } + /** * @brief Get number of bytes available to read and to write to * for the specified ring buffer */ -static inline void -get_ring_buffer_avail_bytes( - hv_vmbus_ring_buffer_info* rbi, - uint32_t* read, - uint32_t* write) +static __inline void +get_ring_buffer_avail_bytes(hv_vmbus_ring_buffer_info *rbi, uint32_t *read, +uint32_t *write) { uint32_t read_loc, write_loc; @@ -97,28 +92,26 @@ get_ring_buffer_avail_bytes( read_loc = rbi->ring_buffer->read_index; write_loc = rbi->ring_buffer->write_index; - *write = HV_BYTES_AVAIL_TO_WRITE( - read_loc, write_loc, rbi->ring_data_size); + *write = HV_BYTES_AVAIL_TO_WRITE(read_loc, write_loc, + rbi->ring_data_size); *read = rbi->ring_data_size - *write; } /** * @brief Get the next write location for the specified ring buffer */ -static inline uint32_t -get_next_write_location(hv_vmbus_ring_buffer_info* ring_info) +static __inline uint32_t +get_next_write_location(hv_vmbus_ring_buffer_info *ring_info) { - uint32_t next = ring_info->ring_buffer->write_index; - return (next); + return ring_info->ring_buffer->write_index; } /** * @brief Set the next write location for the specified ring buffer */ -static inline void -set_next_write_location( - hv_vmbus_ring_buffer_info* ring_info, - uint32_tnext_write_location) +static __inline void +set_next_write_location(hv_vmbus_ring_buffer_info *ring_info, +uint32_t next_write_location) { ring_info->ring_buffer->write_index = next_write_location; } @@ -126,23 +119,22 @@ set_next_write_location( /** * @brief Get the next read location for the specified ring buffer */ -static inline uint32_t -get_next_read_location(hv_vmbus_ring_buffer_info* ring_info) +sta
svn commit: r303180 - head/sys/dev/hyperv/vmbus
Author: sephe Date: Fri Jul 22 03:42:32 2016 New Revision: 303180 URL: https://svnweb.freebsd.org/changeset/base/303180 Log: hyperv/vmbus: Cleanup and augment bufring sysctl tree creation Binary state node is added, so that userland programs do not have to parse human readable state string. MFC after:1 week Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D7268 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c == --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 03:34:15 2016 (r303179) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 03:42:32 2016 (r303180) @@ -44,36 +44,74 @@ static uint32_t copy_from_ring_buffer(hv char *dest, uint32_t dest_len, uint32_t start_read_offset); static int -hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS) +vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) { - hv_vmbus_ring_buffer_info* rbi; - uint32_t read_index, write_index, interrupt_mask, sz; - uint32_t read_avail, write_avail; - char rbi_stats[256]; - - rbi = (hv_vmbus_ring_buffer_info*)arg1; - read_index = rbi->ring_buffer->read_index; - write_index = rbi->ring_buffer->write_index; - interrupt_mask = rbi->ring_buffer->interrupt_mask; - sz = rbi->ring_data_size; - write_avail = HV_BYTES_AVAIL_TO_WRITE(read_index, - write_index, sz); - read_avail = sz - write_avail; - - snprintf(rbi_stats, sizeof(rbi_stats), - "r_idx:%d w_idx:%d int_mask:%d r_avail:%d w_avail:%d", - read_index, write_index, interrupt_mask, read_avail, write_avail); - return sysctl_handle_string(oidp, rbi_stats, sizeof(rbi_stats), req); + const hv_vmbus_ring_buffer_info *br = arg1; + uint32_t rindex, windex, intr_mask, ravail, wavail; + char state[256]; + + rindex = br->ring_buffer->read_index; + windex = br->ring_buffer->write_index; + intr_mask = br->ring_buffer->interrupt_mask; + wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); + ravail = br->ring_data_size - wavail; + + snprintf(state, sizeof(state), + "rindex:%u windex:%u intr_mask:%u ravail:%u wavail:%u", + rindex, windex, intr_mask, ravail, wavail); + return sysctl_handle_string(oidp, state, sizeof(state), req); +} + +/* + * Binary bufring states. + */ +static int +vmbus_br_sysctl_state_bin(SYSCTL_HANDLER_ARGS) +{ +#define BR_STATE_RIDX 0 +#define BR_STATE_WIDX 1 +#define BR_STATE_IMSK 2 +#define BR_STATE_RSPC 3 +#define BR_STATE_WSPC 4 +#define BR_STATE_MAX 5 + + const hv_vmbus_ring_buffer_info *br = arg1; + uint32_t rindex, windex, wavail, state[BR_STATE_MAX]; + + rindex = br->ring_buffer->read_index; + windex = br->ring_buffer->write_index; + wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); + + state[BR_STATE_RIDX] = rindex; + state[BR_STATE_WIDX] = windex; + state[BR_STATE_IMSK] = br->ring_buffer->interrupt_mask; + state[BR_STATE_WSPC] = wavail; + state[BR_STATE_RSPC] = br->ring_data_size - wavail; + + return sysctl_handle_opaque(oidp, state, sizeof(state), req); } void -hv_ring_buffer_stat(struct sysctl_ctx_list *ctx, -struct sysctl_oid_list *tree_node, hv_vmbus_ring_buffer_info *rbi, -const char *desc) -{ - SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO, - "ring_buffer_stats", CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, - rbi, 0, hv_rbi_sysctl_stats, "A", desc); +vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, struct sysctl_oid *br_tree, +hv_vmbus_ring_buffer_info *br, const char *name) +{ + struct sysctl_oid *tree; + char desc[64]; + + tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(br_tree), OID_AUTO, + name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); + if (tree == NULL) + return; + + snprintf(desc, sizeof(desc), "%s state", name); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + br, 0, vmbus_br_sysctl_state, "A", desc); + + snprintf(desc, sizeof(desc), "%s binary state", name); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state_bin", + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + br, 0, vmbus_br_sysctl_state_bin, "IU", desc); } /** Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h == --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri Jul 22 03:34:15 2016 (r303179) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Fri Jul 22 03:42:32 2016 (r303180) @@
Re: svn commit: r303146 - head/usr.bin/sed
On Thu, Jul 21, 2016 at 02:17:36PM +, Pedro F. Giffuni wrote: > New Revision: 303146 > URL: https://svnweb.freebsd.org/changeset/base/303146 > > Log: > sed(1): Appease older GCC. Isn't it also being dictated by style(9) and common sense? :) ./danfe > Modified: > head/usr.bin/sed/process.c > > @@ -97,11 +97,12 @@ process(void) > { > struct s_command *cp; > SPACE tspace; > - size_t oldpsl = 0; > + size_t oldpsl; > char *p; > int oldpsanl; > > p = NULL; > + oldpsanl = oldpsl = 0; ___ 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-unsubscr...@freebsd.org"
svn commit: r303182 - head/sys/dev/hyperv/vmbus
Author: sephe Date: Fri Jul 22 05:09:08 2016 New Revision: 303182 URL: https://svnweb.freebsd.org/changeset/base/303182 Log: hyperv/vmbus: Move vmbus bufring definition to vmbus_reg.h And add more comment about its fields. MFC after:1 week Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D7269 Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c == --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 03:48:44 2016 (r303181) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Fri Jul 22 05:09:08 2016 (r303182) @@ -32,6 +32,7 @@ #include #include "hv_vmbus_priv.h" +#include /* Amount of space to write to */ #defineHV_BYTES_AVAIL_TO_WRITE(r, w, z)\ @@ -50,9 +51,9 @@ vmbus_br_sysctl_state(SYSCTL_HANDLER_ARG uint32_t rindex, windex, intr_mask, ravail, wavail; char state[256]; - rindex = br->ring_buffer->read_index; - windex = br->ring_buffer->write_index; - intr_mask = br->ring_buffer->interrupt_mask; + rindex = br->ring_buffer->br_rindex; + windex = br->ring_buffer->br_windex; + intr_mask = br->ring_buffer->br_imask; wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); ravail = br->ring_data_size - wavail; @@ -78,13 +79,13 @@ vmbus_br_sysctl_state_bin(SYSCTL_HANDLER const hv_vmbus_ring_buffer_info *br = arg1; uint32_t rindex, windex, wavail, state[BR_STATE_MAX]; - rindex = br->ring_buffer->read_index; - windex = br->ring_buffer->write_index; + rindex = br->ring_buffer->br_rindex; + windex = br->ring_buffer->br_windex; wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size); state[BR_STATE_RIDX] = rindex; state[BR_STATE_WIDX] = windex; - state[BR_STATE_IMSK] = br->ring_buffer->interrupt_mask; + state[BR_STATE_IMSK] = br->ring_buffer->br_imask; state[BR_STATE_WSPC] = wavail; state[BR_STATE_RSPC] = br->ring_data_size - wavail; @@ -127,8 +128,8 @@ get_ring_buffer_avail_bytes(hv_vmbus_rin /* * Capture the read/write indices before they changed */ - read_loc = rbi->ring_buffer->read_index; - write_loc = rbi->ring_buffer->write_index; + read_loc = rbi->ring_buffer->br_rindex; + write_loc = rbi->ring_buffer->br_windex; *write = HV_BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->ring_data_size); @@ -141,7 +142,7 @@ get_ring_buffer_avail_bytes(hv_vmbus_rin static __inline uint32_t get_next_write_location(hv_vmbus_ring_buffer_info *ring_info) { - return ring_info->ring_buffer->write_index; + return ring_info->ring_buffer->br_windex; } /** @@ -151,7 +152,7 @@ static __inline void set_next_write_location(hv_vmbus_ring_buffer_info *ring_info, uint32_t next_write_location) { - ring_info->ring_buffer->write_index = next_write_location; + ring_info->ring_buffer->br_windex = next_write_location; } /** @@ -160,7 +161,7 @@ set_next_write_location(hv_vmbus_ring_bu static __inline uint32_t get_next_read_location(hv_vmbus_ring_buffer_info *ring_info) { - return ring_info->ring_buffer->read_index; + return ring_info->ring_buffer->br_rindex; } /** @@ -171,7 +172,7 @@ static __inline uint32_t get_next_read_location_with_offset(hv_vmbus_ring_buffer_info *ring_info, uint32_t offset) { - uint32_t next = ring_info->ring_buffer->read_index; + uint32_t next = ring_info->ring_buffer->br_rindex; next += offset; next %= ring_info->ring_data_size; @@ -185,7 +186,7 @@ static __inline void set_next_read_location(hv_vmbus_ring_buffer_info *ring_info, uint32_t next_read_location) { - ring_info->ring_buffer->read_index = next_read_location; + ring_info->ring_buffer->br_rindex = next_read_location; } /** @@ -194,7 +195,7 @@ set_next_read_location(hv_vmbus_ring_buf static __inline void * get_ring_buffer(hv_vmbus_ring_buffer_info *ring_info) { - return ring_info->ring_buffer->buffer; + return ring_info->ring_buffer->br_data; } /** @@ -212,13 +213,13 @@ get_ring_buffer_size(hv_vmbus_ring_buffe static __inline uint64_t get_ring_buffer_indices(hv_vmbus_ring_buffer_info *ring_info) { - return ((uint64_t)ring_info->ring_buffer->write_index) << 32; + return ((uint64_t)ring_info->ring_buffer->br_windex) << 32; } void hv_ring_buffer_read_begin(hv_vmbus_ring_buffer_info *ring_info) { - ring_info->ring_buffer->interrupt_mask = 1; + ring_info->ring_buffer->br_imask = 1; mb(); } @@ -227,7 +228,7 @@ hv_ring_buffer_read_end(hv_vmbus_ring_bu { uint32_t read, write; - ring_info->ring_buffer->
Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys
On 07/21/16 14:35, John Baldwin wrote: On Thursday, July 21, 2016 01:37:42 PM Andrew Turner wrote: On Wed, 20 Jul 2016 13:28:53 +0200 Michal Meloun wrote: Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a): 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(), but is both problematically more general and less flexible (it has requirements on timing of PIC attachment vs. driver resource allocation) OFW_BUS_MAP_INTR() can parse only OFW based data and expect that parsed data are magicaly stored within the call. The new method, bus_map_intr(), can parse data from multiple sources (OFW, UEFI / ACPI, synthetic[gpio device + pin number]). It also returns parsed data back to caller. And no, it doesn't add any additional timing requirements . I've been looking at ACPI on arm64. So far I have not found the need for this with ACPI as we don't need to send the data to the interrupt controller driver to be parsed in the way OFW/FDT needs to. ACPI though has a gross hack where we call BUS_CONFIG_INTR on the IRQ in bus_alloc_resource(). I hadn't realized that. It looks like you could do essentially the same thing we do on PowerPC to clean this up by explicitly mapping the ACPI interrupt domains to different PICs with varying default interrupt properties. What I had advocated in the discussions leading up to this was to have some sort of opaque structure containing a set of properties (the sort of thing bus_map_resource and make_dev_s use) that was passed up at bus_setup_intr() time. I think it should now be passed up at bus_alloc_resource() time instead, but it would allow bus drivers to "decorate" a SYS_RES_IRQ request as it goes up the device tree with properties that the interrupt controller can then associate with the IRQ cookie it allocates in its own code. We used to do this on PPC and MIPS, and the current code still supports it, but it turned out not to be useful in the end for IRQs. The hierarchy for IRQs rarely (read: almost never) follows the bus hierarchy and often is enumerated in a different order. I have hardware, for example, where the children of a single parent bus are all wired to different interrupt controllers and sometimes to a mixture of interrupt controllers. Those controllers are cascaded in ways that cross the newbus tree laterally and, on some of them, the parent device from the bus topology has interrupts handled by its own (bus) children. Trying to make the newbus parents do something sensible with all of this would be crazy and, in the case where parents depend on resources provided by their own children, impossible. This is all to say that, since you want the interrupts to be decorated along a path that usually has nothing to do with the newbus hierarchy, it doesn't add much to add extra features to resource allocation. ofw_bus_map_intr() is a newbus method to support this kind of thing but, on all supported platforms, it is implemented only in nexus and no cases have appeared where anyone ever wanted anything at the intermediate layers. I would let the particular structure have different layouts for different resource types. On x86 we would replace bus_config_intr by passing the level and trigger-mode in this structure. However, I could also see allowing the memattr to be set for a SYS_RES_MEMORY resource so you could have a much shorter way than an explicit bus_map_resource to map an entire BAR as WC for example: struct alloc_resource_args { size_t len; union { struct { enum intr_trigger trigger; enum intr_polarity polarity; } irq; struct { vm_memattr_t memattr; } memory; } } ... union alloc_resource_args args; init_alloc_resource_args(&args, sizeof(args)); args.memattr = VM_MEMATTR_WRITE_COMBINING; /* Uses WC for the implicit mapping. */ res = bus_alloc_resource(, &args); ... foobus_alloc_resource(..., union alloc_resource_args *args) { union alloc_resource_args args2; switch (type) { case SYS_RES_IRQ: if (args == NULL) { init_alloc_resource_args(&args2, sizeof(args2)); args = &args2; } /* Replace call to BUS_CONFIG_INTR on ACPI: */ if (args->irq.polarity == INTR_POLARITY_CONFORMING && device_has_polarity_from_CRS) args->irq.polarity = polarity_from_CRS; ... } However, you could associate arbitrary data with a resource request by adding more members to the approriate struct in the union. For memory, I think this is an interesting concept, but it really doesn't match well with what you would want to do for interrupts or for, say, GPIOs in which the lines of control are fundamentally unrelated to the newbus hierarchy. -Nathan ___ svn-src-head@freebs
svn commit: r303183 - head/sys/modules/cam
Author: kib Date: Fri Jul 22 06:21:03 2016 New Revision: 303183 URL: https://svnweb.freebsd.org/changeset/base/303183 Log: Make cam.ko loadable. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile == --- head/sys/modules/cam/Makefile Fri Jul 22 05:09:08 2016 (r303182) +++ head/sys/modules/cam/Makefile Fri Jul 22 06:21:03 2016 (r303183) @@ -2,7 +2,7 @@ S= ${.CURDIR}/../.. -.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/${MACHINE}/${MACHINE} +.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/cam/nvme $S/${MACHINE}/${MACHINE} KMOD= cam @@ -41,6 +41,8 @@ SRCS+=ata_da.c SRCS+= ata_machdep.c .endif SRCS+= ata_pmp.c +SRCS+= nvme_all.c +SRCS+= nvme_xpt.c EXPORT_SYMS= YES # XXX evaluate ___ 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-unsubscr...@freebsd.org"