Commit Graph

193186 Commits

Author SHA1 Message Date
nwhitehorn
4a4705a68f Align stacks of kernel threads correctly at 16-byte boundaries rather than
making sure they are all misaligned at +8 bytes. This fixes clang builds
of powerpc64 kernels (aside from a required increase in KSTACK_PAGES which
will come later).

This commit from FreeBSD/powerpc64 with a clang-built kernel.

MFC after:	2 weeks
2013-09-05 23:00:24 +00:00
carl
3186588c66 Restructure the PCI bar initialization code in anticipation of upcoming
bug fixes.

Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:59:18 +00:00
carl
03afdcfdc4 Fix name change from ntb_transport to if_ntb. A few places were
overlooked.

Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:56:52 +00:00
carl
af2bf5282f Fix a typo.
Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:55:08 +00:00
carl
78e005b631 Throw a bit to enable the link to come up on Xeon.
Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:52:40 +00:00
carl
75c7fb01d0 Add some logging to ntb link up.
Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:46:48 +00:00
hrs
eb57efaf2f Style clean-ups.
Reviewed by:	md5
2013-09-05 21:19:16 +00:00
hrs
81f77e5add Enable "late" option when a file= option is specified in /etc/fstab.
The file= option requires rw mount where the backing store exists but
it does not work because rc.d/swap runs before rc.d/fsck.
Reported by:	wblock
2013-09-05 20:50:52 +00:00
jilles
4b58ef1a3f watch: Do not mess up the tty modes on early error.
Record the initial state earlier, so it is always safe to restore it.

One way this happens is if watch(8) is started by a user that does not have
access to /dev/snp. The result is "staircase effect" during later commands.

PR:		bin/153052
MFC after:	1 week
2013-09-05 19:02:03 +00:00
hiren
0493244548 Fixing a small typo.
Reviewed by:	gjb
Approved by:	sbruno (mentor)
2013-09-05 18:18:23 +00:00
sbruno
48389c2d47 Minor printf nit to keep out clean 2013-09-05 16:38:26 +00:00
sjg
61d13f6983 Merge bmake-20130904 2013-09-05 15:57:26 +00:00
sjg
2abe6518e6 Tag bmake-20130904 2013-09-05 15:49:51 +00:00
sjg
83450adcff Import bmake-20130904 2013-09-05 15:49:22 +00:00
jhb
42eb0e69b4 Use LIST_FOREACH_SAFE() instead of doing it by hand. 2013-09-05 14:26:37 +00:00
jhb
057d03f1de Use an unsigned long when indexing into mfchashtbl[] and mf6ctable[]. This
matches the types used when computing hash indices and the type of the
maximum size of mfchashtbl[].

PR:		kern/181821
Submitted by:	Sven-Thorsten Dietrich <sven@vyatta.com> (IPv4)
MFC after:	1 week
2013-09-05 14:16:37 +00:00
glebius
84626a2dc5 Fix build. 2013-09-05 13:53:25 +00:00
glebius
2260c8f4ea Fix build.
counter.h requires systm.h
2013-09-05 13:46:30 +00:00
kib
a08e5f97bc The vm_pageout_flush() functions sbusies pages in the passed pages
run.  After that, the pager put method is called, usually translated
to VOP_WRITE().  For the filesystems which use buffer cache,
bufwrite() sbusies the buffer pages again, waiting for the xbusy state
to drain.  The later is done in vfs_drain_busy_pages(), which is
called with the buffer pages already sbusied (by vm_pageout_flush()).

Since vfs_drain_busy_pages() can only wait for one page at the time,
and during the wait, the object lock is dropped, previous pages in the
buffer must be protected from other threads busying them.  Up to the
moment, it was done by xbusying the pages, that is incompatible with
the sbusy state in the new implementation of busy.  Switch to sbusy.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
2013-09-05 12:56:08 +00:00
kib
7ab18d4990 The vm_page_trysbusy() should not fail when shared busy counter or
VPB_BIT_WAITERS flag were changed between reading of busy_lock and the
cas.  The vm_page_sbusy(), which is the only user of
vm_page_trysbusy() in the tree, panics on the failure, which in these
cases is transient and do not mean that the current page state
prevents sbusying.

