[Kernel][ANDROID 10][20.02.2021][4.14.220] Kirisakura 1.0.1_R Asus Zenfone 6 aka Kirin

Search This thread

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,432
22,999
Kirisakura-Kernel for the Asus Zenfone 6

Hello everyone,

After rising to the most popular Kernel on Pixel 3/XL, here it is for the Asus Zenfone 6!

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, alongside Kirisakura-Kernel for the OnePlus 8 Pro, 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, 4 and 5 devices.
The recently released Kirisakura-Kernel for the OnePlus 8 Pro was featured on the XDA-Portal due to the inclusion of CFI. The featured article explains CFI in great details, is easy to understand and definitely worth to read.

Another security feature is Shadow Call Stack (SCS). Similar to CFI, only the Pixel 3, 4 and 5 kernels use this security feature.
SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
If you´re interested here are a few good links:
Google Security Blog explaining SCS.
LLVM doc about SCS
Android DOCs documenting SCS

If reading about upstream in the paragraph above 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 855/+ that´s built into the different SKUs of the Zenfone 6.
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 the other features 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.
Many of the 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 Asus for Android 11
- Upstreamed against latest CAF
- Linux-Stable-Upstream included to latest 4.14.220
- compiled with Clang 11.0.1 prebuilt from Google
- Link-Time-Optimization (LTO)
- Kernel Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common
- Shadow Call Stack (SCS) Security-Feature
- Use ThinLTO which was first used in the Pixel 4 XL Android R-Preview Kernel instead of full LTO for full program visibility (needed by CFI)
- fix CFI-Violations found in various subsystems like Asus/device specific 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!
- Anykernel zip is based on the all new Anykernel3 release from @osm0sis
- include vDSO 32 patches to improve 32-bit performance
- disable various debugging configs, that are not needed in a perf build kernel according to google.
- disable selinux auditing (we don´t have to adress selinux denials running a stock rom)

EAS related features:
- backported scheduler from sd865
- disable autogroups and use cgroups for more efficient task placement!
- disable core_ctl for improved task placement and load balancing
- updates from kernel/common
- scheduler updates from Googles Pixel kernel

CPU related features:
- Power saving workingqueues enabled by default (toggleable in EXKM)
have a read here: https://lwn.net/Articles/731052/
this complements EAS in general
- Change various drivers ( MM, audio) to user power efficient workingqueues. This should work well in conjunction with EAS
- include cpuidle patches from CAF
- improvements to cpufreq/times/stats
- improve memory allocations in binder driver
- vdso32 patches as found on Google Pixel devices (brief documentation here)

File System related features:
- Set the bio REQ_NOENCRYPT flag (When lower layers such as dm-crypt observe the REQ_NOENCRYPT flag, it helps the I/O stack avoid redundant encryption, improving performance and power utilization. ) (CAF default)
- 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
- ufs improvements from pixel 4/ pixel 5 kernel

GPU related features:
- KCAL to control the display
- KLAPSE integrated
- KCAL/KLAPSE: changes safety measures -> allow completely disabling two RGB values (this was requested to, for example, only have red values on night dimming)


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

Memory related features:
- Memory Management patches from mainline kernel
- Speculative Page Faults (1. 2)
- Fix various memory leaks in different subsystems
- Reap memory of a task that receives sigkill
- enabled per process reclaim
- allow ZRAM to use higher swappiness values than 100
- possibility to use lzo-rle as default ZRAM compression algorithm (more information here and there )

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
- Shadow Call Stack (SCS) Security-Feature
- fix various CFI-Violations found in various subsystems like Asus/device specific drivers and qualcomm drivers
- enable init_on_alloc for even more security, more information can be found in the commit message

WLAN Driver
- use CAF wlan driver and compile it inline, the only way to ensure working wlan with this kernel
- the kernel cannot even force load prebuild WLAN module as the kernel base is way to far from stock!
- do no longer rely on the pre compiled wlan driver module
- completely removed qcom_rx wakelock in the wlan driver
- removed debugging from wlan driver
- removed logging from wlan driver

Magisk Companion Module
- set kernel settings like I intend them to be :)


