FORUMS

[Kernel][19.06.2020][Android 10] Kirisakura 1.0.0 for OnePlus 8 Pro aka InstantNoodle

4,510 posts
Thanks Meter: 14,517
 
By Freak07, Recognized Developer / Recognized Contributor on 19th June 2020, 07:26 PM
Post Reply Email Thread
Kirisakura-Kernel for the OnePlus 8 Pro

Hello everyone,

To keep it short: Here is Kirisakura - Kernel for the OnePlus 8 Pro aka InstantNoodle.
I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.

Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!

This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security and performance, while keeping stability as the foucs during testing! This includes Linux-Stable, CAF-Upstream and kernel/common.
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features. In fact this may be (and probably is) the first 4.19 msm kernel with a fully working Kernel-CFI implementation and CFI-Violations fixed on a smartphone.
The only kernels made by OEMs offering this security feature are the ones for the Pixel 3 and Pixel 4 devices.

If that got you curious,have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.

Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 865 that´s built into the OP8 Pro.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst others to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.

The kernel includes a lot of improvements and contributions from other developers as well. Without this kernel would not exist.
I´d like to mention @tbalden ´s excellent CleanSlate features at this place. They improve usability by a big margin for me personally. The highly customizable sweep to sleep implementation (adjustable to different navigation settings), long tap to bring down status bar (very useful on a big device), backlight dimmer and notification reminder are very useful features that I use personally every day, which can be enabled rootless if one desires to run without root.
Another big part of improvements originate from @arter97´s, @kdrag0n´s and @Sultanxda´s work. Many others contributed in some way or another to this kernel.
A big thanks to all of them at this place!

Now lets continue with a list of features in the next paragraph!


Main Features:
- Based on latest kernel sources from OnePlus for Android 10 and intended for use on OOS-Stable releases
- compiled with Clang 11.0.1 and built with -O3 speed optimizations
- Linux-Stable-Upstream included to latest 4.19.128
- CAF base for the Snapdragon 865 (SD865) updated to CAF-Tag LA.UM.8.12.r1-11900-sm8250.0
- Kernel Control-Flow-Integration (CFI) andLink-Time-Optimization (LTO) ported from 4.19 kernel/common and Pixel 4/XL Kernel
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Preview Kernel instead of full LTO
- fix various CFI-Violations found in various subsystems like OnePlus drivers and qualcomm drivers
- Link the kernel with LLD and use RELR-Relocation
- include important fixes/improvements from kernel/common
- Flashing the kernel will keep root!
- Cleanslate Features included! See @tbaldens´s CleanSlate Thread for more information
- Flashable via EXKM and FKM on a rooted system!
- Anykernel zip is based on the Anykernel3 release from @osm0sis

EAS related features:
- EAS implementation patched up to latest CAF state
- disable autogroups and use cgroups for more efficient task placement!
- Dynamic Stune Boost to inflate task utilization and not overload cores on interaction (thanks to @RenderBroken, @joshuous and @tbalden for the rootless implementation )
- updates from kernel/common

CPU related features:
- Change various drivers (WLAN, MM, audio, charger, power, thermal, glink etc) to user power efficient workingqueues. This compliments EAS
- include cpuidle patches from CAF
- improvements to cpufreq/times/stats
- improve memory allocations in binder driver

GPU related features:
- GPU driver updated to latest CAF-State
- remove POPP functionality from GPU driver to avoid constant fight about downscaling with msm-adreno-tz
- don´t wake the gpu on touch input, instead wake when receiving an ioctl
- don´t copy fence names by default to save a bit of cpu-time (explanation)
- msm: kgsl: Stop slab shrinker when no more pages can be reclaimed

File System related features:
- improve memory allocations in sdcardfs
- improve eventpoll logging to stop indicting timerfd (improves kernel wakelock readability)
- improve memory allocations in kernfs
- writeback: hardcode dirty_expire_centisecs=3000 based on this commit

