Skip to content

Commit

Permalink
Merge pull request ghostbsd#349 from trueos/fbsd12-update-20190624
Browse files Browse the repository at this point in the history
Fbsd12 update 20190624
  • Loading branch information
kmoore134 authored Jun 24, 2019
2 parents 3d83b9b + 113bf51 commit 50d216f
Show file tree
Hide file tree
Showing 52 changed files with 962 additions and 178 deletions.
7 changes: 4 additions & 3 deletions libexec/rc/rc.d/ntpd
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ ntpd_precmd()
if can_run_nonroot; then
_user="ntpd"
driftopt="-f ${_ntp_default_driftfile}"
elif [ -z "${rc_flags##*-f*}" ] ||
[ -z "${rc_flags##*--driftfile*}" ] ||
grep -q "^[ \t]*driftfile" "${ntpd_config}"; then
elif grep -q "^[ \t]*driftfile" "${ntpd_config}" ||
[ -n "${rc_flags}" ] &&
( [ -z "${rc_flags##*-f*}" ] ||
[ -z "${rc_flags##*--driftfile*}" ] ); then
driftopt="" # admin set the option, we don't need to add it.
elif [ -f "${_ntp_old_driftfile}" ]; then
driftopt="-f ${_ntp_old_driftfile}"
Expand Down
1 change: 1 addition & 0 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ chroot_arm_build_release() {
[ ! -z "${RELEASECONF}" ] && . "${RELEASECONF}"
export MAKE_FLAGS="${MAKE_FLAGS} TARGET=${EMBEDDED_TARGET}"
export MAKE_FLAGS="${MAKE_FLAGS} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}"
export MAKE_FLAGS="${MAKE_FLAGS} ${CONF_FILES}"
eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release obj
export WORLDDIR="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release -V WORLDDIR)"
export OBJDIR="$(eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release -V .OBJDIR)"
Expand Down
2 changes: 1 addition & 1 deletion release/tools/arm.subr
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ arm_install_base() {
TARGET=${EMBEDDED_TARGET} \
TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \
DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \
installworld installkernel distribution
${CONF_FILES} installworld installkernel distribution
chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos

arm_create_user
Expand Down
22 changes: 22 additions & 0 deletions share/man/man3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,21 @@ MLINKS+= tree.3 RB_EMPTY.3 \
tree.3 RB_ENTRY.3 \
tree.3 RB_FIND.3 \
tree.3 RB_FOREACH.3 \
tree.3 RB_FOREACH_FROM.3 \
tree.3 RB_FOREACH_REVERSE.3 \
tree.3 RB_FOREACH_REVERSE_FROM.3 \
tree.3 RB_FOREACH_REVERSE_SAFE.3 \
tree.3 RB_FOREACH_SAFE.3 \
tree.3 RB_GENERATE.3 \
tree.3 RB_GENERATE_FIND.3 \
tree.3 RB_GENERATE_INSERT.3 \
tree.3 RB_GENERATE_INSERT_COLOR.3 \
tree.3 RB_GENERATE_MINMAX.3 \
tree.3 RB_GENERATE_NEXT.3 \
tree.3 RB_GENERATE_NFIND.3 \
tree.3 RB_GENERATE_PREV.3 \
tree.3 RB_GENERATE_REMOVE.3 \
tree.3 RB_GENERATE_REMOVE_COLOR.3 \
tree.3 RB_GENERATE_STATIC.3 \
tree.3 RB_HEAD.3 \
tree.3 RB_INIT.3 \
Expand All @@ -194,6 +207,15 @@ MLINKS+= tree.3 RB_EMPTY.3 \
tree.3 RB_PARENT.3 \
tree.3 RB_PREV.3 \
tree.3 RB_PROTOTYPE.3 \
tree.3 RB_PROTOTYPE_FIND.3 \
tree.3 RB_PROTOTYPE_INSERT.3 \
tree.3 RB_PROTOTYPE_INSERT_COLOR.3 \
tree.3 RB_PROTOTYPE_MINMAX.3 \
tree.3 RB_PROTOTYPE_NEXT.3 \
tree.3 RB_PROTOTYPE_NFIND.3 \
tree.3 RB_PROTOTYPE_PREV.3 \
tree.3 RB_PROTOTYPE_REMOVE.3 \
tree.3 RB_PROTOTYPE_REMOVE_COLOR.3 \
tree.3 RB_PROTOTYPE_STATIC.3 \
tree.3 RB_REMOVE.3 \
tree.3 RB_RIGHT.3 \
Expand Down
14 changes: 6 additions & 8 deletions share/man/man9/VOP_ADVLOCK.9
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 30, 1999
.Dd May 27, 2019
.Dt VOP_ADVLOCK 9
.Os
.Sh NAME
Expand Down Expand Up @@ -56,13 +56,7 @@ Description of the lock.
.It Fa flags
One of more of the following:
.Pp
.Bl -tag -width ".Dv F_UNLCK" -offset indent -compact
.It Dv F_RDLCK
Shared or read lock.
.It Dv F_UNLCK
Unlock.
.It Dv F_WRLCK
Exclusive or write lock.
.Bl -tag -width ".Dv F_REMOTE" -offset indent -compact
.It Dv F_WAIT
Wait until lock is granted.
.It Dv F_FLOCK
Expand All @@ -71,6 +65,10 @@ Use
semantics for lock.
.It Dv F_POSIX
Use POSIX semantics for lock.
.It Dv F_REMOTE
Lock owner is remote NFS client.
.It Dv F_NOINTR
Mask signals while waiting for the lock.
.El
.El
.Pp
Expand Down
6 changes: 2 additions & 4 deletions sys/amd64/amd64/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware");

int lazy_fpu_switch = 0;
SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RD,
&lazy_fpu_switch, 0,
"Lazily load FPU context after context switch");

Expand Down Expand Up @@ -269,7 +269,6 @@ fpuinit_bsp1(void)
uint64_t xsave_mask_user;
bool old_wp;

TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch);
if (!use_xsave)
return;
cpuid_count(0xd, 0x0, cp);
Expand Down Expand Up @@ -774,8 +773,7 @@ void
fpu_activate_sw(struct thread *td)
{

if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 ||
!PCB_USER_FPU(td->td_pcb)) {
if ((td->td_pflags & TDP_KTHREAD) != 0 || !PCB_USER_FPU(td->td_pcb)) {
PCPU_SET(fpcurthread, NULL);
start_emulating();
} else if (PCPU_GET(fpcurthread) != td) {
Expand Down
84 changes: 39 additions & 45 deletions sys/amd64/amd64/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,41 +118,41 @@ static bool trap_user_dtrace(struct trapframe *,
int (**hook)(struct trapframe *));
#endif

#define MAX_TRAP_MSG 32
static char *trap_msg[] = {
"", /* 0 unused */
"privileged instruction fault", /* 1 T_PRIVINFLT */
"", /* 2 unused */
"breakpoint instruction fault", /* 3 T_BPTFLT */
"", /* 4 unused */
"", /* 5 unused */
"arithmetic trap", /* 6 T_ARITHTRAP */
"", /* 7 unused */
"", /* 8 unused */
"general protection fault", /* 9 T_PROTFLT */
"debug exception", /* 10 T_TRCTRAP */
"", /* 11 unused */
"page fault", /* 12 T_PAGEFLT */
"", /* 13 unused */
"alignment fault", /* 14 T_ALIGNFLT */
"", /* 15 unused */
"", /* 16 unused */
"", /* 17 unused */
"integer divide fault", /* 18 T_DIVIDE */
"non-maskable interrupt trap", /* 19 T_NMI */
"overflow trap", /* 20 T_OFLOW */
"FPU bounds check fault", /* 21 T_BOUND */
"FPU device not available", /* 22 T_DNA */
"double fault", /* 23 T_DOUBLEFLT */
"FPU operand fetch fault", /* 24 T_FPOPFLT */
"invalid TSS fault", /* 25 T_TSSFLT */
"segment not present fault", /* 26 T_SEGNPFLT */
"stack fault", /* 27 T_STKFLT */
"machine check trap", /* 28 T_MCHK */
"SIMD floating-point exception", /* 29 T_XMMFLT */
"reserved (unknown) fault", /* 30 T_RESERVED */
"", /* 31 unused (reserved) */
"DTrace pid return trap", /* 32 T_DTRACE_RET */
static const char UNKNOWN[] = "unknown";
static const char *const trap_msg[] = {
[0] = UNKNOWN, /* unused */
[T_PRIVINFLT] = "privileged instruction fault",
[2] = UNKNOWN, /* unused */
[T_BPTFLT] = "breakpoint instruction fault",
[4] = UNKNOWN, /* unused */
[5] = UNKNOWN, /* unused */
[T_ARITHTRAP] = "arithmetic trap",
[7] = UNKNOWN, /* unused */
[8] = UNKNOWN, /* unused */
[T_PROTFLT] = "general protection fault",
[T_TRCTRAP] = "debug exception",
[11] = UNKNOWN, /* unused */
[T_PAGEFLT] = "page fault",
[13] = UNKNOWN, /* unused */
[T_ALIGNFLT] = "alignment fault",
[15] = UNKNOWN, /* unused */
[16] = UNKNOWN, /* unused */
[17] = UNKNOWN, /* unused */
[T_DIVIDE] = "integer divide fault",
[T_NMI] = "non-maskable interrupt trap",
[T_OFLOW] = "overflow trap",
[T_BOUND] = "FPU bounds check fault",
[T_DNA] = "FPU device not available",
[T_DOUBLEFLT] = "double fault",
[T_FPOPFLT] = "FPU operand fetch fault",
[T_TSSFLT] = "invalid TSS fault",
[T_SEGNPFLT] = "segment not present fault",
[T_STKFLT] = "stack fault",
[T_MCHK] = "machine check trap",
[T_XMMFLT] = "SIMD floating-point exception",
[T_RESERVED] = "reserved (unknown) fault",
[31] = UNKNOWN, /* reserved */
[T_DTRACE_RET] = "DTrace pid return trap",
};

static int prot_fault_translation;
Expand Down Expand Up @@ -879,7 +879,6 @@ trap_fatal(frame, eva)
int code, ss;
u_int type;
struct soft_segment_descriptor softseg;
char *msg;
#ifdef KDB
bool handled;
#endif
Expand All @@ -889,11 +888,8 @@ trap_fatal(frame, eva)
sdtossd(&gdt[NGDT * PCPU_GET(cpuid) + IDXSEL(frame->tf_cs & 0xffff)],
&softseg);

if (type <= MAX_TRAP_MSG)
msg = trap_msg[type];
else
msg = "UNKNOWN";
printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg,
printf("\n\nFatal trap %d: %s while in %s mode\n", type,
type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN,
TRAPF_USERMODE(frame) ? "user" : "kernel");
#ifdef SMP
/* two separate prints in case of a trap on an unmapped page */
Expand Down Expand Up @@ -944,10 +940,8 @@ trap_fatal(frame, eva)
}
#endif
printf("trap number = %d\n", type);
if (type <= MAX_TRAP_MSG)
panic("%s", trap_msg[type]);
else
panic("unknown/reserved trap");
panic("%s", type < nitems(trap_msg) ? trap_msg[type] :
"unknown/reserved trap");
}

#ifdef KDTRACE_HOOKS
Expand Down
5 changes: 5 additions & 0 deletions sys/arm/freescale/imx/imx_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ DRIVER_MODULE(imx_i2c, simplebus, i2c_driver, i2c_devclass, 0, 0);
DRIVER_MODULE(ofw_iicbus, imx_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0);
MODULE_DEPEND(imx_i2c, iicbus, 1, 1, 1);
MODULE_DEPEND(imx_i2c, ofw_iicbus, 1, 1, 1);
SIMPLEBUS_PNP_INFO(compat_data);

static phandle_t
i2c_get_node(device_t bus, device_t dev)
Expand Down Expand Up @@ -468,6 +469,10 @@ i2c_detach(device_t dev)
if (sc->iicbus != NULL)
device_delete_child(dev, sc->iicbus);

/* Release bus-recover pins; gpio_pin_release() handles NULL args. */
gpio_pin_release(sc->rb_sclpin);
gpio_pin_release(sc->rb_sdapin);

if (sc->res != NULL)
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res);

