Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New upstream stable version is available - Networking is now fully stable and enabled by default - SDL2 backend is now available alongside SDL1, so switch to it - Fixed a name collision of PAGE_SIZE with Serenity headers - Many other changes and fixes - See https://github.com/LekKit/RVVM/releases/tag/v0.6 for more
- Loading branch information
Showing
4 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#!/usr/bin/env -S bash ../.port_include.sh | ||
# Maintainer: LekKit <github.com/LekKit> | ||
|
||
port='rvvm' | ||
version='0.5' | ||
archive_hash='3a1dbb91ad04f068078bc6c6c27cc5792eebc111907cb5a14bde158fe6e757c9' | ||
version='0.6' | ||
archive_hash='97e98c95d8785438758b81fb5c695b8eafb564502c6af7f52555b056e3bb7d7a' | ||
files=( | ||
"https://github.com/LekKit/RVVM/archive/v${version}.tar.gz#${archive_hash}" | ||
) | ||
workdir="RVVM-${version}" | ||
depends=('sdl12-compat') | ||
depends=('SDL2') | ||
|
||
build_opts=( | ||
'GIT_COMMIT=76796ba' | ||
'GIT_COMMIT=f937fd8' | ||
'OS=SerenityOS' | ||
'USE_NET=1' | ||
'USE_SDL=1' | ||
'USE_SDL=2' | ||
) | ||
makeopts+=("${build_opts[@]}" 'all' 'lib') | ||
installopts+=("${build_opts[@]}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Patches for RVVM on SerenityOS | ||
|
||
## `disable-threaded-io.patch` | ||
|
||
Due to sloppy scheduler/threading behavior on Serenity, threaded IO is disabled in this port for now. | ||
Otherwise U-Boot randomly fails to read data from NVMe, or fails to initialize NVMe altogether, | ||
along with other IO issues in guests - all due to threaded tasks being randomly delayed for very long. | ||
|
||
I am not an expert on how scheduler works in Serenity, so I am unable to fix it yet. | ||
This problem was also visible in previous v0.5 version of this port, but back then I thought it's some kind of a temporary problem. | ||
Couldn't reproduce this on any other host OS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
commit f897929a4616f0b0a88bab36c7fc2a9c5bbb3365 | ||
Author: LekKit <50500857+LekKit@users.noreply.github.com> | ||
Date: Fri Mar 22 10:05:07 2024 +0200 | ||
|
||
Disable threaded IO on Serenity | ||
|
||
diff --git a/src/threading.c b/src/threading.c | ||
index 98883ed..705749c 100644 | ||
--- a/src/threading.c | ||
+++ b/src/threading.c | ||
@@ -318,6 +318,12 @@ void condvar_free(cond_var_t* cond) | ||
|
||
// Threadpool task offloading | ||
|
||
+// Serenity has serious scheduler issues that cause threadpool to | ||
+// perform very poorly when vCPU is not sleeping. | ||
+// Basically a thread that uses 100% of CPU on Serenity somehow | ||
+// monopolizes host CPU so threadpool/eventloop tasks are timing out. | ||
+ | ||
+#ifndef __serenity__ | ||
#define WORKER_THREADS 4 | ||
#define WORKQUEUE_SIZE 2048 | ||
#define WORKQUEUE_MASK (WORKQUEUE_SIZE - 1) | ||
@@ -440,8 +446,11 @@ static void* threadpool_worker(void* ptr) | ||
return ptr; | ||
} | ||
|
||
+#endif | ||
+ | ||
static bool thread_queue_task(thread_func_t func, void** arg, unsigned arg_count, bool va) | ||
{ | ||
+#ifndef __serenity__ | ||
DO_ONCE ({ | ||
atomic_store_uint32_ex(&pool_run, 1, ATOMIC_RELAXED); | ||
workqueue_init(&pool_wq); | ||
@@ -461,6 +470,9 @@ static bool thread_queue_task(thread_func_t func, void** arg, unsigned arg_count | ||
// Still not queued! | ||
// Assuming entire threadpool is busy, just do a blocking task | ||
DO_ONCE(rvvm_warn("Blocking on workqueue task %p", func)); | ||
+#else | ||
+ UNUSED(func); UNUSED(arg); UNUSED(arg_count); UNUSED(va); | ||
+#endif | ||
return false; | ||
} | ||
|