Commit Graph

1183 Commits

Author SHA1 Message Date
bjorn3 56000cbd9c pcid: Remove subsystem id from PciEndpointHeader 2024-06-16 13:03:58 +02:00
bjorn3 0d926fb3f7 xhcid: Sleep for 2ms on every poll loop
This significantly reduces cpu usage. On my laptop before this change a
single core would be fully loaded while running at 3-4GHz. With this
change it would only be loaded for about 50% while running at 1-2GHz.
This improves battery lifetime while also preventing the fan from
spinning up to a distracting level.

This shouldn't noticably affect latency given that most keyboards and
mice don't support polling at 500Hz anyway.
2024-06-16 12:04:05 +02:00
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
4lDO2 dd10d77350 Make lived stateless. 2024-06-16 11:27:24 +02:00
Jeremy Soller e1a2e21735 Merge branch 'x86_virtio_modern_transport' into 'master'
Support the modern virtio transport on x86

See merge request redox-os/drivers!173
2024-06-15 21:37:44 +00: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
Jeremy Soller be02d70c60 Merge branch 'rustfmt_pcid' into 'master'
Rustfmt pcid

See merge request redox-os/drivers!172
2024-06-15 19:41:09 +00:00
bjorn3 2144eaa62c Rustfmt pcid 2024-06-15 21:38:43 +02:00
Jeremy Soller cd498c1826 Merge branch 'pcid_int_rework' into 'master'
Add PciFunctionHandle::map_bar method

See merge request redox-os/drivers!171
2024-06-15 13:51:20 +00: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
Jeremy Soller aaa3b89a1d Merge branch 'pcid_cleanup7' into 'master'
Use pci_types for parsing capabilties

See merge request redox-os/drivers!170
2024-06-15 11:55:03 +00:00
bjorn3 4bd978da7a pcid: Use pci_types for parsing capabilties 2024-06-15 13:45:57 +02:00
bjorn3 2ab2fe7b5e Update to pci_types 0.10.0 2024-06-15 13:41:51 +02:00
Jeremy Soller ac5f839ded Merge branch 'ided' into 'master'
Switch ided to v2 scheme protocol.

See merge request redox-os/drivers!169
2024-06-15 11:29:47 +00:00
4lDO2 ccbc1d6d69 Switch ided to v2 scheme protocol. 2024-06-15 12:14:18 +02:00
Jeremy Soller cec242c73d Merge branch 'schemev2plus' into 'master'
Use new positioned IO interface in disk drivers

See merge request redox-os/drivers!168
2024-06-14 12:31:50 +00:00
4lDO2 05ec7464ea Update syscall. 2024-06-14 14:22:01 +02:00
4lDO2 2b146f8778 Properly pass POSITIONED new fd flag. 2024-06-14 13:51:13 +02:00
4lDO2 0058d7c948 Positioned IO. 2024-06-14 13:51:13 +02:00
4lDO2 a366841777 Switch remaining storage daemons to schemev2. 2024-06-14 13:51:13 +02:00
4lDO2 9dee2c12ae Migrate nvmed to schemev2. 2024-06-14 13:51:13 +02:00
4lDO2 0ccf87f357 Use schemev2 for ahcid. 2024-06-14 13:51:08 +02:00
Jeremy Soller 4f86767f03 Merge branch 'initfs_hex_pci_id' into 'master'
Use hex pci id's in initfs.toml

See merge request redox-os/drivers!166
2024-06-14 11:23:30 +00:00
Jeremy Soller 0e5977b868 Merge branch 'pcid_cleanup6' into 'master'
pcid: Replace get_capabilities with get_vendor_capabilities

See merge request redox-os/drivers!167
2024-06-14 11:23:00 +00:00
Jeremy Soller 9d3361d4dd Merge branch 'virtio' into 'master'
Fix vga=virtio by using a scatter-gather list for the framebuffer.

See merge request redox-os/drivers!165
2024-06-14 11:21:46 +00: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 019779daee Use hex pci id's in initfs.toml
This is consistent with the pcid configs for non-initfs drivers.
2024-06-14 11:06:49 +02:00
4lDO2 7b2f4dda90 Use scatter-gather list for virtio framebuffer.
The current frame allocator limits requests to powers of two, between 4
KiB and 4 MiB. As such, a 8-bit color 1920x1080 framebuffer needs at
least two allocations.
2024-06-14 08:26:19 +02:00
Jeremy Soller 8f98e28e97 Merge branch 'fix_virtio_blkd_empty_disk' into 'master'
virtio-blkd: Do not crash when the disk is empty

See merge request redox-os/drivers!164
2024-06-13 22:44:59 +00:00
Jeremy Soller b26b1e7b7f Merge branch 'pcid_cleanup5' into 'master'
Remove PciFunc

See merge request redox-os/drivers!163
2024-06-13 22:40:43 +00:00
bjorn3 47ce36741e virtio-blkd: Avoid crash on ls /scheme 2024-06-13 21:47:22 +02:00
bjorn3 32bcf25f99 virtio-blkd: Do not crash when the disk is empty 2024-06-13 21:33:11 +02:00
bjorn3 d2084e58cb pcid: Remove PciFunc 2024-06-13 15:06:49 +02:00
bjorn3 d3dc2e0f80 pcid: Remove all PciFunc methods 2024-06-13 14:52:02 +02:00
Jeremy Soller b13b7c8e7c ided: detect when controller is DMA capable 2024-06-12 07:57:54 -06:00
Jeremy Soller 75a9a3b48a Merge branch 'minor_changes' into 'master'
Couple of minor changes

See merge request redox-os/drivers!162
2024-06-11 19:17:15 +00:00
bjorn3 f6a709ee5a pcid: Simplify PciFunc::read_range
This also avoids UB caused by creating a slice of uninitialized u8.
2024-06-11 21:05:25 +02:00
bjorn3 dc33cba4c0 Fix typo 2024-06-11 21:05:09 +02:00
Jeremy Soller 8e67869b96 Merge branch 'pcid_cleanup4' into 'master'
Store decoded MSI info instead of full capability in PciFeatureInfo

See merge request redox-os/drivers!161
2024-06-11 18:09:54 +00:00
bjorn3 8e02a87474 pcid: Reduce visibility of MsiCapability and MsixCapability methods 2024-06-11 16:57:58 +02:00
bjorn3 4f583b1cfb Store decoded MSI info instead of full capability in PciFeatureInfo 2024-06-11 16:48:43 +02:00
Jeremy Soller 7a67110109 Merge branch 'pcid_cleanup3' into 'master'
Simplify and refactor handling of MSI/MSI-X

See merge request redox-os/drivers!160
2024-06-10 20:27:54 +00:00
bjorn3 df66633111 pcid: Store decoded MsixInfo instead of full capability in PciFeatureInfo 2024-06-10 21:00:07 +02:00
bjorn3 7c112c34dd pcid: Remove some unused methods on MsixCapability 2024-06-10 19:44:12 +02:00
bjorn3 15c9ad1ba6 pcid: Ensure MSI and MSI-X are not enabled at the same time 2024-06-10 19:44:12 +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