serenity/Kernel
Idan Horowitz d1f7a2f9a5 Kernel: Finish base implementation of VirtQueues
This commit includes a lot of small changes and additions needed to
finalize the base implementation of VirtIOQueues and VirtDevices:
* The device specific driver implementation now has to handle setting
up the queues it needs before letting the base device class know it
finised initialization
* Supplying buffers to VirtQueues is now done via ScatterGatherLists
instead of arbitary buffer pointers - this ensures the pointers are
physical and allows us to follow the specification in regards to the
requirement that individual descriptors must point to physically
contiguous buffers. This can be further improved in the future by
implementating support for the Indirect-Descriptors feature (as
defined by the specification) to reduce descriptor usage for very
fragmented buffers.
* When supplying buffers to a VirtQueue the driver must supply a
(temporarily-)unique token (usually the supplied buffer's virtual
address) to ensure the driver can discern which buffer has finished
processing by the device in the case in which the device does not
offer the F_IN_ORDER feature.
* Device drivers now handle queue updates (supplied buffers being
returned from the device) by implementing a single pure virtual
method instead of setting a seperate callback for each queue
* Two new VirtQueue methods were added to allow the device driver
to either discard or get used/returned buffers from the device by
cleanly removing them off the descriptor chain (This also allows
the VirtQueue implementation to reuse those freed descriptors)

This also includes the necessary changes to the VirtIOConsole
implementation to match these interface changes.