Misc Features:

Wakelock Blocker:
- advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]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 to make the kernel more lightweight in various places
- fix several coding issues detected by newer Clang-Toolchains
- add support for steam controller
- add support for nintendo switch controller
- ufs improvements from pixel 4/ pixel 5 kernel
- gpu/kgsl improvements from pixel 4/pixel 5 kernel

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

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. (not the latest canary!)

3. Flash the kernel.zip via latest EXKM or FKM app. Alternatively via TWRP.

4. Reboot and profit.


DOWNLOAD:
Download is located always in this folder:

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

Changelog:

Android 9/Pie
1.0.0 Initial Release
1.3.0 https://xdaforums.com/showpost.php?p=79852192&postcount=21
1.5.0 https://xdaforums.com/showpost.php?p=79948337&postcount=36
1.6.0 https://xdaforums.com/showpost.php?p=80037776&postcount=46
1.8.1 https://xdaforums.com/showpost.php?p=80275065&postcount=58
3.0.0 https://xdaforums.com/showpost.php?p=80712703&postcount=66

Android 10/Q
1.0.0_Q https://xdaforums.com/showpost.php?p=81368413&postcount=73
1.0.3_Q https://xdaforums.com/showpost.php?p=82387237&postcount=86
1.2.0_Q https://xdaforums.com/showpost.php?p=83920653&postcount=92

Android 11/R
1.0.1_R https://xdaforums.com/t/kernel-andr...sus-zenfone-6-aka-kirin.3940178/post-84526765

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:
Asus for the Zenfone 6!
@osm0sis for all his work, including the ak2 installer!
@tbalden for being the best HTC wingman!
@LeeDroid for his awesome roms!
@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
@topjohnwu for magisk!
@osm0sis for anykernel!

XDA:DevDB Information
Kirisakura-Kernel, Kernel for the ASUS ZenFone 6 (2019)

Contributors
Freak07
Source Code: https://github.com/freak07/Kirisakura_Kirin

Version Information
Status:
Stable
 
Last edited:

isthisadagger

Senior Member
Aug 22, 2015
178
88
1. Does it have to be magisk stable or is canary (dev version) ok? I am asking because i need to use canary so my stupid pay app will not detect root.
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.
 

jeremyet

Senior Member
May 30, 2017
120
63
London
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.[/QUOTE]

It's in the downloads folder at the end of the afh link in the OP
 
  • Like
Reactions: isthisadagger

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,432
22,999
1. Does it have to be magisk stable or is canary (dev version) ok? I am asking because i need to use canary so my stupid pay app will not detect root.
2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.


2. This might sound stupid but what is magisk companion and where do i get it? I can not find it in the magisk modules repository or on xda and neither google.

It's in the downloads folder at the end of the afh link in the OP[/QUOTE]


1. you can probably use the canaries of magisk too. But keep in mind, they’re canary builds for a reason. If you’re having issues, flash to magisk stable and see if you can reproduce them.


2. Like @jeremyet said, it’s in the download folder in the OP :cowboy:
 

JJ111