UI/UX/Usability related features from CleanSlate:
- CleanSlate features made by @tbalden
- Flashlight Notification/Call blinking
- Vibrating Notification Reminder
- Sweep to Sleep touchscreen gesture - highly customizable
- DoubleTap on Sweep2Sleep's area gestures - new way to pull down android Notification Area
- Face down screen off - new gesture
- Backlight Dimmer - possibility to use lower panel brightness (switch DC dimming off in Lab settings!)
- KCAL Color Control (credit to @savoca)

Network related features:
- Wireguard Support (Details)
- advanced TCP algorithms enabled
- includes new bbr and bbr2

Memory related features:
- Speculative Page Faults left enabled (1. 2) (CAF default)
- various fixes for PSI-Monitor, which is used by the userspace lowmemorykiller-daemon
- Fix various memory leaks in different subsystems
- improved mm with patches from mainline
- various other changes from mainline
- included zstd as an option for ZRAM-algorithm (lz4 is probably the best all around, so only change it if you know why and what you are doing)
- improve memory allocations in various subsystems

Security related features:
- Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common and Pixel 4/XL Kernel
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Kernel instead of full LTO
- fix various CFI-Violations found in various subsystems like OnePlus drivers and qualcomm drivers
- enable init_on_alloc for even more security, more information can be found in the commit message


Misc Features:

TCP Congestion Algorithms:
- advanced algorithms enabled, enable them with your favorite kernel manager
- includes [URL="https://github.com/freak07/Kirisakura_bluecross/commit/0f8782ea14974ce992618b55f0c041ef43ed0b78#diff-9d300dab5fe08187678045c92cbf5de6"]new bbr2

Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read this for further info
- blocking a kernel wakelock should only be done in case of firmware incompatabilities (WiFi network at work (can´t be changed) causes deep sleep to not work on the phone.) That´s the only use case I see for this feature. The kernel does not features this to improve battery life!

Other features:
- disable logging and debugging to make the kernel more lightweight in various places (includes binder, mm, vma, gpu, ipa etc)
- fix several coding issues detected by newer Clang-Toolchains
- add support for steam controller
- add support for nintendo switch controller

Feature section for the "non visible" but perceptible improvements:
- updated binder section (responsible for interprocess communication)
- updated sdcardfs ; have a read about it here:


Requirements

- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root


How to flash the Kernel:

1. Download the latest kernel.zip and make sure you have properly updated to the latest matching OnePlus firmware. When OOS receives an update it takes OnePlus a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.

1a. Optional: While it may not be necessary all times, you may want to restore stock boot.img, re-root with magisk and optionally install twrp.zip if coming from another kernel. Before reporting issues make sure you do that! Thank you!

2. Make sure to use latest Magisk-stable, if you choose to use Magisk.

3. Flash the kernel.zip via latest EXKM or FKM app, or TWRP (haven´t tested TWRP myself as I don´t need it) and do a full reboot.

4. Reboot and profit.


DOWNLOAD:
Download is located always in this folder:
https://www.androidfilehost.com/?w=files&flid=313864

Important: Read after Download
Please take a look at the second post after flashing the kernel!

Changelog:

Android 10
1.0.0 Initial Release


Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee
If you like my work: http://paypal.me/freak07

Credits:
@osm0sis for all his work, including the ak3 installer!
@tbalden for being the best HTC wingman!
@LeeDroid and @mwilky for their awesome roms and work!
@Captain_Throwback for all the mentoring and guidance!
@Eliminater74 for bringing me into the game and the Inspiration
@nathanchance for his upstream guidance and assistance
@RenderBroken for helping me out
@flar2 for all his work
@joshuous for all the help he provided to me in the past!
@arter97 for giving me advice
@kdrag0n for his help too
@topjohnwu for magisk!

XDA:DevDB Information
Kirisakura Kernel, Kernel for the OnePlus 8 Pro

