bjorn3
fc9331b16a
virtio: Remove legacy transport support
...
Transitional virtio devices (which have both legacy and virtio 1.0
support) have been the default since QEMU 2.7.0, which was released
8 years ago. Basically every non-commercial Linux distro with an older
QEMU has been EOL already.
The legacy transport is also one of the few places where port I/O is
necessary, which is non-trivial to sandbox even once we have IOMMU
support. As it isn't possible to distinguish legacy and modern virtio
devices for pcid, this would mean that all virtio drivers have to be
started as privileged even if it turns out the modern transport is
supported by the VMM.
2024-06-16 11:49:11 +02:00
bjorn3
359f4482dd
virtio: Merge the x86 and x86_64 platform specific code
2024-06-15 21:59:10 +02:00
bjorn3
b6a75d0a16
virtio: Support the modern transport on x86
2024-06-15 21:59:10 +02:00
bjorn3
23ac696491
pcid: Add PciFunctionHandle::map_bar method
...
This will enable the pcid driver interface to safely map the MSI-X table
in the future without having to worry about a BAR being mapped twice.
2024-06-15 15:47:48 +02:00
bjorn3
a3b957c2e5
pcid: Fetch config in PciFunctionHandle::connect_default()
2024-06-15 15:16:09 +02:00
bjorn3
fdb9ea816b
pcid: Rename PcidServerHandle to PciFunctionHandle
2024-06-15 15:05:59 +02:00
bjorn3
3299a070f2
pcid: Also return bar size from physmap_mem and use it in two more drivers
2024-06-15 14:01:06 +02:00
bjorn3
386a63df42
pcid: Replace get_capabilities with get_vendor_capabilities
...
While this stops returning raw MSI/MSI-X capabilities from
get_capabilities, the same info can be obtained using
fetch_all_features and feature_info.
2024-06-14 11:12:06 +02:00
bjorn3
dc33cba4c0
Fix typo
2024-06-11 21:05:09 +02:00
bjorn3
df66633111
pcid: Store decoded MsixInfo instead of full capability in PciFeatureInfo
2024-06-10 21:00:07 +02:00
bjorn3
588bbfe6a3
pcid: Stop returning feature enable status from fetch_all_features
...
For the same reason the feature_status method was removed.
2024-06-10 19:44:12 +02:00
4lDO2
4c35e88997
Use latest event queue interface everywhere.
2024-03-31 14:30:04 +02:00
Jeremy Soller
ff7015a55a
virtio-core: fix compilation on i686
2024-03-19 16:19:47 -06:00
Jacob Lorentzon
ff956fd3bb
Switch to libredox where applicable (fixed)
2024-03-18 22:09:25 +00:00
Jeremy Soller
98078650f8
Revert "Switch to libredox where applicable."
...
This reverts commit 2e7dbf1cc1 .
2024-03-18 15:00:52 -06:00
4lDO2
2e7dbf1cc1
Switch to libredox where applicable.
2024-03-18 19:23:05 +01:00
bjorn3
9bb1222933
Fix UB lint in virtio-core
...
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> virtio-core/src/probe.rs:126:21
|
86 | let capability = unsafe { &*(capability.data.as_ptr() as *const PciCapability) };
| --------------------------------------------------- backing allocation comes from here
...
126 | (&*(capability as *const PciCapability as *const PciCapabilityNotify))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: casting from `transport_pci::PciCapability` (13 bytes) to `transport_pci::PciCapabilityNotify` (17 bytes)
= note: `#[deny(invalid_reference_casting)]` on by default
2024-03-06 21:06:26 +01:00
Jeremy Soller
2c672a0568
More fixes for 32-bit x86
2024-02-16 20:58:54 -07:00
Jeremy Soller
2a4e292e1d
virtio-core: mark CommonCfg as packed
2024-02-16 20:52:55 -07:00
Enver Balalic
7439262994
ihdad, rtl8139d, rtl8168d, virtio-core, xhcid: Fix aarch64 build
2024-02-10 19:03:36 +01:00
bjorn3
67d3015e2e
Add helper for allocating a single MSI/MSI-X interrupt vector
...
It doesn't actually configure the device to emit it though, but does
make this easier to do.
2024-01-25 14:43:44 +01:00
bjorn3
9b809312c2
Ignore MSI-X PBA in all drivers
...
It isn't used in any driver and even on Linux no driver seems to use it
at all. The only times it seems to be useful are if you were to mask an
interrupt and want to check if the interrupt fired without unmasking or
if you want to make the device itself trigger an interrupt.
2024-01-24 14:28:40 +01:00
bjorn3
f43aa8574c
Simplify MSI-X table pointer computation
2024-01-24 14:28:40 +01:00
bjorn3
7dbf22331b
Share msix config validation code
2024-01-24 14:28:40 +01:00
bjorn3
77b97bb2ed
Introduce PciBar::physmap_mem helper
2024-01-23 12:02:40 +01:00
bjorn3
a5d0c7c354
Use pci_types for reading BARs
...
This simplifies a lot of code and adds support for 64bit BARs.
2024-01-22 15:54:18 +01:00
bjorn3
5192816de7
Introduce expect_port and expect_mem helpers
2024-01-21 21:12:24 +01:00
bjorn3
d0e90f5ded
Remove fetch_header from pcid_interface
...
Most things are already stored in SubdriverArguments and the couple of
things that aren't may change over time and thus should be read again
each time they are accessed, while fetch_header would receive a fixed
copy from pcid.
2024-01-21 19:35:39 +01:00
bjorn3
1890293e86
Introduce a FullDeviceId type and pass it in pcid_interface
2024-01-21 15:18:56 +01:00
bjorn3
fbcf01b413
Add a couple of FIXME
2024-01-18 19:03:10 +01:00
bjorn3
b06f0534aa
Remove interrupt status register probing
...
It isn't used when MSI-X is used and we always use MSI-X interrupts.
2024-01-18 18:45:32 +01:00
bjorn3
fcc55507ea
Move the notify_multiplier field into a separate PciCapabilityNotify type
...
It only exists for VIRTIO_PCI_CAP_NOTIFY_CFG and could conflict with
fields of other capability types.
2024-01-18 18:07:05 +01:00
bjorn3
380a416258
Reorganize virtio headers and add a couple of new fields
...
Also add a decent amount of comments from the virtio spec.
2024-01-18 17:17:39 +01:00
bjorn3
bd8b218174
Don't return Result from spawn_irq_thread
...
It never returns an error.
2024-01-18 15:29:06 +01:00
4lDO2
ea73da92bf
Replace all physalloc usages with Dma.
2023-12-12 12:03:03 +01:00
4lDO2
0d99333c3f
Remove PhysBox.
2023-12-12 12:03:03 +01:00
Jeremy Soller
82fe14960f
Fix build on x86
2023-11-08 09:54:27 -07:00
Enver Balalic
ad9295715f
virtio-core: move things around so aarch64 builds
2023-10-19 15:01:01 +00:00
Jeremy Soller
61e9512468
Update redox_syscall to 0.4
2023-09-07 20:49:37 -06:00
Jeremy Soller
9d7e19cc0d
Merge branch 'core' into 'master'
...
virtio-core: add support for legacy transport
See merge request redox-os/drivers!112
2023-08-23 12:26:44 +00:00
Anhad Singh
6a5e9d2613
virtio-core: add support for legacy transport
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-08-23 15:03:46 +10:00
Jeremy Soller
ac9e4abcd0
virtio-core: Fix compilation on non-x86_64
2023-08-21 09:21:35 -06:00
Anhad Singh
820b8370ae
virtio-gpu: remove the +1 workaround
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-25 16:34:25 +10:00
Anhad Singh
a153c8bc1c
inputd: correctly pass on resize events
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-20 19:20:56 +10:00
Anhad Singh
e457f03935
virtio-gpu: handling GPU resets
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-20 17:34:59 +10:00
4lDO2
e4374ac60d
Switch to common::dma::Dma in virtio-*.
2023-07-18 13:47:15 +02:00
4lDO2
c63c266400
Remove physmap in virtio.
2023-07-18 11:01:16 +02:00
Anhad Singh
5c4e7b36fa
make getty work
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-07 16:51:46 +10:00
Anhad Singh
2f2720263f
drivers: add inputd
...
Take out the input coalescing from `vesad` into `inputd`.
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-05 11:12:53 +10:00
Anhad Singh
7cc2f4eff7
virtio-gpu: start working on the scheme
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2023-07-03 17:12:59 +10:00