Re: svn commit: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On Tue, Feb 19, 2019 at 06:43:28PM -0500, Shawn Webb wrote: > At the risk of painting a bikeshed a lovely color of neon purple, I'm > curious about if/how these types of commits get merged upstream to > (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very > confused|is anyone else confused where upstream is?). > > Who is upstream? Is work like this going to remain as a downstream > patch to ZFS? Or is FreeBSD going to work to upstream this type of > work? I've always felt that we should've become upstream to everyone else the moment we knew Oracle would eat Sun (20 April 2009), and never understood why it didn't happen and now, ten years later, we're talking about ZFS on fucking Linux becoming our upstream. Something'd got very wrong here and I'd like to know what and why. > I hope my curiousity doesn't offend anyone. ;) Not at all, I'm also confused and curious. ./danfe ___ 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: r344343 - head/sys/arm/allwinner
Author: ganbold Date: Wed Feb 20 07:10:38 2019 New Revision: 344343 URL: https://svnweb.freebsd.org/changeset/base/344343 Log: Clarify notifications when battery capacity ratio reaches warning and shutdown thresholds. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c == --- head/sys/arm/allwinner/axp81x.c Wed Feb 20 06:54:32 2019 (r344342) +++ head/sys/arm/allwinner/axp81x.c Wed Feb 20 07:10:38 2019 (r344343) @@ -1088,9 +1088,9 @@ axp8xx_intr(void *arg) if (bootverbose) device_printf(dev, "AXP_IRQSTAT4 val: %x\n", val); if (val & AXP_IRQSTAT4_BATLVL_LO0) - devctl_notify("PMU", "Battery", "lower than level 2", NULL); + devctl_notify("PMU", "Battery", "shutdown threshold", NULL); if (val & AXP_IRQSTAT4_BATLVL_LO1) - devctl_notify("PMU", "Battery", "lower than level 1", NULL); + devctl_notify("PMU", "Battery", "warning threshold", NULL); /* Acknowledge */ axp8xx_write(dev, AXP_IRQSTAT4, val); } ___ 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: r344340 - head/usr.bin/calendar
Author: bapt Date: Wed Feb 20 06:40:52 2019 New Revision: 344340 URL: https://svnweb.freebsd.org/changeset/base/344340 Log: calendar: use iconv to respect the output encoding calendar(1) can have input in various encoding, specifying LANG= to enable calendar(1) to determine which one to use. The problem is the content of the calendar itself is exposed as is making it unreadable in many cases. For example french calendar which is encoded ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment. Using iconv allows to solve this issue. This will also allow to keep only 1 encoding in base for those files without breaking user existing setup Reported by: many MFC after:1 month Differential Revision:https://reviews.freebsd.org/D19221 Modified: head/usr.bin/calendar/Makefile head/usr.bin/calendar/calendar.c head/usr.bin/calendar/calendar.h head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/Makefile == --- head/usr.bin/calendar/Makefile Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/Makefile Wed Feb 20 06:40:52 2019 (r344340) @@ -13,6 +13,10 @@ INTER= de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_F DE_LINKS= de_DE.ISO8859-15 FR_LINKS= fr_FR.ISO8859-15 +.if ${MK_ICONV} == "yes" +CFLAGS+= -DWITH_ICONV +.endif + FILESGROUPS+= CALS CALS= calendars/calendar.all \ calendars/calendar.australia \ Modified: head/usr.bin/calendar/calendar.c == --- head/usr.bin/calendar/calendar.cWed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.cWed Feb 20 06:40:52 2019 (r344340) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -66,6 +67,9 @@ static char *DEBUG = NULL; static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; intEastLongitude = LONGITUDE_NOTSET; +#ifdef WITH_ICONV +const char *outputEncoding; +#endif static voidusage(void) __dead2; @@ -80,6 +84,12 @@ main(int argc, char *argv[]) struct tm tp1, tp2; (void)setlocale(LC_ALL, ""); +#ifdef WITH_ICONV + /* save the information about the encoding used in the terminal */ + outputEncoding = strdup(nl_langinfo(CODESET)); + if (outputEncoding == NULL) + errx(1, "cannot allocate memory"); +#endif while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1) switch (ch) { Modified: head/usr.bin/calendar/calendar.h == --- head/usr.bin/calendar/calendar.hWed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/calendar.hWed Feb 20 06:40:52 2019 (r344340) @@ -59,6 +59,9 @@ extern struct fixs neaster, npaskha, ncny, nfullmoon, extern struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; extern double UTCOffset; extern int EastLongitude; +#ifdef WITH_ICONV +extern const char *outputEncoding; +#endif #define isleap(y) y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) @@ -197,3 +200,7 @@ voidfpom(int year, double utcoffset, double *ffms, do void equinoxsolstice(int year, double UTCoffset, int *equinoxdays, int *solsticedays); void fequinoxsolstice(int year, double UTCoffset, double *equinoxdays, double *solsticedays); intcalculatesunlongitude30(int year, int degreeGMToffset, int *ichinesemonths); + +#ifdef WITH_ICONV +void set_new_encoding(void); +#endif Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Wed Feb 20 06:03:21 2019 (r344339) +++ head/usr.bin/calendar/events.c Wed Feb 20 06:40:52 2019 (r344340) @@ -35,10 +35,120 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV +#include +#include +#include +static iconv_t conv = (iconv_t)-1; +static char *currentEncoding = NULL; + +#endif + #include "pathnames.h" #include "calendar.h" +#ifdef WITH_ICONV +void +set_new_encoding(void) +{ + const char *newenc; + + newenc = nl_langinfo(CODESET); + if (currentEncoding == NULL) { + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + return; + } + if (strcmp(currentEncoding, newenc) == 0) + return; + free(currentEncoding); + currentEncoding = strdup(newenc); + if (currentEncoding == NULL) + errx(1, "set_new_encoding: cannot allocate memory"); + if (conv != (iconv_t) -1) { + iconv_close(conv); +
svn commit: r344337 - head/usr.sbin/efivar
Author: bcran Date: Wed Feb 20 05:19:16 2019 New Revision: 344337 URL: https://svnweb.freebsd.org/changeset/base/344337 Log: Add the unix path to the output of `efivar --load-option` Reviewed by: imp Sponsored by: Netflix Differential Revision:https://reviews.freebsd.org/D19242 Modified: head/usr.sbin/efivar/efiutil.c Modified: head/usr.sbin/efivar/efiutil.c == --- head/usr.sbin/efivar/efiutil.c Wed Feb 20 03:07:11 2019 (r344336) +++ head/usr.sbin/efivar/efiutil.c Wed Feb 20 05:19:16 2019 (r344337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2019 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -120,6 +120,7 @@ bindump(uint8_t *data, size_t datalen) void efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) { + char *dev, *relpath, *abspath; uint8_t *ep = data + datalen; uint8_t *walker = data; uint32_t attr; @@ -131,6 +132,7 @@ efi_print_load_option(uint8_t *data, size_t datalen, i int len; void *opt; int optlen; + int rv; if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) return; @@ -162,8 +164,15 @@ efi_print_load_option(uint8_t *data, size_t datalen, i free(str); while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); + rv = efivar_device_path_to_unix_path(dp, , , ); dp = (efidp)((char *)dp + efidp_size(dp)); printf(" %s\n", buf); + if (rv == 0) { + printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); + free(dev); + free(relpath); + free(abspath); + } } if (optlen == 0) return; ___ 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: r344335 - head/stand/uboot/common
Author: ian Date: Wed Feb 20 03:00:55 2019 New Revision: 344335 URL: https://svnweb.freebsd.org/changeset/base/344335 Log: Fix the handling of legacy-format devices in the u-boot loaderdev variable. When I added support for the standard loader(8) disk0s2a: type formats, the parsing of legacy format was broken because it also contains a colon, but it comes before the slice and partition. That would cause disk_parsedev() to return success with the slice and partition set to wildcard values. This change examines the string first, and if it contains spaces, dots, or a colon at any position other than the end, it must be a legacy-format string and we don't even try to use disk_parsedev() on it. Reported by: Manuel Stuhn Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c == --- head/stand/uboot/common/main.c Wed Feb 20 02:49:26 2019 (r344334) +++ head/stand/uboot/common/main.c Wed Feb 20 03:00:55 2019 (r344335) @@ -226,16 +226,23 @@ get_load_device(int *type, int *unit, int *slice, int p = get_device_type(devstr, type); /* -* If type is DEV_TYP_STOR we have a disk-like device. If we can parse -* the remainder of the string as a standard unit+slice+partition (e.g., -* 0s2a or 1p12), return those results. Otherwise we'll fall through to -* the code that parses the legacy format. +* If type is DEV_TYP_STOR we have a disk-like device. If the remainder +* of the string contains spaces, dots, or a colon in any location other +* than the last char, it's legacy format. Otherwise it might be +* standard loader(8) format (e.g., disk0s2a or mmc1p12), so try to +* parse the remainder of the string as such, and if it works, return +* those results. Otherwise we'll fall through to the code that parses +* the legacy format. */ - if ((*type & DEV_TYP_STOR) && disk_parsedev(, p, NULL) == 0) { - *unit = dev.dd.d_unit; - *slice = dev.d_slice; - *partition = dev.d_partition; - return; + if (*type & DEV_TYP_STOR) { + size_t len = strlen(p); + if (strcspn(p, " .") == len && strcspn(p, ":") >= len - 1 && + disk_parsedev(, p, NULL) == 0) { + *unit = dev.dd.d_unit; + *slice = dev.d_slice; + *partition = dev.d_partition; + return; + } } /* Ignore optional spaces after the device name. */ ___ 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: r344334 - head/sys/fs/fuse
Author: cem Date: Wed Feb 20 02:49:26 2019 New Revision: 344334 URL: https://svnweb.freebsd.org/changeset/base/344334 Log: Fuse: whitespace and style(9) cleanup Take a pass through fixing some of the most egregious whitespace issues in fs/fuse. Also fix some style(9) warts while here. Not 100% cleaned up, but somewhat less painful to look at and edit. No functional change. Modified: head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse.h == --- head/sys/fs/fuse/fuse.h Wed Feb 20 02:48:59 2019(r344333) +++ head/sys/fs/fuse/fuse.h Wed Feb 20 02:49:26 2019(r344334) @@ -197,26 +197,27 @@ do { \ #define FUSE_TRACE 0 #endif -#define DEBUGX(cond, fmt, ...) do { \ -if (((cond))) { \ -printf("%s: " fmt, __func__, ## __VA_ARGS__); \ -} } while (0) +#define DEBUGX(cond, fmt, ...) do {\ + if (((cond))) { \ + printf("%s: " fmt, __func__, ## __VA_ARGS__); \ + } \ +} while (0) -#define fuse_lck_mtx_lock(mtx) do { \ -DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ -__STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -mtx_lock(&(mtx)); \ -DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ -__STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -} while (0) +#define fuse_lck_mtx_lock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_lock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) -#define fuse_lck_mtx_unlock(mtx) do { \ -DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ -__STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -mtx_unlock(&(mtx)); \ -DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ -__STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -} while (0) +#define fuse_lck_mtx_unlock(mtx) do { \ + DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ + mtx_unlock(&(mtx)); \ + DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ + __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ +} while (0) void fuse_ipc_init(void); void fuse_ipc_destroy(void); Modified: head/sys/fs/fuse/fuse_device.c == --- head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_device.c Wed Feb 20 02:49:26 2019 (r344334) @@ -317,7 +317,7 @@ again: return (err); } -static __inline int +static inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", Modified: head/sys/fs/fuse/fuse_file.c == --- head/sys/fs/fuse/fuse_file.cWed Feb 20 02:48:59 2019 (r344333) +++ head/sys/fs/fuse/fuse_file.cWed Feb 20 02:49:26 2019 (r344334) @@ -91,11 +91,8 @@ SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLF _fh_count, 0, "number of open FUSE filehandles"); int -fuse_filehandle_open(struct vnode *vp, -fufh_type_t fufh_type, -struct fuse_filehandle **fufhp, -struct thread *td, -struct ucred *cred) +fuse_filehandle_open(struct vnode *vp, fufh_type_t fufh_type, +struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct fuse_dispatcher fdi; struct fuse_open_in *foi; @@ -114,8 +111,8
svn commit: r344333 - head/sys/fs/fuse
Author: cem Date: Wed Feb 20 02:48:59 2019 New Revision: 344333 URL: https://svnweb.freebsd.org/changeset/base/344333 Log: fuse: add descriptions for remaining sysctls (Except reclaim revoked; I don't know what that goal of that one is.) Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c == --- head/sys/fs/fuse/fuse_file.cWed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_file.cWed Feb 20 02:48:59 2019 (r344333) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int fuse_fh_count = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, filehandle_count, CTLFLAG_RD, -_fh_count, 0, ""); +_fh_count, 0, "number of open FUSE filehandles"); int fuse_filehandle_open(struct vnode *vp, Modified: head/sys/fs/fuse/fuse_vnops.c == --- head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:40:38 2019 (r344332) +++ head/sys/fs/fuse/fuse_vnops.c Wed Feb 20 02:48:59 2019 (r344333) @@ -180,17 +180,17 @@ struct vop_vector fuse_vnops = { static u_long fuse_lookup_cache_hits = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_hits, CTLFLAG_RD, -_lookup_cache_hits, 0, ""); +_lookup_cache_hits, 0, "number of positive cache hits in lookup"); static u_long fuse_lookup_cache_misses = 0; SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD, -_lookup_cache_misses, 0, ""); +_lookup_cache_misses, 0, "number of cache misses in lookup"); intfuse_lookup_cache_enable = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, lookup_cache_enable, CTLFLAG_RW, -_lookup_cache_enable, 0, ""); +_lookup_cache_enable, 0, "if non-zero, enable lookup cache"); /* * XXX: This feature is highly experimental and can bring to instabilities, ___ 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: r344332 - head/sys/x86/x86
Author: bde Date: Wed Feb 20 02:40:38 2019 New Revision: 344332 URL: https://svnweb.freebsd.org/changeset/base/344332 Log: Fix hangs in r341810 waiting for AP startup. idle_td is dereferenced without thread-locking it to make its contents is invariant, and was accessed without telling the compiler that its contents is invariant. Some compilers optimized accesses to the supposedly invariant contents by moving the critical checks for changes outside of the loop that waits for changes. Fix this using atomic ops. This bug only showed up for the following configuration: a Turion2 system, amd64 kernels, compiled by gcc, and SCHED_4BSD. clang fails to do the optimization with all CFLAGS that I tried, because it doesn't fully optimize the '__asm __volatile' for cpu_spinwait() although this asm has no memory clobber. gcc only does the optimization with most CFLAGS. I mostly used -Os with all compilers. i386 works because gcc -m32 -Os only moves 1 or the 2 accesses outside of the loop. Non-Turion2 systems and SCHED_ULE worked due to different timing (when all APs start before the BP checks them outside of the loop). Reviewed by: kib Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c == --- head/sys/x86/x86/mp_x86.c Wed Feb 20 02:14:41 2019(r344331) +++ head/sys/x86/x86/mp_x86.c Wed Feb 20 02:40:38 2019(r344332) @@ -1088,8 +1088,8 @@ smp_after_idle_runnable(void *arg __unused) for (cpu = 1; cpu < mp_ncpus; cpu++) { idle_td = pcpu_find(cpu)->pc_idlethread; - while (idle_td->td_lastcpu == NOCPU && - idle_td->td_oncpu == NOCPU) + while (atomic_load_int(_td->td_lastcpu) == NOCPU && + atomic_load_int(_td->td_oncpu) == NOCPU) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); ___ 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: r344331 - head/sys/teken
Author: bde Date: Wed Feb 20 02:14:41 2019 New Revision: 344331 URL: https://svnweb.freebsd.org/changeset/base/344331 Log: Attempt to complete fixing programmable function keys for syscons. The flag for the driver capability of supporting the fix is independent of the flag for cons25 mode so that it can be managed independently, but I forget to preserve it when resetting the terminal. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h == --- head/sys/teken/teken_subr.h Wed Feb 20 01:12:59 2019(r344330) +++ head/sys/teken/teken_subr.h Wed Feb 20 02:14:41 2019(r344331) @@ -1000,7 +1000,7 @@ teken_subr_do_reset(teken_t *t) t->t_scrollreg.ts_begin = 0; t->t_scrollreg.ts_end = t->t_winsize.tp_row; t->t_originreg = t->t_scrollreg; - t->t_stateflags &= TS_8BIT|TS_CONS25; + t->t_stateflags &= TS_8BIT | TS_CONS25 | TS_CONS25KEYS; t->t_stateflags |= TS_AUTOWRAP; t->t_scs[0] = teken_scs_us_ascii; ___ 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: r344292 - head/sys/dev/acpica
On Tue, 19 Feb 2019, Tom Jones wrote: Log: Fix style after r340832 Reported by: jhb Reviewed by: jhb, jtl Approved by: jtl (mentor) Unfortunately, acpi (even the FreeBSD dev/acpica part) has a very non-KNF style. It is unclear even what this style is, so it is hard to write changes consistent with it. But it is clear that this style isn't the one one used in the line after the one touched by this commit. Modified: head/sys/dev/acpica/acpi_battery.c == --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * Be sure we can get various info from the battery. */ if (ACPI_BATT_GET_STATUS(batt_dev, [i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) continue; /* If a battery is not installed, we sometimes get strange values. */ acpica uses 4-column indents, especially in this file, so the 'continue' line is clearly misindented here. acpica's indentation for continued lines is unclear. The KNF 4-column continuation indent works very badly when the main indent is also 4-column. But it is used in similar code (including a 'continue' just 5 lines after here). So it is consistently bad here. Elsewhere, acpica seems to use gnu style (-lp). Here and 5 lines later, that accidentally gives the 4-column indent by lining up with the parentheses of 'if (', A quick look at some other files shows many examples of gnu style (-lp) for long function parameter lists, and many similar regressions towards KNF style. Bruce ___ 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: r344325 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Wed Feb 20 00:25:45 2019 New Revision: 344325 URL: https://svnweb.freebsd.org/changeset/base/344325 Log: Simplify the code. No functional changes. Reviewed by: rpokala Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cWed Feb 20 00:19:11 2019(r344324) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cWed Feb 20 00:25:45 2019(r344325) @@ -568,10 +568,7 @@ vdev_raidz_map_alloc(abd_t *abd, uint64_t size, uint64 abd_alloc_linear(rm->rm_col[c].rc_size, B_TRUE); } - rm->rm_col[c].rc_abd = abd_get_offset(abd, 0); - off = rm->rm_col[c].rc_size; - - for (c = c + 1; c < acols; c++) { + for (off = 0; c < acols; c++) { rm->rm_col[c].rc_abd = abd_get_offset(abd, off); off += rm->rm_col[c].rc_size; } ___ 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: r344320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:53:33 2019 New Revision: 344320 URL: https://svnweb.freebsd.org/changeset/base/344320 Log: Simplify the code. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:44:00 2019(r344319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Tue Feb 19 23:53:33 2019(r344320) @@ -360,16 +360,13 @@ trim_map_write_start(zio_t *zio) return (B_FALSE); } - ts = avl_find(>tm_queued_frees, , NULL); - if (ts != NULL) { - /* -* Loop until all overlapping segments are removed. -*/ - do { - trim_map_segment_remove(tm, ts, start, end); - ts = avl_find(>tm_queued_frees, , NULL); - } while (ts != NULL); + /* +* Loop until all overlapping segments are removed. +*/ + while ((ts = avl_find(>tm_queued_frees, , NULL)) != NULL) { + trim_map_segment_remove(tm, ts, start, end); } + avl_add(>tm_inflight_writes, zio); mutex_exit(>tm_lock); ___ 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: r344319 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:44:00 2019 New Revision: 344319 URL: https://svnweb.freebsd.org/changeset/base/344319 Log: Correct typo in the comment. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:43:15 2019(r344318) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:44:00 2019(r344319) @@ -2558,7 +2558,7 @@ vdev_raidz_io_done(zio_t *zio) /* * We're here because either: * -* total_errors == rm_first_datacol, or +* total_errors == rm_firstdatacol, or * vdev_raidz_combrec() failed * * In either case, there is enough bad data to prevent ___ 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: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On Tue, Feb 19, 2019 at 11:35:56PM +, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Feb 19 23:35:55 2019 > New Revision: 344316 > URL: https://svnweb.freebsd.org/changeset/base/344316 > > Log: > The way ZFS searches for its vdevs is the following: first it looks for > a vdev that has the same name as the one stored in metadata and that has > all VDEV labels in place. If it cannot find a GEOM provider with the given > name and all VDEV labels it will scan all GEOM providers for the best match > (the most VDEV labels available), but here the name is ignored. > > In case the ZFS pool is created, eg. using GPT partition label: > > # zpool create tank /dev/gpt/tank > > everything works, and on every import ZFS will pick /dev/gpt/tank and > not /dev/da0p4. > > The problem occurs when da0p4 is extended and ZFS is unable to find all > VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end > of the partition are now somewhere else). In this case it will scan all > GEOM providers and will pick the first one with the best match, ie. da0p4. > > Fix this problem by checking the VDEV/provider name even if we get the same > match. If the name is the same as the one we have in pool's metadata, prefer > this GEOM provider. > > Reported by:oshogbo, Michal Mroz > Tested by: Michal Mroz > Obtained from: Fudo Security > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c At the risk of painting a bikeshed a lovely color of neon purple, I'm curious about if/how these types of commits get merged upstream to (OpenZFS|Illumos|ZFS On Linux|where ever ZFS upstream is now|I'm very confused|is anyone else confused where upstream is?). Who is upstream? Is work like this going to remain as a downstream patch to ZFS? Or is FreeBSD going to work to upstream this type of work? I hope my curiousity doesn't offend anyone. ;) Thanks, -- Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal:+1 443-546-8752 Tor+XMPP+OTR:latt...@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE signature.asc Description: PGP signature
svn commit: r344318 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:43:15 2019 New Revision: 344318 URL: https://svnweb.freebsd.org/changeset/base/344318 Log: Change assertion to log the incorrect io_type we've got. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:41:23 2019(r344317) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:43:15 2019(r344318) @@ -2020,7 +2020,7 @@ vdev_raidz_io_start(zio_t *zio) return; } - ASSERT(zio->io_type == ZIO_TYPE_READ); + ASSERT3U(zio->io_type, ==, ZIO_TYPE_READ); /* * Iterate over the columns in reverse order so that we hit the parity ___ 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: r344317 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:41:23 2019 New Revision: 344317 URL: https://svnweb.freebsd.org/changeset/base/344317 Log: Grabage-collect no longer used variable. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:35:55 2019(r344316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.cTue Feb 19 23:41:23 2019(r344317) @@ -270,7 +270,6 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = 0; c < rm->rm_firstdatacol; c++) { if (rm->rm_col[c].rc_abd != NULL) @@ -281,11 +280,9 @@ vdev_raidz_map_free(raidz_map_t *rm) rm->rm_col[c].rc_size); } - size = 0; for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) { if (rm->rm_col[c].rc_abd != NULL) abd_put(rm->rm_col[c].rc_abd); - size += rm->rm_col[c].rc_size; } if (rm->rm_abd_copy != NULL) ___ 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: r344316 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:35:55 2019 New Revision: 344316 URL: https://svnweb.freebsd.org/changeset/base/344316 Log: The way ZFS searches for its vdevs is the following: first it looks for a vdev that has the same name as the one stored in metadata and that has all VDEV labels in place. If it cannot find a GEOM provider with the given name and all VDEV labels it will scan all GEOM providers for the best match (the most VDEV labels available), but here the name is ignored. In case the ZFS pool is created, eg. using GPT partition label: # zpool create tank /dev/gpt/tank everything works, and on every import ZFS will pick /dev/gpt/tank and not /dev/da0p4. The problem occurs when da0p4 is extended and ZFS is unable to find all VDEV labels in /dev/gpt/tank anymore (the VDEV labels stored at the end of the partition are now somewhere else). In this case it will scan all GEOM providers and will pick the first one with the best match, ie. da0p4. Fix this problem by checking the VDEV/provider name even if we get the same match. If the name is the same as the one we have in pool's metadata, prefer this GEOM provider. Reported by: oshogbo, Michal Mroz Tested by:Michal Mroz Obtained from:Fudo Security Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:24:39 2019(r344315) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:35:55 2019(r344316) @@ -692,10 +692,12 @@ vdev_geom_attach_by_guids(vdev_t *vd) struct g_geom *gp; struct g_provider *pp, *best_pp; struct g_consumer *cp; + const char *vdpath; enum match match, best_match; g_topology_assert(); + vdpath = vd->vdev_path + sizeof("/dev/") - 1; cp = NULL; best_pp = NULL; best_match = NO_MATCH; @@ -710,6 +712,10 @@ vdev_geom_attach_by_guids(vdev_t *vd) if (match > best_match) { best_match = match; best_pp = pp; + } else if (match == best_match) { + if (strcmp(pp->name, vdpath) == 0) { + best_pp = pp; + } } if (match == FULL_MATCH) goto out; ___ 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: r344315 - head/release/tools
Author: cperciva Date: Tue Feb 19 23:24:39 2019 New Revision: 344315 URL: https://svnweb.freebsd.org/changeset/base/344315 Log: Fix sed script to insert Amazon NTP server into ntp.conf once rather than twice. Reported by: Rafal Lukawiecki MFC after:1 week Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf == --- head/release/tools/ec2.conf Tue Feb 19 23:22:39 2019(r344314) +++ head/release/tools/ec2.conf Tue Feb 19 23:24:39 2019(r344315) @@ -96,7 +96,7 @@ vm_extra_pre_umount() { # Use the NTP service provided by Amazon sed -i '' -e 's/^pool/#pool/' \ - -e 's/^#server.*/server 169.254.169.123 iburst/' \ + -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ ${DESTDIR}/etc/ntp.conf # The first time the AMI boots, the installed "first boot" scripts ___ 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: r344314 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Tue Feb 19 23:22:39 2019 New Revision: 344314 URL: https://svnweb.freebsd.org/changeset/base/344314 Log: In the vdev_geom_open_by_path() function we assume that vdev path starts with "/dev/". Make sure this is the case. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 22:46:50 2019(r344313) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 19 23:22:39 2019(r344314) @@ -794,7 +794,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t * /* * We must have a pathname, and it must be absolute. */ - if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { + if (vd->vdev_path == NULL || strncmp(vd->vdev_path, "/dev/", 5) != 0) { vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; return (EINVAL); } ___ 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: r344310 - head/lib/libc/tests/sys
Author: ngie Date: Tue Feb 19 22:19:31 2019 New Revision: 344310 URL: https://svnweb.freebsd.org/changeset/base/344310 Log: Make `server_cat(..)` handle short receives In short, the prior code was far too simplistic when it came to calling recv(2) and failed intermittently (or in the case of Jenkins, deterministically). Handle short recv(2)s by checking the return code and incrementing the window into the buffer by the number of received bytes. If the number of received bytes <= 0, then bail out of the loop, and test the total number of received bytes vs the expected number of bytes sent for equality, and base whether or not the test passes/fails on that fact. Remove the expected failure, now that the hdtr testcases deterministically pass on my host after this change [1]. PR: 234809 [1], 235200 Reviewed by: asomers Approved by: emaste (mentor) MFC after:1 week Differential Revision: https://reviews.freebsd.org/D19188 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c == --- head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 21:58:23 2019 (r344309) +++ head/lib/libc/tests/sys/sendfile_test.c Tue Feb 19 22:19:31 2019 (r344310) @@ -156,6 +156,8 @@ setup_client(int domain, int type, int port) "Will try to connect to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); freeaddrinfo(res); @@ -187,6 +189,8 @@ setup_server(int domain, int type, int port) "Will try to bind socket to host='%s', address_family=%d, " "socket_type=%d\n", host, res->ai_family, res->ai_socktype); + /* Avoid a double print when forked by flushing. */ + fflush(stdout); error = bind(sock, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); ATF_REQUIRE_EQ_MSG(error, 0, "bind failed: %s", strerror(errno)); @@ -204,11 +208,17 @@ setup_server(int domain, int type, int port) static void server_cat(const char *dest_filename, int server_sock, size_t len) { - char *buffer; + char *buffer, *buf_window_ptr; int recv_sock; - ssize_t received_bytes; + size_t buffer_size; + ssize_t received_bytes, recv_ret; - buffer = calloc(len + 1, sizeof(char)); + /* +* Ensure that there isn't excess data sent across the wire by +* capturing 10 extra bytes (plus 1 for nul). +*/ + buffer_size = len + 10 + 1; + buffer = calloc(buffer_size, sizeof(char)); if (buffer == NULL) err(1, "malloc failed"); @@ -216,32 +226,26 @@ server_cat(const char *dest_filename, int server_sock, if (recv_sock == -1) err(1, "accept failed"); - /* -* XXX: this assumes the simplest case where all data is received in a -* single recv(2) call. -*/ - if (recv(recv_sock, buffer, len, 0) == -1) - err(1, "recv failed"); + buf_window_ptr = buffer; + received_bytes = 0; + do { + recv_ret = recv(recv_sock, buf_window_ptr, + buffer_size - received_bytes, 0); + if (recv_ret <= 0) + break; + buf_window_ptr += recv_ret; + received_bytes += recv_ret; + } while (received_bytes < buffer_size); atf_utils_create_file(dest_filename, "%s", buffer); - /* -* This recv(2) call helps ensure the amount of sent data is exactly -* what was specified by `len`. -*/ - received_bytes = recv(recv_sock, buffer, len, 0); - switch (received_bytes) { - case -1: - err(1, "recv failed"); - case 0: - break; - default: - errx(1, "received unexpected data: %s", buffer); - } - (void)close(recv_sock); (void)close(server_sock); free(buffer); + + if (received_bytes != len) + errx(1, "received unexpected data: %zd != %zd", received_bytes, + len); } static int @@ -666,10 +670,6 @@ hdtr_positive_test(int domain) trailers[0].iov_len = strlen(trailers[0].iov_base); offset = 0; nbytes = 0; - - atf_tc_expect_fail( - "The header/trailer testcases fail today with a data mismatch; " - "bug # 234809"); for (i = 0; i < nitems(testcases); i++) { struct sf_hdtr hdtr; ___ svn-src-head@freebsd.org mailing list
svn commit: r344309 - head/sys/teken
Author: ed Date: Tue Feb 19 21:58:23 2019 New Revision: 344309 URL: https://svnweb.freebsd.org/changeset/base/344309 Log: Place an upper bound on the number of iterations for REP. Right now it's possible to invoke the REP escape sequence with a maximum of tens of millions of iterations. In practice, there is never any need to do this. Calling it more frequently than the number of cells in the terminal hardly makes any sense. By placing a limit on it, we can prevent users from exhausting resources in inside the terminal emulator. As support for this escape sequence is not present in any of the stable branches, there is no need to MFC. Reported by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11255 Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h == --- head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019(r344308) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:58:23 2019(r344309) @@ -1337,8 +1337,11 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi static void teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts) { + unsigned int max_repetitions; + max_repetitions = t->t_winsize.tp_row * t->t_winsize.tp_col; + if (rpts > max_repetitions) + rpts = max_repetitions; for (; t->t_last != 0 && rpts > 0; rpts--) teken_subr_regular_character(t, t->t_last); } - ___ 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: r344308 - head/sys/teken
Author: ed Date: Tue Feb 19 21:49:48 2019 New Revision: 344308 URL: https://svnweb.freebsd.org/changeset/base/344308 Log: Add missing __unused attributes to unused function arguments. This fixes the userspace build of libteken. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h == --- head/sys/teken/teken_subr.h Tue Feb 19 21:33:02 2019(r344307) +++ head/sys/teken/teken_subr.h Tue Feb 19 21:49:48 2019(r344308) @@ -372,7 +372,7 @@ teken_subr_cursor_up(teken_t *t, unsigned int nrows) } static void -teken_subr_set_cursor_style(teken_t *t, unsigned int style) +teken_subr_set_cursor_style(teken_t *t __unused, unsigned int style __unused) { /* TODO */ ___ 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: r344307 - head/sys/geom
Author: markj Date: Tue Feb 19 21:33:02 2019 New Revision: 344307 URL: https://svnweb.freebsd.org/changeset/base/344307 Log: Limit the number of entries allocated for a REPORT_ZONES command. The DIOCGETZONE ioctl can be used to fetch the zone list of an SMR drive, and the caller specifies the number of entries it wants to fetch. Clamp the caller's request to a sane limit so that a user cannot attempt large allocations. Callers already need to invoke the ioctl multiple times to fetch the full list in general, so there's no harm in limiting the number of entries returned. Fix style while here. admbug: 807 Reported by: Ilja Van Sprundel Reviewed by: asomers, ken Tested by:ken MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19249 Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c == --- head/sys/geom/geom_dev.cTue Feb 19 21:27:30 2019(r344306) +++ head/sys/geom/geom_dev.cTue Feb 19 21:33:02 2019(r344307) @@ -677,8 +677,10 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data alloc_size = 0; if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) { - rep = _args->zone_params.report; +#defineMAXENTRIES (MAXPHYS / sizeof(struct disk_zone_rep_entry)) + if (rep->entries_allocated > MAXENTRIES) + rep->entries_allocated = MAXENTRIES; alloc_size = rep->entries_allocated * sizeof(struct disk_zone_rep_entry); if (alloc_size != 0) @@ -688,15 +690,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data rep->entries = new_entries; } error = g_io_zonecmd(zone_args, cp); - if ((zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES) -&& (alloc_size != 0) -&& (error == 0)) { + if (zone_args->zone_cmd == DISK_ZONE_REPORT_ZONES && + alloc_size != 0 && error == 0) error = copyout(new_entries, old_entries, alloc_size); - } - if ((old_entries != NULL) -&& (rep != NULL)) + if (old_entries != NULL && rep != NULL) rep->entries = old_entries; - if (new_entries != NULL) g_free(new_entries); break; ___ 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: r344306 - head/bin/sh
Author: jilles Date: Tue Feb 19 21:27:30 2019 New Revision: 344306 URL: https://svnweb.freebsd.org/changeset/base/344306 Log: sh: Send normal output from bind builtin to stdout PR: 233343 Submitted by: Yuichiro NAITO (original version) Modified: head/bin/sh/histedit.c head/bin/sh/output.c head/bin/sh/output.h Modified: head/bin/sh/histedit.c == --- head/bin/sh/histedit.c Tue Feb 19 21:22:22 2019(r344305) +++ head/bin/sh/histedit.c Tue Feb 19 21:27:30 2019(r344306) @@ -472,10 +472,31 @@ str_to_event(const char *str, int last) int bindcmd(int argc, char **argv) { + int ret; + FILE *old; + FILE *out; if (el == NULL) error("line editing is disabled"); - return (el_parse(el, argc, __DECONST(const char **, argv))); + + INTOFF; + + out = out1fp(); + if (out == NULL) + error("Out of space"); + + el_get(el, EL_GETFP, 1, ); + el_set(el, EL_SETFP, 1, out); + + ret = el_parse(el, argc, __DECONST(const char **, argv)); + + el_set(el, EL_SETFP, 1, old); + + fclose(out); + + INTON; + + return ret; } #else Modified: head/bin/sh/output.c == --- head/bin/sh/output.cTue Feb 19 21:22:22 2019(r344305) +++ head/bin/sh/output.cTue Feb 19 21:27:30 2019(r344306) @@ -340,6 +340,12 @@ doformat(struct output *dest, const char *f, va_list a } } +FILE * +out1fp(void) +{ + return fwopen(out1, doformat_wr); +} + /* * Version of write which resumes after a signal is caught. */ Modified: head/bin/sh/output.h == --- head/bin/sh/output.hTue Feb 19 21:22:22 2019(r344305) +++ head/bin/sh/output.hTue Feb 19 21:27:30 2019(r344306) @@ -39,6 +39,7 @@ #include #include +#include struct output { char *nextc; @@ -75,6 +76,7 @@ void out1fmt(const char *, ...) __printflike(1, 2); void out2fmt_flush(const char *, ...) __printflike(1, 2); void fmtstr(char *, int, const char *, ...) __printflike(3, 4); void doformat(struct output *, const char *, va_list) __printflike(2, 0); +FILE *out1fp(void); int xwrite(int, const char *, int); #define outc(c, file) ((file)->nextc == (file)->bufend ? (emptyoutbuf(file), *(file)->nextc++ = (c)) : (*(file)->nextc++ = (c))) ___ 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: r344305 - head/sys/geom
Author: markj Date: Tue Feb 19 21:22:22 2019 New Revision: 344305 URL: https://svnweb.freebsd.org/changeset/base/344305 Log: Impose a limit on the number of GEOM_CTL arguments. Otherwise a privileged user can trigger a memory allocation of unbounded size, or an integer overflow in the subsequent geom_alloc_copyin() call, leading to out-of-bounds accesses. Hard-code a large limit to circumvent this problem. admbug: 854 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: ae MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19251 Modified: head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom_ctl.c == --- head/sys/geom/geom_ctl.cTue Feb 19 21:20:50 2019(r344304) +++ head/sys/geom/geom_ctl.cTue Feb 19 21:22:22 2019(r344305) @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; + if (req->narg > 2048) { + gctl_error(req, "too many arguments"); + req->arg = NULL; + return; + } + ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { gctl_error(req, "bad control request"); ___ 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: r344304 - in head/sys: amd64/conf i386/conf
Author: imp Date: Tue Feb 19 21:20:50 2019 New Revision: 344304 URL: https://svnweb.freebsd.org/changeset/base/344304 Log: Remove drm from LINT kernels drm was accidentally left in the LINT kernels. Pointy hat to: imp Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES == --- head/sys/amd64/conf/NOTES Tue Feb 19 20:26:03 2019(r344303) +++ head/sys/amd64/conf/NOTES Tue Feb 19 21:20:50 2019(r344304) @@ -286,17 +286,6 @@ optionsACPI_DEBUG # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -optionsDRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # Modified: head/sys/i386/conf/NOTES == --- head/sys/i386/conf/NOTESTue Feb 19 20:26:03 2019(r344303) +++ head/sys/i386/conf/NOTESTue Feb 19 21:20:50 2019(r344304) @@ -489,17 +489,6 @@ device aibs # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq -# Direct Rendering modules for 3D acceleration. -device drm # DRM core module required by DRM drivers -device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL -device mgadrm # AGP Matrox G200, G400, G450, G550 -device r128drm # ATI Rage 128 -device savagedrm # S3 Savage3D, Savage4 -device sisdrm # SiS 300/305, 540, 630 -device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee -device viadrm # VIA -optionsDRM_DEBUG # Include debug printfs (slow) - # # Network interfaces: # ___ 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: r344303 - head/usr.bin/mkuzip
Author: kib Date: Tue Feb 19 20:26:03 2019 New Revision: 344303 URL: https://svnweb.freebsd.org/changeset/base/344303 Log: Minor cleanup for mkuzip(8) man page. List all single-letter options in summary. Order options alphabetically. Sponsored by: Mellanox Technologies MFC after:3 days Modified: head/usr.bin/mkuzip/mkuzip.8 Modified: head/usr.bin/mkuzip/mkuzip.8 == --- head/usr.bin/mkuzip/mkuzip.8Tue Feb 19 20:12:12 2019 (r344302) +++ head/usr.bin/mkuzip/mkuzip.8Tue Feb 19 20:26:03 2019 (r344303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2006 +.Dd February 19, 2019 .Dt MKUZIP 8 .Os .Sh NAME @@ -35,10 +35,10 @@ class .Sh SYNOPSIS .Nm -.Op Fl v +.Op Fl dLSsvZ +.Op Fl j Ar compression_jobs .Op Fl o Ar outfile .Op Fl s Ar cluster_size -.Op Fl j Ar compression_jobs .Ar infile .Sh DESCRIPTION The @@ -68,6 +68,33 @@ locating each individual cluster is written to the out .Pp The options are: .Bl -tag -width indent +.It Fl j Ar compression_jobs +Specify the number of compression jobs that +.Nm +runs in parallel to speed up compression. +When option is not specified the number of jobs set to be equal +to the value of +.Va hw.ncpu +.Xr sysctl 8 +variable. +.It Fl d +Enable de-duplication. +When the option is enabled the +.Nm +detects identical blocks in the input and replaces each subsequent occurence +of such block with pointer to the very first one in the output. +Setting this option results is moderate decrease of compressed image size, +typically around 3-5% of a final size of the compressed image. +.It Fl L +Use +.Xr lzma 3 +compression algorithm instead of the default +.Xr zlib 3 . +The +.Xr lzma 3 +provides noticeable better compression levels on the same data set +at the expense of much slower compression speed (10-20x) and somewhat slower +decompression (2-3x). .It Fl o Ar outfile Name of the output file .Ar outfile . @@ -79,16 +106,9 @@ compression or .Pa .ulzma for the .Xr lzma 3 . -.It Fl L -Use -.Xr lzma 3 -compression algorithm instead of the default -.Xr zlib 3 . -The -.Xr lzma 3 -provides noticeable better compression levels on the same data set -at the expense of much slower compression speed (10-20x) and somewhat slower -decompression (2-3x). +.It Fl S +Print summary about the compression ratio as well as output +file size after file has been processed. .It Fl s Ar cluster_size Split the image into clusters of .Ar cluster_size @@ -111,26 +131,6 @@ Setting .Fl Z results is slight increase of compressed image size, typically less than 0.1% of a final size of the compressed image. -.It Fl d -Enable de-duplication. -When the option is enabled the -.Nm -detects identical blocks in the input and replaces each subsequent occurence -of such block with pointer to the very first one in the output. -Setting this option results is moderate decrease of compressed image size, -typically around 3-5% of a final size of the compressed image. -.It Fl S -Print summary about the compression ratio as well as output -file size after file has been processed. -.It Fl j Ar compression_jobs -Specify the number of compression jobs that -.Nm -runs in parallel to speed up compression. -When option is not specified the number of jobs set to be equal -to the value of -.Va hw.ncpu -.Xr sysctl 8 -variable. .El .Sh NOTES The compression ratio largely depends on the cluster size used. ___ 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: r344302 - head/sbin/fsck_ffs
Author: mckusick Date: Tue Feb 19 20:12:12 2019 New Revision: 344302 URL: https://svnweb.freebsd.org/changeset/base/344302 Log: Ensure that inode updates are properly flushed out during the first pass of fsck_ffs. Some changes, such as check-hash corrections were being lost. Reported by: Michael Tuexen (tuexen@) Tested by: Michael Tuexen (tuexen@) MFC after: 3 days Modified: head/sbin/fsck_ffs/inode.c Modified: head/sbin/fsck_ffs/inode.c == --- head/sbin/fsck_ffs/inode.c Tue Feb 19 19:57:55 2019(r344301) +++ head/sbin/fsck_ffs/inode.c Tue Feb 19 20:12:12 2019(r344302) @@ -349,9 +349,11 @@ getnextinode(ino_t inumber, int rebuildcg) lastinum += fullcnt; } /* +* Flush old contents in case they have been updated. * If getblk encounters an error, it will already have zeroed * out the buffer, so we do not need to do so here. */ + flush(fswritefd, ); getblk(, blk, size); nextinop = inobuf.b_un.b_buf; } @@ -461,6 +463,10 @@ void freeinodebuf(void) { + /* +* Flush old contents in case they have been updated. +*/ + flush(fswritefd, ); if (inobuf.b_un.b_buf != NULL) free((char *)inobuf.b_un.b_buf); inobuf.b_un.b_buf = NULL; ___ 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: r344301 - head/sys/netinet6
Author: thj Date: Tue Feb 19 19:57:55 2019 New Revision: 344301 URL: https://svnweb.freebsd.org/changeset/base/344301 Log: When dropping a fragment queue count the number of fragments in the queue When dropping a fragment queue, account for the number of fragments in the queue. This improves accounting between the number of fragments received and the number of fragments dropped. Reviewed by: jtl, bz, transport Approved by: jtl (mentor), bz (mentor) Differential Revision:https://review.freebsd.org/D17521 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c == --- head/sys/netinet6/frag6.c Tue Feb 19 19:37:09 2019(r344300) +++ head/sys/netinet6/frag6.c Tue Feb 19 19:57:55 2019(r344301) @@ -593,7 +593,7 @@ insert: af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -603,7 +603,7 @@ insert: } if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { - IP6STAT_INC(ip6s_fragdropped); + IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, hash); } IP6Q_UNLOCK(hash); @@ -861,7 +861,8 @@ frag6_slowtimo(void) --q6->ip6q_ttl; q6 = q6->ip6q_next; if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); + IP6STAT_ADD(ip6s_fragtimeout, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(q6->ip6q_prev, i); } @@ -879,7 +880,8 @@ frag6_slowtimo(void) (V_ip6_maxfragpackets > 0 && V_ip6q[i].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } @@ -896,7 +898,8 @@ frag6_slowtimo(void) IP6Q_LOCK(i); head = IP6Q_HEAD(i); if (head->ip6q_prev != head) { - IP6STAT_INC(ip6s_fragoverflow); + IP6STAT_ADD(ip6s_fragoverflow, + q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } ___ 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: r344298 - in head/sys: conf modules modules/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms modules/drm2/radeonkmsfw modules/drm2/radeonkmsfw/ARUBA_me modules/drm2/ra...
Author: imp Date: Tue Feb 19 19:36:56 2019 New Revision: 344298 URL: https://svnweb.freebsd.org/changeset/base/344298 Log: Remove drm2 modules. Remove support for compiling drm2 as a module. This has transitioned to the drm-kmod or drm-legacy-kmodw ports. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/modules/drm2/Makefile head/sys/modules/drm2/Makefile.inc head/sys/modules/drm2/drm2/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_me/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/ARUBA_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_me/Makefile head/sys/modules/drm2/radeonkmsfw/BARTS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/BTC_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAICOS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CAYMAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_me/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CEDAR_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_me/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/CYPRESS_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_me/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/HAINAN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_me/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/JUNIPER_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile head/sys/modules/drm2/radeonkmsfw/Makefile.inc head/sys/modules/drm2/radeonkmsfw/OLAND_ce/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_mc/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_me/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/OLAND_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_me/Makefile head/sys/modules/drm2/radeonkmsfw/PALM_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_ce/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_mc/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_me/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/PITCAIRN_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R100_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R200_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R300_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R420_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R520_cp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_me/Makefile head/sys/modules/drm2/radeonkmsfw/R600_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/R600_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/R700_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_me/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/REDWOOD_rlc/Makefile head/sys/modules/drm2/radeonkmsfw/RS600_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS690_cp/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_me/Makefile head/sys/modules/drm2/radeonkmsfw/RS780_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV610_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV620_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV630_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV635_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV670_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV710_uvd/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV730_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_me/Makefile head/sys/modules/drm2/radeonkmsfw/RV770_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO2_pfp/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_me/Makefile head/sys/modules/drm2/radeonkmsfw/SUMO_pfp/Makefile
svn commit: r344297 - in head/sys: conf dev/drm modules modules/drm modules/drm/drm modules/drm/mach64 modules/drm/mga modules/drm/r128 modules/drm/savage modules/drm/sis modules/drm/tdfx modules/d...
Author: imp Date: Tue Feb 19 19:36:43 2019 New Revision: 344297 URL: https://svnweb.freebsd.org/changeset/base/344297 Log: Per discussions on arch@ and elsewhere, retire drm module / drives. Retire the drm modules / drivers. These are now handled by the drm-legacy-kmod port and/or the drm-kmod port. All future development and maintanace will be handled there. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm.h head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_agpsupport.c head/sys/dev/drm/drm_atomic.h head/sys/dev/drm/drm_auth.c head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_context.c head/sys/dev/drm/drm_dma.c head/sys/dev/drm/drm_drawable.c head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_fops.c head/sys/dev/drm/drm_hashtab.c head/sys/dev/drm/drm_hashtab.h head/sys/dev/drm/drm_internal.h head/sys/dev/drm/drm_ioctl.c head/sys/dev/drm/drm_irq.c head/sys/dev/drm/drm_linux_list.h head/sys/dev/drm/drm_lock.c head/sys/dev/drm/drm_memory.c head/sys/dev/drm/drm_mm.c head/sys/dev/drm/drm_mm.h head/sys/dev/drm/drm_pci.c head/sys/dev/drm/drm_pciids.h head/sys/dev/drm/drm_sarea.h head/sys/dev/drm/drm_scatter.c head/sys/dev/drm/drm_sman.c head/sys/dev/drm/drm_sman.h head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm/drm_vm.c head/sys/dev/drm/mach64_dma.c head/sys/dev/drm/mach64_drm.h head/sys/dev/drm/mach64_drv.c head/sys/dev/drm/mach64_drv.h head/sys/dev/drm/mach64_irq.c head/sys/dev/drm/mach64_state.c head/sys/dev/drm/mga_dma.c head/sys/dev/drm/mga_drm.h head/sys/dev/drm/mga_drv.c head/sys/dev/drm/mga_drv.h head/sys/dev/drm/mga_irq.c head/sys/dev/drm/mga_state.c head/sys/dev/drm/mga_ucode.h head/sys/dev/drm/mga_warp.c head/sys/dev/drm/r128_cce.c head/sys/dev/drm/r128_drm.h head/sys/dev/drm/r128_drv.c head/sys/dev/drm/r128_drv.h head/sys/dev/drm/r128_irq.c head/sys/dev/drm/r128_state.c head/sys/dev/drm/savage_bci.c head/sys/dev/drm/savage_drm.h head/sys/dev/drm/savage_drv.c head/sys/dev/drm/savage_drv.h head/sys/dev/drm/savage_state.c head/sys/dev/drm/sis_drm.h head/sys/dev/drm/sis_drv.c head/sys/dev/drm/sis_drv.h head/sys/dev/drm/sis_ds.c head/sys/dev/drm/sis_ds.h head/sys/dev/drm/sis_mm.c head/sys/dev/drm/tdfx_drv.c head/sys/dev/drm/tdfx_drv.h head/sys/dev/drm/via_3d_reg.h head/sys/dev/drm/via_dma.c head/sys/dev/drm/via_dmablit.c head/sys/dev/drm/via_dmablit.h head/sys/dev/drm/via_drm.h head/sys/dev/drm/via_drv.c head/sys/dev/drm/via_drv.h head/sys/dev/drm/via_irq.c head/sys/dev/drm/via_map.c head/sys/dev/drm/via_mm.c head/sys/dev/drm/via_verifier.c head/sys/dev/drm/via_verifier.h head/sys/dev/drm/via_video.c head/sys/modules/drm/Makefile head/sys/modules/drm/Makefile.inc head/sys/modules/drm/drm/Makefile head/sys/modules/drm/mach64/Makefile head/sys/modules/drm/mga/Makefile head/sys/modules/drm/r128/Makefile head/sys/modules/drm/savage/Makefile head/sys/modules/drm/sis/Makefile head/sys/modules/drm/tdfx/Makefile head/sys/modules/drm/via/Makefile Modified: head/sys/conf/files head/sys/conf/kern.opts.mk head/sys/modules/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Tue Feb 19 19:17:20 2019(r344296) +++ head/sys/conf/files Tue Feb 19 19:36:43 2019(r344297) @@ -1541,55 +1541,6 @@ dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme -dev/drm/ati_pcigart.c optional drm -dev/drm/drm_agpsupport.c optional drm -dev/drm/drm_auth.c optional drm -dev/drm/drm_bufs.c optional drm -dev/drm/drm_context.c optional drm -dev/drm/drm_dma.c optional drm -dev/drm/drm_drawable.c optional drm -dev/drm/drm_drv.c optional drm -dev/drm/drm_fops.c optional drm -dev/drm/drm_hashtab.c optional drm -dev/drm/drm_ioctl.coptional drm -dev/drm/drm_irq.c optional drm -dev/drm/drm_lock.c optional drm -dev/drm/drm_memory.c optional drm -dev/drm/drm_mm.c optional drm -dev/drm/drm_pci.c optional drm -dev/drm/drm_scatter.c optional drm -dev/drm/drm_sman.c optional drm -dev/drm/drm_sysctl.c optional drm -dev/drm/drm_vm.c optional drm -dev/drm/mach64_dma.c optional mach64drm -dev/drm/mach64_drv.c optional mach64drm -dev/drm/mach64_irq.c optional mach64drm -dev/drm/mach64_state.c optional mach64drm -dev/drm/mga_dma.c optional mgadrm -dev/drm/mga_drv.c optional mgadrm -dev/drm/mga_irq.c optional mgadrm
svn commit: r344300 - in head: . sys/sys
Author: imp Date: Tue Feb 19 19:37:09 2019 New Revision: 344300 URL: https://svnweb.freebsd.org/changeset/base/344300 Log: Add an UPDATING entry for the removal of drm and drm2 Also bump FreeBSD version to 1300013 since this series is a big change. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING == --- head/UPDATING Tue Feb 19 19:37:02 2019(r344299) +++ head/UPDATING Tue Feb 19 19:37:09 2019(r344300) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190219: + drm and drm2 have been removed from the tree. Please see + https://wiki.freebsd.org/Graphics for the latest information on + migrating to the drm ports. + 20190131: Iflib is no longer unconditionally compiled into the kernel. Drivers using iflib and statically compiled into the kernel, now require Modified: head/sys/sys/param.h == --- head/sys/sys/param.hTue Feb 19 19:37:02 2019(r344299) +++ head/sys/sys/param.hTue Feb 19 19:37:09 2019(r344300) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ 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: r344299 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/drm2/radeon/reg_srcs
Author: imp Date: Tue Feb 19 19:37:02 2019 New Revision: 344299 URL: https://svnweb.freebsd.org/changeset/base/344299 Log: Remove the i915 and radeon drivers. Per discussions on arch@ and elsewhere, the maintenance of this code has moved to the drm-kmod and drm-legacy-kmod ports. Remove the i915 and radeon drivers from the tree. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Deleted: head/sys/dev/drm2/ati_pcigart.c head/sys/dev/drm2/i915/dvo.h head/sys/dev/drm2/i915/dvo_ch7017.c head/sys/dev/drm2/i915/dvo_ch7xxx.c head/sys/dev/drm2/i915/dvo_ivch.c head/sys/dev/drm2/i915/dvo_ns2501.c head/sys/dev/drm2/i915/dvo_sil164.c head/sys/dev/drm2/i915/dvo_tfp410.c head/sys/dev/drm2/i915/i915_debug.c head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_context.c head/sys/dev/drm2/i915/i915_gem_evict.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_stolen.c head/sys/dev/drm2/i915/i915_gem_tiling.c head/sys/dev/drm2/i915/i915_ioc32.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/i915_suspend.c head/sys/dev/drm2/i915/intel_acpi.c head/sys/dev/drm2/i915/intel_bios.c head/sys/dev/drm2/i915/intel_bios.h head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_ddi.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_dvo.c head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/drm2/i915/intel_hdmi.c head/sys/dev/drm2/i915/intel_iic.c head/sys/dev/drm2/i915/intel_lvds.c head/sys/dev/drm2/i915/intel_modes.c head/sys/dev/drm2/i915/intel_opregion.c head/sys/dev/drm2/i915/intel_overlay.c head/sys/dev/drm2/i915/intel_panel.c head/sys/dev/drm2/i915/intel_pm.c head/sys/dev/drm2/i915/intel_ringbuffer.c head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/dev/drm2/i915/intel_sdvo.c head/sys/dev/drm2/i915/intel_sdvo_regs.h head/sys/dev/drm2/i915/intel_sprite.c head/sys/dev/drm2/i915/intel_tv.c head/sys/dev/drm2/radeon/ObjectID.h head/sys/dev/drm2/radeon/README head/sys/dev/drm2/radeon/atom-bits.h head/sys/dev/drm2/radeon/atom-names.h head/sys/dev/drm2/radeon/atom-types.h head/sys/dev/drm2/radeon/atom.c head/sys/dev/drm2/radeon/atom.h head/sys/dev/drm2/radeon/atombios.h head/sys/dev/drm2/radeon/atombios_crtc.c head/sys/dev/drm2/radeon/atombios_dp.c head/sys/dev/drm2/radeon/atombios_encoders.c head/sys/dev/drm2/radeon/atombios_i2c.c head/sys/dev/drm2/radeon/avivod.h head/sys/dev/drm2/radeon/cayman_blit_shaders.c head/sys/dev/drm2/radeon/cayman_blit_shaders.h head/sys/dev/drm2/radeon/cayman_reg_safe.h head/sys/dev/drm2/radeon/evergreen.c head/sys/dev/drm2/radeon/evergreen_blit_kms.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.c head/sys/dev/drm2/radeon/evergreen_blit_shaders.h head/sys/dev/drm2/radeon/evergreen_cs.c head/sys/dev/drm2/radeon/evergreen_hdmi.c head/sys/dev/drm2/radeon/evergreen_reg.h head/sys/dev/drm2/radeon/evergreen_reg_safe.h head/sys/dev/drm2/radeon/evergreend.h head/sys/dev/drm2/radeon/ni.c head/sys/dev/drm2/radeon/ni_reg.h head/sys/dev/drm2/radeon/nid.h head/sys/dev/drm2/radeon/r100.c head/sys/dev/drm2/radeon/r100_reg_safe.h head/sys/dev/drm2/radeon/r100_track.h head/sys/dev/drm2/radeon/r100d.h head/sys/dev/drm2/radeon/r200.c head/sys/dev/drm2/radeon/r200_reg_safe.h head/sys/dev/drm2/radeon/r300.c head/sys/dev/drm2/radeon/r300_reg.h head/sys/dev/drm2/radeon/r300_reg_safe.h head/sys/dev/drm2/radeon/r300d.h head/sys/dev/drm2/radeon/r420.c head/sys/dev/drm2/radeon/r420_reg_safe.h head/sys/dev/drm2/radeon/r420d.h head/sys/dev/drm2/radeon/r500_reg.h head/sys/dev/drm2/radeon/r520.c head/sys/dev/drm2/radeon/r520d.h head/sys/dev/drm2/radeon/r600.c head/sys/dev/drm2/radeon/r600_audio.c head/sys/dev/drm2/radeon/r600_blit_kms.c head/sys/dev/drm2/radeon/r600_blit_shaders.c head/sys/dev/drm2/radeon/r600_blit_shaders.h head/sys/dev/drm2/radeon/r600_cp.h head/sys/dev/drm2/radeon/r600_cs.c head/sys/dev/drm2/radeon/r600_cs.h head/sys/dev/drm2/radeon/r600_hdmi.c head/sys/dev/drm2/radeon/r600_reg.h head/sys/dev/drm2/radeon/r600_reg_safe.h head/sys/dev/drm2/radeon/r600d.h head/sys/dev/drm2/radeon/radeon.h head/sys/dev/drm2/radeon/radeon_acpi.c head/sys/dev/drm2/radeon/radeon_acpi.h head/sys/dev/drm2/radeon/radeon_agp.c head/sys/dev/drm2/radeon/radeon_asic.c head/sys/dev/drm2/radeon/radeon_asic.h head/sys/dev/drm2/radeon/radeon_atombios.c head/sys/dev/drm2/radeon/radeon_benchmark.c head/sys/dev/drm2/radeon/radeon_bios.c head/sys/dev/drm2/radeon/radeon_blit_common.h
svn commit: r344296 - in head/sys: amd64/include i386/include
Author: kib Date: Tue Feb 19 19:17:20 2019 New Revision: 344296 URL: https://svnweb.freebsd.org/changeset/base/344296 Log: Provide convenience C wrappers for RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:3 days Differential revision:https://reviews.freebsd.org/D18893 Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h == --- head/sys/amd64/include/cpufunc.hTue Feb 19 19:16:28 2019 (r344295) +++ head/sys/amd64/include/cpufunc.hTue Feb 19 19:17:20 2019 (r344296) @@ -627,6 +627,22 @@ cpu_mwait(u_long extensions, u_int hints) __asm __volatile("mwait" : : "a" (hints), "c" (extensions)); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #ifdef _KERNEL /* This is defined in but is too painful to get to */ #ifndefMSR_FSBASE Modified: head/sys/i386/include/cpufunc.h == --- head/sys/i386/include/cpufunc.h Tue Feb 19 19:16:28 2019 (r344295) +++ head/sys/i386/include/cpufunc.h Tue Feb 19 19:17:20 2019 (r344296) @@ -726,6 +726,22 @@ intr_restore(register_t eflags) write_eflags(eflags); } +static __inline uint32_t +rdpkru(void) +{ + uint32_t res; + + __asm __volatile("rdpkru" : "=a" (res) : "c" (0) : "edx"); + return (res); +} + +static __inline void +wrpkru(uint32_t mask) +{ + + __asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ intbreakpoint(void); ___ 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: r344294 - head/lib/libc/posix1e
Author: sef Date: Tue Feb 19 19:15:15 2019 New Revision: 344294 URL: https://svnweb.freebsd.org/changeset/base/344294 Log: Remove some redundant code in _posix1e_acl_strip_np This was discovered through examination -- acl_copy_entry() copies the tag type and permset fields. Reviewed by: trasz, pfg Sponsored by: iXsystems Inc. Differential Revision:https://reviews.freebsd.org/D19240 Modified: head/lib/libc/posix1e/acl_strip.c Modified: head/lib/libc/posix1e/acl_strip.c == --- head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:13:48 2019 (r344293) +++ head/lib/libc/posix1e/acl_strip.c Tue Feb 19 19:15:15 2019 (r344294) @@ -70,7 +70,6 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat { acl_t acl_new, acl_old; acl_entry_t entry, entry_new; - acl_permset_t perm; acl_tag_t tag; int entry_id, have_mask_entry; @@ -104,15 +103,7 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculat case ACL_USER_OBJ: case ACL_GROUP_OBJ: case ACL_OTHER: - if (acl_get_tag_type(entry, ) == -1) - goto fail; - if (acl_get_permset(entry, ) == -1) - goto fail; if (acl_create_entry(_new, _new) == -1) - goto fail; - if (acl_set_tag_type(entry_new, tag) == -1) - goto fail; - if (acl_set_permset(entry_new, perm) == -1) goto fail; if (acl_copy_entry(entry_new, entry) == -1) goto fail; ___ 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: r344293 - head/sys/x86/include
Author: kib Date: Tue Feb 19 19:13:48 2019 New Revision: 344293 URL: https://svnweb.freebsd.org/changeset/base/344293 Log: Add definition for %cr4 PKRU enable bit. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:3 days Differential revision:https://reviews.freebsd.org/D18893 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h == --- head/sys/x86/include/specialreg.h Tue Feb 19 19:04:52 2019 (r344292) +++ head/sys/x86/include/specialreg.h Tue Feb 19 19:13:48 2019 (r344293) @@ -77,6 +77,7 @@ #defineCR4_XSAVE 0x0004/* XSETBV/XGETBV */ #defineCR4_SMEP 0x0010 /* Supervisor-Mode Execution Prevention */ #defineCR4_SMAP 0x0020 /* Supervisor-Mode Access Prevention */ +#defineCR4_PKE 0x0040 /* Protection Keys Enable */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. ___ 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: r344292 - head/sys/dev/acpica
Author: thj Date: Tue Feb 19 19:04:52 2019 New Revision: 344292 URL: https://svnweb.freebsd.org/changeset/base/344292 Log: Fix style after r340832 Reported by: jhb Reviewed by: jhb, jtl Approved by: jtl (mentor) MFC after:3 days Differential Revision:https://reviews/freebsd.org/D18354 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c == --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * Be sure we can get various info from the battery. */ if (ACPI_BATT_GET_STATUS(batt_dev, [i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) continue; /* If a battery is not installed, we sometimes get strange values. */ ___ 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: r344280 - head/usr.sbin/freebsd-update
Author: emaste Date: Tue Feb 19 17:38:24 2019 New Revision: 344280 URL: https://svnweb.freebsd.org/changeset/base/344280 Log: freebsd-update: Clarify help text Improve help text to include example release numbers for reference and clarify the -F option. PR: 231185, 214619 Submitted by: Gerald Aryeetey Reviewed by: delphij, rgrimes MFC after:1 month Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D18944 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.8 == --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:03:34 2019(r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Feb 19 17:38:24 2019(r344280) @@ -89,13 +89,13 @@ Read configuration options from .It Fl F Force .Nm Cm fetch -to proceed where it normally would not, such as an unfinished upgrade +to proceed in the case of an unfinished upgrade. .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release to which +Specify the new release (e.g. 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server Modified: head/usr.sbin/freebsd-update/freebsd-update.sh == --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:03:34 2019(r344279) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Feb 19 17:38:24 2019(r344280) @@ -45,7 +45,8 @@ Options: (default: /var/db/freebsd-update/) -f conffile -- Read configuration options from conffile (default: /etc/freebsd-update.conf) - -F -- Force a fetch operation to proceed + -F -- Force a fetch operation to proceed in the + case of an unfinished upgrade -k KEY -- Trust an RSA key with SHA256 hash of KEY -r release -- Target for upgrade (e.g., 11.1-RELEASE) -s server-- Server from which to fetch updates ___ 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: r344279 - head/sys/kern
Author: andrew Date: Tue Feb 19 17:03:34 2019 New Revision: 344279 URL: https://svnweb.freebsd.org/changeset/base/344279 Log: Create a common function to handle freeing the kcov info struct. Both places that may free the kcov info struct are identical. Create a new common function to hold the code. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c == --- head/sys/kern/kern_kcov.c Tue Feb 19 15:46:43 2019(r344278) +++ head/sys/kern/kern_kcov.c Tue Feb 19 17:03:34 2019(r344279) @@ -136,6 +136,7 @@ static d_mmap_single_t kcov_mmap_single; static d_ioctl_t kcov_ioctl; static int kcov_alloc(struct kcov_info *info, size_t entries); +static void kcov_free(struct kcov_info *info); static void kcov_init(const void *unused); static struct cdevsw kcov_cdevsw = { @@ -288,14 +289,7 @@ kcov_mmap_cleanup(void *arg) * The KCOV_STATE_DYING stops new threads from using it. * The lack of a thread means nothing is currently using the buffers. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static int @@ -398,6 +392,19 @@ kcov_alloc(struct kcov_info *info, size_t entries) return (0); } +static void +kcov_free(struct kcov_info *info) +{ + + if (info->kvaddr != 0) { + pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); + kva_free(info->kvaddr, info->bufsize); + } + if (info->bufobj != NULL && !info->mmap) + vm_object_deallocate(info->bufobj); + free(info, M_KCOV_INFO); +} + static int kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag __unused, struct thread *td) @@ -531,14 +538,7 @@ kcov_thread_dtor(void *arg __unused, struct thread *td * The KCOV_STATE_DYING stops new threads from using it. * It also stops the current thread from trying to use the info struct. */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); + kcov_free(info); } static void ___ 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: r344278 - head/sys/kern
Author: markj Date: Tue Feb 19 15:46:43 2019 New Revision: 344278 URL: https://svnweb.freebsd.org/changeset/base/344278 Log: Move a racy assertion in filt_pipewrite(). EVFILT_WRITE knotes for pipes live on the knlist for the other end of the pipe. Since they do not hold a reference on the corresponding file structure, they may be removed from the knlist by pipeclose() while still remaining active. In this case, there is no knlist lock acquired before filt_pipewrite() is called, so the assertion fails. Fix the problem by first checking whether that end of the pipe has been closed. These checks are memory safe since the knote holds a reference on one end of the pipe, and the pipe structure is not freed until both ends are closed. The checks are not racy since PIPE_EOF is never cleared after being set, and pipe_present is never set back to PIPE_ACTIVE after pipeclose() has been called. PR: 235640 Reported and tested by: pho Reviewed by: kib MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D19224 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cTue Feb 19 12:45:37 2019(r344277) +++ head/sys/kern/sys_pipe.cTue Feb 19 15:46:43 2019(r344278) @@ -1741,15 +1741,19 @@ static int filt_pipewrite(struct knote *kn, long hint) { struct pipe *wpipe; - + + /* +* If this end of the pipe is closed, the knote was removed from the +* knlist and the list lock (i.e., the pipe lock) is therefore not held. +*/ wpipe = kn->kn_hook; - PIPE_LOCK_ASSERT(wpipe, MA_OWNED); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_data = 0; kn->kn_flags |= EV_EOF; return (1); } + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); kn->kn_data = (wpipe->pipe_buffer.size > 0) ? (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; if (wpipe->pipe_state & PIPE_DIRECTW) ___ 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: r344277 - head/sys/fs/nfsclient
Author: trasz Date: Tue Feb 19 12:45:37 2019 New Revision: 344277 URL: https://svnweb.freebsd.org/changeset/base/344277 Log: Work around the "nfscl: bad open cnt on server" assertion that can happen when rerooting into NFSv4 rootfs with kernel built with INVARIANTS. I've talked to rmacklem@ (back in 2017), and while the root cause is still unknown, the case guarded by assertion (nfscl_doclose() being called from VOP_INACTIVE) is believed to be safe, and the whole thing seems to run just fine. Obtained from:CheriBSD MFC after:2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c == --- head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 11:07:02 2019 (r344276) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 19 12:45:37 2019 (r344277) @@ -3188,8 +3188,11 @@ lookformore: !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, nfhp->nfh_len)) { /* Found an open, close it. */ +#ifdef DIAGNOSTIC KASSERT((op->nfso_opencnt == 0), - ("nfscl: bad open cnt on server")); + ("nfscl: bad open cnt on server (%d)", +op->nfso_opencnt)); +#endif NFSUNLOCKCLSTATE(); nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, p); ___ 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: r344276 - head/sys/rpc/rpcsec_gss
Author: trasz Date: Tue Feb 19 11:07:02 2019 New Revision: 344276 URL: https://svnweb.freebsd.org/changeset/base/344276 Log: Bump the default kern.rpc.gss.client_max from 128 to 1024. The old value resulted in bad performance, with high kernel and gssd(8) load, with more than ~64 clients; it also triggered crashes, which are to be fixed by a different patch. PR: 235582 Discussed with: rmacklem@ MFC after:2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c == --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cTue Feb 19 10:40:35 2019 (r344275) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cTue Feb 19 11:07:02 2019 (r344276) @@ -170,7 +170,7 @@ struct svc_rpc_gss_cookedcred { }; #define CLIENT_HASH_SIZE 256 -#define CLIENT_MAX 128 +#define CLIENT_MAX 1024 u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; ___ 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: r344273 - head/sys/rpc/rpcsec_gss
Author: trasz Date: Tue Feb 19 10:17:49 2019 New Revision: 344273 URL: https://svnweb.freebsd.org/changeset/base/344273 Log: Add kern.rpc.gss.client_hash tunable, to make it possible to bump it easily. This can lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson Reviewed by: rmacklem@ MFC after:2 weeks Sponsored by: Chalmers University of Technology Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c == --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cTue Feb 19 10:07:48 2019 (r344272) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cTue Feb 19 10:17:49 2019 (r344273) @@ -172,6 +172,7 @@ struct svc_rpc_gss_cookedcred { #define CLIENT_HASH_SIZE 256 #define CLIENT_MAX 128 u_int svc_rpc_gss_client_max = CLIENT_MAX; +u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); @@ -180,12 +181,16 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFL _rpc_gss_client_max, 0, "Max number of rpc-gss clients"); +SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_hash, CTLFLAG_RDTUN, +_rpc_gss_client_hash_size, 0, +"Size of rpc-gss client hash table"); + static u_int svc_rpc_gss_client_count; SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, _rpc_gss_client_count, 0, "Number of rpc-gss clients"); -struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; +struct svc_rpc_gss_client_list *svc_rpc_gss_client_hash; struct svc_rpc_gss_client_list svc_rpc_gss_clients; static uint32_t svc_rpc_gss_next_clientid = 1; @@ -194,7 +199,8 @@ svc_rpc_gss_init(void *arg) { int i; - for (i = 0; i < CLIENT_HASH_SIZE; i++) + svc_rpc_gss_client_hash = mem_alloc(sizeof(struct svc_rpc_gss_client_list) * svc_rpc_gss_client_hash_size); + for (i = 0; i < svc_rpc_gss_client_hash_size; i++) TAILQ_INIT(_rpc_gss_client_hash[i]); TAILQ_INIT(_rpc_gss_clients); svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); @@ -530,7 +536,7 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *i if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); - list = _rpc_gss_client_hash[id->ci_id % CLIENT_HASH_SIZE]; + list = _rpc_gss_client_hash[id->ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(_rpc_gss_lock); TAILQ_FOREACH(client, list, cl_link) { if (client->cl_id.ci_id == id->ci_id) { @@ -569,7 +575,7 @@ svc_rpc_gss_create_client(void) getboottime(); client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++; - list = _rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = _rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(_rpc_gss_lock); TAILQ_INSERT_HEAD(list, client, cl_link); TAILQ_INSERT_HEAD(_rpc_gss_clients, client, cl_alllink); @@ -635,7 +641,7 @@ svc_rpc_gss_forget_client_locked(struct svc_rpc_gss_cl struct svc_rpc_gss_client_list *list; sx_assert(_rpc_gss_lock, SX_XLOCKED); - list = _rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = _rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; TAILQ_REMOVE(list, client, cl_link); TAILQ_REMOVE(_rpc_gss_clients, client, cl_alllink); svc_rpc_gss_client_count--; @@ -650,7 +656,7 @@ svc_rpc_gss_forget_client(struct svc_rpc_gss_client *c struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client *tclient; - list = _rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + list = _rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(_rpc_gss_lock); TAILQ_FOREACH(tclient, list, cl_link) { /* ___ 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"