Expand Down
1 change: 1 addition & 0 deletions sys/arm64/conf/GENERIC
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ device bcm2835_bsc # Broadcom BCM283x I2C bus
device iicbus
device iic
device twsi # Allwinner I2C controller
device syr827 # Silergy SYR827 PMIC

# Clock and reset controllers
device aw_ccu # Allwinner clock controller
Expand Down
30 changes: 16 additions & 14 deletions sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,14 +1571,14 @@ static kmutex_t l2arc_feed_thr_lock;
static kcondvar_t l2arc_feed_thr_cv;
static uint8_t l2arc_thread_exit;

static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *);
static abd_t *arc_get_data_abd(arc_buf_hdr_t *, uint64_t, void *, boolean_t);
static void *arc_get_data_buf(arc_buf_hdr_t *, uint64_t, void *);
static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *);
static void arc_get_data_impl(arc_buf_hdr_t *, uint64_t, void *, boolean_t);
static void arc_free_data_abd(arc_buf_hdr_t *, abd_t *, uint64_t, void *);
static void arc_free_data_buf(arc_buf_hdr_t *, void *, uint64_t, void *);
static void arc_free_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag);
static void arc_hdr_free_pabd(arc_buf_hdr_t *);
static void arc_hdr_alloc_pabd(arc_buf_hdr_t *);
static void arc_hdr_alloc_pabd(arc_buf_hdr_t *, boolean_t);
static void arc_access(arc_buf_hdr_t *, kmutex_t *);
static boolean_t arc_is_overflowing();
static void arc_buf_watch(arc_buf_t *);
Expand Down Expand Up @@ -3364,14 +3364,14 @@ arc_buf_destroy_impl(arc_buf_t *buf)
}

