Commit Graph

215032 Commits

Author SHA1 Message Date
Mark Johnston
da3d1eecc5 5396 fix longjmp clobbering errors
illumos/illumos-gate@67a4bb8f9a

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Gary Mills <gary_mills@fastmail.fm>
2016-08-13 19:54:32 +00:00
Mark Johnston
eb9da1ada8 Fix handling of forward enum declarations in the CTF tools.
Reported by:	mmacy
MFC after:	2 weeks
2016-08-13 19:51:00 +00:00
Mark Johnston
842ee21e20 Strengthen assertions about the busy state of newly-allocated pages.
Reviewed by:	alc
MFC after:	1 week
2016-08-13 19:49:32 +00:00
Mark Johnston
fc85a6f0c4 Initialize page busy lock state in vm_phys_add_page().
MFC after:	1 week
2016-08-13 19:48:43 +00:00
Justin Hibbits
791578a84f Add missing pmap_kenter() method for book-e.
This isn't added to AIM yet, because it's not yet needed.  It's needed for
Book-E ePAPR boot support.

X-MFC With:	r304047
2016-08-13 18:57:14 +00:00
Justin Hibbits
cbc3c68d9a Add a kdb show command to print arbitrary SPRs on PowerPC
Summary:
There is often a need at the debugger to print arbitrary special
purpose registers (SPRs) on PowerPC.  Using a rewritable asm stub, print any SPR
provided on the command line.

Note, as there is no checking in this, attempting to print a nonexistent SPR
may cause a Program exception (illegal instruction, or boundedly undefined).

Note also that this relies on the kernel text pages being writable.  If in the
future this is made not the case, this will need to be reworked.

Test Plan:
Printing the Processor Version Register (PVR, SPR 287):

db> show spr 11f
SPR 287(11f): 80240012

Differential Revision: https://reviews.freebsd.org/D7403
2016-08-13 18:46:49 +00:00
Alan Cox
fc9bbf2794 Eliminate two calls to vm_page_xunbusy() that are both unnecessary and
incorrect from the error cases in exec_map_first_page().  They are
unnecessary because we automatically unbusy the page in vm_page_free()
when we remove it from the object.  The calls are incorrect because they
happen after the page is freed, so we might actually unbusy the page
after it has been reallocated to a different object.  (This error was
introduced in r292373.)

Reviewed by:	kib
MFC after:	1 week
2016-08-13 18:10:32 +00:00
Andrey V. Elsukov
57fb3b7a78 Add stats reset command implementation to NPTv6 module
to be able reset statistics counters.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-08-13 16:45:14 +00:00
Andrey V. Elsukov
c402a01b03 Replace __noinline with special debug macro NAT64NOINLINE. 2016-08-13 16:26:15 +00:00
Justin Hibbits
253902b44c Add ePAPR boot support for PowerPC book-E (MPC85xx) hardware
Summary:
u-boot, following the ePAPR specification, puts secondary cores into a
spinloop at boot, rather than leaving them shut off.  It then relies on the host
OS to write the correct values to a special spin table, located in coherent
memory (on newer implementations), or noncoherent memory (older
implementations).

This supports both implementations of ePAPR, as well as continuing to support
non-ePAPR booting, by first attempting to use the spintable, and falling back to
expecting non-started CPUs.

Test Plan:
Booted on a P5020 board.  Tested before and after the changes.
Before the changes, prints the error "SMP: CPU 1 already out of hold-off state!"
and panics shortly thereafter.  After the changes, same boot method lets it
complete boot.

Reviewed by:	nwhitehorn
MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D7494
2016-08-13 16:16:02 +00:00
Andrey V. Elsukov
d8caf56e9e Add ipfw_nat64 module that implements stateless and stateful NAT64.
The module works together with ipfw(4) and implemented as its external
action module.

Stateless NAT64 registers external action with name nat64stl. This
keyword should be used to create NAT64 instance and to address this
instance in rules. Stateless NAT64 uses two lookup tables with mapped
IPv4->IPv6 and IPv6->IPv4 addresses to perform translation.