Contributors
Freak07
Source Code: https://github.com/freak07/Kirisakur..._InstantNoodle

Kernel Special Features:

Version Information
Status: Stable

Created 2020-06-19
Last Updated 2020-06-21
The Following 30 Users Say Thank You to Freak07 For This Useful Post: [ View ]
19th June 2020, 07:27 PM |#2  
Freak07's Avatar
OP Recognized Developer / Recognized Contributor
Thanks Meter: 14,517
 
More
FAQ
F.A.Q:

Question: Is root preserved when flashing this kernel?
Answer: Yes, the AnyKernel.zip will detect root and keep it.

Question: How do I return back to stock or another kernel.
Answer: Extract boot.img from matching firmware you are on and flash the extracted boot.img via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom.

Question: How to report bugs properly?
Answer: Have a look at post #3 in this thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re not using any mods, magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.

If the device force reboots/randomly reboots (that means you see the bootloader unlocked screen!) provide a ramoops file.
Easiest way is immediately after booting up, with a root explorer navigate to sys/fs/pstore. Copy the contents to your internal storage, zip it up and send it to me.

If the issue happens while the device is running provide a dmesg plus a logcat that you take while/shortly after the issue happens. This will log what´s running in the current session. Try to be as detailed as possible what´s happening when the issue appears. It will also help me in reading the log!
The Following User Says Thank You to Freak07 For This Useful Post: [ View ]
19th June 2020, 07:28 PM |#3  
Freak07's Avatar
OP Recognized Developer / Recognized Contributor
Thanks Meter: 14,517
 
More
Useful Resources

How to report bugs:

It is incredibly useful if bug reports are done in a proper way. That saves everyones time and will ultimately lead to a faster bugfix (hopefully).
The following guide from @nathanchance is a very good guideline on how to properly report a bug!
Please also take a log at the FAQ one post above. It covers some procedural steps as well and serves as a guideline too!

https://github.com/nathanchance/Andr..._Reporting.txt
The Following User Says Thank You to Freak07 For This Useful Post: [ View ]
19th June 2020, 07:35 PM |#4  
Freak07's Avatar
OP Recognized Developer / Recognized Contributor
Thanks Meter: 14,517
 
More
Hello everyone

I want to lose a few words about this kernel.
Before anybody asks, it´s made for the OP8 Pro only!

As you may or may not have noticed by reading the OP this kernel is very far from the stock base.
Adding linux-stable upstream and CAF-Upstream causes the commit-count to increase from 805000 to about 840000.
A "higher" commit count does not automatically translater to a better kernel. However upstreaming linux-stable and the CAF-Base to the latest code is an important aspect, that´s often cast aside. (after all the android kernel is based on the linux-kernel and the CAF-Base is the kernel base OnePlus bases the kernel for the OP8 Pro on) . Many developers work constantly on improving the linux-stable branches with commits that are tested, same goes for the qualcomm developers over at the CAF-Forums.
The main goals of this kernel are summarized in the OP. I encourage everyone to at least read once through it.
Here´s a short summary of what I think are the most characteristic and important aspects (also an excerpt from the first post of this thread ):

This project aims to keep most of the subsystems updated, way ahead of the stock kernel, thereby improving security, stability and performance! This includes Linux-Stable, CAF-Upstream and kernel/common.
Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, are quite unique security features. In fact this may be (and probably is) the first 4.19 kernel with a fully working Kernel-CFI implementation and CFI-Violations fixed.
The only kernels made by OEMs offering this security feature are the ones for the Pixel 3 and Pixel 4 devices.

If some of that got you curious,have a read about Linux-Stable and why it is important here. The stable-process is not the same for every subsystem, but the general idea, rule of thumb and benefits are applicable for other subsystems as well.

