| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
The only driver I know that implemented this interface was removed 7
months ago. Remove the interface and platform from the softc.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51992
|
| |
|
|
|
|
| |
Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50913
|
| |
|
|
|
|
|
| |
This is simpler and more robust than individual calls to
device_delete_child.
Differential Revision: https://reviews.freebsd.org/D47972
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
the flags argument is unused.
Its initial design idea has been superceded by the addition of
virtio_setup_intr and related APIs.
Sponsored by: The FreeBSD Foundation
Reviewers: bryanv
Reviewed By: bryanv
Subscribers: cognet, imp
Differential Revision: https://reviews.freebsd.org/D41850
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
these static functions:
- vq_ring_use_indirect
and these public functions:
- virtio_bus_is_modern
- virtio_with_feature
- virtqueue_empty
- virtqueue_full
exclusively return a boolean value.
Change their return values to bool.
Sponsored by: The FreeBSD Foundation
Reviewers: bryanv
Reviewed By: bryanv
Subscribers: cognet, imp
Differential Revision: https://reviews.freebsd.org/D41848
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Virtio MMIO bus driver was added in 2014 with support for devices
exposed via FDT; in 2018 support was added to discover Virtio MMIO
devices via ACPI tables, as in QEMU. The Firecracker VMM eschews both
FDT and ACPI, instead presenting device information via kernel command
line arguments of the form virtio_mmio.device=<parameters>.
These command line parameters get converted into kernel environment
variables; this adds support for parsing those variables and attaching
virtio_mmio children to nexus.
There is a case to be made that it would be cleaner to have a new
"cmdlinebus" attached to nexus and virtio_mmio children attached to
that. A future commit might do that.
Discussed with: imp, jrtc27
Sponsored by: https://patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D36189
|
| |
|
|
|
|
|
|
|
|
| |
Implement the virtio_bus_finalize_features method so the FEATURES_OK
status bit is set. Implement the virtio_bus_config_generation method
to ensure larger than 4-byte reads are consistent.
Reviewed by: cperciva
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36150
|
| | |
|
| | |
|
| |
|
|
|
|
| |
I accidentally didn't include hunk in the committed patch.
Fixes: 6c4f95161d6e ("virtio: make the write_config buffer argument const")
|
| |
|
|
|
|
|
|
| |
No functional change intended, but noticed that we could add const here
while adding linuxkpi support for virtio.
Reviewed By: bryanv, imp
Differential Revision: https://reviews.freebsd.org/D32370
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bus_child_{pnpinfo,location} with sbuf
Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.
Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.
Document these new interfaces with man pages, and oversight from before.
Reviewed by: jhb, bcr
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29937
|
| |
|
|
|
|
|
|
| |
This was blindly moved in r360722 but the variable being printed is not
yet initialised. It's of little use and can easily be added back in the
right place if needed by someone debugging, so just delete it.
Reported by: bryanv
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We must check MagicValue not just Version before anything else, and then
we must check DeviceID and immediately abort if zero (and this must not
be an error).
Do all this when probing rather than at the start of attaching as that's
where this belongs, and provides a clear boundary between the device
detection and device initialisation parts of the specified driver
initialisation process. This also means we don't create empty device
instances for placeholder devices, reducing clutter on systems that
pre-allocate a large number, such as QEMU's AArch64 virt machine (which
provides 32).
Reviewed by: bryanv
Differential Revision: https://reviews.freebsd.org/D28070
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the existing legacy PCI driver as the basis for shared code
between the legacy and modern PCI drivers. The existing virtio_pci
kernel module will contain both the legacy and modern drivers.
Changes to the virtqueue and each device driver (network, block, etc)
for V1 support come in later commits.
Update the MMIO driver to reflect the VirtIO bus method changes, but
the modern compliance can be improved on later.
Note that the modern PCI driver requires bus_map_resource() to be
implemented, which is not the case on all archs.
The hw.virtio.pci.transitional tunable default value is zero so
transitional devices will continue to be driven via the legacy
driver.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27856
|
| |
|
|
|
|
|
| |
This is alreaady defined by each architecture as that is the only place
we can know what the correct page shift should be.
Sponsored by: Innovate UK
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This caused us to write to the low half of the feature word twice, once with
the high bits and once with the low bits. Common legacy device implementations
seem to be fairly lenient about being able to write to the feature bits
multiple times, but Arm's models use a stricter implementation that will ignore
the second write. This fixes using vtnet(4) on those models.
Reported by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Pointy hat: jrtc27
Notes:
svn path=/head/; revision=368761
|
| |
|
|
|
|
|
|
|
|
| |
This register is only defined for the legacy v1 interface so only write
to it when interacting with a legacy device.
Sponsored by: Innovate UK
Notes:
svn path=/head/; revision=363390
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The feature bits are exposed as a 32-bit register with 2 banks, so we
should negotiate both halves. Notably, VIRTIO_F_VERSION_1 is in the
upper half, and will be used in an upcoming commit.
The PCI bus driver also has this bug, but the legacy BAR layout did not
include selector registers and is rather different from the modern
layout, so it remains solely as legacy.
Reviewed by: br, brooks (mentor), jhb (mentor)
Approved by: br, brooks (mentor), jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D25131
Notes:
svn path=/head/; revision=361943
|
| |
|
|
|
|
|
|
|
|
| |
This fixes -Wshift-count-overflow warnings/errors on architectures using
32-bit physical addresses.
Reported by: lwhsu
Notes:
svn path=/head/; revision=360789
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The non-legacy virtio MMIO specification drops the use of PFNs and
replaces them with physical addresses. Whilst many implementations are
so-called transitional devices, also implementing the legacy
specification, TinyEMU[1] does not. Device-specific configuration
registers have also changed to being little-endian, and must be accessed
using a single aligned access for registers up to 32 bits, and two
32-bit aligned accesses for 64-bit registers.
[1] https://bellard.org/tinyemu/
Reviewed by: br, brooks (mentor)
Approved by: br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24681
Notes:
svn path=/head/; revision=360722
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we register an interrupt handler we need to pass the intr_type along in
bus_setup_intr().
The interrupt type matters because it is used to decide if we need to enter
NET_EPOCH. That meant that vtmmio-based if_vtnet did not, which led to panics
with INVARIANTS set.
Sponsored by: Axiado
Notes:
svn path=/head/; revision=358178
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to allocate a contiguous memory block anywhere in memory, but
expressed this as having to be between 0 and 0xffffffff. This limits us
on 64-bit machines, and outright breaks on machines where memory is
mapped above that address range.
Allow the full address range to be used for this allocation.
Sponsored by: Axiado
Notes:
svn path=/head/; revision=350364
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expose the same fields and widths from both vtio buses, even though they
don't quite line up; several virtio drivers can attach to both buses,
and sharing a PNP info table for both seems more convenient.
In practice, I doubt any virtio driver really needs to match on anything
other than bus and device_type (eliminating the unused entries for
vtmmio), and also in practice device_type is << 2^16 (so far, values
range from 1 to 20). So it might be fine to only expose a 16-bit
device_type for PNP purposes. On the other hand, I don't see much harm
in overkill here.
Reviewed by: bryanv, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D20406
Notes:
svn path=/head/; revision=348598
|
| |
|
|
|
|
|
|
|
|
| |
This allows the memory mapped I/O virtio driver to attach when we boot
with ACPI tables, for example in some cases with QEMU emulating arm64.
MFC after: 1 month
Notes:
svn path=/head/; revision=339540
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
original initialization, so we don't miss few registers to
configure.
This fixes vtnet(4) operation with QEMU's virtio-net-device.
Tested in QEMU with FreeBSD/RISC-V.
Reviewed by: bryanv
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15821
Notes:
svn path=/head/; revision=335211
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
code before each write happens, e.g. write-back caches.
This will help booting in Bluespec simulator of CHERI processor.
Notes:
svn path=/head/; revision=285091
|
| |
|
|
|
|
|
| |
Sponsored by: HEIF5
Notes:
svn path=/head/; revision=284544
|
| |
|
|
|
|
|
|
|
| |
Those messages are noisy, but useless for average user.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=280090
|
| |
|
|
|
|
|
|
|
| |
a 1 byte page size until told otherwise.
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=276409
|
| |
|
|
|
|
|
|
|
| |
the AArch64 virtual platform with the Linaro UEFI.
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=276358
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two main parts to get it to work, 1) most of the register
accesses need to be word sized, other than the config register which
needs to be byte aligned, and 2) we don't need the platform driver
for this to work on the Foundation Model, allow it to be NULL.
Differential Revision: https://reviews.freebsd.org/D1240
Reviewed by: bryanv
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=275640
|
|
|
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=274655
|