aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/beri
Commit message (Collapse)AuthorAgeFilesLines
* Remove SOC FPGA driversJohn Baldwin2024-12-068-2578/+0
| | | | | | | | | The drivers have been disconnected from the build since the removal of the SOCFPGA kernel configs. Reviewed by: manu, imp, andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D47885
* kern: Make fileops and filterops tables const where possibleMark Johnston2024-11-261-2/+2
| | | | | | No functional change intended. MFC after: 1 week
* bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon()Pierre Pronchery2024-09-271-3/+8
| | | | | | | | | | | | | | | Avoid a race condition when accessing guest memory, by reading memory contents only once. This has also been applied to _vq_record() in sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion. Reported by: Synacktiv Reviewed by: markj Security: HYP-10 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45735
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-276-6/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-166-12/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Mechanically convert vtbe(4) to IfAPIJustin Hibbits2023-02-071-37/+36
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37844
* beri: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-105-16/+5
|
* vfs: NDFREE(&nd, NDF_ONLY_PNBUF) -> NDFREE_PNBUF(&nd)Mateusz Guzik2022-03-241-1/+1
|
* vfs: remove the unused thread argument from NDINIT*Mateusz Guzik2021-11-251-2/+1
| | | | | | See b4a58fbf640409a1 ("vfs: remove cn_thread") Bump __FreeBSD_version to 1400043.
* if_vtbe: Add missing includes to fix buildJessica Clarke2021-03-081-0/+4
| | | | | | | PR: 254137 Reported by: Mina Galić <me@igalic.co> MFC after: 3 days Fixes: f8bc74e2f4a5 ("tap: add support for virtio-net offloads")
* beri: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-3/+0
| | | | Notes: svn path=/head/; revision=365120
* Although most of the NIC drivers are epoch ready, due to peer pressureGleb Smirnoff2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | switch over to opt-in instead of opt-out for epoch. Instead of IFF_NEEDSEPOCH, provide IFF_KNOWSEPOCH. If driver marks itself with IFF_KNOWSEPOCH, then ether_input() would not enter epoch when processing its packets. Now this will create recursive entrance in epoch in >90% network drivers, but will guarantee safeness of the transition. Mark several tested drivers as IFF_KNOWSEPOCH. Reviewed by: hselasky, jeff, bz, gallatin Differential Revision: https://reviews.freebsd.org/D23674 Notes: svn path=/head/; revision=358301
* Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces thatGleb Smirnoff2020-01-231-1/+1
| | | | | | | | | | | supposedly may call into ether_input() without network epoch. They all need to be reviewed before 13.0-RELEASE. Some may need be fixed. The flag is not planned to be used in the kernel for a long time. Notes: svn path=/head/; revision=357010
* vfs: drop the mostly unused flags argument from VOP_UNLOCKMateusz Guzik2020-01-031-4/+4
| | | | | | | | | | | Filesystems which want to use it in limited capacity can employ the VOP_UNLOCK_FLAGS macro. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D21427 Notes: svn path=/head/; revision=356337
* vfs: introduce v_irflag and make v_type smallerMateusz Guzik2019-12-081-1/+1
| | | | | | | | | | | | | | | | | | The current vnode layout is not smp-friendly by having frequently read data avoidably sharing cachelines with very frequently modified fields. In particular v_iflag inspected for VI_DOOMED can be found in the same line with v_usecount. Instead make it available in the same cacheline as the v_op, v_data and v_type which all get read all the time. v_type is avoidably 4 bytes while the necessary data will easily fit in 1. Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new flag field with a new value: VIRF_DOOMED. Reviewed by: kib, jeff Differential Revision: https://reviews.freebsd.org/D22715 Notes: svn path=/head/; revision=355537
* Fix off-by-one error in BERI virtio driverOleksandr Tymoshenko2019-02-111-2/+2
| | | | | | | | | | | | | | | | | | The hardcoded ident is exactly 20 bytes long but sprintf adds terminating zero, so there is one byte written out of array bounds.As a fix use strncpy it appends \0 only if space allows and its behavior matches virtio spec: When VIRTIO_BLK_T_GET_ID is issued, the device identifier, up to 20 bytes, is written to the buffer. The identifier should be interpreted as an ascii string. It is terminated with \0, unless it is exactly 20 bytes long. PR: 202298 Reviewed by: br MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18852 Notes: svn path=/head/; revision=343998
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-211-1/+1
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* dev: make some use of mallocarray(9).Pedro F. Giffuni2018-01-131-1/+1
| | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Notes: svn path=/head/; revision=327949
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-1/+1
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Allow BERI virtio-platform code to operate with no PIO devices specified.Ruslan Bukin2015-07-031-23/+69
| | | | | | | | We will use it with Bluespec simulator of CHERI processor for invalidating caches only. Notes: svn path=/head/; revision=285093
* o Switch to use non-mergeable RX buffers to avoid mbuf adjustment needsRuslan Bukin2015-01-054-26/+38
| | | | | | | o Operate with copy of iov as we expect later it was not modified Notes: svn path=/head/; revision=276710
* Do not configure Altera PIO device on ARM startup.Ruslan Bukin2015-01-041-2/+0
| | | | | | | | PIO is a device implemented in soft-core and becomes available after flashing FPGA only. Notes: svn path=/head/; revision=276670
* Remove dev/virtio/virtio.h include from BERI VirtIOBryan Venteicher2014-12-293-3/+4
| | | | | | | | | | This header file contains prototypes and defines that only make sense to the guest VirtIO device drivers. Reviewed by: br Notes: svn path=/head/; revision=276354
* Eliminate a "cast discards qualifiers" warning when building with gcc.Ian Lepore2014-12-211-1/+2
| | | | Notes: svn path=/head/; revision=276031
* Add virtio bus 'poll' method allowing us to inform backend we areRuslan Bukin2014-12-121-0/+10
| | | | | | | | | | | | going to poll virtqueue. Use on BERI soft-core to invalidate cpu caches. Reviewed by: bryanv Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=275728
* o Add BERI Virtio Networking Frontend (if_vtbe)Ruslan Bukin2014-12-096-79/+784
| | | | | | | | | | | o Move similar block/networking methods to common file o Follow r275640 and correct MMIO registers width o Pass value to MMIO platform_note method. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=275647
* o Add PIO and vtblk mmio device info to the treeRuslan Bukin2014-11-251-1/+1
| | | | | | | | o Add FPGA memory window to static dev mappings o Fix whitespace Notes: svn path=/head/; revision=275049
* Add BERI-specific virtio block backend device driver.Ruslan Bukin2014-11-253-0/+857
| | | | | | | | This part intended to operate on ARM side in heterogeneous (ARM/BERI) system on crystal. Notes: svn path=/head/; revision=275048
* Add BERI-specific virtio mmio "platform" device.Ruslan Bukin2014-11-192-0/+262
| | | | | | | | | | This device provides a connector to Altera PIO allowing us to interrupt software-implemented virtio mmio backend. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=274714
* Provide a character device allowing us to access BERI memory regions.Ruslan Bukin2014-10-221-0/+186
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=273469
* Add driver for BERI soft processor 'ring buffer' device.Ruslan Bukin2014-10-191-0/+529
Ring device provides a way for communicate to BERI peripherals such as BERI debug unit and console. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=273278