Quick explanation of CAF-Upstream. CAF is short for Codeaurora-Forums. This is the place where development from Qualcomm for their SoCs happens. This includes the Snapdragon 865 that´s built into the OP8 Pro.
The kernel-bases available on the Codeaurora-Forums, are basically the foundations OEMs use, to build their own kernel additions on top for devices featuring Qualcomm SoCs.
The Qualcomm developers push regular updates to the bases of the different SoCs, a bit similar to how Linux-Upstream works. OEMs usually stop updating the initial base after the phone is released.
This kernel focuses amongst others to provide the latest CAF-Updates merged in a regular manner, to provide updates, improvements and enhancements for SoC specific drivers and subsystems! This might take a while, because a lot of device specific testing is done on my end to ensure stability.


I invite everybody to try the kernel

If you face any bugs, I´d appreciate if bug reports are done in the proper way, like it is asked for and explained in the 2nd and 3rd post.
If you read the OP you probably noticed I´m not talking about any improvments (some call it even magic) to performance or battery life. This is not one of the direct goals of this kernel.
If the modifications present in the kernel make you feel a noticable difference in either of these I´m very happy for you. I know that artifical benchmarks are improved and some other things I tested.
If this kernel is not for you you can very easy return to the stock kernel, like it´s described in the FAQ as well!
There might not be updates of this kernel for every single linux-stable upstream revision that is released at kernel.org or every single new commit added to the tree, but rather less updates but bigger ones.

I guess that gives everybody a rough idea of where this project might be going.


I wish everybody a nice day
The Following 9 Users Say Thank You to Freak07 For This Useful Post: [ View ]
19th June 2020, 07:39 PM |#5  
Reuben_skelz92's Avatar
Senior Member
Thanks Meter: 584
 
More
Loved this for the 7 pro. Welcome 😊
19th June 2020, 07:42 PM |#6  
tbalden's Avatar
Recognized Developer
Flag Budapest
Thanks Meter: 16,480
 
Donate to Me
More
Woohoo, welcome!
Congrats on this truly great achievement.
Keep it up.


Sent from my Pixel 4 XL using Tapatalk
The Following 4 Users Say Thank You to tbalden For This Useful Post: [ View ]
19th June 2020, 07:42 PM |#7  
kristofpetho's Avatar
Senior Member
Flag Zoetermeer
Thanks Meter: 8,763
 
More
Excellent, welcome!
The Following User Says Thank You to kristofpetho For This Useful Post: [ View ] Gift kristofpetho Ad-Free
19th June 2020, 08:21 PM |#9  
Senior Member
Flag London
Thanks Meter: 724
 
More
possible to add option to disable touchboost?
19th June 2020, 09:34 PM |#10  
Freak07's Avatar
OP Recognized Developer / Recognized Contributor
Thanks Meter: 14,517
 
More
Quote:
Originally Posted by tbalden

Woohoo, welcome!
Congrats on this truly great achievement.
Keep it up.


Sent from my Pixel 4 XL using Tapatalk

Thank you! Glad to have you as a wingman for a very long time across different devices now!
Keep on rocking with all the CleanSlate goodies!

Quote:
Originally Posted by Reuben_skelz92

Loved this for the 7 pro. Welcome

Quote:
Originally Posted by kristofpetho

Excellent, welcome!

Quote:
Originally Posted by TheKnux

Hey buddy! Nice to see you here!

Thank you

Quote:
Originally Posted by Nekromantik

possible to add option to disable touchboost?

Yes, since all Cleanslate features are included it´s accessible via CleanSlate config app.
https://forum.xda-developers.com/sho...&postcount=192

Gestures and Extras Section - Stock touchboost.
The Following 4 Users Say Thank You to Freak07 For This Useful Post: [ View ]
19th June 2020, 10:27 PM |#11  
Senior Member
Honolulu, Hawaii
Thanks Meter: 802
 
More
nice to see ya here
The Following User Says Thank You to masri1987 For This Useful Post: [ View ] Gift masri1987 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes