aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* acct: Zero pad bytes in accounting recordsMark Johnston2021-07-301-0/+2
| | | | | | | Reported by: KMSAN Sponsored by: The FreeBSD Foundation (cherry picked from commit 90959dd1e50ee820e84bed4bc63fbed140298441)
* vfs: Initialize "lastfail" in vfs_mountroot_wait()Mark Johnston2021-07-301-0/+1
| | | | | | | | | | This variable is only used to rate-limit "Root mount waiting for: ..." messages using ppsratecheck(). Reported by: KMSAN Sponsored by: The FreeBSD Foundation (cherry picked from commit 048cd371f3d793fa354f1d3a1d484bc2725a3fc1)
* Add required sysctl name length checks to various handlersMark Johnston2021-07-303-2/+39
| | | | | | | Reported by: KMSAN Sponsored by: The FreeBSD Foundation (cherry picked from commit 0dcef81de9915e8ce1e3985204bebe7026d96b6f)
* ixgbe: Clean up ix_txrxKevin Bowling2021-07-301-47/+40
| | | | | | | | | | | The intention here is to reduce differences with D30072. The only functional change is logical simplification in ixgbe_rx_checksum. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D30074 (cherry picked from commit 51e46835e10a2628482deefc0efd356fb733337a)
* ixgbe: Print FW NVM and Option ROM versionsKevin Bowling2021-07-302-1/+101
| | | | | | | | | | | | It can be useful for system operators to see this kind of information when correlating issues or requesting support from the OEM or Intel for hardware and firmware issues. Reviewed by: gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30178 (cherry picked from commit 7660e4ea5cb750ded38a0bd81cde2e2b130222df)
* libpmc: Import AMD Zen 3 PMU eventsGreg V2021-07-299-0/+1575
| | | | | | | | Reviewed by: mav, mhorne MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30965 (cherry picked from commit 8c2dd68caa963f1900a8228b0732b04f5d530ffa)
* hwpmc_arm64: add a PMCDBG to the interrupt handlerMitchell Horne2021-07-291-0/+3
| | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 13f5a3076bc8f3774b82f2d5ca29e2e0e2af997b)
* arm64 support for pmu-eventsMitchell Horne2021-07-293-4/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8cc3815f: hwpmc_arm64: accept raw event codes for PMC_OP_PMCALLOCATE Make it possible to specify event codes without an offset of PMC_EV_ARMV8_FIRST, by setting a machine-dependent flag. This is required to make use of event definitions from pmu-events. Reviewed by: ray (slightly earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30602 28dd6730: libpmc: enable pmu_utils on arm64 This allows supported libpmc to query/select from the pmu-events table, which may have a more complete set of events than what we define manually. A future update to these definitions should greatly improve this support. The alias table is empty for now, until this future import is complete. Add the Foundation's copyright for recent work on this file. Reviewed by: ray (slightly earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30603 27ea55fc: libpmc/hwpmc: fix issues with arm64 pmu-events support Due to a mis-merge, the changes committed to libpmc never called pmu_parse_event(), or set pm->pm_ev. However, this field shouldn't be used to carry the actual pmc event code anyway, as it is expected to contain the index into the pmu event array (otherwise, it breaks event name lookup in pmclog_get_event()). Add a new MD field, pm_md.pm_md_config, to pass the raw event code to arm64_allocate_pmc(). Additionally, the change made to pmc_md_op_pmcallocate was incorrect, as this is a union, not a struct. Restore the proper padding size. Reviewed by: luporl, ray, andrew Fixes: 28dd6730a5d6 ("libpmc: enable pmu_utils on arm64") Fixes: 8cc3815f02be ("hwpmc_arm64: accept raw event codes...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31221 (cherry picked from commit 8cc3815f02be9fa2a96e47713ad989e6d787e12a) (cherry picked from commit 28dd6730a5d6bc73aca4c015c0ff875a9def25ac) (cherry picked from commit 27ea55fc655b0081f760a34ff5dd5526ba02a0fb)
* hwpmc_arm64: fill kern.hwpmc.cpuidMitchell Horne2021-07-291-0/+13
| | | | | | | | | | | | This will be used to detect supported pmu events. The expected format is the MIDR register with the revision and variant fields masked. See also: lib/libpmc/pmu-events/arch/arm64/mapfile.csv. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30601 (cherry picked from commit 5867cccdc49df3e7eb3147d6516b488dd8384afe)
* hwpmc_arm64.c: fix return styleMitchell Horne2021-07-291-7/+7
| | | | | | | | | In accordance to style(9). MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 2129c8f6771a9a33253a1fe2d4e9d3494bc77f10)
* libpmc: make libpmc_pmu_utils.c more amenable to portingMitchell Horne2021-07-291-53/+12
| | | | | | | | | | | | | | The current version has every function stubbed out for !x86. Only two functions (pmu_alias_get() and pmc_pmu_pmcallocate() are really platform dependent, so reduce the width of the ifdefs and remove some of the stubs. Reviewed by: ray MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30532 (cherry picked from commit 0024f1aa7720d5f4f587a6c5911fc5238195ae49)
* libpmc: limit pmu-events to 64-bit powerpcMitchell Horne2021-07-291-1/+1
| | | | | | | | | | Although currently unused, there are only pmu event definitions for POWER8 and POWER9. There is no sense in building these on 32-bit platforms. Sponsored by: The FreeBSD Foundation (cherry picked from commit 507d68984a010dab0c3ecc5477c36526c3a7fa48)
* libpmc: use $MACHINE_CPUARCHMitchell Horne2021-07-291-1/+1
| | | | | | | | | This is preferred over $MACHINE_ARCH for these types of checks, although it makes no difference for amd64 or i386. No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3864da302af34853ddb2c33a42de5668a0d68cdd)
* pmccontrol: improve -L with pmu-eventsMitchell Horne2021-07-291-9/+7
| | | | | | | | | | | | Check if the pmu utils are supported rather than carrying a machine-dependent #ifdef. Reviewed by: gnn, ray, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30526 (cherry picked from commit 167cdaa7e30093215a753d4f788d921b1f7c1474)
* libpmc: eliminate pmc_pmu_stat_mode()Mitchell Horne2021-07-293-27/+11
| | | | | | | | | | | | | There is a single consumer, the pmc utility, that clearly has knowledge of which counters it is expecting. Remove this function and have it use common counter aliases instead. Reviewed by: gnn MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30528 (cherry picked from commit ec66cc955b629e614cf493bf168048de033f6a2c)
* libpmc: remove pe->aliasMitchell Horne2021-07-292-5/+0
| | | | | | | | | | | | It has never been a part of upstream's struct pmu_event. The jevents utility will not fill this field, so remove it. Reviewed by: gnn MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30530 (cherry picked from commit 0c915023dbb7000cd30bb768eb84f6dc757adcc5)
* libpmc: always generate libpmc_events.cMitchell Horne2021-07-293-8/+5
| | | | | | | | | | | | The jevents build tool will create an empty table if it doesn't find any events, so we can remove the extra $MACHINE_CPUARCH checks. Reviewed by: gnn, ray, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30531 (cherry picked from commit 689c7e7975cdee38ca6fd60ad3372d55c43c948c)
* libpmc: remove unused 'isfixed' variableMitchell Horne2021-07-291-2/+0
| | | | | | | | | Reviewed by: gnn, emaste MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30529 (cherry picked from commit 0092642f863946ee1edc88fa634887d7c8a54656)
* libpmc: fix "instructions" alias on IntelMitchell Horne2021-07-291-1/+1
| | | | | | | | | | | | | The typo prevents the counter from being allocated. This fixes e.g. pmcstat -s instructions sleep 5 Reviewed by: mizhka, gnn, ray, emaste MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30527 (cherry picked from commit bc1a6a9d692a1f827514144b6bce0654a8be4f4d)
* hwpmc: fix PMC_CPU_LASTMitchell Horne2021-07-291-1/+1
| | | | | | | | | It is unused, but incorrect. MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit f59127dac5ca0be3648ecc0a031a21e472afb133)
* libpmc: fall-back to kernel tables if pmu-events failsMitchell Horne2021-07-291-21/+19
| | | | | | | | | | | | | | | | | | | On x86, the pmu_events table is the source of truth for finding supported events. However, events not found there may still be present in the kernel's static event tables. For example, the pmc.soft(3) events will never be available from pmu-events. Update pmc_allocate() to search the legacy event tables if pmc_pmu_pmcallocate() fails to return a result. This allows both event sources to be consulted before giving up, thus restoring pmc.soft(3) and pmc.tsc(3) on x86. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30216 (cherry picked from commit dfdc57e8aa8ba4b4e4484f736e8c7645ab69b54a)
* libpmc: remove PMC_MDEP_TABLE logicMitchell Horne2021-07-291-50/+4
| | | | | | | | | | | | | | | This logic was added for handling some of the complicated relationships between events and x86 CPU models. Since that logic has been mostly removed from libpmc(3) in favor of pmu-events, this no longer serves much of a purpose. Mapping CPU types to event tables is already handled by the switch statement in pmc_init(). Reviewed by: ray, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30196 (cherry picked from commit da13ef6aa0565c8d79326bba5606671062033bbf)
* libpmc: remove unused PMC_MDEP_INIT_INTEL_V2Mitchell Horne2021-07-291-22/+0
| | | | | | | | | | | | All uses of this macro were removed in e92a1350b50e. Remove cpu_has_iaf_counters as well. Reviewed by: ray, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30195 (cherry picked from commit 4d8d74a4f52efd078bd6298e0adbdd476ed70de9)
* arm64: Fix finding the pmc event IDAndrew Turner2021-07-292-2/+3
| | | | | | | | | | | | | The lower pmc event bits were masked off to find the PMC event ID. The doesn't work when there are more events. Switch it to use the offser relative to the first event while also checking the ID is in the expected range. Reviewed by: gnn, ray Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D29600 (cherry picked from commit 24b2f4ea49229618c5608846acfc10be2eb0d567)
* eli: Zero pad bytes that arise when certain auth algorithms are usedMark Johnston2021-07-291-0/+11
| | | | | | | | | | | | | | | | | | When authentication is configured, GELI ensures that the amount of data per sector is a multiple of 16 bytes. This is done in eli_metadata_softc(). When the digest size is not a multiple of 16 bytes, this leaves some extra pad bytes at the end of every sector, and they were not being zeroed before being written to disk. In particular, this happens with the HMAC/SHA1, HMAC/RIPEMD160 and HMAC/SHA384 data authentication algorithms. This change ensures that they are zeroed before being written to disk. Reported by: KMSAN Reviewed by: delphij, asomers Sponsored by: The FreeBSD Foundation (cherry picked from commit 0fcafe8516d170852aa73f029a6a28bed1e29292)
* Assert that valid PTEs are not overwritten when installing a new PTPMark Johnston2021-07-295-3/+24
| | | | | | | | | | amd64 and 32-bit ARM already had assertions to this effect. Add them to other pmaps. Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit b092c58c006fd5c5c051b30ab097f5c1655e0d53)
* pf: Constify tag name and queue name helper functionsMark Johnston2021-07-291-9/+9
| | | | | | | | | No functional change intended. Reviewed by: kp Sponsored by: The FreeBSD Foundation (cherry picked from commit 81f95106b8c14d7ce935864b4705d54a8e437ed6)
* mmc: Drain the intrhook in mmc_detach()Yang Zhong2021-07-291-0/+1
| | | | | | | | | | | | | | | | Buggy SD card drivers may attach and detach a mmc(4) driver instance in quick succession. In this case mmc(4) must disestablish its intrhook callback during detach. Thus, this change adds a call to config_intrhook_drain(), which blocks or does nothing if the intrhook is running or has already ran (the SD card was plugged in), and disestablishes the hook if it hasn't ran yet (the SD card was not plugged in). PR: 254373 Reviewed by: imp, manu, markj Sponsored by: The FreeBSD Foundation (cherry picked from commit d5341d72a11be200e536ac7d8967449a3f521792)
* man9: Update guarantees for userspace fetch/store operationsMark Johnston2021-07-292-6/+10
| | | | | | | | | | Platforms may either silently handle unaligned accesses or return an error. Atomicity is not guaranteed in this case, however. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit fd5827b1785a9363abe601cbd9d8558b0fc8d3e8)
* man9: Remove stray .In macrosMark Johnston2021-07-292-2/+0
| | | | | | Fixes: 9c11d8d483c4 (cherry picked from commit 18c696c00159d1071ed17e3bed1863e412dd5cb5)
* nfsclient: Avoid copying uninitialized bytes into statfsMark Johnston2021-07-291-1/+1
| | | | | | | | | | | | hst will be nul-terminated but the remaining space in the buffer is left uninitialized. Avoid copying the entire buffer to ensure that uninitialized bytes are not leaked via statfs(2). Reported by: KMSAN Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation (cherry picked from commit 44de1834b53f4654cc2f6d76406f5705f8167927)
* arm64: Print CPU features slightly earlierMark Johnston2021-07-281-1/+2
| | | | | | | | | | In particular, print them before we release APs. Otherwise they tend to get mixed with other kernel messages. Reviewed by: andrew, manu Sponsored by: The FreeBSD Foundation (cherry picked from commit fa46a46a82498532f547be5f6b5a94d05f53b0be)
* bsdinstall: Only show menu if there are more items to be installedRenato Botelho2021-07-271-10/+12
| | | | | | | Obtained from: Rubicon Communications, LLC ("Netgate") Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 95f0da5be1e3456c930f5f9538cbc099c65f2014)
* Fix the 'linux' rc script on aarch64.Edward Tomasz Napierala2021-07-271-1/+7
| | | | | | | | | | | | Previously it would try to load linux.ko instead of linux64.ko and fail. While here, don't try to match 'linuxaout'; even if implemented, it's the same module as `linuxelf`. Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29288 (cherry picked from commit e026f4243c5a65d19a63d98f55be17e8294a1e87)
* freebsd-tips: Use a fetchable URL as exampleLi-Wen Hsu2021-07-271-2/+2
| | | | | | | | | | | | | MFC after: 3 days (cherry picked from commit ffe6afc4f0121f1909f2fa88694228f771dd3fcb) freebsd-tips: Fix the description of fetch(1) to match the command Reported by: jrtc27 MFC with: ffe6afc4f0121f1909f2fa88694228f771dd3fcb (cherry picked from commit 167897510919a76740eca0d79713abbd088660fe)
* man7: Update FreeBSD.org URLsLi-Wen Hsu2021-07-272-3/+3
| | | | | | MFC after: 3 days (cherry picked from commit 8dfb00245701a4f9290cd3a24e9bdcafa55a075b)
* share/misc: Update FreeBSD.org URLsLi-Wen Hsu2021-07-272-2/+2
| | | | | | MFC after: 3 days (cherry picked from commit 89c0640c7090d5dfbe46adbe50186399923f360f)
* freebsd-update: Update URL of supported platforms informationLi-Wen Hsu2021-07-271-1/+1
| | | | | | MFC after: 3 days (cherry picked from commit 86d0d3aadb48a9a917167078ed197a061179fa4f)
* [skip ci] correct a few SPDX license tagsAlan Somers2021-07-276-6/+6
| | | | | | | | | | These were all incorrectly labeled as 2-clause BSD licenses by a semi-automated process, when in fact they are 3-clause. Discussed with: pfg, imp Sponsored by: Axcient (cherry picked from commit 3874c0abb0afaea6adc24ac96dc9dc5043f2b69e)
* fusefs: correctly set lock owner during FUSE_SETLKAlan Somers2021-07-272-22/+32
| | | | | | | | | | | | | | | | | During FUSE_SETLK, the owner field should uniquely identify the calling process. The fusefs module now sets it to the process's pid. Previously, it expected the calling process to set it directly, which was wrong. libfuse also apparently expects the owner field to be set during FUSE_GETLK, though I'm not sure why. PR: 256005 Reported by: Agata <chogata@moosefs.pro> Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D30622 (cherry picked from commit 18b19f8c6e04935a63a951afe0e540674bc94455)
* pf: clean up syncookie callout on vnet shutdownKristof Provost2021-07-273-0/+8
| | | | | | | | | | Ensure that we cancel any outstanding callouts for syncookies when we terminate the vnet. MFC after: 1 week Sponsored by: Modirum MDPay (cherry picked from commit 32271c4d383effeac7878201ef5cbdfaeedc3755)
* pf: remove stray debug lineKristof Provost2021-07-271-1/+0
| | | | | | | MFC after: 1 week Sponsored by: Modirum MDPay (cherry picked from commit 84db87b8dafd9e9970fd36ac48c11ffdc89d31d0)
* pf: fix LINT buildKristof Provost2021-07-271-0/+1
| | | | | | | | | | | | We failed to list the new pf_syncookies.c file in sys/conf/files. This worked for the usual configurations, where pf is a module, but not for LINT builds. Reported by: lwhsu MFC after: 1 week Sponsored by: Modirum MDPay (cherry picked from commit b972a7fa9e1e01367435a5699b71cc7b5e494fee)
* pf tests: ensure syncookie does not create stateKristof Provost2021-07-271-0/+49
| | | | | | | | | | | Test that with syncookies enabled pf does not create state for connections before the remote peer has replied to the SYN|ACK message. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31142 (cherry picked from commit 27ab791a55191c0b6503391d411303b042b41047)
* pf tests: Forwarding syncookie testKristof Provost2021-07-272-0/+85
| | | | | | | | | | | | Test syncookies on a forwarding host. That is, in a setup where the machine (or vnet) running pf is not the same as the machine (or vnet) running the server it's protecting. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31141 (cherry picked from commit 3be9301a7e4fbd630cbde1bd3e1b59ac726e21af)
* pfctl: syncookie configurationKristof Provost2021-07-276-6/+122
| | | | | | | | | | | pfctl and libpfctl code required to enable/disable the syncookie feature. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31140 (cherry picked from commit c69121c473d75abab55f9ade8e8138ac09c0942c)
* pf: syncookie ioctl interfaceKristof Provost2021-07-273-1/+103
| | | | | | | | | | | Kernel side implementation to allow switching between on and off modes, and allow this configuration to be retrieved. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31139 (cherry picked from commit 231e83d3422ff58fe94de8375a9532a1726056ed)
* pf: syncookie supportKristof Provost2021-07-278-32/+492
| | | | | | | | | | | | | | | | | | Import OpenBSD's syncookie support for pf. This feature help pf resist TCP SYN floods by only creating states once the remote host completes the TCP handshake rather than when the initial SYN packet is received. This is accomplished by using the initial sequence numbers to encode a cookie (hence the name) in the SYN+ACK response and verifying this on receipt of the client ACK. Reviewed by: kbowling Obtained from: OpenBSD MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31138 (cherry picked from commit 8e1864ed07121b479b95d7e3a5931a9e0ffd4713)
* pf: factor out pf_synproxy()Kristof Provost2021-07-271-36/+49
| | | | | | | | MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31137 (cherry picked from commit ee9c3d38039eb29966e1f0b8f617bc564c078289)
* Revert "loader: support.4th resets the read buffer incorrectly"Warner Losh2021-07-271-1/+1
| | | | | | | | | This reverts commit 9c1c02093b90ae49745a174eb26ea85dd1990eec. It seems to have broken all old nextboot.conf files causing hangs on boot. PR: 239315 (cherry picked from commit 4783fb730fa1cfdbe5c905bb23ac74f681e2df6b)