Dimitry Andric [Sun, 27 Feb 2011 02:06:09 +0000 (02:06 +0000)]
Clang's integrated assembler can now handle sys/boot/i386/boot2/sio.S.
It used to choke on the notation "inb (%dx),%al" for "inb %dx,%al"; GNU
as accepts both forms. Which notation is more 'correct' is an open
question. :)
Dimitry Andric [Sun, 27 Feb 2011 01:32:10 +0000 (01:32 +0000)]
Update llvm/clang to trunk r126547.
There are several bugfixes in this update, but the most important one is
to ensure __start_ and __stop_ symbols for linker sets and kernel module
metadata are always emitted in object files:
http://llvm.org/bugs/show_bug.cgi?id=9292
Before this fix, if you compiled kernel modules with clang, they would
not be properly processed by kldxref, and if they had any dependencies,
the kernel would fail to load those. Another problem occurred when
attempting to mount a tmpfs filesystem, which would result in 'operation
not supported by device'.
Dimitry Andric [Sun, 27 Feb 2011 00:02:48 +0000 (00:02 +0000)]
Instead of defining LLVM_MULTITHREADED as 0 or 1, define or undefine it,
and test appropriately. Otherwise it might erroneously pick up some
pthread primitives, and fail to link.
Dimitry Andric [Sat, 26 Feb 2011 22:45:40 +0000 (22:45 +0000)]
Fix breakage in sys/netinet/sctp_sysctl.c, introduced by r219057. If
SCTP_HAS_RTTC is not defined, this file fails to compile. Insert the
necessary #ifdefs to make it work.
Nathan Whitehorn [Sat, 26 Feb 2011 15:44:03 +0000 (15:44 +0000)]
Show disk model numbers in partition wizard screen. Also, since da(4) disks
are probably more likely to be USB or Firewire these days than SCSI, just
call them and anyone unknown "Disk" instead of SCSI disk.
Randall Stewart [Sat, 26 Feb 2011 15:23:46 +0000 (15:23 +0000)]
Improvements to CC modules:
1) Add four new points that allow you to get more information
to cc algo's
2) Fix the case where user changes module on a existing TCB, in
such a case, the initialization module needs to be called on all nets.
3) Move htcp_cc structure to a union that other modules can use.
4) Add 5th point for get/set socket options for cc_module specific options
Nathan Whitehorn [Sat, 26 Feb 2011 14:58:54 +0000 (14:58 +0000)]
Add the disk ident and a human-meaningful description (here, the disk model
string) to the geom_disk config XML so that they are easily accessible from
userland.
Jung-uk Kim [Fri, 25 Feb 2011 23:14:24 +0000 (23:14 +0000)]
Set C1 "I/O then Halt" capability bit for Intel EIST. Some broken BIOSes
refuse to load external SSDTs if this bit is unset for _PDC. It seems Linux
and OpenSolaris did the same long ago.
Dmitry Chagin [Fri, 25 Feb 2011 22:05:33 +0000 (22:05 +0000)]
Introduce preliminary support of the show description of the ABI of
traced process by adding two new events which records value of process
sv_flags to the trace file at process creation/execing/exiting time.
Dmitry Chagin [Fri, 25 Feb 2011 22:03:28 +0000 (22:03 +0000)]
ktrace_resize_pool() locking slightly reworked:
1) do not take a lock around the single atomic operation.
2) do not lose the invariant of lock by dropping/acquiring
ktrace_mtx around free() or malloc().
Kenneth D. Merry [Fri, 25 Feb 2011 17:30:25 +0000 (17:30 +0000)]
Silence 'out of chain frames' warnings and bump the number of frames.
mps.c: Hide the 'out of chain frames' warning behind MPS_INFO.
mps_sas.c: Hide the SIM queue freeze/unfreeze messages behind MPS_INFO.
mpsvar.h: Bump the number of chain frames from 1024 to 2048. From
testing, it looks like this makes it less likely that we'll
run out of chain frames, and it doesn't cost much memory
(32K).
No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.
Sponsored by: Google Summer of Code 2010
Submitted by: kibab
Reviewed by: silence on geom@ during 2 weeks
X-MFC after: to be determined in last commit with code from this project
Add some FEATURE macros for various features (AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/
PMC/SYSV/...).
No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.
Sponsored by: Google Summer of Code 2010
Submitted by: kibab
Reviewed by: arch@ (parts by rwatson, trasz, jhb)
X-MFC after: to be determined in last commit with code from this project
David E. O'Brien [Fri, 25 Feb 2011 09:07:17 +0000 (09:07 +0000)]
Add a real dependency on the microcode.
Now when one does 'make kernel ; make kernel' the second invocation
only does: `kernel.ko' is up to date.
rather than reproduce all the binary microcode files and relink the kernel.
[continuation of r212429]
Gabor Kovesdan [Fri, 25 Feb 2011 00:04:39 +0000 (00:04 +0000)]
Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.
This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:
- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.
Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009
Dimitry Andric [Thu, 24 Feb 2011 21:45:58 +0000 (21:45 +0000)]
Recently, in upstream clang, a fix was done to add -L/usr/lib to the
arguments passed to ld, when linking. This was to appease configure
scripts in several ports, that grep for such a -L option in "${CC} -v"
output, to determine the startup objects passed to ld. Note ld itself
does not need to be told about /usr/lib, since it has this path builtin
anyway.
However, if clang is built as a bootstrap tool during buildworld, it
should not use *anything* outside ${WORLDTMP} to include or link with.
The upstream fix to add -L/usr/lib breaks this assumption, and can thus
cause libraries from /usr/lib to be linked in during buildworld.
This can result in buildworld dying during linking of zinject, where it
picks up the wrong copy of libzpool.so, eventually leading to:
/usr/obj/usr/src/tmp/lib/libthr.so.3: undefined reference to `_rtld_get_stack_prot'
Fix this issue by not adding any hardcoded paths, but by looping through
the run-time library path list, which is already correctly set for the
bootstrap phase.
Reported by: datastream.freecity@gmail.com
Pointy hat to: dim
Sergey Kandaurov [Thu, 24 Feb 2011 09:22:56 +0000 (09:22 +0000)]
Remove sysctl vm.max_proc_mmap used to protect from KVA space exhaustion.
As it was pointed out by Alan Cox, that no longer serves its purpose with
the modern UMA allocator compared to the old one used in 4.x days.
The removal of sysctl eliminates max_proc_mmap type overflow leading to
the broken mmap(2) seen with large amount of physical memory on arches
with factually unbound KVA space (such as amd64). It was found that
slightly less than 256GB of physmem was enough to trigger the overflow.
- Add support for some non-standard USB MIDI devices from Roland, by
means of allowing vendor specific interface class for audio and MIDI devices.
- Add new quirks for this. The vendor and product list in OpenBSD's
dev/usb/umidi_quirks.c was used as reference.
Rebecca Cran [Wed, 23 Feb 2011 21:45:28 +0000 (21:45 +0000)]
Use the cprd_mem field when setting the start and length for a memory
resource - the layout of cprd_port is identical but using cprd_mem
makes the code easier to understand.
PR: kern/118493
Submitted by: Weongyo Jeong <weongyo.jeong at gmail.com>
MFC after: 3 days
Dimitry Andric [Wed, 23 Feb 2011 21:17:38 +0000 (21:17 +0000)]
Fix the 32-bit build stage on amd64 when WITH_CTF is enabled. It seems
ctfconvert will corrupt object files that are compiled with -g, if it is
not run with -g itself.
To fix it, remove -g from CFLAGS in lib/librt/Makefile. If you need to
compile this library with debug info, use DEBUG_FLAGS=-g instead, which
will work correctly, even when using WITH_CTF.
Move the max_threads_per_proc and max_threads_hits variables to the
file where they are used. Declare the kern.threads sysctl node at the
same location. Since no external use for the variables exists, make them
static.
John Baldwin [Wed, 23 Feb 2011 13:23:28 +0000 (13:23 +0000)]
Use umtx_key objects to uniquely identify futexes. Private futexes in
different processes that happen to use the same user address in the
separate processes will now be treated as distinct futexes rather than the
same futex. We can now honor shared futexes properly by mapping them to a
PROCESS_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key
objects.
John Baldwin [Wed, 23 Feb 2011 12:58:50 +0000 (12:58 +0000)]
Properly handle BARs bigger than 4G. The '1' was treated as an int
causing the size calculation to be truncated to the size of an int
(32-bits on all current architectures).
Submitted by: Anish akgupt3 of gmail
MFC after: 1 week
Pyun YongHyeon [Wed, 23 Feb 2011 02:40:31 +0000 (02:40 +0000)]
Remove unnecessary controller reinitialization which resulted in
link flips during alias address insertion or dhclient operation.
While I'm here remove dc_reset() in DC_ISR_BUS_ERR case. Device is
fully reinitialized again in dc_init_locked().
Doug Barton [Tue, 22 Feb 2011 21:13:40 +0000 (21:13 +0000)]
Update how accounting log files are rotated.
The old version had a race between the time that the old file was
cp'ed to acct.0 and the time that 'sa -s' was run that prevented
the commands that occurred in the meantime from being backed up.
It's also arguable that the old version was inefficient in using
cp which can be a problem on a space-constrained system.
This version avoids both problems, albeit it's considerably more
complicated. The advantage of putting the log rotation in the rc.d
script is that it can handle the _enable and _file questions without
having to do gymnastics to discover either value in the periodic script.
As a side effect of reviewing the rc.d script I cleaned it up a bit.
Bernhard Schmidt [Tue, 22 Feb 2011 19:05:42 +0000 (19:05 +0000)]
Make sure to only accept and handle action frames which are for us. In
promiscuous mode we might receive stuff which otherwise gets filtered
by hardware.
Alan Cox [Tue, 22 Feb 2011 14:47:10 +0000 (14:47 +0000)]
Eliminate two dubious attempts at optimizing the implementation of a
file's last accessed, modified, and changed times:
TMPFS_NODE_ACCESSED and TMPFS_NODE_CHANGED should be set unconditionally
in tmpfs_remove() without regard to the number of hard links to the file.
Otherwise, after the last directory entry for a file has been removed, a
process that still has the file open could read stale values for the last
accessed and changed times with fstat(2).
Similarly, tmpfs_close() should update the time-related fields even if all
directory entries for a file have been removed. In this case, the effect
is that the time-related fields will have values that are later than
expected. They will correspond to the time at which fstat(2) is called.
Nathan Whitehorn [Tue, 22 Feb 2011 13:56:59 +0000 (13:56 +0000)]
Add support for optional distributions, installation of the ports tree and
src. Fitting all of this on a single CD along with a full system requires
changing the default compression algorithm from gzip to xz.
In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t. The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.
Lawrence Stewart [Tue, 22 Feb 2011 10:09:34 +0000 (10:09 +0000)]
Use a single list to simplify future maintenance and ensure all list items are
aligned the same (no functional change at the moment as both list items are the
same number of characters).
Maxim Sobolev [Tue, 22 Feb 2011 09:11:47 +0000 (09:11 +0000)]
Make code more friendly to the non-C99 compilers - don't allocate
local variables in the `for' loop declaration. This allows trunk
newsyslog.c to be compiled on 7.x. This change should be no-op from
the functional POV.
Ulrich Spörlein [Tue, 22 Feb 2011 08:13:49 +0000 (08:13 +0000)]
Flesh out WITHOUT_GROFF support to DTRT.
A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.
vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.
Jayachandran C. [Tue, 22 Feb 2011 07:49:51 +0000 (07:49 +0000)]
Fix bzero() for 64-bit.
The existing implementation of bzero incorrectly clears bytes when the
start address is not word aligned. Fix it by using REG_SHI macro which
works on both 32 and 64 bit.
Warner Losh [Tue, 22 Feb 2011 04:49:57 +0000 (04:49 +0000)]
Back out 218933 and 281934. The easy cases still worked, but some
hard cases broke in worse ways than the status quo. Back them out
until that can be resolved.
Warner Losh [Tue, 22 Feb 2011 04:07:15 +0000 (04:07 +0000)]
Select building CLANG based on ${TARGET_ARCH} and existence of
WITH{,OUT}_CLANG. We default to yes on some archs, no on others,
unless WITHOUT_CLANG or WITH_CLANG is defined respectively.
Warner Losh [Tue, 22 Feb 2011 04:03:33 +0000 (04:03 +0000)]
Testing based on MACHINE_ARCH is problematic. Default to yes to build
clang. A separate change will fix buildworld to default to yes or no
based on the target.
Adrian Chadd [Tue, 22 Feb 2011 00:37:53 +0000 (00:37 +0000)]
Shuffle around the RTS/CTS rate/duration logic.
* Turn ath_tx_calc_ctsduration() into a function that
returns the ctsduration, or -1 for HT rates;
* add a printf() to ath_tx_calc_ctsduration() which will be
very loud if somehow that function is called with an MCS
rate;
* Add ath_tx_get_rtscts_rate() which returns the RTS/CTS
rate to use for the given data rate, incl. the short
preamble flag;
* Only call ath_tx_calc_ctsduration() for non-11n chipsets;
11n chipsets don't require the rtscts duration to be
calculated.