Skip to content

Commit

Permalink
Merge remote-tracking branch 'auto-kernel-ci' into auto-kernel
Browse files Browse the repository at this point in the history
* auto-kernel-ci:
  goodix_driver_gt9886: cleanup and fix code styling
  ARM64: configs: raphael: Enable GAMEMODE support
  goodix_driver_gt9886: Implement GAMEMODE Support
  ARM64: configs: raphael: Balance schedutil up/down rate limits
  cpufreq: schedutil: Apply init protection to default configuration options
  cpufreq: schedutil: Enable iowait boost by default
  sched: features: Disable EAS_PREFER_IDLE
  [TEMP]: Kbuild: disable compound-token-split-by-space warnings
  Makefile: Enable LLVM integrated assembler also for assembly files
  crypto: arm64/aes-modes - get rid of literal load of addend vector
  crypto: arm64/chacha20 - move kernel mode neon en/disable into loop
  crypto: arm64/aes-bs - move kernel mode neon en/disable into loop
  crypto: arm64/aes-blk - move kernel mode neon en/disable into loop
  crypto: arm64/aes-ce-ccm - move kernel mode neon en/disable into loop
  kbuild: use LLVM integrated assembler for C files
  drm: msm: sde: Cleanup and optimize sde_connector_update_hbm
  drm: msm: sde: Remove mutex usage in sde_connector_update_hbm
  drm: msm: Fix dimlayer when dc is enabled
  drm: msm: Add support to block fod dimlayer backlight
  drm: msm: dsi_panel: Add support to skip set backlight
  drm: msm: cleanup xiaomi changes for sanity
  Revert "drm: msm: sde: workaround for miui like fod behaviour"
  drone: switch to Full LTO builds
  drone: update for new scripts
  README: Refactor and update
  ARM64: configs: raphael: Enable stack & heap initialization
  scripts: dtc: Enable avoid_unnecessary_addr_size warnings
  Linux 4.14.196
  ALSA: usb-audio: Update documentation comment for MS2109 quirk
  HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()
  tpm: Unify the mismatching TPM space buffer sizes
  btrfs: check the right error variable in btrfs_del_dir_entries_in_log
  usb: storage: Add unusual_uas entry for Sony PSZ drives
  USB: cdc-acm: rework notification_buffer resizing
  USB: gadget: u_f: Unbreak offset calculation in VLAs
  USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()
  USB: gadget: u_f: add overflow checks to VLA macros
  overflow.h: Add allocation size calculation helpers
  usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()
  USB: Ignore UAS for JMicron JMS567 ATA/ATAPI Bridge
  USB: quirks: Add no-lpm quirk for another Raydium touchscreen
  usb: uas: Add quirk for PNY Pro Elite
  USB: yurex: Fix bad gfp argument
  drm/amdgpu: Fix buffer overflow in INFO ioctl
  device property: Fix the secondary firmware node handling in set_primary_fwnode()
  PM: sleep: core: Fix the handling of pending runtime resume requests
  xhci: Do warm-reset when both CAS and XDEV_RESUME are set
  XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.
  writeback: Fix sync livelock due to b_dirty_time processing
  writeback: Avoid skipping inode writeback
  writeback: Protect inode->i_io_list with inode->i_lock
  serial: 8250: change lock order in serial8250_do_startup()
  serial: 8250_exar: Fix number of ports for Commtech PCIe cards
  serial: pl011: Don't leak amba_ports entry on driver register error
  serial: pl011: Fix oops on -EPROBE_DEFER
  serial: samsung: Removes the IRQ not found warning
  vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()
  vt: defer kfree() of vc_screenbuf in vc_do_resize()
  USB: lvtest: return proper error code in probe
  fbcon: prevent user font height or width change from causing potential out-of-bounds access
  btrfs: fix space cache memory leak after transaction abort
  HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands
  powerpc/perf: Fix soft lockups due to missed interrupt accounting
  net: gianfar: Add of_node_put() before goto statement
  scsi: ufs: Clean up completed request without interrupt notification
  scsi: ufs: Improve interrupt handling for shared interrupts
  scsi: ufs: Fix possible infinite loop in ufshcd_hold
  s390/cio: add cond_resched() in the slow_eval_known_fn() loop
  spi: stm32: fix stm32_spi_prepare_mbr in case of odd clk_rate
  fs: prevent BUG_ON in submit_bh_wbc()
  jbd2: abort journal if free a async write error metadata buffer
  ext4: don't BUG on inconsistent journal feature
  jbd2: make sure jh have b_transaction set in refile/unfile_buffer
  usb: gadget: f_tcm: Fix some resource leaks in some error paths
  i2c: rcar: in slave mode, clear NACK earlier
  null_blk: fix passing of REQ_FUA flag in null_handle_rq
  nvme-fc: Fix wrong return value in __nvme_fc_init_request()
  media: gpio-ir-tx: improve precision of transmitted signal due to scheduling
  Revert "ath10k: fix DMA related firmware crashes on multiple devices"
  efi: provide empty efi_enter_virtual_mode implementation
  USB: sisusbvga: Fix a potential UB casued by left shifting a negative value
  powerpc/spufs: add CONFIG_COREDUMP dependency
  KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
  media: davinci: vpif_capture: fix potential double free
  EDAC/ie31200: Fallback if host bridge device is already initialized
  scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del()
  ceph: fix potential mdsc use-after-free crash
  scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
  locking/lockdep: Fix overflow in presentation of average lock-time
  drm/nouveau: Fix reference count leak in nouveau_connector_detect
  drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open
  f2fs: fix use-after-free issue
  cec-api: prevent leaking memory through hole in structure
  mips/vdso: Fix resource leaks in genvdso.c
  rtlwifi: rtl8192cu: Prevent leaking urb
  PCI: Fix pci_create_slot() reference count leak
  omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
  selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
  scsi: lpfc: Fix shost refcount mismatch when deleting vport
  drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails
  drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config
  drm/amd/display: fix ref count leak in amdgpu_drm_ioctl
  drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms
  drm/radeon: fix multiple reference count leak
  drm/amdkfd: Fix reference count leaks.
  iommu/iova: Don't BUG on invalid PFNs
  scsi: target: tcmu: Fix crash on ARM during cmd completion
  blktrace: ensure our debugfs dir exists
  media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq()
  powerpc/xive: Ignore kmemleak false positives
  arm64: dts: qcom: msm8916: Pull down PDM GPIOs during sleep
  mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs
  ASoC: tegra: Fix reference count leaks.
  ALSA: pci: delete repeated words in comments
  gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
  ipvlan: fix device features
  tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
  net: Fix potential wrong skb->protocol in skb_vlan_untag()
  powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
  ANDROID: cuttlefish_defconfig: initialize locals with zeroes
  BACKPORT: security: allow using Clang's zero initialization for stack variables
  Revert "binder: Prevent context manager from incrementing ref 0"

