svn commit: r267317 - head/usr.bin/dtc
Author: rpaulo Date: Tue Jun 10 06:04:25 2014 New Revision: 267317 URL: http://svnweb.freebsd.org/changeset/base/267317 Log: dtc: don't crash if the argument is a directory. Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc == --- head/usr.bin/dtc/fdt.cc Tue Jun 10 05:58:46 2014(r267316) +++ head/usr.bin/dtc/fdt.cc Tue Jun 10 06:04:25 2014(r267317) @@ -42,6 +42,8 @@ #include stdio.h #include stdlib.h #include unistd.h +#include sys/types.h +#include sys/stat.h #include dtb.hh namespace dtc @@ -1078,6 +1080,13 @@ device_tree::buffer_for_file(const char fprintf(stderr, Unable to open file %s\n, path); return 0; } + struct stat st; + if (fstat(source, st) == 0 S_ISDIR(st.st_mode)) + { + fprintf(stderr, File %s is a directory\n, path); + close(source); + return 0; + } input_buffer *b = new mmap_input_buffer(source); // Keep the buffer that owns the memory around for the lifetime // of this FDT. Ones simply referring to it may have shorter ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267318 - head/usr.bin/dtc
Author: rpaulo Date: Tue Jun 10 06:16:34 2014 New Revision: 267318 URL: http://svnweb.freebsd.org/changeset/base/267318 Log: dtc: ignore lines starting with #. This is necessary because we use the C pre-processor to parse #include lines and cpp adds line markings that start with #. Modified: head/usr.bin/dtc/input_buffer.cc Modified: head/usr.bin/dtc/input_buffer.cc == --- head/usr.bin/dtc/input_buffer.ccTue Jun 10 06:04:25 2014 (r267317) +++ head/usr.bin/dtc/input_buffer.ccTue Jun 10 06:16:34 2014 (r267318) @@ -151,7 +151,7 @@ input_buffer::next_token() start = cursor; skip_spaces(); // Parse /* comments - if (((*this)[0] == '/') ((*this)[1] == '*')) + if ((*this)[0] == '/' (*this)[1] == '*') { // eat the start of the comment ++(*this); @@ -168,13 +168,14 @@ input_buffer::next_token() // Eat the / ++(*this); } - // Parse // comments - if (((*this)[0] == '/') ((*this)[1] == '/')) + // Parse // comments and # comments + if (((*this)[0] == '/' (*this)[1] == '/') || +(*this)[0] == '#') { // eat the start of the comment ++(*this); ++(*this); - // Find the ending * of */ + // Find the ending of the line while (**this != '\n') { ++(*this); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267319 - head/sys/tools/fdt
Author: rpaulo Date: Tue Jun 10 06:24:01 2014 New Revision: 267319 URL: http://svnweb.freebsd.org/changeset/base/267319 Log: Call cpp with -P to avoid printing line markings. Modified: head/sys/tools/fdt/make_dtb.sh Modified: head/sys/tools/fdt/make_dtb.sh == --- head/sys/tools/fdt/make_dtb.sh Tue Jun 10 06:16:34 2014 (r267318) +++ head/sys/tools/fdt/make_dtb.sh Tue Jun 10 06:24:01 2014 (r267319) @@ -15,6 +15,6 @@ fi for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb echo converting $d - $dtb -cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | +cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} done ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r267291 - head/sys/libkern
On Mon, Jun 09, 2014 at 07:27:47PM +, John Baldwin wrote: New Revision: 267291 URL: http://svnweb.freebsd.org/changeset/base/267291 Log: Use strcasecmp() instead of strcmp() when checking user-supplied encoding names so that encoding names are treated as case-insensitive. This allows the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior of iconv(1). Thanks! Thas had bitten me before; caused me some nasty debugging minutes. MFC after: 1 week Please MFC to stable/8 as well, thank you. ./danfe ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267320 - head/usr.sbin/acpi/acpiconf
Author: eadler Date: Tue Jun 10 08:15:41 2014 New Revision: 267320 URL: http://svnweb.freebsd.org/changeset/base/267320 Log: acpiconf(8): tell users not to use -k Add language from jhb Requested by: jhb, jkim Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 == --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Tue Jun 10 06:24:01 2014 (r267319) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Tue Jun 10 08:15:41 2014 (r267320) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd June 8, 2014 +.Dd June 10, 2014 .Dt ACPICONF 8 .Os .Sh NAME @@ -52,6 +52,7 @@ Displays a summary of available options. Get design information about the specified battery. .It Fl k Ar ack Ack or abort a pending suspend request using the argument provided. +.Sy Most users should not use this option directly. .It Fl s Ar type Enters the specified sleep mode. Recognized types are ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r267248 - head/usr.sbin/acpi/acpiconf
On 9 June 2014 11:16, Jung-uk Kim j...@freebsd.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-06-09 11:43:52 -0400, John Baldwin wrote: On Sunday, June 08, 2014 9:54:01 pm Eitan Adler wrote: Author: eadler Date: Mon Jun 9 01:54:00 2014 New Revision: 267248 URL: http://svnweb.freebsd.org/changeset/base/267248 Log: acpiconf(8): document 'k' option Add missing documentation for the 'k' option based on reading the source code. Might want some explicit language to say that users should probably never use this option directly. +1 Done. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267321 - in head/sys/dev/usb: . controller
Author: marius Date: Tue Jun 10 08:20:00 2014 New Revision: 267321 URL: http://svnweb.freebsd.org/changeset/base/267321 Log: Avoid the USB device disconnected and controller shutdown clutter on system shutdown by putting the former under !rebooting and turning the latter into debug messages. Reviewed by: hps MFC after:1 week Sponsored by: Bally Wulff Games Entertainment GmbH Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/controller/usb_controller.c == --- head/sys/dev/usb/controller/usb_controller.cTue Jun 10 08:15:41 2014(r267320) +++ head/sys/dev/usb/controller/usb_controller.cTue Jun 10 08:20:00 2014(r267321) @@ -333,7 +333,7 @@ usb_shutdown(device_t dev) return (0); } - device_printf(bus-bdev, Controller shutdown\n); + DPRINTF(%s: Controller shutdown\n, device_get_nameunit(bus-bdev)); USB_BUS_LOCK(bus); usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), @@ -345,7 +345,8 @@ usb_shutdown(device_t dev) } USB_BUS_UNLOCK(bus); - device_printf(bus-bdev, Controller shutdown complete\n); + DPRINTF(%s: Controller shutdown complete\n, + device_get_nameunit(bus-bdev)); return (0); } Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Tue Jun 10 08:15:41 2014 (r267320) +++ head/sys/dev/usb/usb_device.c Tue Jun 10 08:20:00 2014 (r267321) @@ -1124,10 +1124,12 @@ usb_detach_device_sub(struct usb_device */ *ppdev = NULL; - device_printf(dev, at %s, port %d, addr %d - (disconnected)\n, - device_get_nameunit(udev-parent_dev), - udev-port_no, udev-address); + if (!rebooting) { + device_printf(dev, at %s, port %d, addr %d + (disconnected)\n, + device_get_nameunit(udev-parent_dev), + udev-port_no, udev-address); + } if (device_is_attached(dev)) { if (udev-flags.peer_suspended) { @@ -2143,8 +2145,10 @@ usb_free_device(struct usb_device *udev, #endif #if USB_HAVE_UGEN - printf(%s: %s at %s (disconnected)\n, udev-ugen_name, - usb_get_manufacturer(udev), device_get_nameunit(bus-bdev)); + if (!rebooting) { + printf(%s: %s at %s (disconnected)\n, udev-ugen_name, + usb_get_manufacturer(udev), device_get_nameunit(bus-bdev)); + } /* Destroy UGEN symlink, if any */ if (udev-ugen_symlink) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267322 - stable/9/sys/i386/conf
Author: marius Date: Tue Jun 10 09:33:58 2014 New Revision: 267322 URL: http://svnweb.freebsd.org/changeset/base/267322 Log: MFC: r266821 (partial) - Actually, modules are built correctly when compiled along the kernel as they then pick up an opt_global.h from KERNBUILDDIR having PAE defined. Thus, build all modules by default except those which still really are defective as of r267058. - Minor style cleanup. Approved by: re (glebius) Modified: stable/9/sys/i386/conf/PAE Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/conf/PAE == --- stable/9/sys/i386/conf/PAE Tue Jun 10 08:20:00 2014(r267321) +++ stable/9/sys/i386/conf/PAE Tue Jun 10 09:33:58 2014(r267322) @@ -10,9 +10,8 @@ ident PAE-GENERIC # To make a PAE kernel, the next option is needed optionsPAE # Physical Address Extensions Kernel -# Don't build modules with this kernel config, since they are not built with -# the correct options headers. -makeoptionsNO_MODULES=yes +# The following modules don't build with PAE enabled. +makeoptionsWITHOUT_MODULES=ctl dpt hptmv ida malo mwl # force isp firmware to fully loaded device ispfw @@ -23,7 +22,6 @@ deviceispfw # address properly may cause data corruption when used in a machine with more # than 4 gigabytes of memory. - nodevice ahb nodevice amd nodevice sym ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267323 - stable/9/sys/i386/conf
Author: marius Date: Tue Jun 10 09:36:10 2014 New Revision: 267323 URL: http://svnweb.freebsd.org/changeset/base/267323 Log: MFC: r266820 (partial) - Shrink the list of excluded modules to what actually still doesn't build as of r267058. - Some style cleanups. Approved by: re (glebius) Modified: stable/9/sys/i386/conf/XEN Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/conf/XEN == --- stable/9/sys/i386/conf/XEN Tue Jun 10 09:33:58 2014(r267322) +++ stable/9/sys/i386/conf/XEN Tue Jun 10 09:36:10 2014(r267323) @@ -7,11 +7,12 @@ cpu I686_CPU ident XEN makeoptionsDEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols -makeoptionsWITHOUT_MODULES=aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mpr mps mwl nve rdma sound sym trm xfs + +# The following modules don't build with PAE and XEN enabled. +makeoptionsWITHOUT_MODULES=ctl dpt drm drm2 hptmv ida malo mwl rdma xfs optionsSCHED_ULE # ULE scheduler optionsPREEMPTION # Enable kernel thread preemption -#options SCHED_4BSD optionsINET# InterNETworking optionsINET6 # IPv6 communications protocols @@ -65,7 +66,6 @@ options MCLSHIFT=12 optionsSMP # Symmetric MultiProcessor Kernel device apic# I/O APIC - #deviceatkbdc # AT keyboard controller #deviceatkbd # AT keyboard device psm # PS/2 mouse @@ -87,4 +87,3 @@ devicefaith # IPv6-to-IPv4 relaying ( # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter - ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267324 - head/tools/tools/vt/fontcvt
Author: emaste Date: Tue Jun 10 12:59:56 2014 New Revision: 267324 URL: http://svnweb.freebsd.org/changeset/base/267324 Log: vt fontcvt: handle failure writing output font Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c == --- head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 10 09:36:10 2014 (r267323) +++ head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 10 12:59:56 2014 (r267324) @@ -354,7 +354,7 @@ number_glyphs(void) gl-g_index = idx++; } -static void +static int write_glyphs(FILE *fp) { struct glyph *gl; @@ -362,8 +362,10 @@ write_glyphs(FILE *fp) for (i = 0; i VFNT_MAPS; i++) { TAILQ_FOREACH(gl, glyphs[i], g_list) - fwrite(gl-g_data, wbytes * height, 1, fp); + if (fwrite(gl-g_data, wbytes * height, 1, fp) != 1) + return (1); } + return (0); } static void @@ -390,7 +392,7 @@ struct file_mapping { uint16_tlength; } __packed; -static void +static int write_mappings(FILE *fp, unsigned int map_idx) { struct mapping_list *ml = maps[map_idx]; @@ -405,10 +407,12 @@ write_mappings(FILE *fp, unsigned int ma fm.source = htobe32(mp-m_char); fm.destination = htobe16(mp-m_glyph-g_index); fm.length = htobe16(mp-m_length - 1); - fwrite(fm, sizeof fm, 1, fp); + if (fwrite(fm, sizeof fm, 1, fp) != 1) + return (1); } } assert(i == j); + return (0); } struct file_header { @@ -441,13 +445,19 @@ write_fnt(const char *filename) fh.map_count[1] = htobe32(map_folded_count[1]); fh.map_count[2] = htobe32(map_folded_count[2]); fh.map_count[3] = htobe32(map_folded_count[3]); - fwrite(fh, sizeof fh, 1, fp); + if (fwrite(fh, sizeof fh, 1, fp) != 1) { + perror(filename); + return (1); + } - write_glyphs(fp); - write_mappings(fp, VFNT_MAP_NORMAL); - write_mappings(fp, 1); - write_mappings(fp, VFNT_MAP_BOLD); - write_mappings(fp, 3); + if (write_glyphs(fp) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL) != 0 || + write_mappings(fp, 1) != 0 || + write_mappings(fp, VFNT_MAP_BOLD) != 0 || + write_mappings(fp, 3) != 0) { + perror(filename); + return (1); + } return (0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r267318 - head/usr.bin/dtc
On Tue, Jun 10, 2014 at 2:16 AM, Rui Paulo rpa...@freebsd.org wrote: Author: rpaulo Date: Tue Jun 10 06:16:34 2014 New Revision: 267318 URL: http://svnweb.freebsd.org/changeset/base/267318 Log: dtc: ignore lines starting with #. This is necessary because we use the C pre-processor to parse #include lines and cpp adds line markings that start with #. [Obligatory note that cpp is tied to its C compiler and is only obligated to produce output acceptable to that C compiler; such output could be arbitrarily complex.] -Ben ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267326 - head/release
Author: gjb Date: Tue Jun 10 15:19:28 2014 New Revision: 267326 URL: http://svnweb.freebsd.org/changeset/base/267326 Log: Add empty pkg-stage file to CLEANFILES if WITH_DVD=1. MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Tue Jun 10 13:57:15 2014(r267325) +++ head/release/Makefile Tue Jun 10 15:19:28 2014(r267326) @@ -100,6 +100,9 @@ CLEANFILES= packagesystem *.txz MANIFEST CLEANFILES+= ${I}.xz . endfor .endif +. if defined(WITH_DVD) !empty(WITH_DVD) +CLEANFILES+= pkg-stage +. endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267327 - head/release
Author: gjb Date: Tue Jun 10 15:20:41 2014 New Revision: 267327 URL: http://svnweb.freebsd.org/changeset/base/267327 Log: Fix indentation level. MFC after:3 days X-MFC-With: r267326 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Tue Jun 10 15:19:28 2014(r267326) +++ head/release/Makefile Tue Jun 10 15:20:41 2014(r267327) @@ -100,9 +100,9 @@ CLEANFILES= packagesystem *.txz MANIFEST CLEANFILES+= ${I}.xz . endfor .endif -. if defined(WITH_DVD) !empty(WITH_DVD) +.if defined(WITH_DVD) !empty(WITH_DVD) CLEANFILES+= pkg-stage -. endif +.endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267328 - head/sys/dev/netmap
Author: luigi Date: Tue Jun 10 16:06:59 2014 New Revision: 267328 URL: http://svnweb.freebsd.org/changeset/base/267328 Log: change the netmap mbuf destructor so the same code works also on FreeBSD 9. For head and 10 this change has no effect, but on stable/9 it would cause panics when using emulated netmap on top of a standard device driver. Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c == --- head/sys/dev/netmap/netmap_generic.cTue Jun 10 15:20:41 2014 (r267327) +++ head/sys/dev/netmap/netmap_generic.cTue Jun 10 16:06:59 2014 (r267328) @@ -102,24 +102,30 @@ __FBSDID($FreeBSD$); * mbuf wrappers */ -/* mbuf destructor, also need to change the type to EXT_EXTREF, +/* + * mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and * chain into uma_zfree(zone_pack, mf) * (or reinstall the buffer ?) + * + * On FreeBSD 9 the destructor is called as ext_free(ext_arg1, ext_arg2) + * whereas newer version have ext_free(m, ext_arg1, ext_arg2) + * For compatibility we set ext_arg1 = m on allocation so we have + * the same code on both. */ #define SET_MBUF_DESTRUCTOR(m, fn) do {\ - (m)-m_ext.ext_free = (void *)fn; \ - (m)-m_ext.ext_type = EXT_EXTREF; \ -} while (0) + (m)-m_ext.ext_free = (void *)fn; \ + (m)-m_ext.ext_type = EXT_EXTREF; \ + } while (0) static void -netmap_default_mbuf_destructor(struct mbuf *m) +netmap_default_mbuf_destructor(struct mbuf *m) { - /* restore original mbuf */ - m-m_ext.ext_buf = m-m_data = m-m_ext.ext_arg1; - m-m_ext.ext_arg1 = NULL; + /* restore original data pointer and type */ + m-m_ext.ext_buf = m-m_data = m-m_ext.ext_arg2; m-m_ext.ext_type = EXT_PACKET; m-m_ext.ext_free = NULL; + m-m_ext.ext_arg1 = m-m_ext.ext_arg2 = NULL; if (*(m-m_ext.ref_cnt) == 0) *(m-m_ext.ref_cnt) = 1; uma_zfree(zone_pack, m); @@ -131,7 +137,8 @@ netmap_get_mbuf(int len) struct mbuf *m; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); if (m) { - m-m_ext.ext_arg1 = m-m_ext.ext_buf; // XXX save + m-m_ext.ext_arg1 = m; /* FreeBSD 9 compat */ + m-m_ext.ext_arg2 = m-m_ext.ext_buf; /* save original */ m-m_ext.ext_free = (void *)netmap_default_mbuf_destructor; m-m_ext.ext_type = EXT_EXTREF; ND(5, create m %p refcnt %d, m, *m-m_ext.ref_cnt); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267329 - head/sys/conf
Author: tuexen Date: Tue Jun 10 16:11:20 2014 New Revision: 267329 URL: http://svnweb.freebsd.org/changeset/base/267329 Log: Add support for the SCTP_LOCAL_TRACE_BUF options. While there, fix some whitespaces. MFC after: 1 week Modified: head/sys/conf/options Modified: head/sys/conf/options == --- head/sys/conf/options Tue Jun 10 16:06:59 2014(r267328) +++ head/sys/conf/options Tue Jun 10 16:11:20 2014(r267329) @@ -453,8 +453,9 @@ SCTP_MBCNT_LOGGING opt_sctp.h # Log to K SCTP_PACKET_LOGGINGopt_sctp.h # Log to a packet buffer last N packets SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. -SCTP_USE_PERCPU_STATopt_sctp.h # Use per cpu stats. -SCTP_MCORE_INPUTopt_sctp.h # Have multiple input threads for input mbufs +SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. +SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs +SCTP_LOCAL_TRACE_BUF opt_sctp.h # Use tracebuffer exported via sysctl # # # ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267330 - in head/sys/amd64: include vmm vmm/intel
Author: neel Date: Tue Jun 10 16:45:58 2014 New Revision: 267330 URL: http://svnweb.freebsd.org/changeset/base/267330 Log: Add helper functions to populate VM exit information for rendezvous and astpending exits. This is to reduce code duplication between VT-x and SVM implementations. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/include/vmm.h == --- head/sys/amd64/include/vmm.hTue Jun 10 16:11:20 2014 (r267329) +++ head/sys/amd64/include/vmm.hTue Jun 10 16:45:58 2014 (r267330) @@ -146,6 +146,8 @@ cpuset_t vm_active_cpus(struct vm *vm); cpuset_t vm_suspended_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); +void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip); +void vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip); /* * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. Modified: head/sys/amd64/vmm/intel/vmx.c == --- head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 16:11:20 2014 (r267329) +++ head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 16:45:58 2014 (r267330) @@ -2263,32 +2263,7 @@ vmx_exit_process(struct vmx *vmx, int vc return (handled); } -static __inline int -vmx_exit_astpending(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmexit-rip = vmcs_guest_rip(); - vmexit-inst_length = 0; - vmexit-exitcode = VM_EXITCODE_BOGUS; - vmx_astpending_trace(vmx, vcpu, vmexit-rip); - vmm_stat_incr(vmx-vm, vcpu, VMEXIT_ASTPENDING, 1); - - return (HANDLED); -} - -static __inline int -vmx_exit_rendezvous(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmexit-rip = vmcs_guest_rip(); - vmexit-inst_length = 0; - vmexit-exitcode = VM_EXITCODE_RENDEZVOUS; - vmm_stat_incr(vmx-vm, vcpu, VMEXIT_RENDEZVOUS, 1); - - return (UNHANDLED); -} - -static __inline int +static __inline void vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit) { @@ -2312,8 +2287,6 @@ vmx_exit_inst_error(struct vmxctx *vmxct default: panic(vm_exit_inst_error: vmx_enter_guest returned %d, rc); } - - return (UNHANDLED); } /* @@ -2386,6 +2359,8 @@ vmx_run(void *arg, int vcpu, register_t vmcs_write(VMCS_GUEST_RIP, startrip); vmx_set_pcpu_defaults(vmx, vcpu, pmap); do { + handled = UNHANDLED; + /* * Interrupts are disabled from this point on until the * guest starts executing. This is done for the following @@ -2408,19 +2383,20 @@ vmx_run(void *arg, int vcpu, register_t if (vcpu_suspended(suspend_cookie)) { enable_intr(); vm_exit_suspended(vmx-vm, vcpu, vmcs_guest_rip()); - handled = UNHANDLED; break; } if (vcpu_rendezvous_pending(rendezvous_cookie)) { enable_intr(); - handled = vmx_exit_rendezvous(vmx, vcpu, vmexit); + vm_exit_rendezvous(vmx-vm, vcpu, vmcs_guest_rip()); break; } if (curthread-td_flags (TDF_ASTPENDING | TDF_NEEDRESCHED)) { enable_intr(); - handled = vmx_exit_astpending(vmx, vcpu, vmexit); + vm_exit_astpending(vmx-vm, vcpu, vmcs_guest_rip()); + vmx_astpending_trace(vmx, vcpu, vmexit-rip); + handled = HANDLED; break; } @@ -2440,7 +2416,7 @@ vmx_run(void *arg, int vcpu, register_t handled = vmx_exit_process(vmx, vcpu, vmexit); } else { enable_intr(); - handled = vmx_exit_inst_error(vmxctx, rc, vmexit); + vmx_exit_inst_error(vmxctx, rc, vmexit); } launched = 1; vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); Modified: head/sys/amd64/vmm/vmm.c == --- head/sys/amd64/vmm/vmm.cTue Jun 10 16:11:20 2014(r267329) +++ head/sys/amd64/vmm/vmm.cTue Jun 10 16:45:58 2014(r267330) @@ -1331,6 +1331,32 @@ vm_exit_suspended(struct vm *vm, int vcp vmexit-u.suspended.how = vm-suspend; } +void +vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + KASSERT(vm-rendezvous_func != NULL, (rendezvous not in progress)); + + vmexit = vm_exitinfo(vm, vcpuid); +
svn commit: r267331 - in head: . etc share/mk
Author: jmmv Date: Tue Jun 10 17:04:30 2014 New Revision: 267331 URL: http://svnweb.freebsd.org/changeset/base/267331 Log: Put the test suite in its own tests.txz distribution file. Force all the contents of /usr/tests to go into a separate distribution file so that users of binary releases can easily choose to not install it. To make this possible, we need two fixes: - bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we do not recurse into 'tests' subdirectories when we needn't. Otherwise, we end up with some Kyuafiles in base.txz. - etc/Makefile needs to skip installing tests in its 'distribute' target so that a Kyuafile doesn't leak into base.txz. Approved by: gjb Modified: head/Makefile.inc1 head/etc/Makefile head/share/mk/bsd.subdir.mk head/share/mk/bsd.test.mk Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Jun 10 16:45:58 2014(r267330) +++ head/Makefile.inc1 Tue Jun 10 17:04:30 2014(r267331) @@ -776,6 +776,9 @@ EXTRA_DISTRIBUTIONS+= games .if defined(LIB32TMP) ${MK_LIB32} != no EXTRA_DISTRIBUTIONS+= lib32 .endif +.if ${MK_TESTS} != no +EXTRA_DISTRIBUTIONS+= tests +.endif MTREE_MAGIC?= mtree 2.0 @@ -817,6 +820,10 @@ distributeworld installworld: _installch mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib /dev/null .endif +.if ${MK_TESTS} != no ${dist} == tests + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ + -p ${DESTDIR}/${DISTDIR}/${dist}/usr /dev/null +.endif .if defined(NO_ROOT) ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ sed -e 's#^\./#./${dist}/#' ${METALOG} Modified: head/etc/Makefile == --- head/etc/Makefile Tue Jun 10 16:45:58 2014(r267330) +++ head/etc/Makefile Tue Jun 10 17:04:30 2014(r267331) @@ -174,7 +174,10 @@ afterinstall: .endif distribute: - ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION} + # Avoid installing tests here; make distribution will do this and + # correctly place them in the right location. + ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \ + DESTDIR=${DISTDIR}/${DISTRIBUTION} ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} .include bsd.endian.mk Modified: head/share/mk/bsd.subdir.mk == --- head/share/mk/bsd.subdir.mk Tue Jun 10 16:45:58 2014(r267330) +++ head/share/mk/bsd.subdir.mk Tue Jun 10 17:04:30 2014(r267331) @@ -81,6 +81,7 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE +.if !defined(NO_SUBDIR) @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ ${ECHODIR} === ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install}); \ @@ -94,6 +95,7 @@ ${__target}_subdir_${__dir}: .MAKE ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ .endif +.endif .endfor ${__target}: ${__subdir_targets} .else Modified: head/share/mk/bsd.test.mk == --- head/share/mk/bsd.test.mk Tue Jun 10 16:45:58 2014(r267330) +++ head/share/mk/bsd.test.mk Tue Jun 10 17:04:30 2014(r267331) @@ -27,6 +27,15 @@ TESTS_SUBDIRS?= # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= +# Force all tests in a separate distribution file. +# +# We want this to be the case even when the distribution name is already +# overriden. For example: we want the tests for programs in the 'games' +# distribution to end up in the 'tests' distribution; the test programs +# themselves have all the necessary logic to detect that the games are not +# installed and thus won't cause false negatives. +DISTRIBUTION:= tests + # Ordered list of directories to construct the PATH for the tests. TESTS_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin \ ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267332 - head/release
Author: jmmv Date: Tue Jun 10 17:05:41 2014 New Revision: 267332 URL: http://svnweb.freebsd.org/changeset/base/267332 Log: Strip out the test suite from the installation media. This affects the disc1.iso, dvd1.iso and bootonly.iso files. Obtained from:gjb Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Tue Jun 10 17:04:30 2014(r267331) +++ head/release/Makefile Tue Jun 10 17:05:41 2014(r267332) @@ -155,7 +155,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist @@ -180,7 +180,7 @@ bootonly: packagesystem WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \ WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \ WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \ - WITHOUT_KERNEL_SYMBOLS=1 + WITHOUT_KERNEL_SYMBOLS=1 MK_TESTS=no # Copy manifest only (no distfiles) to get checksums mkdir -p bootonly/usr/freebsd-dist cp MANIFEST bootonly/usr/freebsd-dist @@ -199,7 +199,8 @@ dvd: # Install system mkdir -p ${.TARGET} cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ + MK_TESTS=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267333 - stable/10/sys/dev/netmap
Author: luigi Date: Tue Jun 10 17:17:44 2014 New Revision: 267333 URL: http://svnweb.freebsd.org/changeset/base/267333 Log: MFC 267328: change the netmap mbuf destructor so the same code works also on FreeBSD 9. For head and 10 this change has no effect, but on stable/9 it would cause panics when using emulated netmap on top of a standard device driver. MFC after:3 days Modified: stable/10/sys/dev/netmap/netmap_generic.c Modified: stable/10/sys/dev/netmap/netmap_generic.c == --- stable/10/sys/dev/netmap/netmap_generic.c Tue Jun 10 17:05:41 2014 (r267332) +++ stable/10/sys/dev/netmap/netmap_generic.c Tue Jun 10 17:17:44 2014 (r267333) @@ -102,24 +102,30 @@ __FBSDID($FreeBSD$); * mbuf wrappers */ -/* mbuf destructor, also need to change the type to EXT_EXTREF, +/* + * mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and * chain into uma_zfree(zone_pack, mf) * (or reinstall the buffer ?) + * + * On FreeBSD 9 the destructor is called as ext_free(ext_arg1, ext_arg2) + * whereas newer version have ext_free(m, ext_arg1, ext_arg2) + * For compatibility we set ext_arg1 = m on allocation so we have + * the same code on both. */ #define SET_MBUF_DESTRUCTOR(m, fn) do {\ - (m)-m_ext.ext_free = (void *)fn; \ - (m)-m_ext.ext_type = EXT_EXTREF; \ -} while (0) + (m)-m_ext.ext_free = (void *)fn; \ + (m)-m_ext.ext_type = EXT_EXTREF; \ + } while (0) static void -netmap_default_mbuf_destructor(struct mbuf *m) +netmap_default_mbuf_destructor(struct mbuf *m) { - /* restore original mbuf */ - m-m_ext.ext_buf = m-m_data = m-m_ext.ext_arg1; - m-m_ext.ext_arg1 = NULL; + /* restore original data pointer and type */ + m-m_ext.ext_buf = m-m_data = m-m_ext.ext_arg2; m-m_ext.ext_type = EXT_PACKET; m-m_ext.ext_free = NULL; + m-m_ext.ext_arg1 = m-m_ext.ext_arg2 = NULL; if (*(m-m_ext.ref_cnt) == 0) *(m-m_ext.ref_cnt) = 1; uma_zfree(zone_pack, m); @@ -131,7 +137,8 @@ netmap_get_mbuf(int len) struct mbuf *m; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); if (m) { - m-m_ext.ext_arg1 = m-m_ext.ext_buf; // XXX save + m-m_ext.ext_arg1 = m; /* FreeBSD 9 compat */ + m-m_ext.ext_arg2 = m-m_ext.ext_buf; /* save original */ m-m_ext.ext_free = (void *)netmap_default_mbuf_destructor; m-m_ext.ext_type = EXT_EXTREF; ND(5, create m %p refcnt %d, m, *m-m_ext.ref_cnt); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r267332 - head/release
On 06/10/14 10:05, Julio Merino wrote: Author: jmmv Date: Tue Jun 10 17:05:41 2014 New Revision: 267332 URL: http://svnweb.freebsd.org/changeset/base/267332 Log: Strip out the test suite from the installation media. This affects the disc1.iso, dvd1.iso and bootonly.iso files. Obtained from: gjb Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Tue Jun 10 17:04:30 2014(r267331) +++ head/release/Makefile Tue Jun 10 17:05:41 2014(r267332) @@ -155,7 +155,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 # Copy distfiles Shouldn't this be WITHOUT_TESTS or the like? I thought we weren't supposed to set MK_* at the command line. -Nathan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267334 - stable/10/sys/dev/netmap
Author: luigi Date: Tue Jun 10 17:24:46 2014 New Revision: 267334 URL: http://svnweb.freebsd.org/changeset/base/267334 Log: MFC 267284 Fixes from Fanco Ficthner on transparent mode * The way rings are updated changed with the last API bump. Also sync -head when moving slots in netmap_sw_to_nic(). * Remove a crashing selrecord() call. * Unclog the logic surrounding netmap_rxsync_from_host(). * Add timestamping to RX host ring. * Remove a couple of obsolete comments. Submitted by: Franco Fichtner MFC after:3 days Sponsored by: Packetwerk Modified: stable/10/sys/dev/netmap/netmap.c Modified: stable/10/sys/dev/netmap/netmap.c == --- stable/10/sys/dev/netmap/netmap.c Tue Jun 10 17:17:44 2014 (r267333) +++ stable/10/sys/dev/netmap/netmap.c Tue Jun 10 17:24:46 2014 (r267334) @@ -981,7 +981,7 @@ netmap_sw_to_nic(struct netmap_adapter * dst-len = tmp.len; dst-flags = NS_BUF_CHANGED; - rdst-cur = nm_next(dst_cur, dst_lim); + rdst-head = rdst-cur = nm_next(dst_cur, dst_lim); } /* if (sent) XXX txsync ? */ } @@ -1028,11 +1028,6 @@ netmap_txsync_to_host(struct netmap_adap * They have been put in kring-rx_queue by netmap_transmit(). * We protect access to the kring using kring-rx_queue.lock * - * This routine also does the selrecord if called from the poll handler - * (we know because td != NULL). - * - * NOTE: on linux, selrecord() is defined as a macro and uses pwait - * as an additional hidden argument. * returns the number of packets delivered to tx queues in * transparent mode, or a negative value if error */ @@ -1088,10 +1083,6 @@ netmap_rxsync_from_host(struct netmap_ad nm_rxsync_finalize(kring); - /* access copies of cur,tail in the kring */ - if (kring-rcur == kring-rtail td) /* no bufs available */ - selrecord(td, kring-si); - mbq_unlock(q); return ret; } @@ -2124,8 +2115,6 @@ do_retry_rx: /* * transparent mode support: collect packets * from the rxring(s). -* XXX NR_FORWARD should only be read on -* physical or NIC ports */ if (netmap_fwd ||kring-ring-flags NR_FORWARD) { ND(10, forwarding some buffers up %d to %d, @@ -2152,13 +2141,12 @@ do_retry_rx: /* transparent mode XXX only during first pass ? */ if (na-na_flags NAF_HOST_RINGS) { kring = na-rx_rings[na-num_rx_rings]; - if (check_all_rx -(netmap_fwd || kring-ring-flags NR_FORWARD)) { - /* XXX fix to use kring fields */ - if (nm_ring_empty(kring-ring)) - send_down = netmap_rxsync_from_host(na, td, dev); - if (!nm_ring_empty(kring-ring)) - revents |= want_rx; + if (netmap_fwd || kring-ring-flags NR_FORWARD) { + send_down = netmap_rxsync_from_host(na, td, dev); + if (send_down (netmap_no_timestamp == 0 || + kring-ring-flags NR_TIMESTAMP)) { + microtime(kring-ring-ts); + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r267332 - head/release
On Tue, Jun 10, 2014 at 10:22:15AM -0700, Nathan Whitehorn wrote: On 06/10/14 10:05, Julio Merino wrote: Author: jmmv Date: Tue Jun 10 17:05:41 2014 New Revision: 267332 URL: http://svnweb.freebsd.org/changeset/base/267332 Log: Strip out the test suite from the installation media. This affects the disc1.iso, dvd1.iso and bootonly.iso files. Obtained from:gjb Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/MakefileTue Jun 10 17:04:30 2014(r267331) +++ head/release/MakefileTue Jun 10 17:05:41 2014(r267332) @@ -155,7 +155,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ -WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 +WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 # Copy distfiles Shouldn't this be WITHOUT_TESTS or the like? I thought we weren't supposed to set MK_* at the command line. It does not work, or at least last I tried, because you cannot specify WITHOUT_FOO=1 if WITH_FOO=1 is set. Using MK_FOO=no allows more granular tuning for these cases. Glen pgpmhE7xgH6_L.pgp Description: PGP signature
Re: svn commit: r267332 - head/release
On 06/10/14 10:26, Glen Barber wrote: On Tue, Jun 10, 2014 at 10:22:15AM -0700, Nathan Whitehorn wrote: On 06/10/14 10:05, Julio Merino wrote: Author: jmmv Date: Tue Jun 10 17:05:41 2014 New Revision: 267332 URL: http://svnweb.freebsd.org/changeset/base/267332 Log: Strip out the test suite from the installation media. This affects the disc1.iso, dvd1.iso and bootonly.iso files. Obtained from: gjb Modified: head/release/Makefile Modified: head/release/Makefile == --- head/release/Makefile Tue Jun 10 17:04:30 2014(r267331) +++ head/release/Makefile Tue Jun 10 17:05:41 2014(r267332) @@ -155,7 +155,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 # Copy distfiles Shouldn't this be WITHOUT_TESTS or the like? I thought we weren't supposed to set MK_* at the command line. It does not work, or at least last I tried, because you cannot specify WITHOUT_FOO=1 if WITH_FOO=1 is set. Using MK_FOO=no allows more granular tuning for these cases. Glen Ah, OK. Just wanted to make sure it was deliberate! -Nathan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267335 - head/lib/clang
Author: dim Date: Tue Jun 10 17:54:24 2014 New Revision: 267335 URL: http://svnweb.freebsd.org/changeset/base/267335 Log: In some scenarios, when generating llvm/clang .inc.h files, multiple source files could be passed to tblgen or clang-tblgen, leading to a Too many positional arguments specified error message. Fix this by replacing the too-generic ${.ALLSRC} sources with explicit paths. Reported by: ryst...@gmail.com, rodrigc MFC after:3 days Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk == --- head/lib/clang/clang.build.mk Tue Jun 10 17:24:46 2014 (r267334) +++ head/lib/clang/clang.build.mk Tue Jun 10 17:54:24 2014 (r267335) @@ -74,149 +74,160 @@ ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-classes \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-dump \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-read \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-write \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} +
svn commit: r267336 - head/sys/netgraph/bluetooth/socket
Author: trociny Date: Tue Jun 10 18:21:37 2014 New Revision: 267336 URL: http://svnweb.freebsd.org/changeset/base/267336 Log: PF_BLUETOOTH protocols: skip initialization of non-virtualized globals for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded. MFC after:1 week Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c == --- head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.cTue Jun 10 17:54:24 2014(r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.cTue Jun 10 18:21:37 2014(r267336) @@ -51,6 +51,9 @@ #include sys/socketvar.h #include sys/sysctl.h #include sys/taskqueue.h + +#include net/vnet.h + #include netgraph/ng_message.h #include netgraph/netgraph.h #include netgraph/bluetooth/include/ng_bluetooth.h @@ -728,6 +731,10 @@ ng_btsocket_hci_raw_init(void) bitstr_t*f = NULL; int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_hci_raw_node = NULL; ng_btsocket_hci_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_hci_raw_ioctl_timeout = 5; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c == --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 17:54:24 2014(r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 18:21:37 2014(r267336) @@ -1813,6 +1813,10 @@ ng_btsocket_l2cap_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_node = NULL; ng_btsocket_l2cap_debug_level = NG_BTSOCKET_WARN_LEVEL; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c == --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 17:54:24 2014(r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 18:21:37 2014(r267336) @@ -50,6 +50,9 @@ #include sys/socketvar.h #include sys/sysctl.h #include sys/taskqueue.h + +#include net/vnet.h + #include netgraph/ng_message.h #include netgraph/netgraph.h #include netgraph/bluetooth/include/ng_bluetooth.h @@ -513,6 +516,10 @@ ng_btsocket_l2cap_raw_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_raw_node = NULL; ng_btsocket_l2cap_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_l2cap_raw_ioctl_timeout = 5; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c == --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 17:54:24 2014(r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 18:21:37 2014(r267336) @@ -328,6 +328,11 @@ ng_btsocket_rfcomm_check_fcs(u_int8_t *d void ng_btsocket_rfcomm_init(void) { + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_rfcomm_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_rfcomm_timo = 60; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c == --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.cTue Jun 10 17:54:24 2014(r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.cTue Jun 10 18:21:37 2014(r267336) @@ -1107,6 +1107,10 @@ ng_btsocket_sco_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_sco_node = NULL; ng_btsocket_sco_debug_level = NG_BTSOCKET_WARN_LEVEL; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267337 - in head: tools/tools/vt/fontcvt usr.bin usr.bin/vtfontcvt
Author: emaste Date: Tue Jun 10 18:29:45 2014 New Revision: 267337 URL: http://svnweb.freebsd.org/changeset/base/267337 Log: vt fontcvt: move to usr.bin/vtfontcvt vtfontcvt is useful for end users to convert arbitrary bitmap fonts for use by vt(4). It can also be used as a build tool, allowing us to keep the source font data in the src tree rather than uuencoded binaries. Reviewed by: ray, wblock (D183) Sponsored by: The FreeBSD Foundation Added: head/usr.bin/vtfontcvt/ head/usr.bin/vtfontcvt/Makefile - copied, changed from r267335, head/tools/tools/vt/fontcvt/Makefile head/usr.bin/vtfontcvt/vtfontcvt.8 (contents, props changed) head/usr.bin/vtfontcvt/vtfontcvt.c - copied, changed from r267335, head/tools/tools/vt/fontcvt/fontcvt.c Deleted: head/tools/tools/vt/fontcvt/Makefile head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/terminus.sh head/usr.bin/Makefile Modified: head/tools/tools/vt/fontcvt/terminus.sh == --- head/tools/tools/vt/fontcvt/terminus.sh Tue Jun 10 18:21:37 2014 (r267336) +++ head/tools/tools/vt/fontcvt/terminus.sh Tue Jun 10 18:29:45 2014 (r267337) @@ -5,7 +5,7 @@ for i in 6:12 8:14 8:16 10:18 10:20 11:2 do C=`echo $i | cut -f 1 -d :` R=`echo $i | cut -f 2 -d :` - ./fontcvt \ + ./vtfontcvt \ -w $C -h $R \ ~/terminus-font-4.36/ter-u${R}n.bdf \ ~/terminus-font-4.36/ter-u${R}b.bdf \ Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Tue Jun 10 18:21:37 2014(r267336) +++ head/usr.bin/Makefile Tue Jun 10 18:29:45 2014(r267337) @@ -362,6 +362,10 @@ SUBDIR+= yacc SUBDIR+= vi .endif +.if ${MK_VT_SUPPORT} != no +SUBDIR+= vtfontcvt +.endif + .if ${MK_USB} != no SUBDIR+= usbhidaction SUBDIR+= usbhidctl Copied and modified: head/usr.bin/vtfontcvt/Makefile (from r267335, head/tools/tools/vt/fontcvt/Makefile) == --- head/tools/tools/vt/fontcvt/MakefileTue Jun 10 17:54:24 2014 (r267335, copy source) +++ head/usr.bin/vtfontcvt/Makefile Tue Jun 10 18:29:45 2014 (r267337) @@ -1,5 +1,7 @@ -PROG= fontcvt -MAN1= +# $FreeBSD$ + +PROG= vtfontcvt +MAN8= vtfontcvt.8 WARNS?=6 Added: head/usr.bin/vtfontcvt/vtfontcvt.8 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Tue Jun 10 18:29:45 2014 (r267337) @@ -0,0 +1,74 @@ +.\ Copyright (c) 2014 The FreeBSD Foundation. All rights reserved. +.\ +.\ +.\ Redistribution and use in source and binary forms, with or without +.\ modification, are permitted provided that the following conditions +.\ are met: +.\ 1. Redistributions of source code must retain the above copyright +.\notice, this list of conditions and the following disclaimer. +.\ 2. Redistributions in binary form must reproduce the above copyright +.\notice, this list of conditions and the following disclaimer in the +.\documentation and/or other materials provided with the distribution. +.\ +.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\ SUCH DAMAGE. +.\ +.\ $FreeBSD$ +.\ +.Dd June 9, 2014 +.Dt VTFONTCVT 8 +.Os +.Sh NAME +.Nm vtfontcvt +.Nd convert font files for use by the video console +.Sh SYNOPSIS +.Nm +.Op Fl h Ar height +.Op Fl v +.Op Fl w Ar width +.Ar normal_font +.Op Ar bold_font +.Ar output_file +.Sh DESCRIPTION +The +.Nm +utility reads source font files in either BDF or Unifont HEX format and +outputs a binary font file for use by +.Xr vt 4 . +HEX format files must have the file extension +.Pa .hex . +.Pp +The following options are available: +.Bl -tag -width 12345678 +.It Fl h Ar height +Set font height. +The default is 16. +Font height is set automatically for HEX files that have a +.Ql # Height: Ar height +comment before any font data. +.It Fl v +Display verbose statistics about the converted font. +.It Fl w Ar width
svn commit: r267338 - head/sys/amd64/include
Author: tychon Date: Tue Jun 10 18:46:00 2014 New Revision: 267338 URL: http://svnweb.freebsd.org/changeset/base/267338 Log: Replace enum forward declarations with complete definitions. Reviewed by: neel Modified: head/sys/amd64/include/vmm.h Modified: head/sys/amd64/include/vmm.h == --- head/sys/amd64/include/vmm.hTue Jun 10 18:29:45 2014 (r267337) +++ head/sys/amd64/include/vmm.hTue Jun 10 18:46:00 2014 (r267338) @@ -37,6 +37,53 @@ enum vm_suspend_how { VM_SUSPEND_LAST }; +/* + * Identifiers for architecturally defined registers. + */ +enum vm_reg_name { + VM_REG_GUEST_RAX, + VM_REG_GUEST_RBX, + VM_REG_GUEST_RCX, + VM_REG_GUEST_RDX, + VM_REG_GUEST_RSI, + VM_REG_GUEST_RDI, + VM_REG_GUEST_RBP, + VM_REG_GUEST_R8, + VM_REG_GUEST_R9, + VM_REG_GUEST_R10, + VM_REG_GUEST_R11, + VM_REG_GUEST_R12, + VM_REG_GUEST_R13, + VM_REG_GUEST_R14, + VM_REG_GUEST_R15, + VM_REG_GUEST_CR0, + VM_REG_GUEST_CR3, + VM_REG_GUEST_CR4, + VM_REG_GUEST_DR7, + VM_REG_GUEST_RSP, + VM_REG_GUEST_RIP, + VM_REG_GUEST_RFLAGS, + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS, + VM_REG_GUEST_LDTR, + VM_REG_GUEST_TR, + VM_REG_GUEST_IDTR, + VM_REG_GUEST_GDTR, + VM_REG_GUEST_EFER, + VM_REG_GUEST_CR2, + VM_REG_LAST +}; + +enum x2apic_state { + X2APIC_DISABLED, + X2APIC_ENABLED, + X2APIC_STATE_LAST +}; + #ifdef _KERNEL #defineVM_MAX_NAMELEN 32 @@ -54,9 +101,6 @@ struct vmspace; struct vm_object; struct pmap; -enum vm_reg_name; -enum x2apic_state; - typedef int(*vmm_init_func_t)(int ipinum); typedef int(*vmm_cleanup_func_t)(void); typedef void (*vmm_resume_func_t)(void); @@ -250,47 +294,6 @@ enum vm_reg_name vm_segment_name(int seg #defineVM_MAXCPU 16 /* maximum virtual cpus */ /* - * Identifiers for architecturally defined registers. - */ -enum vm_reg_name { - VM_REG_GUEST_RAX, - VM_REG_GUEST_RBX, - VM_REG_GUEST_RCX, - VM_REG_GUEST_RDX, - VM_REG_GUEST_RSI, - VM_REG_GUEST_RDI, - VM_REG_GUEST_RBP, - VM_REG_GUEST_R8, - VM_REG_GUEST_R9, - VM_REG_GUEST_R10, - VM_REG_GUEST_R11, - VM_REG_GUEST_R12, - VM_REG_GUEST_R13, - VM_REG_GUEST_R14, - VM_REG_GUEST_R15, - VM_REG_GUEST_CR0, - VM_REG_GUEST_CR3, - VM_REG_GUEST_CR4, - VM_REG_GUEST_DR7, - VM_REG_GUEST_RSP, - VM_REG_GUEST_RIP, - VM_REG_GUEST_RFLAGS, - VM_REG_GUEST_ES, - VM_REG_GUEST_CS, - VM_REG_GUEST_SS, - VM_REG_GUEST_DS, - VM_REG_GUEST_FS, - VM_REG_GUEST_GS, - VM_REG_GUEST_LDTR, - VM_REG_GUEST_TR, - VM_REG_GUEST_IDTR, - VM_REG_GUEST_GDTR, - VM_REG_GUEST_EFER, - VM_REG_GUEST_CR2, - VM_REG_LAST -}; - -/* * Identifiers for optional vmm capabilities */ enum vm_cap_type { @@ -302,12 +305,6 @@ enum vm_cap_type { VM_CAP_MAX }; -enum x2apic_state { - X2APIC_DISABLED, - X2APIC_ENABLED, - X2APIC_STATE_LAST -}; - enum vm_intr_trigger { EDGE_TRIGGER, LEVEL_TRIGGER ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267339 - stable/10/usr.sbin/bhyve
Author: jhb Date: Tue Jun 10 19:00:14 2014 New Revision: 267339 URL: http://svnweb.freebsd.org/changeset/base/267339 Log: MFC 261000,261785,263238,263322,264302: Various AHCI fixes: - Fix issue with stale fields from a recycled request pulled off the freelist. - Provide an indication a PIO Setup Device to Host FIS occurred while executing the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands. - Provide an indication a D2H Register FIS occurred during a SET FEATURES command. - Though there currently isn't a way to insert new media into an ATAPI drive, at least pretend to support Asynchronous Notification (AN) to avoid a guest needlessly polling for it. - Don't reissue in-flight commands. - Constrain the amount of data returned to what is actually available not the size of the buffer. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c == --- stable/10/usr.sbin/bhyve/pci_ahci.c Tue Jun 10 18:46:00 2014 (r267338) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Tue Jun 10 19:00:14 2014 (r267339) @@ -95,6 +95,13 @@ enum sata_fis_type { #defineMODEPAGE_CD_CAPABILITIES0x2A /* + * ATA commands + */ +#defineATA_SF_ENAB_SATA_SF 0x10 +#defineATA_SATA_SF_AN 0x05 +#defineATA_SF_DIS_SATA_SF 0x90 + +/* * Debug printf */ #ifdef AHCI_DEBUG @@ -127,6 +134,7 @@ struct ahci_port { uint8_t xfermode; uint8_t sense_key; uint8_t asc; + uint32_t pending; uint32_t clb; uint32_t clbu; @@ -254,6 +262,16 @@ ahci_write_fis(struct ahci_port *p, enum } static void +ahci_write_fis_piosetup(struct ahci_port *p) +{ + uint8_t fis[20]; + + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_PIOSETUP; + ahci_write_fis(p, FIS_TYPE_PIOSETUP, fis); +} + +static void ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd) { uint8_t fis[8]; @@ -454,6 +472,10 @@ ahci_handle_dma(struct ahci_port *p, int if (iovcnt BLOCKIF_IOV_MAX) { aior-prdtl = iovcnt - BLOCKIF_IOV_MAX; iovcnt = BLOCKIF_IOV_MAX; + /* +* Mark this command in-flight. +*/ + p-pending |= 1 slot; } else aior-prdtl = 0; breq-br_iovcnt = iovcnt; @@ -477,7 +499,7 @@ ahci_handle_dma(struct ahci_port *p, int err = blockif_write(p-bctx, breq); assert(err == 0); - if (!aior-prdtl ncq) + if (ncq) p-ci = ~(1 slot); } @@ -497,6 +519,8 @@ ahci_handle_flush(struct ahci_port *p, i aior-cfis = cfis; aior-slot = slot; aior-len = 0; + aior-done = 0; + aior-prdtl = 0; breq = aior-io_req; err = blockif_flush(p-bctx, breq); @@ -519,12 +543,14 @@ write_prdt(struct ahci_port *p, int slot for (i = 0; i hdr-prdtl len; i++) { uint8_t *ptr; uint32_t dbcsz; + int sublen; dbcsz = (prdt-dbc DBCMASK) + 1; ptr = paddr_guest2host(ahci_ctx(p-pr_sc), prdt-dba, dbcsz); - memcpy(ptr, from, dbcsz); - len -= dbcsz; - from += dbcsz; + sublen = len dbcsz ? len : dbcsz; + memcpy(ptr, from, sublen); + len -= sublen; + from += sublen; prdt++; } hdr-prdbc = size - len; @@ -585,6 +611,7 @@ handle_identify(struct ahci_port *p, int buf[101] = (sectors 16); buf[102] = (sectors 32); buf[103] = (sectors 48); + ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); p-tfd = ATA_S_DSC | ATA_S_READY; p-is |= AHCI_P_IX_DP; @@ -627,6 +654,7 @@ handle_atapi_identify(struct ahci_port * buf[85] = (1 4); buf[87] = (1 14); buf[88] = (1 14 | 0x7f); + ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); p-tfd = ATA_S_DSC | ATA_S_READY; p-is |= AHCI_P_IX_DHR; @@ -1155,6 +1183,17 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_SETFEATURES: { switch (cfis[3]) { + case ATA_SF_ENAB_SATA_SF: + switch (cfis[12]) { + case ATA_SATA_SF_AN: + p-tfd = ATA_S_DSC | ATA_S_READY; + break; + default: + p-tfd = ATA_S_ERROR | ATA_S_READY; + p-tfd |= (ATA_ERROR_ABORT 8); +
svn commit: r267340 - in head/sys: arm/versatile dev/advansys dev/an dev/ata dev/buslogic dev/dpt dev/hifn dev/malo dev/mwl dev/safe dev/sym dev/trm dev/tx dev/ubsec
Author: jhb Date: Tue Jun 10 20:25:45 2014 New Revision: 267340 URL: http://svnweb.freebsd.org/changeset/base/267340 Log: Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Modified: head/sys/arm/versatile/versatile_clcd.c head/sys/dev/advansys/adwcam.c head/sys/dev/an/if_an.c head/sys/dev/ata/ata-dma.c head/sys/dev/buslogic/bt.c head/sys/dev/dpt/dpt_scsi.c head/sys/dev/hifn/hifn7751.c head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malohal.c head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/mwlhal.c head/sys/dev/safe/safe.c head/sys/dev/sym/sym_hipd.c head/sys/dev/trm/trm.c head/sys/dev/tx/if_tx.c head/sys/dev/ubsec/ubsec.c Modified: head/sys/arm/versatile/versatile_clcd.c == --- head/sys/arm/versatile/versatile_clcd.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/arm/versatile/versatile_clcd.c Tue Jun 10 20:25:45 2014 (r267340) @@ -363,8 +363,6 @@ versatile_clcdc_attach(device_t dev) fail: if (sc-fb_base) bus_dmamem_free(sc-dma_tag, sc-fb_base, sc-dma_map); - if (sc-dma_map) - bus_dmamap_destroy(sc-dma_tag, sc-dma_map); if (sc-dma_tag) bus_dma_tag_destroy(sc-dma_tag); return (err); Modified: head/sys/dev/advansys/adwcam.c == --- head/sys/dev/advansys/adwcam.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/advansys/adwcam.c Tue Jun 10 20:25:45 2014 (r267340) @@ -777,7 +777,6 @@ adw_free(struct adw_softc *adw) case 7: bus_dmamem_free(adw-acb_dmat, adw-acbs, adw-acb_dmamap); - bus_dmamap_destroy(adw-acb_dmat, adw-acb_dmamap); case 6: bus_dma_tag_destroy(adw-acb_dmat); case 5: @@ -785,7 +784,6 @@ adw_free(struct adw_softc *adw) case 4: bus_dmamem_free(adw-carrier_dmat, adw-carriers, adw-carrier_dmamap); - bus_dmamap_destroy(adw-carrier_dmat, adw-carrier_dmamap); case 3: bus_dma_tag_destroy(adw-carrier_dmat); case 2: Modified: head/sys/dev/an/if_an.c == --- head/sys/dev/an/if_an.c Tue Jun 10 19:00:14 2014(r267339) +++ head/sys/dev/an/if_an.c Tue Jun 10 20:25:45 2014(r267340) @@ -483,10 +483,6 @@ an_dma_malloc(struct an_softc *sc, bus_s { int r; - r = bus_dmamap_create(sc-an_dtag, BUS_DMA_NOWAIT, dma-an_dma_map); - if (r != 0) - goto fail_0; - r = bus_dmamem_alloc(sc-an_dtag, (void**) dma-an_dma_vaddr, BUS_DMA_NOWAIT, dma-an_dma_map); if (r != 0) @@ -507,9 +503,6 @@ fail_2: bus_dmamap_unload(sc-an_dtag, dma-an_dma_map); fail_1: bus_dmamem_free(sc-an_dtag, dma-an_dma_vaddr, dma-an_dma_map); -fail_0: - bus_dmamap_destroy(sc-an_dtag, dma-an_dma_map); - dma-an_dma_map = NULL; return (r); } @@ -519,7 +512,6 @@ an_dma_free(struct an_softc *sc, struct bus_dmamap_unload(sc-an_dtag, dma-an_dma_map); bus_dmamem_free(sc-an_dtag, dma-an_dma_vaddr, dma-an_dma_map); dma-an_dma_vaddr = 0; - bus_dmamap_destroy(sc-an_dtag, dma-an_dma_map); } /* Modified: head/sys/dev/ata/ata-dma.c == --- head/sys/dev/ata/ata-dma.c Tue Jun 10 19:00:14 2014(r267339) +++ head/sys/dev/ata/ata-dma.c Tue Jun 10 20:25:45 2014(r267340) @@ -224,11 +224,9 @@ ata_dmafree(device_t dev) bus_dmamap_unload(slot-sg_tag, slot-sg_map); slot-sg_bus = 0; } - if (slot-sg_map) { + if (slot-sg) { bus_dmamem_free(slot-sg_tag, slot-sg, slot-sg_map); -bus_dmamap_destroy(slot-sg_tag, slot-sg_map); slot-sg = NULL; -slot-sg_map = NULL; } if (slot-data_map) { bus_dmamap_destroy(slot-data_tag, slot-data_map); Modified: head/sys/dev/buslogic/bt.c == --- head/sys/dev/buslogic/bt.c Tue Jun 10 19:00:14 2014(r267339) +++ head/sys/dev/buslogic/bt.c Tue Jun 10 20:25:45 2014(r267340) @@ -246,7 +246,6 @@ bt_free_softc(device_t dev) case 6: bus_dmamem_free(bt-ccb_dmat, bt-bt_ccb_array, bt-ccb_dmamap); -
svn commit: r267341 - stable/10/usr.sbin/bhyve
Author: jhb Date: Tue Jun 10 21:20:37 2014 New Revision: 267341 URL: http://svnweb.freebsd.org/changeset/base/267341 Log: MFC 261217: Remove support for legacy PCI devices. These haven't been needed since support for LPC uart devices was added and it conflicts with upcoming patches to add PCI INTx support. Approved by: grehan Modified: stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_uart.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 == --- stable/10/usr.sbin/bhyve/bhyve.8Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/bhyve.8Tue Jun 10 21:20:37 2014 (r267341) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd December 12, 2013 +.Dd January 27, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -37,7 +37,6 @@ .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf -.Op Fl S Ar slot,emulation Ns Op , Ns Ar conf .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Ar vmname .Sh DESCRIPTION @@ -202,13 +201,6 @@ The host device must have been reserved loader variable as described in .Xr vmm 4 . .El -.It Fl S Ar slot , Ns Ar emulation Ns Op , Ns Ar conf -Identical to the -s option except the device is instructed to use legacy -ISA addresses if possible. -Currently this only has an effect with the -.Li uart -device emulation. -This option will be deprecated in a future version. .It Fl l Ar lpcdev Ns Op , Ns Ar conf Allow devices behind the LPC PCI-ISA bridge to be configured. The only supported devices are the TTY-class devices, Modified: stable/10/usr.sbin/bhyve/bhyverun.c == --- stable/10/usr.sbin/bhyve/bhyverun.c Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/bhyverun.c Tue Jun 10 21:20:37 2014 (r267341) @@ -124,7 +124,7 @@ usage(int code) { fprintf(stderr, -Usage: %s [-aehwAHIPW] [-g gdb port] [-s pci] [-S pci]\n +Usage: %s [-aehwAHIPW] [-g gdb port] [-s pci]\n %*s [-c vcpus] [-p pincpu] [-m mem] [-l lpc] vm\n -a: local apic is in XAPIC mode (default is X2APIC)\n -A: create an ACPI table\n @@ -137,7 +137,6 @@ usage(int code) -e: exit on unhandled I/O access\n -h: help\n -s: slot,driver,configinfo PCI slot config\n - -S: slot,driver,configinfo legacy PCI slot config\n -l: LPC device configuration\n -m: memory size in MB\n -w: ignore unimplemented MSRs\n, @@ -599,7 +598,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, abehwAHIPWp:g:c:s:S:m:l:)) != -1) { + while ((c = getopt(argc, argv, abehwAHIPWp:g:c:s:m:l:)) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -626,12 +625,7 @@ main(int argc, char *argv[]) } break; case 's': - if (pci_parse_slot(optarg, 0) != 0) - exit(1); - else - break; - case 'S': - if (pci_parse_slot(optarg, 1) != 0) + if (pci_parse_slot(optarg) != 0) exit(1); else break; Modified: stable/10/usr.sbin/bhyve/pci_emul.c == --- stable/10/usr.sbin/bhyve/pci_emul.c Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/pci_emul.c Tue Jun 10 21:20:37 2014 (r267341) @@ -75,7 +75,6 @@ static struct slotinfo { char*si_name; char*si_param; struct pci_devinst *si_devi; - int si_legacy; } pci_slotinfo[MAXSLOTS][MAXFUNCS]; SET_DECLARE(pci_devemu_set, struct pci_devemu); @@ -123,7 +122,7 @@ pci_parse_slot_usage(char *aopt) } int -pci_parse_slot(char *opt, int legacy) +pci_parse_slot(char *opt) { char *slot, *func, *emul, *config; char *str, *cpy; @@ -170,7 +169,6 @@ pci_parse_slot(char *opt, int legacy) error = 0; pci_slotinfo[snum][fnum].si_name = emul; pci_slotinfo[snum][fnum].si_param = config; - pci_slotinfo[snum][fnum].si_legacy = legacy; done: if (error) @@ -521,13 +519,7 @@ pci_emul_alloc_pbar(struct pci_devinst * addr = mask = lobits = 0; break; case PCIBAR_IO: - if (hostbase -
Re: svn commit: r267341 - stable/10/usr.sbin/bhyve
On Tuesday, June 10, 2014 5:20:37 pm John Baldwin wrote: Author: jhb Date: Tue Jun 10 21:20:37 2014 New Revision: 267341 URL: http://svnweb.freebsd.org/changeset/base/267341 Log: MFC 261217: Remove support for legacy PCI devices. These haven't been needed since support for LPC uart devices was added and it conflicts with upcoming patches to add PCI INTx support. Approved by:grehan Note that this is a user-visible change (bhyve -S no longer works), but this option was already documented as being subject to removal in the old manual page. This hack has also not been needed for a long time. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267342 - head/sys/dev/nvme
Author: jimharris Date: Tue Jun 10 21:40:43 2014 New Revision: 267342 URL: http://svnweb.freebsd.org/changeset/base/267342 Log: Use bitwise OR instead of logical OR when constructing value for SET_FEATURES/NUMBER_OF_QUEUES command. Sponsored by: Intel MFC after:3 days Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c == --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jun 10 21:20:37 2014 (r267341) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jun 10 21:40:43 2014 (r267342) @@ -205,7 +205,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvm { uint32_t cdw11; - cdw11 = ((num_queues - 1) 16) || (num_queues - 1); + cdw11 = ((num_queues - 1) 16) | (num_queues - 1); nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11, NULL, 0, cb_fn, cb_arg); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267343 - stable/10/sys/fs/nfsserver
Author: rmacklem Date: Tue Jun 10 22:36:01 2014 New Revision: 267343 URL: http://svnweb.freebsd.org/changeset/base/267343 Log: MFC: r267191 The new NFS server would not allow a hard link to be created to a symlink. This restriction (which was inherited from OpenBSD) is not required by the NFS RFCs. Since this is allowed by the old NFS server, it is a POLA violation to not allow it. This patch modifies the new NFS server to allow this. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c == --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 10 21:40:43 2014 (r267342) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 10 22:36:01 2014 (r267343) @@ -1620,13 +1620,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i nd-nd_repstat = NFSERR_INVAL; if (tovp) vrele(tovp); - } else if (vnode_vtype(vp) == VLNK) { - if (nd-nd_flag ND_NFSV2) - nd-nd_repstat = NFSERR_INVAL; - else - nd-nd_repstat = NFSERR_NOTSUPP; - if (tovp) - vrele(tovp); } if (!nd-nd_repstat) { if (nd-nd_flag ND_NFSV4) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267346 - stable/10/sys/fs/tmpfs
Author: kib Date: Wed Jun 11 03:59:14 2014 New Revision: 267346 URL: http://svnweb.freebsd.org/changeset/base/267346 Log: MFC r267060: Allow shared locking for the tmpfs vnode. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c == --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Tue Jun 10 23:22:17 2014 (r267345) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 11 03:59:14 2014 (r267346) @@ -595,6 +595,8 @@ loop1: default: panic(tmpfs_alloc_vp: type %p %d, node, (int)node-tn_type); } + if (vp-v_type != VFIFO) + VN_LOCK_ASHARE(vp); error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); if (error) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r267347 - in stable/10/sys/dev/usb: . controller
Author: hselasky Date: Wed Jun 11 05:39:08 2014 New Revision: 267347 URL: http://svnweb.freebsd.org/changeset/base/267347 Log: MFC r267240: Resolve a deadlock setting the USB configuration index from userspace on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count. Modified: stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/usb_dev.c stable/10/sys/dev/usb/usb_device.h stable/10/sys/dev/usb/usb_generic.c stable/10/sys/dev/usb/usb_hub.c stable/10/sys/dev/usb/usb_hub.h stable/10/sys/dev/usb/usbdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c == --- stable/10/sys/dev/usb/controller/usb_controller.c Wed Jun 11 03:59:14 2014(r267346) +++ stable/10/sys/dev/usb/controller/usb_controller.c Wed Jun 11 05:39:08 2014(r267347) @@ -366,7 +366,13 @@ usb_bus_explore(struct usb_proc_msg *pm) if (bus-no_explore != 0) return; - if (udev udev-hub) { + if (udev != NULL) { + USB_BUS_UNLOCK(bus); + uhub_explore_handle_re_enumerate(udev); + USB_BUS_LOCK(bus); + } + + if (udev != NULL udev-hub != NULL) { if (bus-do_probe) { bus-do_probe = 0; Modified: stable/10/sys/dev/usb/usb_dev.c == --- stable/10/sys/dev/usb/usb_dev.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_dev.c Wed Jun 11 05:39:08 2014 (r267347) @@ -1116,9 +1116,14 @@ usb_ioctl(struct cdev *dev, u_long cmd, usb_pause_mtx(NULL, hz / 128); - if (usb_ref_device(cpd, refs, 1 /* need uref */)) { - err = ENXIO; - goto done; + while (usb_ref_device(cpd, refs, 1 /* need uref */)) { + if (usb_ref_device(cpd, refs, 0)) { + /* device no longer exits */ + err = ENXIO; + goto done; + } + usb_unref_device(cpd, refs); + usb_pause_mtx(NULL, hz / 128); } } Modified: stable/10/sys/dev/usb/usb_device.h == --- stable/10/sys/dev/usb/usb_device.h Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_device.h Wed Jun 11 05:39:08 2014 (r267347) @@ -228,6 +228,7 @@ struct usb_device { uint8_t address;/* device addess */ uint8_t device_index; /* device index in bus-devices */ uint8_t controller_slot_id; /* controller specific value */ + uint8_t next_config_index; /* used by USB_RE_ENUM_SET_CONFIG */ uint8_t curr_config_index; /* current configuration index */ uint8_t curr_config_no; /* current configuration number */ uint8_t depth; /* distance from root HUB */ @@ -241,6 +242,7 @@ struct usb_device { #defineUSB_RE_ENUM_DONE0 #defineUSB_RE_ENUM_START 1 #defineUSB_RE_ENUM_PWR_OFF 2 +#defineUSB_RE_ENUM_SET_CONFIG 3 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/10/sys/dev/usb/usb_generic.c == --- stable/10/sys/dev/usb/usb_generic.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_generic.c Wed Jun 11 05:39:08 2014 (r267347) @@ -616,24 +616,17 @@ ugen_set_config(struct usb_fifo *f, uint /* not possible in device side mode */ return (ENOTTY); } - if (f-udev-curr_config_index == index) { - /* no change needed */ - return (0); - } + /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { /* ignore any errors */ DPRINTFN(6, no FIFOs\n); } - /* change setting - will free generic FIFOs, if any */ - if (usbd_set_config_index(f-udev, index)) { - return (EIO); - } - /* probe and attach */ - if (usb_probe_and_attach(f-udev, USB_IFACE_INDEX_ANY)) { + + if (usbd_start_set_config(f-udev, index) != 0) return (EIO); - } + return (0); } @@ -970,11 +963,6 @@
svn commit: r267348 - in stable/8/sys/dev/usb: . controller
Author: hselasky Date: Wed Jun 11 05:45:48 2014 New Revision: 267348 URL: http://svnweb.freebsd.org/changeset/base/267348 Log: MFC r267240: Resolve a deadlock setting the USB configuration index from userspace on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count. Modified: stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_hub.h stable/8/sys/dev/usb/usbdi.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c == --- stable/8/sys/dev/usb/controller/usb_controller.cWed Jun 11 05:39:08 2014(r267347) +++ stable/8/sys/dev/usb/controller/usb_controller.cWed Jun 11 05:45:48 2014(r267348) @@ -348,7 +348,13 @@ usb_bus_explore(struct usb_proc_msg *pm) if (bus-no_explore != 0) return; - if (udev udev-hub) { + if (udev != NULL) { + USB_BUS_UNLOCK(bus); + uhub_explore_handle_re_enumerate(udev); + USB_BUS_LOCK(bus); + } + + if (udev != NULL udev-hub != NULL) { if (bus-do_probe) { bus-do_probe = 0; Modified: stable/8/sys/dev/usb/usb_dev.c == --- stable/8/sys/dev/usb/usb_dev.c Wed Jun 11 05:39:08 2014 (r267347) +++ stable/8/sys/dev/usb/usb_dev.c Wed Jun 11 05:45:48 2014 (r267348) @@ -1101,9 +1101,14 @@ usb_ioctl(struct cdev *dev, u_long cmd, usb_pause_mtx(NULL, hz / 128); - if (usb_ref_device(cpd, refs, 1 /* need uref */)) { - err = ENXIO; - goto done; + while (usb_ref_device(cpd, refs, 1 /* need uref */)) { + if (usb_ref_device(cpd, refs, 0)) { + /* device no longer exits */ + err = ENXIO; + goto done; + } + usb_unref_device(cpd, refs); + usb_pause_mtx(NULL, hz / 128); } } Modified: stable/8/sys/dev/usb/usb_device.h == --- stable/8/sys/dev/usb/usb_device.h Wed Jun 11 05:39:08 2014 (r267347) +++ stable/8/sys/dev/usb/usb_device.h Wed Jun 11 05:45:48 2014 (r267348) @@ -219,6 +219,7 @@ struct usb_device { uint8_t address;/* device addess */ uint8_t device_index; /* device index in bus-devices */ uint8_t controller_slot_id; /* controller specific value */ + uint8_t next_config_index; /* used by USB_RE_ENUM_SET_CONFIG */ uint8_t curr_config_index; /* current configuration index */ uint8_t curr_config_no; /* current configuration number */ uint8_t depth; /* distance from root HUB */ @@ -232,6 +233,7 @@ struct usb_device { #defineUSB_RE_ENUM_DONE0 #defineUSB_RE_ENUM_START 1 #defineUSB_RE_ENUM_PWR_OFF 2 +#defineUSB_RE_ENUM_SET_CONFIG 3 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/8/sys/dev/usb/usb_generic.c == --- stable/8/sys/dev/usb/usb_generic.c Wed Jun 11 05:39:08 2014 (r267347) +++ stable/8/sys/dev/usb/usb_generic.c Wed Jun 11 05:45:48 2014 (r267348) @@ -610,24 +610,17 @@ ugen_set_config(struct usb_fifo *f, uint /* not possible in device side mode */ return (ENOTTY); } - if (f-udev-curr_config_index == index) { - /* no change needed */ - return (0); - } + /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { /* ignore any errors */ DPRINTFN(6, no FIFOs\n); } - /* change setting - will free generic FIFOs, if any */ - if (usbd_set_config_index(f-udev, index)) { - return (EIO); - } - /* probe and attach */ - if (usb_probe_and_attach(f-udev, USB_IFACE_INDEX_ANY)) { + + if (usbd_start_set_config(f-udev, index) != 0)
svn commit: r267349 - stable/10/sys/dev/usb/wlan
Author: hselasky Date: Wed Jun 11 05:50:04 2014 New Revision: 267349 URL: http://svnweb.freebsd.org/changeset/base/267349 Log: MFC r267066 and r267041: Fixes for the RSU driver: - The R92S_TCR register is an 8-bit register. Don't access it like a 16-bit register. - Disable parsing the delete station event, due to many false events. - Ensure that there is only one transfer queue for each endpoint, so to hal packets transmitted don't get out of order. - Properly align temporary buffer to 32-bit. - Add an extra parenthesis to make expression clear. - Range check the association ID received from hardware. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rsureg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c == --- stable/10/sys/dev/usb/wlan/if_rsu.c Wed Jun 11 05:45:48 2014 (r267348) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Wed Jun 11 05:50:04 2014 (r267349) @@ -127,10 +127,8 @@ static const STRUCT_USB_HOST_ID rsu_devs static device_probe_t rsu_match; static device_attach_t rsu_attach; static device_detach_t rsu_detach; -static usb_callback_t rsu_bulk_tx_callback_0; -static usb_callback_t rsu_bulk_tx_callback_1; -static usb_callback_t rsu_bulk_tx_callback_2; -static usb_callback_t rsu_bulk_tx_callback_3; +static usb_callback_t rsu_bulk_tx_callback_be_bk; +static usb_callback_t rsu_bulk_tx_callback_vi_vo; static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); @@ -220,6 +218,13 @@ MODULE_DEPEND(rsu, usb, 1, 1, 1); MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); +static uint8_t rsu_wme_ac_xfer_map[4] = { + [WME_AC_BE] = RSU_BULK_TX_BE_BK, + [WME_AC_BK] = RSU_BULK_TX_BE_BK, + [WME_AC_VI] = RSU_BULK_TX_VI_VO, + [WME_AC_VO] = RSU_BULK_TX_VI_VO, +}; + static const struct usb_config rsu_config[RSU_N_TRANSFER] = { [RSU_BULK_RX] = { .type = UE_BULK, @@ -232,20 +237,7 @@ static const struct usb_config rsu_confi }, .callback = rsu_bulk_rx_callback }, - [RSU_BULK_TX_BE] = { - .type = UE_BULK, - .endpoint = 0x06, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_0, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_BK] = { + [RSU_BULK_TX_BE_BK] = { .type = UE_BULK, .endpoint = 0x06, .direction = UE_DIR_OUT, @@ -255,10 +247,10 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_1, + .callback = rsu_bulk_tx_callback_be_bk, .timeout = RSU_TX_TIMEOUT }, - [RSU_BULK_TX_VI] = { + [RSU_BULK_TX_VI_VO] = { .type = UE_BULK, .endpoint = 0x04, .direction = UE_DIR_OUT, @@ -268,20 +260,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_2, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_VO] = { - .type = UE_BULK, - .endpoint = 0x04, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_3, + .callback = rsu_bulk_tx_callback_vi_vo, .timeout = RSU_TX_TIMEOUT }, }; @@ -613,7 +592,7 @@ rsu_alloc_tx_list(struct rsu_softc *sc) STAILQ_INIT(sc-sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(sc-sc_tx_active[i]); STAILQ_INIT(sc-sc_tx_pending[i]); } @@ -633,7 +612,7 @@ rsu_free_tx_list(struct rsu_softc *sc) /* prevent further allocations from TX list(s) */ STAILQ_INIT(sc-sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(sc-sc_tx_active[i]); STAILQ_INIT(sc-sc_tx_pending[i]); } @@ -873,7 +852,7 @@ rsu_read_rom(struct rsu_softc *sc) static int rsu_fw_cmd(struct rsu_softc *sc, uint8_t