Senior Member
Mar 6, 2016
309
290
Berlin
@Freak07: Cool, the first costom kernel for the Zenfone 6, thanks :)
I am still thinking of switching to the Zenfone 6, one feature I currently use a lot, is the "USB fast charge" : it makes a big difference, if I have my Smartphone for file transfer on my Laptop or PC, whether it charges in the background only with 500 mAh or with a little over 900 mAh on my USB 3 ports.
Does your kernel support USB fast charge / if not: will it be supported? (some custom kernels devs don't want to implement it, bacause it is not an official feature and "might" not work perfectly)
 
  • Like
Reactions: SDF05

isthisadagger

Senior Member
Aug 22, 2015
178
88
Coming from stock kernel, I got stuck at the Zenfone logo during reboot after the first flash with exkm. Volume down+power fixed that and after flashing a second time all seems to be working ? zram is at 684mb for my 6Gb variant.
Thank you a lot.
 
  • Like
Reactions: SDF05 and micbanand

shadeMe

Senior Member
Feb 10, 2013
222
36
A quick question about the kernel source: Is there an API/kernel endpoint that can be used to query and manipulate the flip camera's motor? If so, is it something than can be accessed from userland? I was wondering if one might be able to write a shell script that can be used to send commands to it.
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,432
22,999
Flashing via EXKM will NOT work, if you’re on the latest magisk canary! (currently 19305!)

19302 is still working fine with EXKM, as is stable 19.3. Big changes in magisk are coming. we will have to wait for flar2 to find a new way of flashing zips.
 

regenwurm16

Senior Member
May 6, 2011
173
48
Can this be flashed on the latest update or does it require an update from you? If not are there any downsides to it not being based on the most current kernel source code then?
Kind regards
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,432
22,999
Can this be flashed on the latest update or does it require an update from you? If not are there any downsides to it not being based on the most current kernel source code then?
Kind regards

Wait a bit. I’ll release an update soon. (hopefully later today) This will have latest asus sources merged.

I currently see 2 downloads for my kernel :cyclops: so I thought I can take it slow.
Testing was good so it should be ready for prime time :) stay tuned!
 

regenwurm16

Senior Member
May 6, 2011
173
48
Thanks for your effort.
If think the two downloads are because of the scarce availability of the phone. I ordered mine on 5th of June on Amazon Germany the 6GB RAM 128GB ROM variant (only model they sell) and it took until 1st of July to get to me
I would have ordered on the Asus eShop but they don't ship to my country/don't have a shop for my country
Just take a look in the UK availability thread it's even worse there
 
  • Like