Signed-off-by: UtsavBalar1231 <[email protected]>
  • Loading branch information
UtsavBalar1231 committed Sep 8, 2020
2 parents d3cac4b + 194a991 commit cc5ad5c
Show file tree
Hide file tree
Showing 137 changed files with 1,526 additions and 1,101 deletions.
12 changes: 7 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ steps:
from_secret: ci_channel_id
BOT_API_KEY:
from_secret: bot_api_key
RELEASE_VERSION: "test"
TYPE: "LOSFOD"
commands:
- apt-get update && apt-get install -y bison build-essential bc bison curl libssl-dev git zip python flex
- git clone --depth=1 https://github.com/UtsavBalar1231/scripts.git -b master script && cd script
- ./dronesetup.sh --proton
- ./kernel.sh --proton
- git clone https://github.com/UtsavBalar1231/Drone-scripts.git -b master script && cd script
- ./setup-drone --proton
- ./build-kernel --proton --lto
when:
branch:
- auto-kernel-ci
- auto-kernel
event:
- push
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 195
SUBLEVEL = 196
EXTRAVERSION =
NAME = Petit Gorille

Expand Down Expand Up @@ -515,7 +515,6 @@ endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
CLANG_FLAGS += -no-integrated-as
CLANG_FLAGS += -Werror=unknown-warning-option
CLANG_FLAGS += $(call cc-option, -Wno-misleading-indentation)
CLANG_FLAGS += $(call cc-option, -Wno-bool-operation)
Expand Down Expand Up @@ -793,6 +792,7 @@ ifeq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, compound-token-split-by-space)
KBUILD_CFLAGS += $(call cc-option, -Wno-undefined-optimized)
KBUILD_CFLAGS += $(call cc-option, -Wno-tautological-constant-out-of-range-compare)
KBUILD_CFLAGS += $(call cc-option, -mllvm -disable-struct-const-merge)
Expand Down Expand Up @@ -839,12 +839,20 @@ ifndef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS += -fomit-frame-pointer
endif
endif

# Initialize all stack variables with a pattern, if desired.
ifdef CONFIG_INIT_STACK_ALL
# Initialize all stack variables with a 0xAA pattern.
ifdef CONFIG_INIT_STACK_ALL_PATTERN
KBUILD_CFLAGS += -ftrivial-auto-var-init=pattern
endif