A configuration of instance should looks like this:
 1. Create lookup tables:
 # ipfw table T46 create type addr valtype ipv6
 # ipfw table T64 create type addr valtype ipv4
 2. Fill T46 and T64 tables.
 3. Add rule to allow neighbor solicitation and advertisement:
 # ipfw add allow icmp6 from any to any icmp6types 135,136
 4. Create NAT64 instance:
 # ipfw nat64stl NAT create table4 T46 table6 T64
 5. Add rules that matches the traffic:
 # ipfw add nat64stl NAT ip from any to table(T46)
 # ipfw add nat64stl NAT ip from table(T64) to 64:ff9b::/96
 6. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96
    via NAT64 host.

Stateful NAT64 registers external action with name nat64lsn. The only
one option required to create nat64lsn instance - prefix4. It defines
the pool of IPv4 addresses used for translation.

A configuration of instance should looks like this:
 1. Add rule to allow neighbor solicitation and advertisement:
 # ipfw add allow icmp6 from any to any icmp6types 135,136
 2. Create NAT64 instance:
 # ipfw nat64lsn NAT create prefix4 A.B.C.D/28
 3. Add rules that matches the traffic:
 # ipfw add nat64lsn NAT ip from any to A.B.C.D/28
 # ipfw add nat64lsn NAT ip6 from any to 64:ff9b::/96
 4. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96
    via NAT64 host.

Obtained from:	Yandex LLC
Relnotes:	yes
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D6434
2016-08-13 16:09:49 +00:00
Baptiste Daroussin
21725bc7b6 Set date and time formats back to what they were before CLDR
While CLDR brings us a good and up to date source data to generate locales for
all databses we are using for locales, it is not the case of LC_TIME. Where it
does not defines the informations we need.

Put back all the date and time formats from the old locales.
Make it statically for now (in order to be able to merge it now into
11.0-RELEASE). The generation tools will be updated soon.

That gives us time to properly work on LC_TIME during the 12 timeframe.

While here fix abbreviated month for af_ZA (which are already fixed in CLDR
data upstream)

In locales where AP/PM was not defined before CLDR data, remove again the AP/PM
informations

For locales where AP/PM was defined before CLDR data, keep the CLDR information
which was properly translated.

MFC after:	3 days
2016-08-13 15:59:18 +00:00
Andrey V. Elsukov
6951cecf71 Add three helper function to manage tables from external modules.
ipfw_objhash_lookup_table_kidx does lookup kernel index of table;
ipfw_ref_table/ipfw_unref_table takes and releases reference to table.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-08-13 15:48:56 +00:00
Andrey V. Elsukov
56132dcc0d Move logging via BPF support into separate file.
* make interface cloner VNET-aware;
* simplify cloner code and use if_clone_simple();
* migrate LOGIF_LOCK() to rmlock;
* add ipfw_bpf_mtap2() function to pass mbuf to BPF;
* introduce new additional ipfwlog0 pseudo interface. It differs from
  ipfw0 by DLT type used in bpfattach. This interface is intended to
  used by ipfw modules to dump packets with additional info attached.
  Currently pflog format is used. ipfw_bpf_mtap2() function uses second
  argument to determine which interface use for dumping. If dlen is equal
  to ETHER_HDR_LEN it uses old ipfw0 interface, if dlen is equal to
  PFLOG_HDRLEN - ipfwlog0 will be used.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-08-13 15:41:04 +00:00
Enji Cooper
708cc995e3 Redirect the output of the testcases to stderr instead of
redirecting it to /dev/null

This will aid in debugging failures

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 06:26:33 +00:00
Enji Cooper
569e901835 MFhead @ r304038 2016-08-13 06:16:38 +00:00
Enji Cooper
66d08c7db2 Expect :raw to fail on FreeBSD
clnt_raw fails with `RPC_CANTDECODERES` today with the testcase
provided by NetBSD.

PR:		211804
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 06:11:53 +00:00
Enji Cooper
6b7b162b9d Skip 64kB bucket testcases
This bucket size isn't supported on FreeBSD

Sponsored by:	EMC / Isilon Storage Division
2016-08-13 05:42:11 +00:00
Enji Cooper
82bc57c207 Expect :mutexattr2 to fail on FreeBSD
pthread_mutexattr_getprioceiling and pthread_mutexattr_setprioceiling
both return EINVAL if ->m_protocol != PTHREAD_PRIO_PROTECT. The
reasoning behind this decision isn't documented in neither the FreeBSD
nor the OpenGroup manpages.

