aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use makefs(8) in release VM-image generation instead of md(4) and newfs.Nathan Whitehorn2021-02-252-102/+77
| | | | | | | | | | | | | | Using makefs instead reduces the privileges needed to build VM images, simplifies the script (no need to copy files to a fresh image at the end), and improves portability by allowing generation of cross-endian images. As a result of the last, this patch also adds support for generation of powerpc64 and powerpc64le VM images. No other changes to the output. Tested and working for both amd64 and powerpc64 targets. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D28912
* Fix powerpc build after 6dd69f0064f1Marcin Wojtas2021-02-251-2/+2
| | | | | | | | | | Commit 6dd69f0064f1 ("iflib: introduce isc_dma_width") failed to build on powerpc due to implicit type conversion error. Fix that. Submitted by: Artur Rojek <ar@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc.
* ofed: quiet gcc -Wint-in-bool-contextRyan Libby2021-02-241-2/+4
| | | | | | | | | | | | The int in the argument to the ternary triggered -Wint-in-bool-context from gcc. Upstream linux has a larger and more entangled patch, 12f727721eee61b3d19dedb95cb893b2baa9fe41, which doesn't apply cleanly. When we eventually sync that, we can just drop this change. Reviewed by: hselasky, imp, kib MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28762
* ddb: just move cursor when the lexer backs upRyan Libby2021-02-241-11/+16
| | | | | | | | | | | | | | | Get rid of db_look_char because it's not compatible with db_get_line(). This fixes the following issue: db> script lockinfo=show alllocks db> run lockinfo db:0:lockinfo> how alllocks No such command; use "help" to list available commands Reported by: markj Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28725
* ddb: reliably fail with ambiguous commandsRyan Libby2021-02-241-1/+1
| | | | | | | | | | | | db_cmd_match had an even/odd bug, where if a third command was partially matched (or any odd number greater than one) the search result would be set back from CMD_AMBIGUOUS to CMD_FOUND, causing the last command in the list to be executed instead of failing the match. Reported by: mlaier Reviewed by: markj, mlaier, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28659
* vm pqbatch: move unmanaged page assert under pagequeue lockMax Laier2021-02-241-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This KASSERT is overzealous because of the following race condition: 1) A managed page which is currently in PQ_LAUNDRY is freed. vm_page_free_prep calls vm_page_dequeue_deferred() The page state is: PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED 2) The laundry worker comes around and pick up the page and calls vm_pageout_defer(m, PQ_LAUNDRY, true) to check if page is still in the queue. We do a vm_page_astate_load and get PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED as per above. 3) The laundry worker is pre-empted and another thread allocates our page from the free pool. For example vm_page_alloc_domain_after calls vm_page_dequeue() and sets VPO_UNMANAGED because we are allocating for an OBJT_UNMANAGED object. The page state is: PQ_NONE, 0 - VPO_UNMANAGED 4) The laundry worker resumes, and processes vm_pageout_defer based on the stale astate which leads to a call to vm_page_pqbatch_submit, which will trip on the KASSERT. Submitted by: mlaier Reviewed by: markj, rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28563
* Enable PIE by default on 64-bit architecturesMarcin Wojtas2021-02-241-1/+15
| | | | | | | | | | | | | | | | | | | This patch adds Position Independent Executables (PIE) flags for building OS. It allows to enable the ASLR feature based only on the sysctl knobs, without need to rebuild the image. Tests showed that no problems with stability / performance degradation were seen when using PIEs with ASLR disabled. The change is limited only for 64-bit architectures. Use bsd.opts.mk instead of the src.opts.mk in order to satisfy all build dependencies related to MK_PIE. Reviewed by: emaste, imp Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28328
* Disable PIE for powerpc bootloaders.Marcin Wojtas2021-02-244-0/+8
| | | | | | | | | | | | | Bootloaders for powerpc are not built as position independent code. Since bsd.prog.mk is used for building, when PIE is enabled, the PIE flags are added and that causes the build to fail. Adding MK_PIE=no stops bsd.prog.mk from adding PIE specific flags. Submitted by: Dawid Gorecki <dgr@semihalf.com> Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28893
* Disable PIE for MIPS ubldrMarcin Wojtas2021-02-241-0/+4
| | | | | | | | | | | | | | When performing buildworld for MIPS with PIE enabled, the build fails with "position-independent code requires '-mabicalls'" message. -mno-abicalls and -fno-pic flags are explicitly set in MIPS ubldr makefile, so to work around this problem, set MK_PIE=no for MIPS ubldr. Submitted by: Dawid Gorecki <dgr@semihalf.com> Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28370
* iflib: introduce isc_dma_widthMarcin Wojtas2021-02-242-4/+21
| | | | | | | | | | | | | | | | | Some DMA controllers are unable to address the full host memory space and are instead limited to a subset of address range (e.g. 48-bit). Allow the driver to specify the maximum allowed DMA addressing width (in bits) for the NIC hardware, by introducing a new field in if_softc_ctx. If said field is omitted (set to 0), the lowaddr of DMA window bounds defaults to BUS_SPACE_MAXADDR. Submitted by: Artur Rojek <ar@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28706
* Fix crash with rtadv-originated multipath IPv6 routes.Alexander V. Chernikov2021-02-241-3/+2
| | | | | | PR: 253800 Reported by: Frederic Denis <freebsdml at hecian.net> MFC after: immediately
* atomic: add atomic_interrupt_fence()Konstantin Belousov2021-02-242-1/+14
| | | | | | | | | | | with the semantic following C11 signal_fence, that is, it establishes ordering between its place and any interrupt handler executing on the same CPU. Reviewed by: markj, mjg, rlibby Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28909
* pwm_backlight: Add MODULE_DEPEND on backlightBrett Mastbergen2021-02-241-0/+1
| | | | | | | | | | | | Make the pwm_backlight module depend on backlight, so it has access to the backlight interface symbols. Otherwise you'll get an error like: link_elf: symbol backlight_get_info_desc undefined Signed-off-by: Brett Mastbergen <brett.mastbergen@gmail.com> MFC after: 3 days PR: 253765
* Add GPT PREP-boot type to mkimg(1) from geom_gpt.Nathan Whitehorn2021-02-241-0/+2
| | | | | | This partition type can be used to boot some PowerKVM VMs. We don't support it well because of some limitations in SLOF, but it's worth at least have feature parity in geom and mkimg.
* iflib: Avoid double counting in rxeofMark Johnston2021-02-241-2/+0
| | | | | | | | | | | | | iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after. PR: 253583 Reviewed by: gallatin, erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900
* Mount the ESP on /boot/efi in VM images.Nathan Whitehorn2021-02-241-1/+10
| | | | | This follows an earlier change (0b7472b3d8d2) for mounting the ESP from systems set up through the installer and should be MFC'ed with it.
* Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committingKonstantin Belousov2021-02-241-0/+20
| | | | | | | | | | | | softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be done before taking ffs_lock_ea(), because it calls ffs_syncvnode(), potentially dropping the vnode lock. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ffs_close_ea: do not relock vnode under lock_eaKonstantin Belousov2021-02-241-10/+27
| | | | | | | | | | | | | | | | ffs_lock_ea is after the vnode lock, so vnode must not be relocked under lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is dropped, and only truncate to length zero, since this is the only mode supported by ffs_truncate() for EAs. Previously code did truncation and then write. Zero the part of the ext area that is unused, if truncation is due but not done because ea area is not zero-length. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ffs_vnops.c: styleKonstantin Belousov2021-02-241-23/+25
| | | | | | | | | Use local var to shorten ap->a_vp expression. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ffs: do not call softdep_prealloc() from UFS_BALLOC()Konstantin Belousov2021-02-242-5/+5
| | | | | | | | | | | | Do it in ffs_write(), where we can gracefuly handle relock and its consequences. In particular, recheck the v_data to see if the vnode reclamation ended, and return EBADF when we cannot proceed with the write. Reviewed by: mckusick Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ()Konstantin Belousov2021-02-241-1/+1
| | | | | | | | | | | | | instead of DOINGSOFTDEP(). The softdep_prealloc() function does nothing in SU case. Note that the call should be safe with regard to the vnode relock, because it is called with MNT_NOWAIT, which does not descend into fsync. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
* rc: fix parse of $local_startupCy Schubert2021-02-241-0/+1
| | | | | | | | | | | | | | | | | | | 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 introduced parallel execution of rc. It separated groups with line feeds (\n) and elements within groups using spaces. This is a natural separation due to rcorder using spaces and lines to separate elements within groups with groups of services separated by line feeds. 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 parses the output from rcorder by setting $IFS. However it failed to reset $IFS to default ' \t\n' prior to calling find_local_scripts_new(), causing find_local_scripts_new() to fail parsing $local_startup for site-specific local rc scripts, i.e. ${LOCALBASE}/etc/rc.d. This caused daemons from ports and packages such as postfix, dovecot, nut, and others in ${LOCALBASE} not to be started. PR: 249192 MFC after: 3 week X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294
* Update manpage for AMD 10GbE driverRajesh Kumar M A2021-02-241-49/+20
| | | | | | | | Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28724 MFC after: 1 week
* Delete memstick images for PowerPC.Nathan Whitehorn2021-02-241-50/+0
| | | | | | | | | | | | | These images only ever worked on Apple Powermacs, which are now a very old platform, and did so only for a very loose definition of "worked" (they booted on a small subset of supported machines). Moreover, all the machines they *did* boot on also would boot from a memstick made by dd'ing an CD image to a flash drive. Since a flash drive prepared in this way would also boot all the newer systems we support, the memstick images were strictly less functional than the CD images, even for booting from memory sticks. Reviewed by: jhibbits MFC after: 1 week
* rmlock: Add a required compiler membar to the rlock slow pathMark Johnston2021-02-241-1/+5
| | | | | | | | | | | | | | | The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28821
* pam_login_access: Fix negative entry matching logicMark Johnston2021-02-241-3/+3
| | | | | | | PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access
* Revert "ipmi_smbios: Deduplicate smbios entry point discovery logic"Allan Jude2021-02-236-42/+30
| | | | | | This depends on another commit that has not landed yet, and broke the build This reverts commit ba6e37e47f41484fc61cc034619267b82ddd056c.
* Revert "ipmi_smbios: remove unused smbios_cksum function"Allan Jude2021-02-231-0/+17
| | | | This reverts commit d2589dc3d56ce063b28b54df11c950c3758d9578.
* Fix nd6 rib_action() handling.Alexander V. Chernikov2021-02-231-5/+5
| | | | | | | | | rib_action() guarantees valid rc filling IFF it returns without error. Check rib_action() return code instead of checking rc fields. PR: 253800 Reported by: Frederic Denis <freebsdml@hecian.net> MFC after: immediately
* ig4: Add PCI IDs for Intel Gemini Lake I2C controller.Vladimir Kondratyev2021-02-233-1/+24
| | | | | Submitted by: Dmitry Luhtionov MFC after: 2 weeks
* rc.conf(5): Add note about parallel startup variableDaniel Ebdrup Jensen2021-02-231-1/+10
| | | | | | | | | | | The commit below added parallel service startup, and it needs to be documented, so people know about it. PR: 249192 MFC with: 77e1ccbee3ed Reviewed by: yuripv Differential Revision: https://reviews.freebsd.org/D28898
* ipmi_smbios: remove unused smbios_cksum functionAllan Jude2021-02-231-17/+0
| | | | | | Sponsored By: Ampere Computing LLC Submitted By: Klara Inc. Differential Revision: https://reviews.freebsd.org/D28751
* Mount the EFI system partition (ESP) on newly-installed systems.Nathan Whitehorn2021-02-235-138/+48
| | | | | | | | | | | | | | | | | | Per hier(7), the ESP will be mounted at /boot/efi. On UFS systems, any existing ESP will be reused and mounted there; otherwise, a new one will be made. On ZFS systems, space for an ESP is allocated on all disks in the root pool, but only the partition actually used to boot is set up and mounted. This makes future upgrades of the EFI loader easier (upgrade scripts can just change /boot/efi) and also greatly simplifies the parts of the installer involved in initialization of the ESP. It also makes the installer's behavior correspond to the documentation in hier(7). Reviewed by: imp, tsoome MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28897
* ipmi_smbios: Deduplicate smbios entry point discovery logicAllan Jude2021-02-236-30/+42
| | | | | | | Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28743
* smbios: Move smbios driver out from x86 machdep codeAllan Jude2021-02-2312-72/+92
| | | | | | | | | Add it to the x86 GENERIC and MINIMAL kernels Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D28738
* Build lib/msun tests with compiler builtins disabledDimitry Andric2021-02-231-0/+4
| | | | | | | | | | This forces the compiler to emit calls to libm functions, instead of possibly substituting pre-calculated results at compile time, which should help to actually test those functions. Reviewed by: emaste, arichardson, ngie Differential Revision: https://reviews.freebsd.org/D28577 MFC after: 3 days
* iicsmb: Request the bus recursively in bread()Allan Jude2021-02-231-1/+1
| | | | | | | | | | | | | ipmi_ssif will `smbus_request_bus()` to do multiple smbus requests (which requests the iicbus), and then here in `bread()` we also need to request the bus because `bread()` takes multiple transactions. This causes deadlock as it's waiting for the bus it already has without `IIC_RECURSIVE`. Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28742
* camcontrol: change hueristic for I/O-less devtypeWarner Losh2021-02-231-2/+7
| | | | | | Some SATA drives have 'config' set to 0 in the identify block. Rather than rely on it, use the strings windows uses to display the drive since they are supposed to be space padded and will always be non-zero.
* release(7) Fix mistake noted in reviewDaniel Ebdrup Jensen2021-02-231-1/+1
| | | | | | I missed this when doing the final pass. Fixes: f695e960 release(7): Remove stray references to DOC* variables
* Remove __NO_TLS.Konstantin Belousov2021-02-2310-53/+4
| | | | | | | | | All supported platforms support thread-local vars and __thread. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28796
* release(7): Remove stray references to DOC* variablesDaniel Ebdrup Jensen2021-02-231-54/+18
| | | | | | | | | | | | | | | | | | | | We now live in the world of git, and release(7) should reflect that. As of the commit referenced below, release images also no longer include (stale) documentation, as the documentation has moved to AsciiDoctor. This means that a few environment variables no longer make sense, so remove them from their sections and mention them in the compatibility section instead. While here, also pet mandoc. PR: 253615 MFC after: 3 days MFC with: f61e92ca5a23 release: permanently remove the 'reldoc' target and associates Reviewed by: gjb, lwhsu, yuripv Differential Revision: https://reviews.freebsd.org/D28881
* close_range: add audit supportAlex Richardson2021-02-235-2/+25
| | | | | | | | | | | | | This fixes the closefrom test in sys/audit. Includes cherry-picks of the following commits from openbsm: https://github.com/openbsm/openbsm/commit/4dfc628aafe589d68848f7033f3d3488c4d979e0 https://github.com/openbsm/openbsm/commit/99ff6fe32aebc5a4b8d40d60062b8574697df557 https://github.com/openbsm/openbsm/commit/da48a0399e95448693d3fa2be48454ca564c1be8 Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28388
* tests/sys/netgraph: Tell kyua that perl is requiredAlex Richardson2021-02-231-1/+2
| | | | | | | Otherwise these tests fail with incomprehensible error messages. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28894
* find(1): Mark -not as an extensions to POSIXDaniel Ebdrup Jensen2021-02-231-3/+3
| | | | | | | While here, change mdoc macro from Ic to Fl. PR: 253499 Reported by: Michael Siegel <bugcounterism at malbolge.net>
* Bump CTL block backend threads from 14 to 32 per LUN.Alexander Motin2021-02-231-1/+1
| | | | | | | | This makes random read benchmarks look better on a wide ZFS pools. I am not sure where the original value goes from, but it is there for too long now. MFC after: 1 week
* stand/multiboot2: fix header length checkRoger Pau Monné2021-02-231-1/+1
| | | | | | | | | | | | | Check whether we have reached the end of the buffer using search_size instead of MULTIBOOT_SEARCH, which is the maximum defined by the specification, but the file can be shorter than that. This prevents printing a harmless error message when loading a file that is smaller than MULTIBOOT_SEARCH. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode')
* stand/multiboot2: fix error message formatRoger Pau Monné2021-02-231-2/+2
| | | | | | | | Add a missing space in one error message. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode')
* bridge tests: Test STP on top of VLAN devicesKristof Provost2021-02-231-0/+66
| | | | | | | | | This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861
* arp/nd: Cope with late calls to iflladdr_eventKristof Provost2021-02-232-0/+6
| | | | | | | | | | | | | | | | When tearing down vnet jails we can move an if_bridge out (as part of the normal vnet_if_return()). This can, when it's clearing out its list of member interfaces, change its link layer address. That sends an iflladdr_event, but at that point we've already freed the AF_INET/AF_INET6 if_afdata pointers. In other words: when the iflladdr_event callbacks fire we can't assume that ifp->if_afdata[AF_INET] will be set. Reviewed by: donner@, melifaro@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28860
* bridge: Remove members when assigned to a new vnetKristof Provost2021-02-233-3/+29
| | | | | | | | | | | | When the bridge is moved to a different vnet we must remove all of its member interfaces (and span interfaces), because we don't know if those will be moved along with it. We don't want to hold references to interfaces not in our vnet. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28859