Retry the operation inside vm_page_trysbusy() if cas failed, only
return a failure when VPB_BIT_SHARED is cleared.

Reported and tested by:	pho
Reviewed by:	attilio
Sponsored by:	The FreeBSD Foundation
2013-09-05 12:54:40 +00:00
des
795da63f42 authpf needs /var/authpf to exist and be writable by group authpf. 2013-09-05 12:35:23 +00:00
hselasky
d2f07e2fda Correct two comments. 2013-09-05 12:21:11 +00:00
pjd
e6563595d7 The fget() function now takes pointer to cap_rights_t, so change 0 to NULL. 2013-09-05 11:59:23 +00:00
pjd
1c7defb76e Handle cases where capability rights are not provided.
Reported by:	kib
2013-09-05 11:58:12 +00:00
glebius
12cfeea19a Fix !CAPABILITIES build. 2013-09-05 10:24:09 +00:00
br
71ada8a9ac Add support for DLINK DWA-127 Wireless Adapter
Approved by:	cognet (mentor)
2013-09-05 10:09:24 +00:00
ae
7f30f5be1c Remove stub implementation.
MFC after:	1 week
2013-09-05 09:44:09 +00:00
pjd
ad93dafc6a Correct the logic broken in my last commit.
Reported by:	tijl
2013-09-05 09:36:19 +00:00
ae
0a28609aca Remove unused code and sort variables declarations.
PR:		kern/181822
MFC after:	1 week
2013-09-05 08:12:36 +00:00
mav
2a1ed79256 Add more references.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2013-09-05 07:13:08 +00:00
se
f83bb7c481 Fix file selection logic for the RCS/SCCS case, as was done for the simple
file case before. Bump version because of the changed behavior, which now
matches the documentation.

Reviewed by:	pfg
2013-09-05 05:51:15 +00:00
sbruno
bf3232d8bb Restore builds on architectures that don't support CAPABILITIES (mips). 2013-09-05 03:46:44 +00:00
sbruno
c1754372ea This looks like a typo that breaks the build. Yell at me if this isn't the
intended declaration.
2013-09-05 03:36:57 +00:00
jhibbits
2764ddeb0a Fix the build. 2013-09-05 01:13:26 +00:00
pjd
3c622b2c1f Remove fallback to fork(2) if pdfork(2) is not available. If the parent
process dies, the process descriptor will be closed and pdfork(2)ed child
will be killed, which is not the case when regular fork(2) is used.

The PROCDESC option is now part of the GENERIC kernel configuration, so we
can start depending on it.

Add UPDATING entry to inform that this option is now required and log
detailed instruction to syslog if pdfork(2) is not available:

	The pdfork(2) system call is not available; recompile the kernel with options PROCDESC

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by:	Google Summer of Code 2013
2013-09-05 01:05:48 +00:00
pjd
58db73786b Add sysctl/tunables for various metaslab variables. 2013-09-05 00:53:01 +00:00
pjd
15d287f52f Advise a full buildworld, because of the recent Capsicum changes.
Sponsored by:	The FreeBSD Foundation
2013-09-05 00:52:16 +00:00
pjd
f740593978 Add missing '2'. 2013-09-05 00:41:07 +00:00
pjd
36c819441c Remove trailing comma. 2013-09-05 00:38:53 +00:00
pjd
add7315b85 Style fixes. 2013-09-05 00:19:30 +00:00
pjd
36e3a50584 Style fixes. Most fixes are about not treating integers and pointers as
booleans.
2013-09-05 00:17:38 +00:00
pjd
d1a65cb7ef Regenerate after r255219.
Sponsored by:	The FreeBSD Foundation
2013-09-05 00:11:59 +00:00
pjd
029a6f5d92 Change the cap_rights_t type from uint64_t to a structure that we can extend
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

	struct cap_rights {
		uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
	};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

	#define	CAP_PDKILL	CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

	#define	CAP_LOOKUP	CAPRIGHT(0, 0x0000000000000400ULL)
	#define	CAP_FCHMOD	CAPRIGHT(0, 0x0000000000002000ULL)

	#define	CAP_FCHMODAT	(CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

	cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
	void cap_rights_set(cap_rights_t *rights, ...);
	void cap_rights_clear(cap_rights_t *rights, ...);
	bool cap_rights_is_set(const cap_rights_t *rights, ...);

	bool cap_rights_is_valid(const cap_rights_t *rights);
	void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
	void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
	bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

	cap_rights_t rights;

	cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

	#define	cap_rights_set(rights, ...)				\
		__cap_rights_set((rights), __VA_ARGS__, 0ULL)
	void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

	cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by:	The FreeBSD Foundation