Reactions: Oyeahoyeah800

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Kirisakura-Kernel for the Asus Zenfone 6

    Hello everyone,

    After rising to the most popular Kernel on Pixel 3/XL, here it is for the Asus Zenfone 6!

    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, alongside Kirisakura-Kernel for the OnePlus 8 Pro, 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, 4 and 5 devices.
    The recently released Kirisakura-Kernel for the OnePlus 8 Pro was featured on the XDA-Portal due to the inclusion of CFI. The featured article explains CFI in great details, is easy to understand and definitely worth to read.

    Another security feature is Shadow Call Stack (SCS). Similar to CFI, only the Pixel 3, 4 and 5 kernels use this security feature.
    SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
    ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
    If you´re interested here are a few good links:
    Google Security Blog explaining SCS.
    LLVM doc about SCS
    Android DOCs documenting SCS

    If reading about upstream in the paragraph above 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 855/+ that´s built into the different SKUs of the Zenfone 6.
    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 the other features 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.
    Many of the 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 Asus for Android 11
    - Upstreamed against latest CAF
    - Linux-Stable-Upstream included to latest 4.14.220
    - compiled with Clang 11.0.1 prebuilt from Google
    - Link-Time-Optimization (LTO)
    - Kernel Control-Flow-Integration (CFI) and Link-Time-Optimization (LTO) ported from 4.19 kernel/common
    - Shadow Call Stack (SCS) Security-Feature
    - Use ThinLTO which was first used in the Pixel 4 XL Android R-Preview Kernel instead of full LTO for full program visibility (needed by CFI)
    - fix CFI-Violations found in various subsystems like Asus/device specific 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!
    - Anykernel zip is based on the all new Anykernel3 release from @osm0sis
    - include vDSO 32 patches to improve 32-bit performance
    - disable various debugging configs, that are not needed in a perf build kernel according to google.
    - disable selinux auditing (we don´t have to adress selinux denials running a stock rom)

    EAS related features:
    - backported scheduler from sd865
    - disable autogroups and use cgroups for more efficient task placement!
    - disable core_ctl for improved task placement and load balancing
    - updates from kernel/common
    - scheduler updates from Googles Pixel kernel

    CPU related features:
    - Power saving workingqueues enabled by default (toggleable in EXKM)
    have a read here: https://lwn.net/Articles/731052/
    this complements EAS in general
    - Change various drivers ( MM, audio) to user power efficient workingqueues. This should work well in conjunction with EAS
    - include cpuidle patches from CAF
    - improvements to cpufreq/times/stats
    - improve memory allocations in binder driver
    - vdso32 patches as found on Google Pixel devices (brief documentation here)

    File System related features:
    - Set the bio REQ_NOENCRYPT flag (When lower layers such as dm-crypt observe the REQ_NOENCRYPT flag, it helps the I/O stack avoid redundant encryption, improving performance and power utilization. ) (CAF default)
    - 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
    - ufs improvements from pixel 4/ pixel 5 kernel

    GPU related features:
    - KCAL to control the display
    - KLAPSE integrated
    - KCAL/KLAPSE: changes safety measures -> allow completely disabling two RGB values (this was requested to, for example, only have red values on night dimming)


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

    Memory related features:
    - Memory Management patches from mainline kernel
    - Speculative Page Faults (1. 2)
    - Fix various memory leaks in different subsystems
    - Reap memory of a task that receives sigkill
    - enabled per process reclaim
    - allow ZRAM to use higher swappiness values than 100
    - possibility to use lzo-rle as default ZRAM compression algorithm (more information here and there )

    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
    - Shadow Call Stack (SCS) Security-Feature
    - fix various CFI-Violations found in various subsystems like Asus/device specific drivers and qualcomm drivers
    - enable init_on_alloc for even more security, more information can be found in the commit message

    WLAN Driver
    - use CAF wlan driver and compile it inline, the only way to ensure working wlan with this kernel
    - the kernel cannot even force load prebuild WLAN module as the kernel base is way to far from stock!
    - do no longer rely on the pre compiled wlan driver module
    - completely removed qcom_rx wakelock in the wlan driver
    - removed debugging from wlan driver
    - removed logging from wlan driver

    Magisk Companion Module
    - set kernel settings like I intend them to be :)


    Misc Features:

    Wakelock Blocker:
    - advanced wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
    - please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]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 to make the kernel more lightweight in various places
    - fix several coding issues detected by newer Clang-Toolchains
    - add support for steam controller
    - add support for nintendo switch controller
    - ufs improvements from pixel 4/ pixel 5 kernel
    - gpu/kgsl improvements from pixel 4/pixel 5 kernel

    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

    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. (not the latest canary!)

    3. Flash the kernel.zip via latest EXKM or FKM app. Alternatively via TWRP.

    4. Reboot and profit.


    DOWNLOAD:
    Download is located always in this folder:

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

    Changelog:

    Android 9/Pie
    1.0.0 Initial Release
    1.3.0 https://xdaforums.com/showpost.php?p=79852192&postcount=21
    1.5.0 https://xdaforums.com/showpost.php?p=79948337&postcount=36
    1.6.0 https://xdaforums.com/showpost.php?p=80037776&postcount=46
    1.8.1 https://xdaforums.com/showpost.php?p=80275065&postcount=58
    3.0.0 https://xdaforums.com/showpost.php?p=80712703&postcount=66

    Android 10/Q
    1.0.0_Q https://xdaforums.com/showpost.php?p=81368413&postcount=73
    1.0.3_Q https://xdaforums.com/showpost.php?p=82387237&postcount=86
    1.2.0_Q https://xdaforums.com/showpost.php?p=83920653&postcount=92

    Android 11/R
    1.0.1_R https://xdaforums.com/t/kernel-andr...sus-zenfone-6-aka-kirin.3940178/post-84526765

    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:
    Asus for the Zenfone 6!
    @osm0sis for all his work, including the ak2 installer!
    @tbalden for being the best HTC wingman!
    @LeeDroid for his awesome roms!
    @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
    @topjohnwu for magisk!
    @osm0sis for anykernel!

    XDA:DevDB Information
    Kirisakura-Kernel, Kernel for the ASUS ZenFone 6 (2019)

    Contributors
    Freak07
    Source Code: https://github.com/freak07/Kirisakura_Kirin

    Version Information
    Status:
    Stable
    16
    Update to 1.3.0

    Hey guys and girls,

    so here´s 1.3.0. It includes latest asus source, latest caf, latest f2fs patches (huge set of patches), linux-upstream and a few other goodies.

    The problematic commit, which introduced all the selinux denials when merging latest CAF, got identified and reverted by Planet X. Here´s a link to his commit.
    Big thanks to him.
    This effectively means, my magisk module is now way more lightweight, boot time is therefore reduced and battery monitoring apps, or other apps, which were broken before and needed permissive selinux or went unnoticed should work now just fine.


    Changelog below!

    Enjoy!


    Changelog:

    Kernel Base
    - CAF merged up to tag LA.UM.7.1.r1-15000-sm8150.0
    - Linux stable merged up to latest 4.14.131
    - Kernel now built with Clang 9.0.4
    - update audio driver to latest CAF tag LA.UM.7.1.r1-15000-sm8150.0
    - revert a problematic commit introduced by merging the latest CAF base, which caused selinux denials (thanks to Planet-X! )
    • This makes the magisk module much more lightweight and should fix all selinux denials. This also means battery monitoring apps like GSAM, which were broken before should now work just fine.
    - update f2fs to latest state found on the f2fs stable git (androbench shows improved filesystem performance)


    Features:
    - TCP congestion algorithm Agile-SD included as requested by @TheKnux


    Wlan Driver:
    - Update to latest CAF tag LA.UM.7.1.r1-15000-sm8150.0

    Other changes:
    - Kernel Common patches merged:
    BACKPORT: security: Implement Clang's stack initialization
    BACKPORT: security: Create "kernel hardening" config area
    ANDROID: kernel: cgroup: cpuset: Clear cpus_requested for empty buf
    ANDROID: kernel: cgroup: cpuset: Add missing allocation of cpus_requested in alloc_trial_cpuset


    Magisk Module:
    - update to v2
    - remove all the selinux patches, now that we don´t need them


    Have fun flashing and enjoy your device with latest linux-stable :)

    Why is linux-stable important?

    I wish you all a nice day/evening!


    Download is below :)

    Download:

    Disclaimer/Important:

    Before flashing make sure you´re on latest stable Magisk!

    In case you´re on the stock kernel or any kernel, which has AVB not disabled, you have to flash the kernel.zip TWICE in EXKM with a reboot in between in order for the files on vendor to be replaced!
    Otherwise AVB verity prevents these files from being replaced. If you´re coming from this kernel, flashing twice is not required!

    Please use Stable Magisk 19.3., NOT the latest canary when flashing via EXKM (which is your only choice currently)

    Kernel: https://www.androidfilehost.com/?fid=6006931924117909925

    Magisk Module: https://www.androidfilehost.com/?fid=6006931924117909923




    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    If you like my work please consider a donation.
    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea: http://paypal.me/freak07
    12
    Update to 1.0.3

    Hey guys and girls,

    so here´s the promised update.

    Enjoy!


    Changelog:

    Kernel Base
    - Include Asus Sources - "ASUS_I01WD-17.1810.2003.144-kernel-src"
    - CAF merged up to tag LA.UM.8.1.r1-14700-sm8150.0
    - Linux stable merged up to 4.14.176
    - update clang to 10.0.6
    - include vDSO 32 patches to improve 32-bit performance


    Have fun flashing and enjoy your device with latest linux-stable :)

    Why is linux-stable important?

    I wish you all a nice day/evening!


    Download is below :)

    Download:


    Kernel: https://www.androidfilehost.com/?fid=4349826312261781257




    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    If you like my work please consider a donation.
    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea: http://paypal.me/freak07
    11
    Update to 1.0.1_R

    Hey guys and girls,


    here´s the next update that finally adds support for Android 11.
    Asus switched to a new branch for Android 11 provided by qualcomm. That required a complete rebase for my kernel. Although this took a lot of time to start from scratch again, I could apply some of the things I learned over the last year while working on other devices. The result is quite clean and I´m very pleased with the result.

    In other words: This kernel is now amongst a few on XDA that support CFI in enforcing mode. The only devices supporting this security feature from factory by default are google Pixels starting with the Pixel 3 series.
    Kernel Control Flow Integrity (Kernel-CFI), which is achieved by linking the kernel with LLD and Link Time Optimization (LTO), more precisely ThinLTO, is quite an interesting security feature.

    Another security feature is Shadow Call Stack (SCS). Similar to CFI, only the Pixel 3 and 4 Kernel use this security feature.
    SCS is another security patchset that is aimed at preventing attacks via return oriented programming (ROP).
    ROP is a technique where the attacker gains control of the kernel stack to overwrite function return addresses and redirect execution to carefully selected parts of existing kernel code.
    If you´re interested here are a few good links:
    Google Security Blog explaining SCS.
    LLVM doc about SCS
    Android DOCs documenting SCS

    The scheduler from 4.19 CAF was backported to this kernel. Since the SD865 shares the sames architecture, we can benefit from the improvements qualcomm introduced in the SD865 kernel.
    The kernel is setup after boot to work at the intended settings. There is nothing you need to adjust in kernel managers.
    Please notice that this is not a "this kernel will magically improve battery life and performance kernel". There are performance improvements in nearly all scenarios I tested the kernel. Whether this will give you better battery during your own unique usage only you can see. So I guess most might get the same battery life than stock kernel, some might get worse and some better battery life. There are other aspects of a phone that impact battery life way more than how a scheduler is tuned. Network reception, installed apps, usage etc.

    All previous features should still be left intact.

    There are a lot of other optimizations from the ROG3 kernel that were additionally added. I´m updating the OP the reflect those changes.



    Enjoy!


    Changelog:

    Kernel Base

    - complete kernel rebased
    - Based on kernel source for Android 11 from Asus
    - CAF upstream for Android 11 merged
    - Linux stable merged up to 4.14.220
    - introduce LTO, CFI and Shadow Call Stack
    - improvements to quite a few subsystem -> ufs, gpu, display driver
    - all details please refer to the OP


    Have fun flashing and enjoy your device with latest linux-stable :)

    Why is linux-stable important?

    I wish you all a nice day/evening!


    Download is below :)

    Download:


    Kernel:
    https://www.androidfilehost.com/?fid=17248734326145739731




    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    If you like my work please consider a donation.
    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea: http://paypal.me/freak07
    9
    Update to 1.5.0

    Hey guys and girls,

    so here´s 1.5.0. It includes latest asus source, latest caf, latest linux-upstream and a few other goodies.


    Changelog below!

    Enjoy!


    Changelog:

    Kernel Base
    - CAF merged up to tag LA.UM.7.1.r1-15300-sm8150.0
    - Linux stable merged up to latest 4.14.134
    - Kernel now built with Clang 9.0.5
    - update audio driver to latest CAF tag LA.UM.7.1.r1-15300-sm8150.0
    - Update kernel to latest Asus Source 01WD-ASUS-16.1220.1906.167

    Features:
    - add ability to use lzo-rle as ZRAM compression algorithm

    Wlan Driver:
    - Update to latest CAF tag LA.UM.7.1.r1-15300-sm8150.0

    Other changes:
    Improve bluetooth driver:
    - msm_serial_hs: make the Bluetooth tty thread RT
    - Make msm_serial_hs RT to improve Bluetooth performance
    Keep pstore even on warm reboots
    - msm-poweroff: keep console-ramoops alive
    Source fixups:
    - arm64/kernel/perf_trace_user: fix include
    - ipa_v3: ipa_dp: fix a warning in ipa3_send

    Magisk Module:
    - no updates this time


    Have fun flashing and enjoy your device with latest linux-stable :)

    Why is linux-stable important?

    I wish you all a nice day/evening!


    Download is below :)

    Download:

    Disclaimer/Important:


    In case you´re on the stock kernel or any kernel, which has AVB not disabled, you have to flash the kernel.zip TWICE in EXKM with a reboot in between in order for the files on vendor to be replaced!
    Otherwise AVB verity prevents these files from being replaced. If you´re coming from this kernel, flashing twice is not required!


    Kernel: https://www.androidfilehost.com/?fid=6006931924117922869

    Magisk Module: https://www.androidfilehost.com/?fid=6006931924117909923




    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    If you like my work please consider a donation.
    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea: http://paypal.me/freak07