static void
arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr)
arc_hdr_alloc_pabd(arc_buf_hdr_t *hdr, boolean_t do_adapt)
{
ASSERT3U(HDR_GET_LSIZE(hdr), >, 0);
ASSERT(HDR_HAS_L1HDR(hdr));
ASSERT(!HDR_SHARED_DATA(hdr));

ASSERT3P(hdr->b_l1hdr.b_pabd, ==, NULL);
hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr);
hdr->b_l1hdr.b_pabd = arc_get_data_abd(hdr, arc_hdr_size(hdr), hdr, do_adapt);
hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS;
ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL);

Expand Down Expand Up @@ -3435,7 +3435,7 @@ arc_hdr_alloc(uint64_t spa, int32_t psize, int32_t lsize,
* the compressed or uncompressed data depending on the block
* it references and compressed arc enablement.
*/
arc_hdr_alloc_pabd(hdr);
arc_hdr_alloc_pabd(hdr, B_TRUE);
ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));

return (hdr);
Expand Down Expand Up @@ -5156,11 +5156,11 @@ arc_is_overflowing(void)
}

static abd_t *
arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag)
arc_get_data_abd(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt)
{
arc_buf_contents_t type = arc_buf_type(hdr);

arc_get_data_impl(hdr, size, tag);
arc_get_data_impl(hdr, size, tag, do_adapt);
if (type == ARC_BUFC_METADATA) {
return (abd_alloc(size, B_TRUE));
} else {
Expand All @@ -5174,7 +5174,7 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, void *tag)
{
arc_buf_contents_t type = arc_buf_type(hdr);

arc_get_data_impl(hdr, size, tag);
arc_get_data_impl(hdr, size, tag, B_TRUE);
if (type == ARC_BUFC_METADATA) {
return (zio_buf_alloc(size));
} else {
Expand All @@ -5190,12 +5190,13 @@ arc_get_data_buf(arc_buf_hdr_t *hdr, uint64_t size, void *tag)
* limit, we'll only signal the reclaim thread and continue on.
*/
static void
arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag)
arc_get_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag, boolean_t do_adapt)
{
arc_state_t *state = hdr->b_l1hdr.b_state;
arc_buf_contents_t type = arc_buf_type(hdr);

arc_adapt(size, state);
if (do_adapt)
arc_adapt(size, state);

/*
* If arc_size is currently overflowing, and has grown past our
Expand Down Expand Up @@ -5946,8 +5947,9 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_read_done_func_t *done,
* do this after we've called arc_access() to
* avoid hitting an assert in remove_reference().
*/
arc_adapt(arc_hdr_size(hdr), hdr->b_l1hdr.b_state);
arc_access(hdr, hash_lock);
arc_hdr_alloc_pabd(hdr);
arc_hdr_alloc_pabd(hdr, B_FALSE);
}
ASSERT3P(hdr->b_l1hdr.b_pabd, !=, NULL);
size = arc_hdr_size(hdr);
Expand Down Expand Up @@ -6361,7 +6363,7 @@ arc_release(arc_buf_t *buf, void *tag)
if (arc_can_share(hdr, lastbuf)) {
arc_share_buf(hdr, lastbuf);
} else {
arc_hdr_alloc_pabd(hdr);
arc_hdr_alloc_pabd(hdr, B_TRUE);
abd_copy_from_buf(hdr->b_l1hdr.b_pabd,
buf->b_data, psize);
}
Expand Down Expand Up @@ -6524,7 +6526,7 @@ arc_write_ready(zio_t *zio)
* the data into it; otherwise, we share the data directly if we can.
*/
if (zfs_abd_scatter_enabled || !arc_can_share(hdr, buf)) {
arc_hdr_alloc_pabd(hdr);
arc_hdr_alloc_pabd(hdr, B_TRUE);

/*
* Ideally, we would always copy the io_abd into b_pabd, but the
Expand Down
1 change: 1 addition & 0 deletions sys/conf/files
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds1374
dev/iicbus/ds1672.c optional ds1672
dev/iicbus/ds3231.c optional ds3231
dev/iicbus/rtc8583.c optional rtc8583
dev/iicbus/syr827.c optional ext_resources syr827
dev/iicbus/icee.c optional icee
dev/iicbus/if_ic.c optional ic
dev/iicbus/iic.c optional iic
Expand Down
2 changes: 1 addition & 1 deletion sys/contrib/ipfilter/netinet/fil.c
Original file line number Diff line number Diff line change
Expand Up @@ -6268,7 +6268,7 @@ ipf_ioctlswitch(softc, unit, data, cmd, mode, uid, ctx)
* Flags:
* 1 = minimum size, not absolute size
*/
static int ipf_objbytes[IPFOBJ_COUNT][3] = {
static const int ipf_objbytes[IPFOBJ_COUNT][3] = {
{ 1, sizeof(struct frentry), 5010000 }, /* 0 */
{ 1, sizeof(struct friostat), 5010000 },
{ 0, sizeof(struct fr_info), 5010000 },
Expand Down
Loading

0 comments on commit 50d216f

Please sign in to comment.