- For non-TSO offloading, we don't need to access mbuf to know
which csum offloading is requested, we can just use the
CSUM_{IP,TCP,UDP} in the csum_flags.
- For TSO offloading, we still can depend on CSUM_{TSO4,TSO6}
in the csum_flags to tell whether the TSO packet is an IPv4
TSO packet or an IPv6 TSO packet.
This streamlines csum offloading handling (remove the two goto)
and allows us the nuke the unnecessary get_transport_proto_type().
Reviewed by: adrian, Hongjiang Zhang <honzhan microsoft com>
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5098
- Record csum features in softc, so we don't need to duplicate the
logic from attach path to ioctl path.
- Protect if_capenable and if_hwassist changes by main lock.
- Prefer turn on/off bits in if_hwassist explicitly instead of using
XOR.
Reviewed by: adrian, Hongjiang Zhang <honzhan microsoft com>
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5085
When matching brand to the ELF binary by notes, try to find a brand
with interpreter name exactly matching one wanted by the binary. If
no such brand exists, return first brand which accepted the binary by
note.
The change fixes a regression after r292749, where e.g. our two ia32
compat brands, ia32_brand_info and ia32_brand_oinfo, only differ by
the interpeter path and binary matches to a brand by linkage order.
Then old binaries which require /usr/libexec/ld-elf.so.1 but matched
against ia32_brand_info with interp_path /libexec/ld-elf.so.1, were
considered requiring non-standard interpreter name, and magic to force
ld-elf32.so.1 did not happen.
Note that it might make sense to apply the same selection of brands
for other matching criteria, SCO EI_OSABI and 3.x string.
Reported and tested by: dwmalone
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Ravi Pokala [Thu, 4 Feb 2016 19:53:54 +0000 (19:53 +0000)]
Add defines for WRITE_UNCORRECTABLE ATA command, and improve command logging
Add #defines for ATA_WRITE_UNCORRECTABLE48 and its features. Update the
decoding in ATACAM to recognize the new values. Also improve command
decoding for a few other commands (SMART, NOP, SET_FEATURES). Bring the
decoding in ata(4) up to parity with ATACAM.
Michael Tuexen [Thu, 4 Feb 2016 18:08:50 +0000 (18:08 +0000)]
In FreeBSD 10 and higher the driver announces SCTP checksum offloading support
also for 82598, which doesn't support it.
The legacy code has a check for it, which was missed when the code for dealing with
CSUM_IP6_* was added. Add the same check for FreeBSD 10 and higher.
John Baldwin [Thu, 4 Feb 2016 17:43:56 +0000 (17:43 +0000)]
Fix build of powerpc FPU emulator after changes in r295132 to restore the
ABI of struct fpreg. The FPU emulator operates on the "raw" FPU state
stored in the pcb rather than the "cooked" fpreg state used for ptrace()
and cores.
Andrew Turner [Thu, 4 Feb 2016 17:22:15 +0000 (17:22 +0000)]
Enable checking of the stack alignment. The stack should be aligned to a
16-byte value. With this the hardware will check if a memory access uses
an incorrectly aligned stack pointer as the base address.
Michal Meloun [Thu, 4 Feb 2016 17:01:38 +0000 (17:01 +0000)]
Replace broken implementation of fuswintr() and suswintr() by functions
which return -1 as well as on tier 1 archs. Remove block_userspace_access
used only in these implementations.
(1) These functions may be called in interrupt context and pcb_onfault
can be already set in this time. Thus, prior pcb_onfault must be saved
and restored afterwards.
(2) The check that an abort came either from nested interrupt or while
in critical section or holding not sleepable lock must be avoided for
this case.
These functions are called only for profiling reason, so there will be
only small gain by making the code more complex.
Do not copy by field when converting struct oexport_args to struct
export_args on mount update, bzero() is consistent with
vfs_oexport_conv().
Make the code structure more explicit by using switch.
Return EINVAL if export option layout (deduced from size) is unknown.
Based on the submission by: bde
Sponsored by: The FreeBSD Foundation
Michal Meloun [Thu, 4 Feb 2016 14:02:42 +0000 (14:02 +0000)]
ARM: Set UNAL_ENABLE bit in SCTLR CP15 register. This bit is RAO/SBOP
for ARMv7. For ARMv6, it controls ARMv5 compatible alignment support.
This bit have no effect until unaligned access is enabled.
Svatopluk Kraus [Thu, 4 Feb 2016 13:35:40 +0000 (13:35 +0000)]
Small rearrangement of abort_handler().
(1) Move cnt.v_trap increment to the beginning. There is cnt.v_vm_faults
counter in vm_fault(), so a number of hardware emulation aborts may be
get roughly as difference.
(2) Move kdb_reenter() up to not be ignored if pmap_fault() has failed.
(3) Update comments.
Ruslan Bukin [Thu, 4 Feb 2016 12:49:28 +0000 (12:49 +0000)]
Reuse gp register for pcpu pointer.
gp (global pointer) is used by compiler in userland only,
so re-use it for pcpup in kernel, save it on stack on switching
out to userland and load back on return to kernel.
Mateusz Guzik [Thu, 4 Feb 2016 04:25:30 +0000 (04:25 +0000)]
fork: plug a use after free of the returned process
fork1 required its callers to pass a pointer to struct proc * which would
be set to the new process (if any). procdesc and racct manipulation also
used said pointer.
However, the process could have exited prior to do_fork return and be
automatically reaped, thus making this a use-after-free.
Fix the problem by letting callers indicate whether they want the pid or
the struct proc, return the process in stopped state for the latter case.
Gleb Smirnoff [Wed, 3 Feb 2016 23:30:17 +0000 (23:30 +0000)]
Redo r292484. Embed task(9) into zone, so that uz_maxaction is called
in a context that can sleep, allowing consumers of the KPI to run their
drain routines without any extra measures.
Gleb Smirnoff [Wed, 3 Feb 2016 22:02:36 +0000 (22:02 +0000)]
Move uma_dbg_alloc() and uma_dbg_free() into uma_core.c, which allows
to make uma_dbg.h not depend on uma_int.h, which allows to uninclude
uma_int.h from the mbuf(9) allocator.
Svatopluk Kraus [Wed, 3 Feb 2016 12:11:07 +0000 (12:11 +0000)]
Partly revert r295168 and define PTE_DEVICE in pmap-v6.h header again.
It turned out that devmap.c is not only file in which PTE_DEVICE
is used and simultaneously, built for both armv4 and armv6 platforms.
When I tried to build all arm kernels before r295168 commit, it was
hid by some other local changes in my tree. I hope that this is just
temporary workaround before VM_MEMATTR_DEVICE could be used instead of
PTE_DEVICE outside of pmap code for __ARM_ARCH < 6.
Bjoern A. Zeeb [Wed, 3 Feb 2016 11:03:44 +0000 (11:03 +0000)]
Try to fix a bug introduced in r228623. We started to copy the ifa_msghdr
as otherwise platforms with strict alignment would break. It's unclear
to me if there's also a problem with access to the address list following
the structure. However we never copied the address list after the structure
and thus are pointing at random memory. For now just use a pointer to the
original memory for accessing the address list making it at least work on
platforms with weak memory access.
PR: 195445
Reported by: wolfgang lyxys.ka.sub.org
Tested by: wolfgang lyxys.ka.sub.org (x86)
MFC after: 3 days
Michal Meloun [Wed, 3 Feb 2016 08:59:12 +0000 (08:59 +0000)]
ARM: The arm/xscale/i80321 directory is now orphaned, but two drivers
are shared with i8134x. In preparation for removal of i80321, copy these
drivers to i8134x.
Devin Teske [Wed, 3 Feb 2016 04:02:50 +0000 (04:02 +0000)]
f_substr(): Optimized recipe if running under bash
This makes runnig f_substr() faster than it was when running under bash,
but both sh and dash are still faster when using the non-bash recipe which
features dynamically unrolled loops.
Justin Hibbits [Wed, 3 Feb 2016 01:50:27 +0000 (01:50 +0000)]
Align signal stack pointer to 16 bytes.
The stack must be aligned to 16 bytes at all times. Clang 3.8 is especially
adamant about this, and causes strange behavior and segmentation faults if it is
not the case.
Justin Hibbits [Wed, 3 Feb 2016 01:29:06 +0000 (01:29 +0000)]
Make lbc(4) the same driver pass as simplebus.
Device trees mark lbc as compatible with simplebus. Since simplebus is passed
first, it attaches first. When lbc's pass (default pass) comes, the bus is
already attached to simplebus, so is skipped.
John Baldwin [Tue, 2 Feb 2016 22:55:03 +0000 (22:55 +0000)]
- Note that devctl(8) will appear in 10.3 first.
- Add missing devctl_set_driver entry to namelist in devlist(3).
- Fix sorting of function prototypes in devlist(3).
Devin Teske [Tue, 2 Feb 2016 22:18:43 +0000 (22:18 +0000)]
For +=/-=, add . and / to convenience characters
sysrc(8) supports key+=value and key-=value, but can be told what the
delimiter is by being passed as char1 (e.g., "sysrc key+=",value" to use a
comma as the delimiter instead of space). For convenience, if the first char
is alpha-numeric, it is assumed you wanted whitespace as the delimiter.
However, if you naively (as I just did) execute:
sysrc rc_conf_files+=/etc/rc.conf.other
the result is unexpected.
This commit makes `.' and `/' in-addition to alpha-numeric first-characters
to cause the default of whitespace to be used as the delimiter. This also
means that you can no longer use these as a delimiter.
Devin Teske [Tue, 2 Feb 2016 21:58:17 +0000 (21:58 +0000)]
Replace (Qo \ Qc) with (Qo (space) Qc)
When using col(1) piped to vim(1) as pager for man(1), the former sequence
of (Qo \ Qc) renders as "" without the space. Replace with (Qo (space) Qc)
which renders properly in more (all?) pagers.
Svatopluk Kraus [Tue, 2 Feb 2016 21:17:25 +0000 (21:17 +0000)]
Use pmap_preboot_map_attr() directly in arm_devmap_bootstrap()
instead of hiding behind pmap_map_chunk(). It's not longer needed
after old pmap-v6 code was removed.
For compatibility with __ARM_ARCH < 6, define PTE_DEVICE in devmap.c
file. Certainly, it would be nice if VM_MEMATTR_DEVICE could be used
even for __ARM_ARCH < 6.
Svatopluk Kraus [Tue, 2 Feb 2016 21:10:55 +0000 (21:10 +0000)]
Make pmap_preboot_map_attr() vm subsystem compliant, so its arguments
do not depend on pmap internals. This is a preparation for hiding
internal pmap definitions as much as possible from the rest of system.
Simultaneously, the protection argument evaluation is fixed. Happily,
it did not effect the mappings. And it's the reason why it was not fixed
earlier.
Bryan Drewery [Tue, 2 Feb 2016 20:50:09 +0000 (20:50 +0000)]
Adjust install .WAITs for lib/ and etc/ to allow parallelization more.
Only 'installworld' needs to be protected and only when not using
-DNO_ROOT, which implies not installing to / and not needing the
lib dependency protections.
Maxim Sobolev [Tue, 2 Feb 2016 19:04:40 +0000 (19:04 +0000)]
Root out files that don't really belong here and could in fact screw
you over if you happen to use git for FreeBSD development, as it is
the case with the unbound/.gitignore, which lits files that are
actually required for the buildworld.
Andrew Turner [Tue, 2 Feb 2016 17:59:43 +0000 (17:59 +0000)]
Increase the size of PHYS_AVAIL_SIZE to allow firmware to provide a large
number of physical memory locations we can access. This is the case on
some HiKey boards that may have UEFI reserved memory dispersed through the
physical space.
Adrian Chadd [Tue, 2 Feb 2016 16:00:42 +0000 (16:00 +0000)]
Move MIPS32 Release 2 and Release 3 CPUs to use the EHB instruction for
clearing hazards.
This revision makes currently known MIPS32 Release 2 and Release 3 CPUs use
the EHB instruction when clearing hazards. So far the MIPS 74K and MIPS1004K
(somewhat) were already using the EHB. Now we add more r2 and r3 CPUs to
this list.
Also, for the cases of MIPS coherent processing systems (currently 1004K,
1074K, interAptiv and proAptiv) - define proper CCA attributes.
Michal Meloun [Tue, 2 Feb 2016 14:53:34 +0000 (14:53 +0000)]
ARM: All remaining functions in cpufunc_asm_arm10.S are identical with
functions in cpufunc_asm_arm9.S. Use arm9 variants and remove
cpufunc_asm_arm10.S completly.
Hajimu UMEMOTO [Tue, 2 Feb 2016 11:51:18 +0000 (11:51 +0000)]
Make dynamic link of libiconv from ports work again.
The symbols of libiconv from ports were changed to
have prefixed.
Since we have iconv in our libc these days, we don't
need it on 10.X and later. However, 9.X still need
this.
Andrew Turner [Tue, 2 Feb 2016 10:39:18 +0000 (10:39 +0000)]
Add suppor to loader.efi to load files off hte network. For this we need
to open the device in exclusive mode as, without this, the firmware may
also be reading packets off the interface leading to a race.
Andrew Turner [Tue, 2 Feb 2016 10:28:56 +0000 (10:28 +0000)]
Implement single stepping on arm64. We need to set the single step bits in
the processor and debug state registers. A flag has been added to the pcb
to tell us when to enable single stepping for a given thread.