Co-authored-by: Sahan <sahan.h.fernando@gmail.com>
2021-04-17 10:21:23 +02:00
..
ACPI Everything: Add -Wnon-virtual-dtor flag 2021-04-15 20:57:13 +02:00
API LibC+Kernel: Switch off_t to 64 bits 2021-03-17 23:22:42 +01:00
Arch Kernel/PCI + CPU: Allow to access unaligned data 2021-04-06 22:25:28 +02:00
Devices Kernel: Introduce two new boot arguments to assist with bare metal debug 2021-04-08 22:17:13 +02:00
FileSystem AK+Kernel: Make IntrusiveList capable of holding non-raw pointers 2021-04-16 22:26:52 +02:00
Heap Kernel: Do some basic metadata integrity verification in kmalloc/kfree 2021-04-09 17:08:49 +02:00
Interrupts Everything: Add -Wnon-virtual-dtor flag 2021-04-15 20:57:13 +02:00
Modules Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
Net Kernel: Add some missing socket ioctls 2021-04-16 18:57:35 +02:00
PCI Kernel: Add base support for VirtIO devices 2021-04-17 10:21:23 +02:00
Storage Kernel: Remove type from StorageDevice class 2021-04-13 21:52:34 +02:00
Syscalls Kernel: Read the ELF header from the inode rather than the mapped pages 2021-04-14 13:12:52 +02:00
Tasks Kernel: Make Thread use AK::Time internally 2021-03-02 08:36:08 +01:00
Time Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
TTY Kernel: Introduce a new HID subsystem 2021-04-03 11:57:23 +02:00
VirtIO Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VM Kernel: Implement a simple Scatter/Gather List 2021-04-17 10:21:23 +02:00
.gitignore Meta: Expect sync-local.sh script at repository root 2021-01-30 09:18:46 +01:00
AddressSanitizer.cpp Kernel: Initial integration of Kernel Address Sanitizer (KASAN) 2021-02-15 11:41:53 +01:00
AddressSanitizer.h Kernel: Initial integration of Kernel Address Sanitizer (KASAN) 2021-02-15 11:41:53 +01:00
Assertions.h Everywhere: Remove unused RELEASE_ASSERT macro 2021-02-23 21:11:53 +01:00
CMakeLists.txt Kernel: Implement a simple Scatter/Gather List 2021-04-17 10:21:23 +02:00
CMOS.cpp Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
CMOS.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
CommandLine.cpp Kernel: Introduce two new boot arguments to assist with bare metal debug 2021-04-08 22:17:13 +02:00
CommandLine.h Kernel: Introduce two new boot arguments to assist with bare metal debug 2021-04-08 22:17:13 +02:00
Console.cpp Kernel: Refactor storage stack with u64 as file operations offset 2021-03-17 23:22:42 +01:00
Console.h Kernel: Refactor storage stack with u64 as file operations offset 2021-03-17 23:22:42 +01:00
CoreDump.cpp Kernel: Replace process' regions vector with a Red Black tree 2021-04-12 18:03:44 +02:00
CoreDump.h Kernel: Use default con/de-structors 2021-02-28 18:09:12 +01:00
Debug.h.in Kernel: Add base support for VirtIO devices 2021-04-17 10:21:23 +02:00
DMI.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
DMI.h Kernel: Set file size for smbios_entry_point and DMI blobs in ProcFS 2021-02-01 17:13:23 +01:00
DoubleBuffer.cpp Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
DoubleBuffer.h Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
Forward.h Kernel: Add simplistic work queues 2021-03-21 13:41:09 +01:00
FutexQueue.cpp Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
FutexQueue.h Kernel: Some futex improvements 2021-01-17 20:30:31 +01:00
init.cpp Kernel: Add base support for VirtIO devices 2021-04-17 10:21:23 +02:00
IO.h Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
KBuffer.h Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
KBufferBuilder.cpp Kernel: Assert if rounding-up-to-page-size would wrap around to 0 2021-02-14 10:01:50 +01:00
KBufferBuilder.h Kernel: Use default con/de-structors 2021-02-28 18:09:12 +01:00
kprintf.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
KResult.h Everywhere: Remove unnecessary clang-format offs 2021-03-04 11:01:48 +01:00
kstdio.h Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
KSyms.cpp Kernel: Convert klog() => AK::Format in a handful of places 2021-03-12 15:22:35 +01:00
KSyms.h Kernel: Take some baby steps towards x86_64 2021-02-25 16:27:12 +01:00
linker.ld Kernel: Define a KERNEL_VIRTUAL_BASE in the linker script 2021-03-04 18:25:01 +01:00
Lock.cpp Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
Lock.h Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
LockMode.h Kernel: Fix Lock race causing infinite spinning between two threads 2020-12-16 23:38:17 +01:00
mkmap.sh Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
Module.h Kernel: Move all code into the Kernel namespace 2020-02-16 01:27:42 +01:00
Multiboot.h Kernel: Parse boot modules from Multiboot specification 2021-01-22 22:17:39 +01:00
Panic.cpp Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
Panic.h Kernel: Add a PANIC() function 2021-02-14 09:36:58 +01:00
PerformanceEventBuffer.cpp Kernel: Replace process' regions vector with a Red Black tree 2021-04-12 18:03:44 +02:00
PerformanceEventBuffer.h Kernel+Profiler: Capture metadata about all profiled processes 2021-03-02 22:38:06 +01:00
PhysicalAddress.h Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
Process.cpp Kernel+CrashReporter: Add metadata about page faults to crash reports 2021-04-04 20:13:55 +02:00
Process.h AK+Kernel: Make IntrusiveList capable of holding non-raw pointers 2021-04-16 22:26:52 +02:00
ProcessGroup.cpp Kernel: Move block condition evaluation out of the Scheduler 2020-11-30 13:17:02 +01:00
ProcessGroup.h Kernel: Move block condition evaluation out of the Scheduler 2020-11-30 13:17:02 +01:00
Random.cpp Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
Random.h Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
RTC.cpp Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
RTC.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Scheduler.cpp AK+Kernel: Make IntrusiveList capable of holding non-raw pointers 2021-04-16 22:26:52 +02:00
Scheduler.h Kernel: Remove ancient unused Scheduler::beep() declaration 2021-02-07 20:45:09 +01:00
SpinLock.h Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
StdLib.cpp Kernel/LibC: Make memset implementations the same 2021-04-08 23:57:16 +02:00
StdLib.h AK+Everywhere: Make StdLibExtras templates less wrapper-y 2021-04-10 21:01:31 +02:00
Syscall.cpp Kernel: Suppress maybe-uninitialized' warning s_syscall_table in gcc-10.3.0 2021-04-14 21:49:54 +02:00
Thread.cpp Kernel: Send SIGCHLD to the parent process when changing stopped state 2021-03-31 23:49:26 +02:00
Thread.h AK+Kernel: Make IntrusiveList capable of holding non-raw pointers 2021-04-16 22:26:52 +02:00
ThreadBlockers.cpp Kernel: Fix sys$select() not marking fd's after blocking was avoided 2021-03-15 21:21:52 +01:00
ThreadTracer.cpp Kernel::CPU: Move headers into common directory 2021-03-21 09:35:23 +01:00
ThreadTracer.h Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
TimerQueue.cpp Kernel: Make TimeManagement use AK::Time internally 2021-03-02 08:36:08 +01:00
TimerQueue.h Kernel: Make TimerQueue use AK::Time in interface 2021-03-02 08:36:08 +01:00
UBSanitizer.cpp Kernel: Expose sysctl 'ubsan_is_deadly' to panic the Kernel on UB 2021-03-07 17:31:25 +01:00
UBSanitizer.h Kernel: Expose sysctl 'ubsan_is_deadly' to panic the Kernel on UB 2021-03-07 17:31:25 +01:00
UnixTypes.h LibC+Kernel: Switch off_t to 64 bits 2021-03-17 23:22:42 +01:00
UnveilNode.h Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes 2021-02-26 16:59:56 +01:00
UserOrKernelBuffer.cpp AK: Add StringBuilder::appendff using the new format. 2020-09-22 15:06:40 +02:00
UserOrKernelBuffer.h Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
VirtualAddress.h Everywhere: Remove klog(), dbg() and purge all LogStream usage :^) 2021-03-12 17:29:37 +01:00
WaitQueue.cpp Everywhere: Rename ASSERT => VERIFY 2021-02-23 20:56:54 +01:00
WaitQueue.h Kernel: Add WaitQueue::wait_forever and it use it for all infinite waits. 2021-02-15 08:28:57 +01:00
WorkQueue.cpp Kernel: Remove unused WorkQueue::m_name. 2021-03-26 16:54:05 +01:00
WorkQueue.h AK+Kernel: Make IntrusiveList capable of holding non-raw pointers 2021-04-16 22:26:52 +02:00