aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Import tzdata 2019bPhilip Paeps2019-07-0220-381/+720
| | | | | | | | | Changes: https://github.com/eggert/tz/blob/2019b/NEWS MFC after: 1 day Notes: svn path=/head/; revision=349592
* Add a new "untrusted" option to the mount command. Its purposeKirk McKusick2019-07-015-4/+19
| | | | | | | | | | | | | | | | | | | is to notify the kernel that the file system is untrusted and it should use more extensive checks on the file-system's metadata before using it. This option is intended to be used when mounting file systems from untrusted media such as USB memory sticks or other externally-provided media. It will initially be used by the UFS/FFS file system, but should likely be expanded to be used by other file systems that may appear on external media like msdosfs, exfat, and ext2fs. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20786 Notes: svn path=/head/; revision=349589
* arm64: efi: Map memory IO region as deviceEmmanuel Vadot2019-07-011-8/+2
| | | | | | | | Reviewed by: andrew Sponsored by: Ampere Computing, LLC Notes: svn path=/head/; revision=349588
* g_mirror_taste: avoid deadlock, always clear tasting flagRyan Libby2019-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | If g_mirror_taste encountered an error at g_mirror_add_disk, it might try to g_mirror_destroy the device with the G_MIRROR_DEVICE_FLAG_TASTING flag still set. This would wait on a worker to complete the destruction with g_mirror_try_destroy, but that function bails out if the tasting flag is set, resulting in a deadlock. Clear the tasting flag before trying to destroy the device. Test Plan: sysctl debug.fail_point.mnowait="1%return" kyua test -k /usr/tests/sys/geom/class/mirror/Kyuafile Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20744 Notes: svn path=/head/; revision=349587
* g_eli_create: only dec g_access acw if we inc'd itRyan Libby2019-07-011-6/+4
| | | | | | | | | Reviewed by: cem, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20743 Notes: svn path=/head/; revision=349586
* Tidy up pmap_copy(). Notably, deindent the innermost loop by making aAlan Cox2019-07-011-56/+49
| | | | | | | | | | | | simple change to the control flow. Replace an unnecessary test by a KASSERT. Add a comment explaining an obscure test. Reviewed by: kib, markj MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D20812 Notes: svn path=/head/; revision=349585
* Since r349571 we need all the accessor to be present for set or getEmmanuel Vadot2019-07-011-0/+12
| | | | | | | | | | | | otherwise we panic. dwmmc don't handle VCCQ (voltage for the IO line of the SD/eMMC) or TIMING. Add the needed accessor in the {read,write}_ivar functions. Reviewed by: imp (previous version) Notes: svn path=/head/; revision=349584
* Pull in r360968 from upstream llvm trunk (by Philip Reames):Dimitry Andric2019-07-013-173/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify comments on helpers used by LFTR [NFC] I'm slowly wrapping my head around this code, and am making comment improvements where I can. Pull in r360972 from upstream llvm trunk (by Philip Reames): [LFTR] Factor out a helper function for readability purpose [NFC] Pull in r360976 from upstream llvm trunk (by Philip Reames): [IndVars] Don't reimplement Loop::isLoopInvariant [NFC] Using dominance vs a set membership check is indistinguishable from a compile time perspective, and the two queries return equivelent results. Simplify code by using the existing function. Pull in r360978 from upstream llvm trunk (by Philip Reames): [LFTR] Strengthen assertions in genLoopLimit [NFCI] Pull in r362292 from upstream llvm trunk (by Nikita Popov): [IndVarSimplify] Fixup nowrap flags during LFTR (PR31181) Fix for https://bugs.llvm.org/show_bug.cgi?id=31181 and partial fix for LFTR poison handling issues in general. When LFTR moves a condition from pre-inc to post-inc, it may now depend on value that is poison due to nowrap flags. To avoid this, we clear any nowrap flag that SCEV cannot prove for the post-inc addrec. Additionally, LFTR may switch to a different IV that is dynamically dead and as such may be arbitrarily poison. This patch will correct nowrap flags in some but not all cases where this happens. This is related to the adoption of IR nowrap flags for the pre-inc addrec. (See some of the switch_to_different_iv tests, where flags are not dropped or insufficiently dropped.) Finally, there are likely similar issues with the handling of GEP inbounds, but we don't have a test case for this yet. Differential Revision: https://reviews.llvm.org/D60935 Pull in r362971 from upstream llvm trunk (by Philip Reames): Prepare for multi-exit LFTR [NFC] This change does the plumbing to wire an ExitingBB parameter through the LFTR implementation, and reorganizes the code to work in terms of a set of individual loop exits. Most of it is fairly obvious, but there's one key complexity which makes it worthy of consideration. The actual multi-exit LFTR patch is in D62625 for context. Specifically, it turns out the existing code uses the backedge taken count from before a IV is widened. Oddly, we can end up with a different (more expensive, but semantically equivelent) BE count for the loop when requerying after widening. For the nestedIV example from elim-extend, we end up with the following BE counts: BEFORE: (-2 + (-1 * %innercount) + %limit) AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>) This is the only test in tree which seems sensitive to this difference. The actual result of using the wider BETC on this example is that we actually produce slightly better code. :) In review, we decided to accept that test change. This patch is structured to preserve the old behavior, but a separate change will immediate follow with the behavior change. (I wanted it separate for problem attribution purposes.) Differential Revision: https://reviews.llvm.org/D62880 Pull in r362975 from upstream llvm trunk (by Philip Reames): [LFTR] Use recomputed BE count This was discussed as part of D62880. The basic thought is that computing BE taken count after widening should produce (on average) an equally good backedge taken count as the one before widening. Since there's only one test in the suite which is impacted by this change, and it's essentially equivelent codegen, that seems to be a reasonable assertion. This change was separated from r362971 so that if this turns out to be problematic, the triggering piece is obvious and easily revertable. For the nestedIV example from elim-extend.ll, we end up with the following BE counts: BEFORE: (-2 + (-1 * %innercount) + %limit) AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>) Note that before is an i32 type, and the after is an i64. Truncating the i64 produces the i32. Pull in r362980 from upstream llvm trunk (by Philip Reames): Factor out a helper function for readability and reuse in a future patch [NFC] Pull in r363613 from upstream llvm trunk (by Philip Reames): Fix a bug w/inbounds invalidation in LFTR (recommit) Recommit r363289 with a bug fix for crash identified in pr42279. Issue was that a loop exit test does not have to be an icmp, leading to a null dereference crash when new logic was exercised for that case. Test case previously committed in r363601. Original commit comment follows: This contains fixes for two cases where we might invalidate inbounds and leave it stale in the IR (a miscompile). Case 1 is when switching to an IV with no dynamically live uses, and case 2 is when doing pre-to-post conversion on the same pointer type IV. The basic scheme used is to prove that using the given IV (pre or post increment forms) would have to already trigger UB on the path to the test we're modifying. As such, our potential UB triggering use does not change the semantics of the original program. As was pointed out in the review thread by Nikita, this is defending against a separate issue from the hasConcreteDef case. This is about poison, that's about undef. Unfortunately, the two are different, see Nikita's comment for a fuller explanation, he explains it well. (Note: I'm going to address Nikita's last style comment in a separate commit just to minimize chance of subtle bugs being introduced due to typos.) Differential Revision: https://reviews.llvm.org/D62939 Pull in r363875 from upstream llvm trunk (by Philip Reames): [LFTR] Rename variable to minimize confusion [NFC] (Recommit of r363293 which was reverted when a dependent patch was.) As pointed out by Nikita in D62625, BackedgeTakenCount is generally used to refer to the backedge taken count of the loop. A conditional backedge taken count - one which only applies if a particular exit is taken - is called a ExitCount in SCEV code, so be consistent here. Pull in r363877 from upstream llvm trunk (by Philip Reames): [LFTR] Stylistic cleanup as suggested in last review comment of D62939 [NFC] (Resumbit of r363292 which was reverted along w/an earlier patch) Pull in r364346 from upstream llvm trunk (by Philip Reames): [LFTR] Adjust debug output to include extensions (if any) Pull in r364693 from upstream llvm trunk (by Philip Reames): [IndVars] Remove a bit of manual constant folding [NFC] SCEV is more than capable of folding (add x, trunc(0)) to x. Pull in r364709 from upstream llvm trunk (by Nikita Popov): [LFTR] Fix post-inc pointer IV with truncated exit count (PR41998) Fixes https://bugs.llvm.org/show_bug.cgi?id=41998. Usually when we have a truncated exit count we'll truncate the IV when comparing against the limit, in which case exit count overflow in post-inc form doesn't matter. However, for pointer IVs we don't do that, so we have to be careful about incrementing the IV in the wide type. I'm fixing this by removing the IVCount variable (which was ExitCount or ExitCount+1) and replacing it with a UsePostInc flag, and then moving the actual limit adjustment to the individual cases (which are: pointer IV where we add to the wide type, integer IV where we add to the narrow type, and constant integer IV where we add to the wide type). Differential Revision: https://reviews.llvm.org/D63686 Together, these should fix a hang when building the textproc/htmldoc port, due to an incorrect loop optimization. PR: 237515 MFC after: 1 week Notes: svn path=/head/; revision=349583
* Factor out the code that does a VOP_SETATTR(size) from vn_truncate().Rick Macklem2019-07-012-8/+24
| | | | | | | | | | | | | | This patch factors the code in vn_truncate() that does the actual VOP_SETATTR() of size into a separate function called vn_truncate_locked(). This will allow the NFS server and the patch that adds a copy_file_range(2) syscall to call this function instead of duplicating the code and carrying over changes, such as the recent r347151. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D20808 Notes: svn path=/head/; revision=349582
* netmap: fix two panics with emulated adapterVincenzo Maffione2019-07-011-0/+3
| | | | | | | | | | | | | | | This patch fixes 2 panics. The first one is due to the current VNET not being set in the emulated adapter transmission path. The second one is caused by the M_PKTHDR flag not being set when preallocated mbufs are recycled in the transmit path. Submitted by: aleksandr.fedorov@itglobal.com Reviewed by: vmaffione MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20824 Notes: svn path=/head/; revision=349581
* add superio driverAndriy Gapon2019-07-018-0/+1055
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this driver is consolidate information about SuperIO chips and to provide for peaceful coexistence of drivers that need to access SuperIO configuration registers. While SuperIO chips can host various functions most of them are discoverable and accessible without any knowledge of the SuperIO. Examples are: keyboard and mouse controllers, UARTs, floppy disk controllers. SuperIO-s also provide non-standard functions such as GPIO, watchdog timers and hardware monitoring. Such functions do require drivers with a knowledge of a specific SuperIO. At this time the driver supports a number of ITE and Nuvoton (fka Winbond) SuperIO chips. There is a single driver for all devices. So, I have not done the usual split between the hardware driver and the bus functionality. Although, superio does act as a bus for devices that represent known non-standard functions of a SuperIO chip. The bus provides enumeration of child devices based on the hardcoded knowledge of such functions. The knowledge as extracted from datasheets and other drivers. As there is a single driver, I have not defined a kobj interface for it. So, its interface is currently made of simple functions. I think that we can the flexibility (and complications) when we actually need it. I am planning to convert nctgpio and wbwd to superio bus very soon. Also, I am working on itwd driver (watchdog in ITE SuperIO-s). Additionally, there is ithwm driver based on the reverted sensors import, but I am not sure how to integrate it given that we still lack any sensors interface. Discussed with: imp, jhb MFC after: 7 weeks Differential Revision: https://reviews.freebsd.org/D8175 Notes: svn path=/head/; revision=349580
* nctgpio: change default pin names to those used by the datasheet(s)Andriy Gapon2019-07-011-1/+1
| | | | | | | | | | | | | | That is, instead of the current GPIO00 - GPIO15 the names will be GPIO00 - GPIO07, GPIO10 - GPIO17. The first digit is a GPIO "bank" / group number and the second one is a pin number within the bank. Alternative view is that the pin names are changed from decimal numbering scheme to octal one (as there are 8 pins per bank). Discussed with: cem, gonzo MFC after: 2 weeks Notes: svn path=/head/; revision=349579
* Add support for the Marvell 88E6190 11 ports switch.Luiz Otavio O Souza2019-07-012-49/+187
| | | | | | | | | | | With more ports, some of the registers are shifted a bit to accommodate. This switch also adds two high speed Serdes/SGMII interfaces (2.5 Gb/s). Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=349578
* Allow bootstrapping elftoolchain on MacOS and LinuxAlex Richardson2019-07-013-4/+16
| | | | | | | | | | | This is required in order to build on non-FreeBSD systems without setting all the XAR/XSTRINGS/etc. variables Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D16771 Notes: svn path=/head/; revision=349577
* Fix generation of krb5-config with LC_CTYPE=*.UTF-8Alex Richardson2019-07-011-1/+5
| | | | | | | | | | | When building on MacOS with a UTF-8 locale sed will fail when reading krb-config.in due to invalid characters. Forcing the "C" locale fixes this. Reviewed By: emaste, cy Differential Revision: https://reviews.freebsd.org/D16849 Notes: svn path=/head/; revision=349576
* upgrade the warning printf-s in bus accessors to KASSERT-s, take 2Andriy Gapon2019-07-011-12/+7
| | | | | | | | | | | After this change sys/bus.h includes sys/systm.h when _KERNEL is defined. This brings back r349459 but with systm.h hidden from userland. MFC after: 2 weeks Notes: svn path=/head/; revision=349571
* The RFC 3128 test should be made after the offset mask has been applied.Cy Schubert2019-06-301-4/+4
| | | | | | | | Reported by: christos@NetBSD.org X-MFC with: r349399 Notes: svn path=/head/; revision=349568
* Revert r349400. It has uintended effects.Cy Schubert2019-06-301-16/+18
| | | | | | | | Reported by: christos@NetBSD.org X-MFC with: r349400. Notes: svn path=/head/; revision=349567
* efihttp: mark unused arguments with __unusedToomas Soome2019-06-301-5/+7
| | | | | | | we do have __unused, lets use it. Notes: svn path=/head/; revision=349566
* efihttp: comparison of integers of different signsToomas Soome2019-06-301-1/+1
| | | | | | | message.HeaderCount is UINTN (unsigned int), so should be i. Notes: svn path=/head/; revision=349565
* Clean efihttp pointer-sign warningsToomas Soome2019-06-301-14/+14
| | | | | | | | The Http protocol structure is using unsigned char strings, Use type casts where needed. Notes: svn path=/head/; revision=349564
* readelf: Add RISC-V DWARF register aliasesMitchell Horne2019-06-301-0/+68
| | | | | | | | | | | | | | | | This allows DWARF debugging output to use the common register mneumonics, such as ra, sp, or t0. DWARF registers 0-31 are mapped to the 32 general purpose registers, which are then followed by the 32 floating point registers. Reviewed by: markj Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20779 Notes: svn path=/head/; revision=349563
* elftoolchain: fix an incorrect e_flags descriptionMitchell Horne2019-06-301-1/+1
| | | | | | | | | | | | | r349482 introduced the definitions and descriptions of the RISC-V specific e_flags values to elftoolchain. However, the description for the EF_RISCV_RVE flag was incorrectly duplicated from EF_RISCV_RVC. Fix this by providing the proper description for this flag. Reported by: jhb Approved by: markj (mentor) Notes: svn path=/head/; revision=349562
* Fix CROSS_TOOLCHAIN=amd64-gcc build after r349554Alex Richardson2019-06-301-1/+1
| | | | | | | | | Apparently clang can remove the reference to __umoddi3 but GCC keeps it. Reported by: lwhsu Notes: svn path=/head/; revision=349561
* Changes to the expose_password functionality:Dag-Erling Smørgrav2019-06-302-7/+24
| | | | | | | | | | | | | - Implement use_first_pass, allowing expose_password to be used by other service functions than pam_auth() without prompting a second time. - Don't prompt for a password during pam_setcred(). PR: 238041 MFC after: 3 weeks Notes: svn path=/head/; revision=349556
* Fix my name in license headerAlex Richardson2019-06-305-5/+5
| | | | | | | Reported by: trasz Notes: svn path=/head/; revision=349555
* Reduce size of rtld by 22% by pulling in less code from libcAlex Richardson2019-06-3013-23/+460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently RTLD is linked against libc_nossp_pic which means that any libc symbol used in rtld can pull in a lot of depedencies. This was causing symbol such as __libc_interposing and all the pthread stubs to be included in RTLD even though they are not required. It turns out most of these dependencies can easily be avoided by providing overrides inside of rtld. This change is motivated by CHERI, where we have an experimental ABI that requires additional relocation processing to allow the use of function pointers inside of rtld. Instead of adding this self-relocation code to RTLD I attempted to remove most function pointers from RTLD and discovered that most of them came from the libc dependencies instead of being actually used inside rtld. A nice side-effect of this change is that rtld is now 22% smaller on amd64. text data bss dec hex filename 0x21eb6 0xce0 0xe60 145910 239f6 /home/alr48/ld-elf-x86.before.so.1 0x1a6ed 0x728 0xdd8 113645 1bbed /home/alr48/ld-elf-x86.after.so.1 The number of R_X86_64_RELATIVE relocations that need to be processed on startup has also gone down from 368 to 187 (almost 50% less). Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D20663 Notes: svn path=/head/; revision=349554
* Display the approximate space needed when a minidump fails due to lackNavdeep Parhar2019-06-306-18/+24
| | | | | | | | | | | | of space. Reviewed by: kib@ MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D20801 Notes: svn path=/head/; revision=349552
* Add support for Python 3 and make it the default.Marcel Moolenaar2019-06-303-23/+75
| | | | | | | Python 2.7 will retire on Januari 1, 2020. Notes: svn path=/head/; revision=349551
* Remove a call to vm_map_simplify_entry from _vm_map_clip_start.Doug Moore2019-06-301-1/+0
| | | | | | | | | | | | Recent changes to vm_map_protect have made it unnecessary. Reviewed by: alc Approved by: kib (mentor) Tested by: pho Differential Revision: https://reviews.freebsd.org/D20633 Notes: svn path=/head/; revision=349550
* MFV r349535: less v551.Xin LI2019-06-2959-555/+1455
|\ | | | | | | | | | | | | | | MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=349549
| * Vendor import of less v551.vendor/less/v551Xin LI2019-06-2969-717/+1746
| | | | | | | | | | Notes: svn path=/vendor/less/dist/; revision=349535 svn path=/vendor/less/v551/; revision=349536; tag=vendor/less/v551
* | Build lib32 libl. The library is built from usr.bin/lex/lib. It would beTijl Coosemans2019-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp MFC after: 3 days Notes: svn path=/head/; revision=349548
* | Use a consistent snapshot of the fd's rights in fget_mmap().Mark Johnston2019-06-291-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fget_mmap() translates rights on the descriptor to a VM protection mask. It was doing so without holding any locks on the descriptor table, so a writer could simultaneously be modifying those rights. Such a situation would be detected using a sequence counter, but not before an inconsistency could trigger assertion failures in the capability code. Fix the problem by copying the fd's rights to a structure on the stack, and perform the translation only once we know that that snapshot is consistent. Reported by: syzbot+ae359438769fda1840f8@syzkaller.appspotmail.com Reviewed by: brooks, mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20800 Notes: svn path=/head/; revision=349547
* | Fix mutual exclusion in pipe_direct_write().Mark Johnston2019-06-291-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use PIPE_DIRECTW as a semaphore for direct writes to a pipe, where the reader copies data directly from pages mapped into the writer. However, when a reader finishes such a copy, it previously cleared PIPE_DIRECTW, allowing multiple writers to race and corrupt the state used to track wired pages belonging to the writer. Fix this by having the writer clear PIPE_DIRECTW and instead use the count of unread bytes to determine whether a write is finished. Reported by: syzbot+21811cc0a89b2a87a9e7@syzkaller.appspotmail.com Reviewed by: kib, mjg Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20784 Notes: svn path=/head/; revision=349546
* | Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OKLi-Wen Hsu2019-06-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | Submitted by: Ka Ho Ng <khng300 at gmail.com> Reviewed by: mckusick MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20695 Notes: svn path=/head/; revision=349543
* | Skip sys.netpfil.pf.names.names and sys.netpfil.pf.synproxy.synproxyLi-Wen Hsu2019-06-292-0/+2
| | | | | | | | | | | | | | | | | | | | temporarily because kernel panics when flushing epair queue. PR: 238870 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=349539
* | Install missing test data fileLi-Wen Hsu2019-06-291-0/+1
| | | | | | | | | | | | | | | | MFC with: r349527 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=349538
* | Add support for IFCAP_NOMAP to mlx5(4).John Baldwin2019-06-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Since mlx5 uses bus_dma, this only required adding the capability flag. Submitted by: gallatin Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349534
* | Add support for IFCAP_NOMAP to cxgbe(4).John Baldwin2019-06-293-13/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since cxgbe(4) uses sglist instead of bus_dma, this required updates to the code that generates scatter/gather lists for packets. Also, unmapped mbufs are always sent via DMA and never as immediate data in the payload of a work request. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Discussed with: np Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349533
* | Support IFCAP_NOMAP in vlan(4).John Baldwin2019-06-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Enable IFCAP_NOMAP for a vlan interface if it is supported by the underlying trunk device. Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349532
* | Compress pending socket buffer data once it is marked ready.John Baldwin2019-06-291-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply similar logic from sbcompress to pending data in the socket buffer once it is marked ready via sbready. Normally sbcompress merges small mbufs to reduce the length of mbuf chains in the socket buffer. However, sbcompress cannot do this for mbufs marked M_NOTREADY. sbcompress_ready is now called from sbready when mbufs are marked ready to merge small mbuf chains once the data is available to copy. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349531
* | Add support for using unmapped mbufs with sendfile(2).John Baldwin2019-06-293-6/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be enabled at runtime via the kern.ipc.mb_use_ext_pgs sysctl. It is disabled by default. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349530
* | Add an external mbuf buffer type that holds multiple unmapped pages.John Baldwin2019-06-2922-52/+1175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unmapped mbufs allow sendfile to carry multiple pages of data in a single mbuf, without mapping those pages. It is a requirement for Netflix's in-kernel TLS, and provides a 5-10% CPU savings on heavy web serving workloads when used by sendfile, due to effectively compressing socket buffers by an order of magnitude, and hence reducing cache misses. For this new external mbuf buffer type (EXT_PGS), the ext_buf pointer now points to a struct mbuf_ext_pgs structure instead of a data buffer. This structure contains an array of physical addresses (this reduces cache misses compared to an earlier version that stored an array of vm_page_t pointers). It also stores additional fields needed for in-kernel TLS such as the TLS header and trailer data that are currently unused. To more easily detect these mbufs, the M_NOMAP flag is set in m_flags in addition to M_EXT. Various functions like m_copydata() have been updated to safely access packet contents (using uiomove_fromphys()), to make things like BPF safe. NIC drivers advertise support for unmapped mbufs on transmit via a new IFCAP_NOMAP capability. This capability can be toggled via the new 'nomap' and '-nomap' ifconfig(8) commands. For NIC drivers that only transmit packet contents via DMA and use bus_dma, adding the capability to if_capabilities and if_capenable should be all that is required. If a NIC does not support unmapped mbufs, they are converted to a chain of mapped mbufs (using sf_bufs to provide the mapping) in ip_output or ip6_output. If an unmapped mbuf requires software checksums, it is also converted to a chain of mapped mbufs before computing the checksum. Submitted by: gallatin (earlier version) Reviewed by: gallatin, hselasky, rrs Discussed with: ae, kp (firewalls) Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 Notes: svn path=/head/; revision=349529
* | MFV r349454:Martin Matuska2019-06-285-3/+30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor. Relevant vendor changes: PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary (OSS-Fuzz 15431) PR #1218: Fixes to sparse file handling MFC after: 1 week Notes: svn path=/head/; revision=349527
| * | Update vendor/libarchive/dist to git d6d3799d6b309593f271c4c319dfba92efc95772Martin Matuska2019-06-2710-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relevant vendor changes: PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary (OSS-Fuzz 15431) PR #1218: Fixes to sparse file handling Notes: svn path=/vendor/libarchive/dist/; revision=349454
* | | When we protect PTEs (as opposed to PDEs), we only call vm_page_dirty()Alan Cox2019-06-282-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when, in fact, we are write protecting the page and the PTE has PG_M set. However, pmap_protect_pde() was always calling vm_page_dirty() when the PDE has PG_M set. So, adding PG_NX to a writeable PDE could result in unnecessary (but harmless) calls to vm_page_dirty(). Simplify the loop calling vm_page_dirty() in pmap_protect_pde(). Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20793 Notes: svn path=/head/; revision=349526
* | | Need to apply the PCIM_BAR_MEM_BASE mask to the physical memoryHans Petter Selasky2019-06-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | address before returning it to the user. Some of the least significant bits have special meaning and should be masked away. Discussed with: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=349522
* | | Add the 802.1q support for the Marvell e6000 series of ethernet switches.Luiz Otavio O Souza2019-06-282-323/+608
| | | | | | | | | | | | | | | | | | | | | | | | Tested on: espressobin, Clearfog, SG-3100 and others Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=349521
* | | Add the 'drop tagged' flag support for ethernet switch ports.Luiz Otavio O Souza2019-06-283-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to drop all 802.1q tagged packets on a port. Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=349520