# Initialize all stack variables with a zero value.
ifdef CONFIG_INIT_STACK_ALL_ZERO
# Future support for zero initialization is still being debated, see
# https://bugs.llvm.org/show_bug.cgi?id=45497. These flags are subject to being
# renamed or dropped.
KBUILD_CFLAGS += -ftrivial-auto-var-init=zero
KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
endif

KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments)

ifdef CONFIG_DEBUG_INFO
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# IMMENSiTY KERNAL for Redmi K20pro / Mi9Tpro

## IMMENSiTY KERNEL
## For Redmi K20 Pro and Mi9T Pro
[![Build Status](https://cloud.drone.io/api/badges/UtsavBalar1231/kernel_xiaomi_raphael/status.svg?ref=refs/heads/auto-kernel-ci)](https://cloud.drone.io/UtsavBalar1231/kernel_xiaomi_raphael)
![logo](https://github.com/UtsavBalar1231/xda-stuff/raw/master/immensity-new.png "logo here")
![CommitCount](https://img.shields.io/github/commits-since/utsavbalar1231/kernel_xiaomi_raphael/0.9.0/auto-kernel)
[![HitCount](http://hits.dwyl.com/UtsavBalar1231/kernel_xiaomi_raphael.svg)](http://hits.dwyl.com/UtsavBalar1231/kernel_xiaomi_raphael)
![logo](https://github.com/UtsavBalar1231/xda-stuff/raw/master/immensity-pinkcity.png "bruh logo is here")

> Merged AOSP android-4.14-stable [4.14.195]
> Latest CAF tag: **LE.UM.3.2.3-00110-SA2150p**
## Base
> android-4.14-stable **4.14.196**
>
> CAF **LE.UM.3.2.3-00110-SA2150p**
## Technical Information
![poggers](https://github.com/UtsavBalar1231/xda-stuff/raw/master/immensity-greenlight.png "bruh design is here")
> XDA Thread [HERE](https://forum.xda-developers.com/k20-pro/development/kernel-immensity-kernel-t3962389)
>
> Telegram Group [HERE](https://t.me/cuntsspace)
>
> C.I Channel [HERE](https://t.me/cuntsreleases)
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/qcom/msm8916-pins.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
pins = "gpio63", "gpio64", "gpio65", "gpio66",
"gpio67", "gpio68";
drive-strength = <2>;
bias-disable;
bias-pull-down;
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/cuttlefish_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ CONFIG_LSM_MMAP_MIN_ADDR=65536
CONFIG_HARDENED_USERCOPY=y
CONFIG_STATIC_USERMODEHELPER=y
CONFIG_SECURITY_SELINUX=y
CONFIG_INIT_STACK_ALL=y
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
CONFIG_CRYPTO_ADIANTUM=y
CONFIG_CRYPTO_LZ4=y
Expand Down
12 changes: 7 additions & 5 deletions arch/arm64/configs/raphael_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
# CONFIG_CPU_BOOST is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_SCHEDUTIL_UP_RATE_LIMIT=0
CONFIG_SCHEDUTIL_DOWN_RATE_LIMIT=0
CONFIG_SCHEDUTIL_UP_RATE_LIMIT=5000
CONFIG_SCHEDUTIL_DOWN_RATE_LIMIT=10000
# CONFIG_CPU_FREQ_GOV_INTERACTIVE is not set
CONFIG_CPU_FREQ_DEFAULT_LITTLE_MIN=1036800
CONFIG_CPU_FREQ_DEFAULT_BIG_MIN=1056000
Expand Down Expand Up @@ -1892,6 +1892,7 @@ CONFIG_TOUCHSCREEN_GOODIX_GTX8=y
CONFIG_TOUCHSCREEN_GOODIX_GTX8_UPDATE=y
CONFIG_TOUCHSCREEN_GOODIX_GTX8_GESTURE=y
# CONFIG_TOUCHSCREEN_GOODIX_GTX8_TOOLS is not set
CONFIG_TOUCHSCREEN_GOODIX_GTX8_GAMEMODE=y
CONFIG_TOUCHSCREEN_PROPERTIES=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
Expand Down Expand Up @@ -5130,9 +5131,10 @@ CONFIG_DEFAULT_SECURITY="selinux"
#
# Memory initialization
#
CONFIG_INIT_STACK_NONE=y
# CONFIG_INIT_STACK_ALL is not set
# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set
# CONFIG_INIT_STACK_NONE is not set
# CONFIG_INIT_STACK_ALL_PATTERN is not set
CONFIG_INIT_STACK_ALL_ZERO=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CRYPTO=y

Expand Down
47 changes: 23 additions & 24 deletions arch/arm64/crypto/aes-ce-ccm-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ static int ccm_init_mac(struct aead_request *req, u8 maciv[], u32 msglen)
}

static void ccm_update_mac(struct crypto_aes_ctx *key, u8 mac[], u8 const in[],
u32 abytes, u32 *macp, bool use_neon)
u32 abytes, u32 *macp)
{
if (likely(use_neon)) {
if (may_use_simd()) {
kernel_neon_begin();
ce_aes_ccm_auth_data(mac, in, abytes, macp, key->key_enc,
num_rounds(key));
kernel_neon_end();
} else {
if (*macp > 0 && *macp < AES_BLOCK_SIZE) {
int added = min(abytes, AES_BLOCK_SIZE - *macp);
Expand Down Expand Up @@ -141,8 +143,7 @@ static void ccm_update_mac(struct crypto_aes_ctx *key, u8 mac[], u8 const in[],
}
}

static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[],
bool use_neon)
static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[])
{
struct crypto_aead *aead = crypto_aead_reqtfm(req);
struct crypto_aes_ctx *ctx = crypto_aead_ctx(aead);
Expand All @@ -161,7 +162,7 @@ static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[],
ltag.len = 6;
}

ccm_update_mac(ctx, mac, (u8 *)&ltag, ltag.len, &macp, use_neon);
ccm_update_mac(ctx, mac, (u8 *)&ltag, ltag.len, &macp);
scatterwalk_start(&walk, req->src);

do {
Expand All @@ -173,7 +174,7 @@ static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[],
n = scatterwalk_clamp(&walk, len);
}
p = scatterwalk_map(&walk);
ccm_update_mac(ctx, mac, p, n, &macp, use_neon);
ccm_update_mac(ctx, mac, p, n, &macp);
len -= n;

scatterwalk_unmap(p);
Expand Down Expand Up @@ -240,43 +241,42 @@ static int ccm_encrypt(struct aead_request *req)
u8 __aligned(8) mac[AES_BLOCK_SIZE];
u8 buf[AES_BLOCK_SIZE];
u32 len = req->cryptlen;
bool use_neon = may_use_simd();
int err;

err = ccm_init_mac(req, mac, len);
if (err)
return err;

if (likely(use_neon))
kernel_neon_begin();

if (req->assoclen)
ccm_calculate_auth_mac(req, mac, use_neon);
ccm_calculate_auth_mac(req, mac);

/* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE);

err = skcipher_walk_aead_encrypt(&walk, req, true);

if (likely(use_neon)) {
if (may_use_simd()) {
while (walk.nbytes) {
u32 tail = walk.nbytes % AES_BLOCK_SIZE;

if (walk.nbytes == walk.total)
tail = 0;

kernel_neon_begin();
ce_aes_ccm_encrypt(walk.dst.virt.addr,
walk.src.virt.addr,
walk.nbytes - tail, ctx->key_enc,
num_rounds(ctx), mac, walk.iv);
kernel_neon_end();

err = skcipher_walk_done(&walk, tail);
}
if (!err)
if (!err) {
kernel_neon_begin();
ce_aes_ccm_final(mac, buf, ctx->key_enc,
num_rounds(ctx));

kernel_neon_end();
kernel_neon_end();
}
} else {
err = ccm_crypt_fallback(&walk, mac, buf, ctx, true);
}
Expand All @@ -299,43 +299,42 @@ static int ccm_decrypt(struct aead_request *req)
u8 __aligned(8) mac[AES_BLOCK_SIZE];
u8 buf[AES_BLOCK_SIZE];
u32 len = req->cryptlen - authsize;
bool use_neon = may_use_simd();
int err;

err = ccm_init_mac(req, mac, len);
if (err)
return err;

if (likely(use_neon))
kernel_neon_begin();

if (req->assoclen)
ccm_calculate_auth_mac(req, mac, use_neon);
ccm_calculate_auth_mac(req, mac);

/* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE);

err = skcipher_walk_aead_decrypt(&walk, req, true);

if (likely(use_neon)) {
if (may_use_simd()) {
while (walk.nbytes) {
u32 tail = walk.nbytes % AES_BLOCK_SIZE;

if (walk.nbytes == walk.total)
tail = 0;

kernel_neon_begin();
ce_aes_ccm_decrypt(walk.dst.virt.addr,
walk.src.virt.addr,
walk.nbytes - tail, ctx->key_enc,
num_rounds(ctx), mac, walk.iv);
kernel_neon_end();

err = skcipher_walk_done(&walk, tail);
}
if (!err)
if (!err) {
kernel_neon_begin();
ce_aes_ccm_final(mac, buf, ctx->key_enc,
num_rounds(ctx));

kernel_neon_end();
kernel_neon_end();
}
} else {
err = ccm_crypt_fallback(&walk, mac, buf, ctx, false);
}
Expand Down
Loading

0 comments on commit cc5ad5c

Please sign in to comment.