Add printf's to add in debugging the issue

PR:		211802
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 04:45:39 +00:00
Enji Cooper
fbc71595f0 Hack around output differences between FreeBSD and other BSDs
with cat(1)

cat -be on FreeBSD doesn't align the $ with the start of the line
like NetBSD, et al's cat -be does

PR:		210607
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 02:53:02 +00:00
Enji Cooper
8b8a0b8883 Initialize ai to NULL and test for ai with type-appropriate values
Depending on the address family and ai_flags containing AI_V4MAPPED,
it might not do a proper DNS lookup on the provided DNS address

Convert some `ai` boolean true/false checks to NULL/non-NULL while here.

MFC after:	1 week
PR:		211790
Reported by:	Herbie.Robinson@stratus.com
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 02:05:06 +00:00
Enji Cooper
04ee829f13 Increase timeout from 10 minutes to 20 minutes for all tests
On particular slow networks, it can (on average) take longer to
resolve hosts to IP* addresses. 20 minutes seemed reasonable for
my work network

This will be solved in a more meaningful way (if possible) using
concurrency in the near future

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-08-13 01:49:11 +00:00
Enji Cooper
09797f9dce Adjust CFLAGS for fmod_test so it can find isqemu.h
Sponsored by: EMC / Isilon Storage Division
2016-08-13 01:40:08 +00:00
Rick Macklem
1b819cf265 Update the nfsstats structure to include the changes needed by
the patch in D1626 plus changes so that it includes counts for
NFSv4.1 (and the draft of NFSv4.2).
Also, make all the counts uint64_t and add a vers field at the
beginning, so that future revisions can easily be implemented.
There is code in place to handle the old vesion of the nfsstats
structure for backwards binary compatibility.

Subsequent commits will update nfsstat(8) to use the new fields.

Submitted by:	will (earlier version)
Reviewed by:	ken
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D1626
2016-08-12 22:44:59 +00:00
Toomas Soome
1c214db6ca Reviewed by: allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D7491
2016-08-12 22:25:01 +00:00
Edward Tomasz Napierala
f8acef5a3e Remove unused "X" vnode lock assertion, somehow missed in r303743.
MFC after:	1 month
2016-08-12 22:22:11 +00:00
Edward Tomasz Napierala
f83cc0aae4 Print vnode details when vnode locking assertion gets triggered.
MFC after:	1 month
2016-08-12 22:20:52 +00:00
Stephen Hurd
23ac9029f9 Update iflib to support more NIC designs
- Move group task queue into kern/subr_gtaskqueue.c
- Change intr_enable to return an int so it can be detected if it's not
  implemented
- Allow different TX/RX queues per set to be different sizes
- Don't split up TX mbufs before transmit
- Allow a completion queue for TX as well as RX
- Pass the RX budget to isc_rxd_available() to allow an earlier return
  and avoid multiple calls

Submitted by:	shurd
Reviewed by:	gallatin
Approved by:	scottl
Differential Revision:	https://reviews.freebsd.org/D7393
2016-08-12 21:29:44 +00:00
John Baldwin
0e4c843ab4 Add defines needed to export SMBIOS serial numbers
Some defines needed for exporting serial numbers from the SMBIOS were
missed during integration of SMBIOS support in the EFI boot loader (r281138).
This is needed for getting the hostid set from the system hardware UUID.

PR:		206031
Submitted by:	Thomas Eberhardt <sneakywumpus@gmail.com>
MFC after:	1 week
2016-08-12 19:47:20 +00:00
Konstantin Belousov
f214036e99 Move defines common between rtld and libsysdecode into the header,
instead of copying inline into sources.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 19:31:41 +00:00
Konstantin Belousov
09944776b5 Fill phdr and phsize for rtld object. It is needed for
dl_iterate_phdr() reporting the correct values.

