Added built-in work around for blackscreen for 8.00-9.60

- Still feels more like a work around vs a true fix
- 7.xx soon™
This commit is contained in:
Al Azif
2025-08-22 01:34:32 -07:00
parent 631fd7713f
commit 6dd2d4de4d
7 changed files with 404 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ struct kexec_args {
};
static inline void restore(void *kbase, struct kexec_args *uap);
static inline void patch_aio(void *kbase);
static inline void do_patch(void *kbase);
__attribute__((section (".text.start")))
@@ -38,6 +39,7 @@ int kpatch(void *td, struct kexec_args *uap) {
void * const kbase = (void *)rdmsr(0xc0000082) - xfast_syscall_off;
do_patch(kbase);
patch_aio(kbase);
restore(kbase, uap);
return 0;
@@ -61,6 +63,16 @@ static inline void restore(void *kbase, struct kexec_args *uap) {
}
}
// TODO:
__attribute__((always_inline))
static inline void patch_aio(void *kbase) {
const u64 aio_off = 0xb20f5;
disable_cr0_wp();
enable_cr0_wp();
}
__attribute__((always_inline))
static inline void do_patch(void *kbase) {
disable_cr0_wp();