2013-09-05 00:09:56 +00:00
gibbs
ceb5fa1b16 Correct blkback handling of the BLKIF_OP_FLUSH_DISKCACHE opcode.
Properly round-trip the "operation code" for client requests.

sys/dev/xen/blkback/blkback.c:
	In xbb_dispatch_dev() when processing a flush request,
	correctly set bio->bio_caller1 to the request list (not
	bare request) for the operation, as is expected by the
	completion handler xbb_bio_done().

	In xbb_get_resources(), initialize "operation" in the
	driver's internal request object from the client's "ring
	request", so it is correct when used to populate the reply
	when this operation completes.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
2013-09-04 23:32:49 +00:00
kib
23ba68da73 Tidy up some loose ends in the PCID code:
- Restore the pre-PCID TLB shootdown handlers for whole address space
  and single page invalidation asm code, and assign the IPI handler to
  them when PCID is not supported or disabled.  Old handlers have
  linear control flow.  But, still use the common return sequence.

- Stop using pcpu for INVPCID descriptors in the invlrg handler.  It
  is enough to allocate descriptors on the stack.  As result, two
  SWAPGS instructions are shaved off from the code for Haswell+.

- Fix the reverted condition in invlrng for checking of the PCID
  support [1], also in invlrng check that pmap is kernel pmap before
  performing other tests.  For the kernel pmap, which provides global
  mappings, the INVLPG must be used for invalidation always.

- Save the pre-computed pmap' %CR3 register in the struct pmap.  This
  allows to remove several checks for pm_pcid validity when %CR3 is
  reloaded [2].

Noted by:   gibbs [1]
Discussed with:	alc [2]
Tested by:	pho, flo
Sponsored by:	The FreeBSD Foundation
2013-09-04 23:31:29 +00:00
rmacklem
99fb6f77e5 Crashes have been observed for NFSv4.1 mounts when the system
is being shut down which were caused by the nfscbd_pool being
destroyed before the backchannel is disabled. This patch is
believed to fix the problem, by simply avoiding ever destroying
the nfscbd_pool. Since the NFS client module cannot be unloaded,
this should not cause a memory leak.

MFC after:	2 weeks
2013-09-04 22:47:56 +00:00
jilles
ad7328341a sh: Make return return from the closest function or dot script.
Formerly, return always returned from a function if it was called from a
function, even if there was a closer dot script. This was for compatibility
with the Bourne shell which only allowed returning from functions.

Other modern shells and POSIX return from the function or the dot script,
whichever is closest.

Git 1.8.4's rebase --continue depends on the POSIX behaviour.

Reported by:	Christoph Mallon, avg
2013-09-04 22:10:16 +00:00
zbb
206a10e8a6 Add myself as a new committer and cognet as my mentor.
Approved by:	cognet (mentor)
2013-09-04 20:49:32 +00:00
gonzo
1eec0c04d0 Add 32-bit support for Gxemul's oldtestmips machine emulation
Original work by: kan@
2013-09-04 20:34:36 +00:00
gnn
059527f86c Add myself to the list of ports committers.
Approved by: skreuzer (mentor)
2013-09-04 20:12:33 +00:00