PR:	211367
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 18:31:44 +00:00
Konstantin Belousov
20ee0f7112 Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 18:29:11 +00:00
John Baldwin
563e703714 Remove description of P_FOLLOWFORK as this flag was removed. 2016-08-12 16:13:50 +00:00
Bryan Drewery
f566b25e0d Avoid taking PROC_LOCK in syscalls if not being traced.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-12 16:05:53 +00:00
Warren Block
15919690b5 Correct the history of where ps first appeared.
PR:		211741
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
MFC after:	1 week
2016-08-12 14:10:11 +00:00
Bryan Drewery
c8de0c57d7 Avoid showing the bootstrap make command for check-old, etc.
Reported by:	koobs
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-12 13:52:51 +00:00
Bryan Drewery
786c805027 PORTS_MODULES: Don't leak in CC/CXX/CPP.
These may have ccache in them or -target/--sysroot from external
compiler or SYSTEM_COMPILER support.  Many ports do not support
a CC with spaces in it, such as emulators/virtualbox-ose-kmod.
Passing --sysroot to ports makes no sense as ports doesn't support
--sysroot currently.
If these variables need to be overridden for ports then they can
be set in make.conf or passed as make arguments.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-12 11:06:54 +00:00
Andrew Turner
510a3f1b79 Implement promotions and demotions in the arm64 pmap code. For now we don't
promote memory as I am not sure all the demotion cases are handled, however
it is useful to implement pmap_page_set_memattr. This is used, for example,
when mapping uncached memory for bus_dma(9).

pmap_page_set_memattr needs to demote the DMAP region as on ARM we need to
ensure all mappings to the same physical address have the same attributes.

Reviewed by:	kib
Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6987
2016-08-12 10:29:34 +00:00
Enji Cooper
640235e2c2 Checkpoint initial integration work
- Some of the lib/libc and lib/thr tests fail
- lib/msun/exp_test:exp2_values now passes with clang 3.8.0

The Makefiles in contrib/netbsd-tests were pruned as they have no value

Sponsored by: EMC / Isilon Storage Division
2016-08-12 08:50:05 +00:00
Sepherosa Ziehau
8b204d6643 hyperv/hn: Simplify RXBUF disconnection.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7472
2016-08-12 08:29:26 +00:00
Sepherosa Ziehau
55c4b97bfa hyperv/hn: Switch to vmbus xact APIs for NVS chimney buffer connection.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7470
2016-08-12 08:21:02 +00:00
Maxim Konovalov
30bebccae0 o Move tmpstr varibale initialization out of assert(3) call.
This fixes acpidump(8) compiled with "WITHOUT_ASSERT_DEBUG=yes" that
removes assert(3)'s from the code.

Submitted by:	Alexander Nedotsukov
2016-08-12 08:16:35 +00:00
Sepherosa Ziehau
d293af4049 hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7469
2016-08-12 08:07:56 +00:00
Sepherosa Ziehau
386c97e616 hyperv/hn: Simplify NDIS initialization.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7467
2016-08-12 07:57:03 +00:00
Konstantin Belousov
68e9b1e8e1 Decode 32bit utrace records on the 64bit host.
Suppose that ktrace is performed on 32bit binary running on 64bit
host.  In this case, the kernel records are 64bit, while utrace
records from rtld and malloc are 32bit.  Make kdump useful to see
decoded utrace data in that case.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 07:54:59 +00:00
Konstantin Belousov
6bdee22607 Remove unused prototypes.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 07:52:13 +00:00
Sepherosa Ziehau
9b3922212a hyperv/hn: Simplify NDIS configuration.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7466
2016-08-12 07:14:40 +00:00
Ed Schouten
e2f6816100 Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3)
functions to conform to POSIX, let's go ahead and reimplement dirname(3)
in such a way that it's thread-safe, but also guaranteed to succeed. C
libraries like glibc, musl and the one that's part of Solaris already
follow such an approach.

Move the existing implementation to another source file,
freebsd11_dirname.c to keep existing users of the API that pass in a
constant string happy, using symbol versioning.

Put a new version of the function in dirname.c, obtained from CloudABI's
C library. This version scans through the pathname string from left to
right, normalizing it, while discarding the last pathname component.

Reviewed by:	emaste, jilles
Differential Revision:	https://reviews.freebsd.org/D7355
2016-08-12 07:03:58 +00:00
Enji Cooper
5a629b7e69 Remove CVS directories accidentally added in r303980 2016-08-12 06:16:14 +00:00
Alan Cox
791444089f Correct errors and clean up the comments on the active queue scan.
Eliminate some unnecessary blank lines.

Reviewed by:	kib, markj
MFC after:	1 week
2016-08-12 03:22:58 +00:00