summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Bidar2022-03-25 02:51:40 +0200
committerBjörn Bidar2022-06-11 14:10:58 +0300
commit05a0260e8dc51ce338d4ba7d1a9ffcd6b73d04b2 (patch)
tree5685de18d1c76307f59556bfbe7d2aa2f461b601
parent2c114d74749ddbf43bad8b112b3674bd81d01d27 (diff)
downloadaur-05a0260e8dc51ce338d4ba7d1a9ffcd6b73d04b2.tar.gz
Update to 5.17.0.pf1
- New upstream release based on 5.17.0 - Update kernel configs from arch and arch32 - Disable projectc patch-set for now in favor of ZEN interactive patches
-rw-r--r--.SRCINFO70
-rw-r--r--0002-ZEN-Add-VHBA-driver.patch1199
-rw-r--r--0003-ZEN-Add-OpenRGB-patches.patch748
-rw-r--r--0006-ZEN-Disable-stack-conservation-for-GCC.patch34
-rw-r--r--0007-ZEN-Initialize-ata-before-graphics.patch50
-rw-r--r--0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch110
-rw-r--r--0009-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch154
-rw-r--r--0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch91
-rw-r--r--0011-ZEN-intel-pstate-Implement-enable-parameter.patch60
-rw-r--r--0012-ZEN-Add-ACS-override-support.patch153
-rw-r--r--0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch640
-rw-r--r--0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch167
-rw-r--r--0015-ZEN-mm-Disable-watermark-boosting-by-default.patch48
-rw-r--r--0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch111
-rw-r--r--0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch81
-rw-r--r--0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch48
-rw-r--r--0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch78
-rw-r--r--0020-ZEN-INTERACTIVE-Base-config-item.patch29
-rw-r--r--0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch51
-rw-r--r--0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch66
-rw-r--r--0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch25
-rw-r--r--0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch138
-rw-r--r--0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch97
-rw-r--r--0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch27
-rw-r--r--0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch40
-rw-r--r--0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch45
-rw-r--r--PKGBUILD89
-rw-r--r--asus_zenith_ii_map.patch72
-rw-r--r--config.i686115
-rw-r--r--config.x86_64287
-rw-r--r--update_kernel_config.sh4
31 files changed, 4805 insertions, 122 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 27263f915fb6..38b3343f0911 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Sat Jan 15 16:46:43 UTC 2022
+# Fri Mar 25 01:33:04 UTC 2022
pkgbase = linux-pf
pkgdesc = Linux with the pf-kernel patch (uksm, ZSTD, FSGSBASE and more)
- pkgver = 5.16.0.pf1
+ pkgver = 5.17.0.pf1
pkgrel = 1
url = https://gitlab.com/post-factum/pf-kernel/wikis/README
arch = i686
@@ -19,23 +19,71 @@ pkgbase = linux-pf
makedepends = pahole
makedepends = cpio
options = !strip
- source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.16.tar.xz
+ source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.17.tar.xz
source = config.x86_64
source = config.i686
source = pf_defconfig
source = linux.preset
- source = https://github.com/pfactum/pf-kernel/compare/v5.16...v5.16-pf1.diff
+ source = https://github.com/pfactum/pf-kernel/compare/v5.17...v5.17-pf1.diff
source = 90-linux.hook
source = 60-linux.hook
+ source = 0002-ZEN-Add-VHBA-driver.patch
+ source = 0003-ZEN-Add-OpenRGB-patches.patch
+ source = 0006-ZEN-Disable-stack-conservation-for-GCC.patch
+ source = 0007-ZEN-Initialize-ata-before-graphics.patch
+ source = 0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch
+ source = 0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch
+ source = 0011-ZEN-intel-pstate-Implement-enable-parameter.patch
+ source = 0012-ZEN-Add-ACS-override-support.patch
+ source = 0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch
+ source = 0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch
+ source = 0015-ZEN-mm-Disable-watermark-boosting-by-default.patch
+ source = 0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch
+ source = 0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch
+ source = 0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch
+ source = 0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch
+ source = 0020-ZEN-INTERACTIVE-Base-config-item.patch
+ source = 0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch
+ source = 0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch
+ source = 0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch
+ source = 0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
+ source = 0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
+ source = 0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch
+ source = 0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch
+ source = 0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch
source = asus_zenith_ii_map.patch::https://bugzilla.kernel.org/attachment.cgi?id=294489
- sha256sums = 027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb
- sha256sums = 7cbba374356a189faac71001c5344ce8f02434684b1ce1accefc0cc4bd6718e5
- sha256sums = 425743a84ca63599680f28ed2ebb7885483805104953579b6452c6c3ba24d22a
+ sha256sums = 555fef61dddb591a83d62dd04e252792f9af4ba9ef14683f64840e46fa20b1b1
+ sha256sums = 27f59cb7d4adb08a81da3de822ce07d5b103c799e89aa36370e16e0b4d1f8672
+ sha256sums = 969470b3c6d05fc68fdfbaf39296327edbd091a1a997ce9335822a06d690e60e
sha256sums = 30566498a4f549e972fcd430d2fc44b2bd643c55bae20096f083f8837d8c43e4
sha256sums = 82d660caa11db0cd34fd550a049d7296b4a9dcd28f2a50c81418066d6e598864
- sha256sums = 1eb6a4d75c4aa9ba32ec92e60b502c9d04a3869004f1f2686db8631d5f573561
+ sha256sums = 7759d47d620eb74afbce916b9932bdeb331377104daafa4dfa3931e0855ea17c
sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919
sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21
+ sha256sums = f7b461945a51af055630d396474f3cf981b5798830fb165346162680e672f842
+ sha256sums = 5be0363210051e0df9b48fd745f7fe4cfa70963f98971d1b2ee55c27b4393d1a
+ sha256sums = 5f007c21adfb68d84d4b63d26213b9212d956d69fee84953058b71faf4661517
+ sha256sums = c8d29bc2579dc9a954d6b13ed50f8b07abcd058f5dcf18f170bdfd230283f926
+ sha256sums = dd5829548fe2802fa70938359e3606fa4d97c21dbec315a12fb7836dd7caec30
+ sha256sums = de128f4bb0d74bd5cb5ad4e52cbbc04b5f8475f9b754452ebf36b40d933784db
+ sha256sums = fbaf3aad0e0fb84a18d43a647330a25edb6b24f21902d33aff4f0169a0287e21
+ sha256sums = 0dae3fc9a283e45c30d35745ab5832336304a94f414e9f8d97b39d8a768d665f
+ sha256sums = eeb37f5cd79f2e53018d28afbbab36d903f9203b6a7e27a514313afa9bfeff1b
+ sha256sums = 6ebc39aa1d31a3745d7dcd14d6628e62877c9b8572d19c128f45fd180ca3ac7b
+ sha256sums = ff87ca1fb418061ed09cbd4656094ef14978edd23d772b5b4ceaa3481b6f570b
+ sha256sums = 47d18389f5ad85b54456be88634eec020da11d632e9af72e8423104947ef685b
+ sha256sums = f827d78d3eecb948e3eb79219c2eafb98b1e0199f4c1bc00ecb9db1ffad723aa
+ sha256sums = 02030b2ae2d912ccb64c6900cacafc799f01a35f599018007f316427d0daa39b
+ sha256sums = 697db5c22b7ae716eb017c478fa7104e700f3231a88b60fa20bcbb82edc1ae94
+ sha256sums = 77c921dbcf84adfea460e02fbd28542dd988f7e023c4bc75719a24805e7a9c71
+ sha256sums = dd582720ea98321c227a4a98fb45db93afbf172f6531a34ef4a65c0ae0400c59
+ sha256sums = 9e9ccb6cd669fa136669d721a3f5b3b44d522ee686b89e1cf51b92d52a0e82d8
+ sha256sums = b1807be87aa49b7ef40bdc78596ef524c5832e556bf0ff1f62f89e77abd8d773
+ sha256sums = fef891030e93438be1dd32fa2af28d2f5c033e7e03aad5a152eaee51b0e5f178
+ sha256sums = b9f98e665b570d95da7b55c797bcef206fd48c017de86b5c64e22ff5b45a4713
+ sha256sums = 9ffc360f1a1b354bbae4cf7f4f90fb131a80e65e35afdc3a2e52994c2740eae3
+ sha256sums = 75f3929497e6de49337fc4c83a215856397261fb8be726e55656c621b45c1fba
+ sha256sums = a23472c56b3f14ab976fc19cb0a214fd881d7519b47a1bd4f919b29324b2d3a8
sha256sums = 67558840c3e1f1de229b23a54342cb126735282353a4d0a8cd10e4d582e6d9d6
pkgname = linux-pf
@@ -56,7 +104,7 @@ pkgname = linux-pf
provides = NTFS3-MODULE
provides = UKSMD-BUILTIN
provides = V4L2LOOPBACK-MODULE
- provides = linux-pf=5.16.0.pf1
+ provides = linux-pf=5.17.0.pf1
conflicts = linux-pf
replaces = kernel26-pf
@@ -67,7 +115,7 @@ pkgname = linux-pf-headers
pkgname = linux-pf-preset-default
pkgdesc = Linux-pf default preset
install = linux.install
- depends = linux-pf=5.16.0.pf1
- provides = linux-pf-preset=5.16.0.pf1
+ depends = linux-pf=5.17.0.pf1
+ provides = linux-pf-preset=5.17.0.pf1
backup = etc/mkinitcpio.d/linux-pf.preset
diff --git a/0002-ZEN-Add-VHBA-driver.patch b/0002-ZEN-Add-VHBA-driver.patch
new file mode 100644
index 000000000000..71f1b9d1a755
--- /dev/null
+++ b/0002-ZEN-Add-VHBA-driver.patch
@@ -0,0 +1,1199 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
+Date: Mon, 26 Apr 2021 22:12:46 +0200
+Subject: [PATCH] ZEN: Add VHBA driver
+
+remote https://github.com/cdemu/cdemu
+tag vhba-module-20211218
+---
+ drivers/scsi/Kconfig | 2 +
+ drivers/scsi/Makefile | 1 +
+ drivers/scsi/vhba/Kconfig | 9 +
+ drivers/scsi/vhba/Makefile | 4 +
+ drivers/scsi/vhba/vhba.c | 1124 ++++++++++++++++++++++++++++++++++++
+ 5 files changed, 1140 insertions(+)
+ create mode 100644 drivers/scsi/vhba/Kconfig
+ create mode 100644 drivers/scsi/vhba/Makefile
+ create mode 100644 drivers/scsi/vhba/vhba.c
+
+diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
+index 6e3a04107bb6..78de7aecd852 100644
+--- a/drivers/scsi/Kconfig
++++ b/drivers/scsi/Kconfig
+@@ -1535,4 +1535,6 @@ endif # SCSI_LOWLEVEL
+
+ source "drivers/scsi/device_handler/Kconfig"
+
++source "drivers/scsi/vhba/Kconfig"
++
+ endmenu
+diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
+index 19814c26c908..e65448e9a8bc 100644
+--- a/drivers/scsi/Makefile
++++ b/drivers/scsi/Makefile
+@@ -153,6 +153,7 @@ obj-$(CONFIG_CHR_DEV_SCH) += ch.o
+ obj-$(CONFIG_SCSI_ENCLOSURE) += ses.o
+
+ obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas/
++obj-$(CONFIG_VHBA) += vhba/
+
+ # This goes last, so that "real" scsi devices probe earlier
+ obj-$(CONFIG_SCSI_DEBUG) += scsi_debug.o
+diff --git a/drivers/scsi/vhba/Kconfig b/drivers/scsi/vhba/Kconfig
+new file mode 100644
+index 000000000000..e70a381fe3df
+--- /dev/null
++++ b/drivers/scsi/vhba/Kconfig
+@@ -0,0 +1,9 @@
++config VHBA
++ tristate "Virtual (SCSI) Host Bus Adapter"
++ depends on SCSI
++ help
++ This is the in-kernel part of CDEmu, a CD/DVD-ROM device
++ emulator.
++
++ This driver can also be built as a module. If so, the module
++ will be called vhba.
+diff --git a/drivers/scsi/vhba/Makefile b/drivers/scsi/vhba/Makefile
+new file mode 100644
+index 000000000000..ad8b7c6442af
+--- /dev/null
++++ b/drivers/scsi/vhba/Makefile
+@@ -0,0 +1,4 @@
++VHBA_VERSION := 20211218
++
++obj-$(CONFIG_VHBA) += vhba.o
++ccflags-y := -DVHBA_VERSION=\"$(VHBA_VERSION)\" -Werror
+diff --git a/drivers/scsi/vhba/vhba.c b/drivers/scsi/vhba/vhba.c
+new file mode 100644
+index 000000000000..676af31c33ad
+--- /dev/null
++++ b/drivers/scsi/vhba/vhba.c
+@@ -0,0 +1,1124 @@
++/*
++ * vhba.c
++ *
++ * Copyright (C) 2007-2012 Chia-I Wu <olvaffe AT gmail DOT com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#define pr_fmt(fmt) "vhba: " fmt
++
++#include <linux/version.h>
++
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/highmem.h>
++#include <linux/fs.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#include <linux/sched/signal.h>
++#else
++#include <linux/sched.h>
++#endif
++#include <linux/platform_device.h>
++#include <linux/miscdevice.h>
++#include <linux/poll.h>
++#include <linux/slab.h>
++#include <linux/scatterlist.h>
++#ifdef CONFIG_COMPAT
++#include <linux/compat.h>
++#endif
++#include <asm/uaccess.h>
++#include <scsi/scsi.h>
++#include <scsi/scsi_host.h>
++#include <scsi/scsi_cmnd.h>
++#include <scsi/scsi_device.h>
++#include <scsi/scsi_tcq.h>
++
++
++MODULE_AUTHOR("Chia-I Wu");
++MODULE_VERSION(VHBA_VERSION);
++MODULE_DESCRIPTION("Virtual SCSI HBA");
++MODULE_LICENSE("GPL");
++
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
++#define sdev_dbg(sdev, fmt, a...) \
++ dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
++#define scmd_dbg(scmd, fmt, a...) \
++ dev_dbg(&(scmd)->device->sdev_gendev, fmt, ##a)
++#endif
++
++#define VHBA_MAX_SECTORS_PER_IO 256
++#define VHBA_MAX_BUS 16
++#define VHBA_MAX_ID 16
++#define VHBA_MAX_DEVICES (VHBA_MAX_BUS * (VHBA_MAX_ID-1))
++#define VHBA_KBUF_SIZE PAGE_SIZE
++
++#define DATA_TO_DEVICE(dir) ((dir) == DMA_TO_DEVICE || (dir) == DMA_BIDIRECTIONAL)
++#define DATA_FROM_DEVICE(dir) ((dir) == DMA_FROM_DEVICE || (dir) == DMA_BIDIRECTIONAL)
++
++
++static int vhba_can_queue = 32;
++module_param_named(can_queue, vhba_can_queue, int, 0);
++
++
++enum vhba_req_state {
++ VHBA_REQ_FREE,
++ VHBA_REQ_PENDING,
++ VHBA_REQ_READING,
++ VHBA_REQ_SENT,
++ VHBA_REQ_WRITING,
++};
++
++struct vhba_command {
++ struct scsi_cmnd *cmd;
++ /* metatags are per-host. not to be confused with
++ queue tags that are usually per-lun */
++ unsigned long metatag;
++ int status;
++ struct list_head entry;
++};
++
++struct vhba_device {
++ unsigned int num;
++ spinlock_t cmd_lock;
++ struct list_head cmd_list;
++ wait_queue_head_t cmd_wq;
++ atomic_t refcnt;
++
++ unsigned char *kbuf;
++ size_t kbuf_size;
++};
++
++struct vhba_host {
++ struct Scsi_Host *shost;
++ spinlock_t cmd_lock;
++ int cmd_next;
++ struct vhba_command *commands;
++ spinlock_t dev_lock;
++ struct vhba_device *devices[VHBA_MAX_DEVICES];
++ int num_devices;
++ DECLARE_BITMAP(chgmap, VHBA_MAX_DEVICES);
++ int chgtype[VHBA_MAX_DEVICES];
++ struct work_struct scan_devices;
++};
++
++#define MAX_COMMAND_SIZE 16
++
++struct vhba_request {
++ __u32 metatag;
++ __u32 lun;
++ __u8 cdb[MAX_COMMAND_SIZE];
++ __u8 cdb_len;
++ __u32 data_len;
++};
++
++struct vhba_response {
++ __u32 metatag;
++ __u32 status;
++ __u32 data_len;
++};
++
++
++
++struct vhba_command *vhba_alloc_command (void);
++void vhba_free_command (struct vhba_command *vcmd);
++
++static struct platform_device vhba_platform_device;
++
++
++
++/* These functions define a symmetric 1:1 mapping between device numbers and
++ the bus and id. We have reserved the last id per bus for the host itself. */
++void devnum_to_bus_and_id(unsigned int devnum, unsigned int *bus, unsigned int *id)
++{
++ *bus = devnum / (VHBA_MAX_ID-1);
++ *id = devnum % (VHBA_MAX_ID-1);
++}
++
++unsigned int bus_and_id_to_devnum(unsigned int bus, unsigned int id)
++{
++ return (bus * (VHBA_MAX_ID-1)) + id;
++}
++
++struct vhba_device *vhba_device_alloc (void)
++{
++ struct vhba_device *vdev;
++
++ vdev = kzalloc(sizeof(struct vhba_device), GFP_KERNEL);
++ if (!vdev) {
++ return NULL;
++ }
++
++ spin_lock_init(&vdev->cmd_lock);
++ INIT_LIST_HEAD(&vdev->cmd_list);
++ init_waitqueue_head(&vdev->cmd_wq);
++ atomic_set(&vdev->refcnt, 1);
++
++ vdev->kbuf = NULL;
++ vdev->kbuf_size = 0;
++
++ return vdev;
++}
++
++void vhba_device_put (struct vhba_device *vdev)
++{
++ if (atomic_dec_and_test(&vdev->refcnt)) {
++ kfree(vdev);
++ }
++}
++
++struct vhba_device *vhba_device_get (struct vhba_device *vdev)
++{
++ atomic_inc(&vdev->refcnt);
++
++ return vdev;
++}
++
++int vhba_device_queue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
++{
++ struct vhba_host *vhost;
++ struct vhba_command *vcmd;
++ unsigned long flags;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ vcmd = vhba_alloc_command();
++ if (!vcmd) {
++ return SCSI_MLQUEUE_HOST_BUSY;
++ }
++
++ vcmd->cmd = cmd;
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
++ vcmd->metatag = scsi_cmd_to_rq(vcmd->cmd)->tag;
++#else
++ vcmd->metatag = vcmd->cmd->request->tag;
++#endif
++ list_add_tail(&vcmd->entry, &vdev->cmd_list);
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ wake_up_interruptible(&vdev->cmd_wq);
++
++ return 0;
++}
++
++int vhba_device_dequeue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
++{
++ struct vhba_command *vcmd;
++ int retval;
++ unsigned long flags;
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ list_for_each_entry(vcmd, &vdev->cmd_list, entry) {
++ if (vcmd->cmd == cmd) {
++ list_del_init(&vcmd->entry);
++ break;
++ }
++ }
++
++ /* command not found */
++ if (&vcmd->entry == &vdev->cmd_list) {
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++ return SUCCESS;
++ }
++
++ while (vcmd->status == VHBA_REQ_READING || vcmd->status == VHBA_REQ_WRITING) {
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++ scmd_dbg(cmd, "wait for I/O before aborting\n");
++ schedule_timeout(1);
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ }
++
++ retval = (vcmd->status == VHBA_REQ_SENT) ? FAILED : SUCCESS;
++
++ vhba_free_command(vcmd);
++
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ return retval;
++}
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
++int vhba_slave_alloc(struct scsi_device *sdev)
++{
++ struct Scsi_Host *shost = sdev->host;
++
++ sdev_dbg(sdev, "enabling tagging (queue depth: %i).\n", sdev->queue_depth);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
++ if (!shost_use_blk_mq(shost) && shost->bqt) {
++#else
++ if (shost->bqt) {
++#endif
++ blk_queue_init_tags(sdev->request_queue, sdev->queue_depth, shost->bqt);
++ }
++ scsi_adjust_queue_depth(sdev, 0, sdev->queue_depth);
++
++ return 0;
++}
++#endif
++
++void vhba_scan_devices_add (struct vhba_host *vhost, int bus, int id)
++{
++ struct scsi_device *sdev;
++
++ sdev = scsi_device_lookup(vhost->shost, bus, id, 0);
++ if (!sdev) {
++ scsi_add_device(vhost->shost, bus, id, 0);
++ } else {
++ dev_warn(&vhost->shost->shost_gendev, "tried to add an already-existing device %d:%d:0!\n", bus, id);
++ scsi_device_put(sdev);
++ }
++}
++
++void vhba_scan_devices_remove (struct vhba_host *vhost, int bus, int id)
++{
++ struct scsi_device *sdev;
++
++ sdev = scsi_device_lookup(vhost->shost, bus, id, 0);
++ if (sdev) {
++ scsi_remove_device(sdev);
++ scsi_device_put(sdev);
++ } else {
++ dev_warn(&vhost->shost->shost_gendev, "tried to remove non-existing device %d:%d:0!\n", bus, id);
++ }
++}
++
++void vhba_scan_devices (struct work_struct *work)
++{
++ struct vhba_host *vhost = container_of(work, struct vhba_host, scan_devices);
++ unsigned long flags;
++ int change, exists;
++ unsigned int devnum;
++ unsigned int bus, id;
++
++ for (;;) {
++ spin_lock_irqsave(&vhost->dev_lock, flags);
++
++ devnum = find_first_bit(vhost->chgmap, VHBA_MAX_DEVICES);
++ if (devnum >= VHBA_MAX_DEVICES) {
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++ break;
++ }
++ change = vhost->chgtype[devnum];
++ exists = vhost->devices[devnum] != NULL;
++
++ vhost->chgtype[devnum] = 0;
++ clear_bit(devnum, vhost->chgmap);
++
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++
++ devnum_to_bus_and_id(devnum, &bus, &id);
++
++ if (change < 0) {
++ dev_dbg(&vhost->shost->shost_gendev, "trying to remove target %d:%d:0\n", bus, id);
++ vhba_scan_devices_remove(vhost, bus, id);
++ } else if (change > 0) {
++ dev_dbg(&vhost->shost->shost_gendev, "trying to add target %d:%d:0\n", bus, id);
++ vhba_scan_devices_add(vhost, bus, id);
++ } else {
++ /* quick sequence of add/remove or remove/add; we determine
++ which one it was by checking if device structure exists */
++ if (exists) {
++ /* remove followed by add: remove and (re)add */
++ dev_dbg(&vhost->shost->shost_gendev, "trying to (re)add target %d:%d:0\n", bus, id);
++ vhba_scan_devices_remove(vhost, bus, id);
++ vhba_scan_devices_add(vhost, bus, id);
++ } else {
++ /* add followed by remove: no-op */
++ dev_dbg(&vhost->shost->shost_gendev, "no-op for target %d:%d:0\n", bus, id);
++ }
++ }
++ }
++}
++
++int vhba_add_device (struct vhba_device *vdev)
++{
++ struct vhba_host *vhost;
++ unsigned int devnum;
++ unsigned long flags;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ vhba_device_get(vdev);
++
++ spin_lock_irqsave(&vhost->dev_lock, flags);
++ if (vhost->num_devices >= VHBA_MAX_DEVICES) {
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++ vhba_device_put(vdev);
++ return -EBUSY;
++ }
++
++ for (devnum = 0; devnum < VHBA_MAX_DEVICES; devnum++) {
++ if (vhost->devices[devnum] == NULL) {
++ vdev->num = devnum;
++ vhost->devices[devnum] = vdev;
++ vhost->num_devices++;
++ set_bit(devnum, vhost->chgmap);
++ vhost->chgtype[devnum]++;
++ break;
++ }
++ }
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++
++ schedule_work(&vhost->scan_devices);
++
++ return 0;
++}
++
++int vhba_remove_device (struct vhba_device *vdev)
++{
++ struct vhba_host *vhost;
++ unsigned long flags;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ spin_lock_irqsave(&vhost->dev_lock, flags);
++ set_bit(vdev->num, vhost->chgmap);
++ vhost->chgtype[vdev->num]--;
++ vhost->devices[vdev->num] = NULL;
++ vhost->num_devices--;
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++
++ vhba_device_put(vdev);
++
++ schedule_work(&vhost->scan_devices);
++
++ return 0;
++}
++
++struct vhba_device *vhba_lookup_device (int devnum)
++{
++ struct vhba_host *vhost;
++ struct vhba_device *vdev = NULL;
++ unsigned long flags;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ if (likely(devnum < VHBA_MAX_DEVICES)) {
++ spin_lock_irqsave(&vhost->dev_lock, flags);
++ vdev = vhost->devices[devnum];
++ if (vdev) {
++ vdev = vhba_device_get(vdev);
++ }
++
++ spin_unlock_irqrestore(&vhost->dev_lock, flags);
++ }
++
++ return vdev;
++}
++
++struct vhba_command *vhba_alloc_command (void)
++{
++ struct vhba_host *vhost;
++ struct vhba_command *vcmd;
++ unsigned long flags;
++ int i;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ spin_lock_irqsave(&vhost->cmd_lock, flags);
++
++ vcmd = vhost->commands + vhost->cmd_next++;
++ if (vcmd->status != VHBA_REQ_FREE) {
++ for (i = 0; i < vhba_can_queue; i++) {
++ vcmd = vhost->commands + i;
++
++ if (vcmd->status == VHBA_REQ_FREE) {
++ vhost->cmd_next = i + 1;
++ break;
++ }
++ }
++
++ if (i == vhba_can_queue) {
++ vcmd = NULL;
++ }
++ }
++
++ if (vcmd) {
++ vcmd->status = VHBA_REQ_PENDING;
++ }
++
++ vhost->cmd_next %= vhba_can_queue;
++
++ spin_unlock_irqrestore(&vhost->cmd_lock, flags);
++
++ return vcmd;
++}
++
++void vhba_free_command (struct vhba_command *vcmd)
++{
++ struct vhba_host *vhost;
++ unsigned long flags;
++
++ vhost = platform_get_drvdata(&vhba_platform_device);
++
++ spin_lock_irqsave(&vhost->cmd_lock, flags);
++ vcmd->status = VHBA_REQ_FREE;
++ spin_unlock_irqrestore(&vhost->cmd_lock, flags);
++}
++
++int vhba_queuecommand (struct Scsi_Host *shost, struct scsi_cmnd *cmd)
++{
++ struct vhba_device *vdev;
++ int retval;
++ unsigned int devnum;
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
++ scmd_dbg(cmd, "queue %p tag %i\n", cmd, scsi_cmd_to_rq(cmd)->tag);
++#else
++ scmd_dbg(cmd, "queue %p tag %i\n", cmd, cmd->request->tag);
++#endif
++
++ devnum = bus_and_id_to_devnum(cmd->device->channel, cmd->device->id);
++ vdev = vhba_lookup_device(devnum);
++ if (!vdev) {
++ scmd_dbg(cmd, "no such device\n");
++
++ cmd->result = DID_NO_CONNECT << 16;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
++ scsi_done(cmd);
++#else
++ cmd->scsi_done(cmd);
++#endif
++
++ return 0;
++ }
++
++ retval = vhba_device_queue(vdev, cmd);
++
++ vhba_device_put(vdev);
++
++ return retval;
++}
++
++int vhba_abort (struct scsi_cmnd *cmd)
++{
++ struct vhba_device *vdev;
++ int retval = SUCCESS;
++ unsigned int devnum;
++
++ scmd_dbg(cmd, "abort %p\n", cmd);
++
++ devnum = bus_and_id_to_devnum(cmd->device->channel, cmd->device->id);
++ vdev = vhba_lookup_device(devnum);
++ if (vdev) {
++ retval = vhba_device_dequeue(vdev, cmd);
++ vhba_device_put(vdev);
++ } else {
++ cmd->result = DID_NO_CONNECT << 16;
++ }
++
++ return retval;
++}
++
++static struct scsi_host_template vhba_template = {
++ .module = THIS_MODULE,
++ .name = "vhba",
++ .proc_name = "vhba",
++ .queuecommand = vhba_queuecommand,
++ .eh_abort_handler = vhba_abort,
++ .this_id = -1,
++ .max_sectors = VHBA_MAX_SECTORS_PER_IO,
++ .sg_tablesize = 256,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
++ .slave_alloc = vhba_slave_alloc,
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
++ .tag_alloc_policy = BLK_TAG_ALLOC_RR,
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
++ .use_blk_tags = 1,
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
++ .max_segment_size = VHBA_KBUF_SIZE,
++#endif
++};
++
++ssize_t do_request (struct vhba_device *vdev, unsigned long metatag, struct scsi_cmnd *cmd, char __user *buf, size_t buf_len)
++{
++ struct vhba_request vreq;
++ ssize_t ret;
++
++ scmd_dbg(cmd, "request %lu (%p), cdb 0x%x, bufflen %d, sg count %d\n",
++ metatag, cmd, cmd->cmnd[0], scsi_bufflen(cmd), scsi_sg_count(cmd));
++
++ ret = sizeof(vreq);
++ if (DATA_TO_DEVICE(cmd->sc_data_direction)) {
++ ret += scsi_bufflen(cmd);
++ }
++
++ if (ret > buf_len) {
++ scmd_dbg(cmd, "buffer too small (%zd < %zd) for a request\n", buf_len, ret);
++ return -EIO;
++ }
++
++ vreq.metatag = metatag;
++ vreq.lun = cmd->device->lun;
++ memcpy(vreq.cdb, cmd->cmnd, MAX_COMMAND_SIZE);
++ vreq.cdb_len = cmd->cmd_len;
++ vreq.data_len = scsi_bufflen(cmd);
++
++ if (copy_to_user(buf, &vreq, sizeof(vreq))) {
++ return -EFAULT;
++ }
++
++ if (DATA_TO_DEVICE(cmd->sc_data_direction) && vreq.data_len) {
++ buf += sizeof(vreq);
++
++ if (scsi_sg_count(cmd)) {
++ unsigned char *kaddr, *uaddr;
++ struct scatterlist *sglist = scsi_sglist(cmd);
++ struct scatterlist *sg;
++ int i;
++
++ uaddr = (unsigned char *) buf;
++
++ for_each_sg(sglist, sg, scsi_sg_count(cmd), i) {
++ size_t len = sg->length;
++
++ if (len > vdev->kbuf_size) {
++ scmd_dbg(cmd, "segment size (%zu) exceeds kbuf size (%zu)!", len, vdev->kbuf_size);
++ len = vdev->kbuf_size;
++ }
++
++ kaddr = kmap_atomic(sg_page(sg));
++ memcpy(vdev->kbuf, kaddr + sg->offset, len);
++ kunmap_atomic(kaddr);
++
++ if (copy_to_user(uaddr, vdev->kbuf, len)) {
++ return -EFAULT;
++ }
++ uaddr += len;
++ }
++ } else {
++ if (copy_to_user(buf, scsi_sglist(cmd), vreq.data_len)) {
++ return -EFAULT;
++ }
++ }
++ }
++
++ return ret;
++}
++
++ssize_t do_response (struct vhba_device *vdev, unsigned long metatag, struct scsi_cmnd *cmd, const char __user *buf, size_t buf_len, struct vhba_response *res)
++{
++ ssize_t ret = 0;
++
++ scmd_dbg(cmd, "response %lu (%p), status %x, data len %d, sg count %d\n",
++ metatag, cmd, res->status, res->data_len, scsi_sg_count(cmd));
++
++ if (res->status) {
++ if (res->data_len > SCSI_SENSE_BUFFERSIZE) {
++ scmd_dbg(cmd, "truncate sense (%d < %d)", SCSI_SENSE_BUFFERSIZE, res->data_len);
++ res->data_len = SCSI_SENSE_BUFFERSIZE;
++ }
++
++ if (copy_from_user(cmd->sense_buffer, buf, res->data_len)) {
++ return -EFAULT;
++ }
++
++ cmd->result = res->status;
++
++ ret += res->data_len;
++ } else if (DATA_FROM_DEVICE(cmd->sc_data_direction) && scsi_bufflen(cmd)) {
++ size_t to_read;
++
++ if (res->data_len > scsi_bufflen(cmd)) {
++ scmd_dbg(cmd, "truncate data (%d < %d)\n", scsi_bufflen(cmd), res->data_len);
++ res->data_len = scsi_bufflen(cmd);
++ }
++
++ to_read = res->data_len;
++
++ if (scsi_sg_count(cmd)) {
++ unsigned char *kaddr, *uaddr;
++ struct scatterlist *sglist = scsi_sglist(cmd);
++ struct scatterlist *sg;
++ int i;
++
++ uaddr = (unsigned char *)buf;
++
++ for_each_sg(sglist, sg, scsi_sg_count(cmd), i) {
++ size_t len = (sg->length < to_read) ? sg->length : to_read;
++
++ if (len > vdev->kbuf_size) {
++ scmd_dbg(cmd, "segment size (%zu) exceeds kbuf size (%zu)!", len, vdev->kbuf_size);
++ len = vdev->kbuf_size;
++ }
++
++ if (copy_from_user(vdev->kbuf, uaddr, len)) {
++ return -EFAULT;
++ }
++ uaddr += len;
++
++ kaddr = kmap_atomic(sg_page(sg));
++ memcpy(kaddr + sg->offset, vdev->kbuf, len);
++ kunmap_atomic(kaddr);
++
++ to_read -= len;
++ if (to_read == 0) {
++ break;
++ }
++ }
++ } else {
++ if (copy_from_user(scsi_sglist(cmd), buf, res->data_len)) {
++ return -EFAULT;
++ }
++
++ to_read -= res->data_len;
++ }
++
++ scsi_set_resid(cmd, to_read);
++
++ ret += res->data_len - to_read;
++ }
++
++ return ret;
++}
++
++struct vhba_command *next_command (struct vhba_device *vdev)
++{
++ struct vhba_command *vcmd;
++
++ list_for_each_entry(vcmd, &vdev->cmd_list, entry) {
++ if (vcmd->status == VHBA_REQ_PENDING) {
++ break;
++ }
++ }
++
++ if (&vcmd->entry == &vdev->cmd_list) {
++ vcmd = NULL;
++ }
++
++ return vcmd;
++}
++
++struct vhba_command *match_command (struct vhba_device *vdev, __u32 metatag)
++{
++ struct vhba_command *vcmd;
++
++ list_for_each_entry(vcmd, &vdev->cmd_list, entry) {
++ if (vcmd->metatag == metatag) {
++ break;
++ }
++ }
++
++ if (&vcmd->entry == &vdev->cmd_list) {
++ vcmd = NULL;
++ }
++
++ return vcmd;
++}
++
++struct vhba_command *wait_command (struct vhba_device *vdev, unsigned long flags)
++{
++ struct vhba_command *vcmd;
++ DEFINE_WAIT(wait);
++
++ while (!(vcmd = next_command(vdev))) {
++ if (signal_pending(current)) {
++ break;
++ }
++
++ prepare_to_wait(&vdev->cmd_wq, &wait, TASK_INTERRUPTIBLE);
++
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ schedule();
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ }
++
++ finish_wait(&vdev->cmd_wq, &wait);
++ if (vcmd) {
++ vcmd->status = VHBA_REQ_READING;
++ }
++
++ return vcmd;
++}
++
++ssize_t vhba_ctl_read (struct file *file, char __user *buf, size_t buf_len, loff_t *offset)
++{
++ struct vhba_device *vdev;
++ struct vhba_command *vcmd;
++ ssize_t ret;
++ unsigned long flags;
++
++ vdev = file->private_data;
++
++ /* Get next command */
++ if (file->f_flags & O_NONBLOCK) {
++ /* Non-blocking variant */
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ vcmd = next_command(vdev);
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ if (!vcmd) {
++ return -EWOULDBLOCK;
++ }
++ } else {
++ /* Blocking variant */
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ vcmd = wait_command(vdev, flags);
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ if (!vcmd) {
++ return -ERESTARTSYS;
++ }
++ }
++
++ ret = do_request(vdev, vcmd->metatag, vcmd->cmd, buf, buf_len);
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ if (ret >= 0) {
++ vcmd->status = VHBA_REQ_SENT;
++ *offset += ret;
++ } else {
++ vcmd->status = VHBA_REQ_PENDING;
++ }
++
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ return ret;
++}
++
++ssize_t vhba_ctl_write (struct file *file, const char __user *buf, size_t buf_len, loff_t *offset)
++{
++ struct vhba_device *vdev;
++ struct vhba_command *vcmd;
++ struct vhba_response res;
++ ssize_t ret;
++ unsigned long flags;
++
++ if (buf_len < sizeof(res)) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&res, buf, sizeof(res))) {
++ return -EFAULT;
++ }
++
++ vdev = file->private_data;
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ vcmd = match_command(vdev, res.metatag);
++ if (!vcmd || vcmd->status != VHBA_REQ_SENT) {
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++ pr_debug("ctl dev #%u not expecting response\n", vdev->num);
++ return -EIO;
++ }
++ vcmd->status = VHBA_REQ_WRITING;
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ ret = do_response(vdev, vcmd->metatag, vcmd->cmd, buf + sizeof(res), buf_len - sizeof(res), &res);
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ if (ret >= 0) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
++ scsi_done(vcmd->cmd);
++#else
++ vcmd->cmd->scsi_done(vcmd->cmd);
++#endif
++ ret += sizeof(res);
++
++ /* don't compete with vhba_device_dequeue */
++ if (!list_empty(&vcmd->entry)) {
++ list_del_init(&vcmd->entry);
++ vhba_free_command(vcmd);
++ }
++ } else {
++ vcmd->status = VHBA_REQ_SENT;
++ }
++
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ return ret;
++}
++
++long vhba_ctl_ioctl (struct file *file, unsigned int cmd, unsigned long arg)
++{
++ struct vhba_device *vdev = file->private_data;
++ struct vhba_host *vhost = platform_get_drvdata(&vhba_platform_device);
++
++ switch (cmd) {
++ case 0xBEEF001: {
++ unsigned int ident[4]; /* host, channel, id, lun */
++
++ ident[0] = vhost->shost->host_no;
++ devnum_to_bus_and_id(vdev->num, &ident[1], &ident[2]);
++ ident[3] = 0; /* lun */
++
++ if (copy_to_user((void *) arg, ident, sizeof(ident))) {
++ return -EFAULT;
++ }
++
++ return 0;
++ }
++ case 0xBEEF002: {
++ unsigned int devnum = vdev->num;
++
++ if (copy_to_user((void *) arg, &devnum, sizeof(devnum))) {
++ return -EFAULT;
++ }
++
++ return 0;
++ }
++ }
++
++ return -ENOTTY;
++}
++
++#ifdef CONFIG_COMPAT
++long vhba_ctl_compat_ioctl (struct file *file, unsigned int cmd, unsigned long arg)
++{
++ unsigned long compat_arg = (unsigned long)compat_ptr(arg);
++ return vhba_ctl_ioctl(file, cmd, compat_arg);
++}
++#endif
++
++unsigned int vhba_ctl_poll (struct file *file, poll_table *wait)
++{
++ struct vhba_device *vdev = file->private_data;
++ unsigned int mask = 0;
++ unsigned long flags;
++
++ poll_wait(file, &vdev->cmd_wq, wait);
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ if (next_command(vdev)) {
++ mask |= POLLIN | POLLRDNORM;
++ }
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ return mask;
++}
++
++int vhba_ctl_open (struct inode *inode, struct file *file)
++{
++ struct vhba_device *vdev;
++ int retval;
++
++ pr_debug("ctl dev open\n");
++
++ /* check if vhba is probed */
++ if (!platform_get_drvdata(&vhba_platform_device)) {
++ return -ENODEV;
++ }
++
++ vdev = vhba_device_alloc();
++ if (!vdev) {
++ return -ENOMEM;
++ }
++
++ vdev->kbuf_size = VHBA_KBUF_SIZE;
++ vdev->kbuf = kzalloc(vdev->kbuf_size, GFP_KERNEL);
++ if (!vdev->kbuf) {
++ return -ENOMEM;
++ }
++
++ if (!(retval = vhba_add_device(vdev))) {
++ file->private_data = vdev;
++ }
++
++ vhba_device_put(vdev);
++
++ return retval;
++}
++
++int vhba_ctl_release (struct inode *inode, struct file *file)
++{
++ struct vhba_device *vdev;
++ struct vhba_command *vcmd;
++ unsigned long flags;
++
++ vdev = file->private_data;
++
++ pr_debug("ctl dev release\n");
++
++ vhba_device_get(vdev);
++ vhba_remove_device(vdev);
++
++ spin_lock_irqsave(&vdev->cmd_lock, flags);
++ list_for_each_entry(vcmd, &vdev->cmd_list, entry) {
++ WARN_ON(vcmd->status == VHBA_REQ_READING || vcmd->status == VHBA_REQ_WRITING);
++
++ scmd_dbg(vcmd->cmd, "device released with command %lu (%p)\n", vcmd->metatag, vcmd->cmd);
++ vcmd->cmd->result = DID_NO_CONNECT << 16;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
++ scsi_done(vcmd->cmd);
++#else
++ vcmd->cmd->scsi_done(vcmd->cmd);
++#endif
++ vhba_free_command(vcmd);
++ }
++ INIT_LIST_HEAD(&vdev->cmd_list);
++ spin_unlock_irqrestore(&vdev->cmd_lock, flags);
++
++ kfree(vdev->kbuf);
++ vdev->kbuf = NULL;
++
++ vhba_device_put(vdev);
++
++ return 0;
++}
++
++static struct file_operations vhba_ctl_fops = {
++ .owner = THIS_MODULE,
++ .open = vhba_ctl_open,
++ .release = vhba_ctl_release,
++ .read = vhba_ctl_read,
++ .write = vhba_ctl_write,
++ .poll = vhba_ctl_poll,
++ .unlocked_ioctl = vhba_ctl_ioctl,
++#ifdef CONFIG_COMPAT
++ .compat_ioctl = vhba_ctl_compat_ioctl,
++#endif
++};
++
++static struct miscdevice vhba_miscdev = {
++ .minor = MISC_DYNAMIC_MINOR,
++ .name = "vhba_ctl",
++ .fops = &vhba_ctl_fops,
++};
++
++int vhba_probe (struct platform_device *pdev)
++{
++ struct Scsi_Host *shost;
++ struct vhba_host *vhost;
++ int i;
++
++ vhba_can_queue = clamp(vhba_can_queue, 1, 256);
++
++ shost = scsi_host_alloc(&vhba_template, sizeof(struct vhba_host));
++ if (!shost) {
++ return -ENOMEM;
++ }
++
++ shost->max_channel = VHBA_MAX_BUS-1;
++ shost->max_id = VHBA_MAX_ID;
++ /* we don't support lun > 0 */
++ shost->max_lun = 1;
++ shost->max_cmd_len = MAX_COMMAND_SIZE;
++ shost->can_queue = vhba_can_queue;
++ shost->cmd_per_lun = vhba_can_queue;
++
++ vhost = (struct vhba_host *)shost->hostdata;
++ memset(vhost, 0, sizeof(struct vhba_host));
++
++ vhost->shost = shost;
++ vhost->num_devices = 0;
++ spin_lock_init(&vhost->dev_lock);
++ spin_lock_init(&vhost->cmd_lock);
++ INIT_WORK(&vhost->scan_devices, vhba_scan_devices);
++ vhost->cmd_next = 0;
++ vhost->commands = kzalloc(vhba_can_queue * sizeof(struct vhba_command), GFP_KERNEL);
++ if (!vhost->commands) {
++ return -ENOMEM;
++ }
++
++ for (i = 0; i < vhba_can_queue; i++) {
++ vhost->commands[i].status = VHBA_REQ_FREE;
++ }
++
++ platform_set_drvdata(pdev, vhost);
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
++ i = scsi_init_shared_tag_map(shost, vhba_can_queue);
++ if (i) return i;
++#endif
++
++ if (scsi_add_host(shost, &pdev->dev)) {
++ scsi_host_put(shost);
++ return -ENOMEM;
++ }
++
++ return 0;
++}
++
++int vhba_remove (struct platform_device *pdev)
++{
++ struct vhba_host *vhost;
++ struct Scsi_Host *shost;
++
++ vhost = platform_get_drvdata(pdev);
++ shost = vhost->shost;
++
++ scsi_remove_host(shost);
++ scsi_host_put(shost);
++
++ kfree(vhost->commands);
++
++ return 0;
++}
++
++void vhba_release (struct device * dev)
++{
++ return;
++}
++
++static struct platform_device vhba_platform_device = {
++ .name = "vhba",
++ .id = -1,
++ .dev = {
++ .release = vhba_release,
++ },
++};
++
++static struct platform_driver vhba_platform_driver = {
++ .driver = {
++ .owner = THIS_MODULE,
++ .name = "vhba",
++ },
++ .probe = vhba_probe,
++ .remove = vhba_remove,
++};
++
++int __init vhba_init (void)
++{
++ int ret;
++
++ ret = platform_device_register(&vhba_platform_device);
++ if (ret < 0) {
++ return ret;
++ }
++
++ ret = platform_driver_register(&vhba_platform_driver);
++ if (ret < 0) {
++ platform_device_unregister(&vhba_platform_device);
++ return ret;
++ }
++
++ ret = misc_register(&vhba_miscdev);
++ if (ret < 0) {
++ platform_driver_unregister(&vhba_platform_driver);
++ platform_device_unregister(&vhba_platform_device);
++ return ret;
++ }
++
++ return 0;
++}
++
++void __exit vhba_exit(void)
++{
++ misc_deregister(&vhba_miscdev);
++ platform_driver_unregister(&vhba_platform_driver);
++ platform_device_unregister(&vhba_platform_device);
++}
++
++module_init(vhba_init);
++module_exit(vhba_exit);
++
+--
+2.35.1
+
diff --git a/0003-ZEN-Add-OpenRGB-patches.patch b/0003-ZEN-Add-OpenRGB-patches.patch
new file mode 100644
index 000000000000..104f5cb62efc
--- /dev/null
+++ b/0003-ZEN-Add-OpenRGB-patches.patch
@@ -0,0 +1,748 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
+Date: Mon, 3 Aug 2020 21:18:53 +0200
+Subject: [PATCH] ZEN: Add OpenRGB patches
+
+Squashed commit of the following:
+
+commit 942ded8f8652a4b4e6b46d04938bb66f1eac4c78
+Author: Steven Barrett <steven@liquorix.net>
+Date: Sat Jul 4 21:28:54 2020 -0500
+
+ openrgb: Deduplicate piix4 setup for HUDSON2/KERNCZ SMBUS
+
+ In the original OpenRGB patches, the initialization code for CZ
+ secondary SMBus controllers was copied. Later, an upstream commit
+ landed in 5.7 stable that combined the initialization code for both
+ primary/secondary smbus channels.
+
+ Combine the initialization code ahead of time so upstream merges
+ correctly with OpenRGB.
+
+ Fixes: https://github.com/zen-kernel/zen-kernel/issues/176
+
+commit a65e3ecf90b24fd44689cc0713af602965ffaf4e
+Author: Steven Barrett <steven@liquorix.net>
+Date: Wed Jun 17 14:24:20 2020 -0500
+
+ Add OpenRGB patch - 0c45e26c
+
+ Source:
+ https://gitlab.com/CalcProgrammer1/OpenRGB/-/raw/master/OpenRGB.patch
+
+ History:
+ https://gitlab.com/CalcProgrammer1/OpenRGB/-/commits/master/OpenRGB.patch
+---
+ drivers/i2c/busses/Kconfig | 9 +
+ drivers/i2c/busses/Makefile | 1 +
+ drivers/i2c/busses/i2c-nct6775.c | 647 +++++++++++++++++++++++++++++++
+ drivers/i2c/busses/i2c-piix4.c | 4 +-
+ 4 files changed, 659 insertions(+), 2 deletions(-)
+ create mode 100644 drivers/i2c/busses/i2c-nct6775.c
+
+diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
+index 8a6c6ee28556..cf4c5e92738b 100644
+--- a/drivers/i2c/busses/Kconfig
++++ b/drivers/i2c/busses/Kconfig
+@@ -219,6 +219,15 @@ config I2C_CHT_WC
+ combined with a FUSB302 Type-C port-controller as such it is advised
+ to also select CONFIG_TYPEC_FUSB302=m.
+
++config I2C_NCT6775
++ tristate "Nuvoton NCT6775 and compatible SMBus controller"
++ help
++ If you say yes to this option, support will be included for the
++ Nuvoton NCT6775 and compatible SMBus controllers.
++
++ This driver can also be built as a module. If so, the module
++ will be called i2c-nct6775.
++
+ config I2C_NFORCE2
+ tristate "Nvidia nForce2, nForce3 and nForce4"
+ depends on PCI
+diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
+index 1d00dce77098..ec8a1197c8bc 100644
+--- a/drivers/i2c/busses/Makefile
++++ b/drivers/i2c/busses/Makefile
+@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
+ obj-$(CONFIG_I2C_I801) += i2c-i801.o
+ obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
+ obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
++obj-$(CONFIG_I2C_NCT6775) += i2c-nct6775.o
+ obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o
+ obj-$(CONFIG_I2C_NFORCE2_S4985) += i2c-nforce2-s4985.o
+ obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
+diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
+new file mode 100644
+index 000000000000..0462f0952043
+--- /dev/null
++++ b/drivers/i2c/busses/i2c-nct6775.c
+@@ -0,0 +1,647 @@
++/*
++ * i2c-nct6775 - Driver for the SMBus master functionality of
++ * Nuvoton NCT677x Super-I/O chips
++ *
++ * Copyright (C) 2019 Adam Honse <calcprogrammer1@gmail.com>
++ *
++ * Derived from nct6775 hwmon driver
++ * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/jiffies.h>
++#include <linux/platform_device.h>
++#include <linux/hwmon.h>
++#include <linux/hwmon-sysfs.h>
++#include <linux/hwmon-vid.h>
++#include <linux/err.h>
++#include <linux/mutex.h>
++#include <linux/delay.h>
++#include <linux/ioport.h>
++#include <linux/i2c.h>
++#include <linux/acpi.h>
++#include <linux/bitops.h>
++#include <linux/dmi.h>
++#include <linux/io.h>
++#include <linux/nospec.h>
++
++#define DRVNAME "i2c-nct6775"
++
++/* Nuvoton SMBus address offsets */
++#define SMBHSTDAT (0 + nuvoton_nct6793d_smba)
++#define SMBBLKSZ (1 + nuvoton_nct6793d_smba)
++#define SMBHSTCMD (2 + nuvoton_nct6793d_smba)
++#define SMBHSTIDX (3 + nuvoton_nct6793d_smba) //Index field is the Command field on other controllers
++#define SMBHSTCTL (4 + nuvoton_nct6793d_smba)
++#define SMBHSTADD (5 + nuvoton_nct6793d_smba)
++#define SMBHSTERR (9 + nuvoton_nct6793d_smba)
++#define SMBHSTSTS (0xE + nuvoton_nct6793d_smba)
++
++/* Command register */
++#define NCT6793D_READ_BYTE 0
++#define NCT6793D_READ_WORD 1
++#define NCT6793D_READ_BLOCK 2
++#define NCT6793D_BLOCK_WRITE_READ_PROC_CALL 3
++#define NCT6793D_PROC_CALL 4
++#define NCT6793D_WRITE_BYTE 8
++#define NCT6793D_WRITE_WORD 9
++#define NCT6793D_WRITE_BLOCK 10
++
++/* Control register */
++#define NCT6793D_MANUAL_START 128
++#define NCT6793D_SOFT_RESET 64
++
++/* Error register */
++#define NCT6793D_NO_ACK 32
++
++/* Status register */
++#define NCT6793D_FIFO_EMPTY 1
++#define NCT6793D_FIFO_FULL 2
++#define NCT6793D_MANUAL_ACTIVE 4
++
++#define NCT6775_LD_SMBUS 0x0B
++
++/* Other settings */
++#define MAX_RETRIES 400
++
++enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793,
++ nct6795, nct6796, nct6798 };
++
++struct nct6775_sio_data {
++ int sioreg;
++ enum kinds kind;
++};
++
++/* used to set data->name = nct6775_device_names[data->sio_kind] */
++static const char * const nct6775_device_names[] = {
++ "nct6106",
++ "nct6775",
++ "nct6776",
++ "nct6779",
++ "nct6791",
++ "nct6792",
++ "nct6793",
++ "nct6795",
++ "nct6796",
++ "nct6798",
++};
++
++static const char * const nct6775_sio_names[] __initconst = {
++ "NCT6106D",
++ "NCT6775F",
++ "NCT6776D/F",
++ "NCT6779D",
++ "NCT6791D",
++ "NCT6792D",
++ "NCT6793D",
++ "NCT6795D",
++ "NCT6796D",
++ "NCT6798D",
++};
++
++#define SIO_REG_LDSEL 0x07 /* Logical device select */
++#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */
++#define SIO_REG_SMBA 0x62 /* SMBus base address register */
++
++#define SIO_NCT6106_ID 0xc450
++#define SIO_NCT6775_ID 0xb470
++#define SIO_NCT6776_ID 0xc330
++#define SIO_NCT6779_ID 0xc560
++#define SIO_NCT6791_ID 0xc800
++#define SIO_NCT6792_ID 0xc910
++#define SIO_NCT6793_ID 0xd120
++#define SIO_NCT6795_ID 0xd350
++#define SIO_NCT6796_ID 0xd420
++#define SIO_NCT6798_ID 0xd428
++#define SIO_ID_MASK 0xFFF0
++
++static inline void
++superio_outb(int ioreg, int reg, int val)
++{
++ outb(reg, ioreg);
++ outb(val, ioreg + 1);
++}
++
++static inline int
++superio_inb(int ioreg, int reg)
++{
++ outb(reg, ioreg);
++ return inb(ioreg + 1);
++}
++
++static inline void
++superio_select(int ioreg, int ld)
++{
++ outb(SIO_REG_LDSEL, ioreg);
++ outb(ld, ioreg + 1);
++}
++
++static inline int
++superio_enter(int ioreg)
++{
++ /*
++ * Try to reserve <ioreg> and <ioreg + 1> for exclusive access.
++ */
++ if (!request_muxed_region(ioreg, 2, DRVNAME))
++ return -EBUSY;
++
++ outb(0x87, ioreg);
++ outb(0x87, ioreg);
++
++ return 0;
++}
++
++static inline void
++superio_exit(int ioreg)
++{
++ outb(0xaa, ioreg);
++ outb(0x02, ioreg);
++ outb(0x02, ioreg + 1);
++ release_region(ioreg, 2);
++}
++
++/*
++ * ISA constants
++ */
++
++#define IOREGION_ALIGNMENT (~7)
++#define IOREGION_LENGTH 2
++#define ADDR_REG_OFFSET 0
++#define DATA_REG_OFFSET 1
++
++#define NCT6775_REG_BANK 0x4E
++#define NCT6775_REG_CONFIG 0x40
++
++static struct i2c_adapter *nct6775_adapter;
++
++struct i2c_nct6775_adapdata {
++ unsigned short smba;
++};
++
++/* Return negative errno on error. */
++static s32 nct6775_access(struct i2c_adapter * adap, u16 addr,
++ unsigned short flags, char read_write,
++ u8 command, int size, union i2c_smbus_data * data)
++{
++ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
++ unsigned short nuvoton_nct6793d_smba = adapdata->smba;
++ int i, len, cnt;
++ union i2c_smbus_data tmp_data;
++ int timeout = 0;
++
++ tmp_data.word = 0;
++ cnt = 0;
++ len = 0;
++
++ outb_p(NCT6793D_SOFT_RESET, SMBHSTCTL);
++
++ switch (size) {
++ case I2C_SMBUS_QUICK:
++ outb_p((addr << 1) | read_write,
++ SMBHSTADD);
++ break;
++ case I2C_SMBUS_BYTE_DATA:
++ tmp_data.byte = data->byte;
++ case I2C_SMBUS_BYTE:
++ outb_p((addr << 1) | read_write,
++ SMBHSTADD);
++ outb_p(command, SMBHSTIDX);
++ if (read_write == I2C_SMBUS_WRITE) {
++ outb_p(tmp_data.byte, SMBHSTDAT);
++ outb_p(NCT6793D_WRITE_BYTE, SMBHSTCMD);
++ }
++ else {
++ outb_p(NCT6793D_READ_BYTE, SMBHSTCMD);
++ }
++ break;
++ case I2C_SMBUS_WORD_DATA:
++ outb_p((addr << 1) | read_write,
++ SMBHSTADD);
++ outb_p(command, SMBHSTIDX);
++ if (read_write == I2C_SMBUS_WRITE) {
++ outb_p(data->word & 0xff, SMBHSTDAT);
++ outb_p((data->word & 0xff00) >> 8, SMBHSTDAT);
++ outb_p(NCT6793D_WRITE_WORD, SMBHSTCMD);
++ }
++ else {
++ outb_p(NCT6793D_READ_WORD, SMBHSTCMD);
++ }
++ break;
++ case I2C_SMBUS_BLOCK_DATA:
++ outb_p((addr << 1) | read_write,
++ SMBHSTADD);
++ outb_p(command, SMBHSTIDX);
++ if (read_write == I2C_SMBUS_WRITE) {
++ len = data->block[0];
++ if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
++ return -EINVAL;
++ outb_p(len, SMBBLKSZ);
++
++ cnt = 1;
++ if (len >= 4) {
++ for (i = cnt; i <= 4; i++) {
++ outb_p(data->block[i], SMBHSTDAT);
++ }
++
++ len -= 4;
++ cnt += 4;
++ }
++ else {
++ for (i = cnt; i <= len; i++ ) {
++ outb_p(data->block[i], SMBHSTDAT);
++ }
++
++ len = 0;
++ }
++
++ outb_p(NCT6793D_WRITE_BLOCK, SMBHSTCMD);
++ }
++ else {
++ return -ENOTSUPP;
++ }
++ break;
++ default:
++ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
++ return -EOPNOTSUPP;
++ }
++
++ outb_p(NCT6793D_MANUAL_START, SMBHSTCTL);
++
++ while ((size == I2C_SMBUS_BLOCK_DATA) && (len > 0)) {
++ if (read_write == I2C_SMBUS_WRITE) {
++ timeout = 0;
++ while ((inb_p(SMBHSTSTS) & NCT6793D_FIFO_EMPTY) == 0)
++ {
++ if(timeout > MAX_RETRIES)
++ {
++ return -ETIMEDOUT;
++ }
++ usleep_range(250, 500);
++ timeout++;
++ }
++
++ //Load more bytes into FIFO
++ if (len >= 4) {
++ for (i = cnt; i <= (cnt + 4); i++) {
++ outb_p(data->block[i], SMBHSTDAT);
++ }
++
++ len -= 4;
++ cnt += 4;
++ }
++ else {
++ for (i = cnt; i <= (cnt + len); i++) {
++ outb_p(data->block[i], SMBHSTDAT);
++ }
++
++ len = 0;
++ }
++ }
++ else {
++ return -ENOTSUPP;
++ }
++
++ }
++
++ //wait for manual mode to complete
++ timeout = 0;
++ while ((inb_p(SMBHSTSTS) & NCT6793D_MANUAL_ACTIVE) != 0)
++ {
++ if(timeout > MAX_RETRIES)
++ {
++ return -ETIMEDOUT;
++ }
++ usleep_range(250, 500);
++ timeout++;
++ }
++
++ if ((inb_p(SMBHSTERR) & NCT6793D_NO_ACK) != 0) {
++ return -ENXIO;
++ }
++ else if ((read_write == I2C_SMBUS_WRITE) || (size == I2C_SMBUS_QUICK)) {
++ return 0;
++ }
++
++ switch (size) {
++ case I2C_SMBUS_QUICK:
++ case I2C_SMBUS_BYTE_DATA:
++ data->byte = inb_p(SMBHSTDAT);
++ break;
++ case I2C_SMBUS_WORD_DATA:
++ data->word = inb_p(SMBHSTDAT) + (inb_p(SMBHSTDAT) << 8);
++ break;
++ }
++ return 0;
++}
++
++static u32 nct6775_func(struct i2c_adapter *adapter)
++{
++ return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
++ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
++ I2C_FUNC_SMBUS_BLOCK_DATA;
++}
++
++static const struct i2c_algorithm smbus_algorithm = {
++ .smbus_xfer = nct6775_access,
++ .functionality = nct6775_func,
++};
++
++static int nct6775_add_adapter(unsigned short smba, const char *name, struct i2c_adapter **padap)
++{
++ struct i2c_adapter *adap;
++ struct i2c_nct6775_adapdata *adapdata;
++ int retval;
++
++ adap = kzalloc(sizeof(*adap), GFP_KERNEL);
++ if (adap == NULL) {
++ return -ENOMEM;
++ }
++
++ adap->owner = THIS_MODULE;
++ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
++ adap->algo = &smbus_algorithm;
++
++ adapdata = kzalloc(sizeof(*adapdata), GFP_KERNEL);
++ if (adapdata == NULL) {
++ kfree(adap);
++ return -ENOMEM;
++ }
++
++ adapdata->smba = smba;
++
++ snprintf(adap->name, sizeof(adap->name),
++ "SMBus NCT67xx adapter%s at %04x", name, smba);
++
++ i2c_set_adapdata(adap, adapdata);
++
++ retval = i2c_add_adapter(adap);
++ if (retval) {
++ kfree(adapdata);
++ kfree(adap);
++ return retval;
++ }
++
++ *padap = adap;
++ return 0;
++}
++
++static void nct6775_remove_adapter(struct i2c_adapter *adap)
++{
++ struct i2c_nct6775_adapdata *adapdata = i2c_get_adapdata(adap);
++
++ if (adapdata->smba) {
++ i2c_del_adapter(adap);
++ kfree(adapdata);
++ kfree(adap);
++ }
++}
++
++//static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
++
++/*
++ * when Super-I/O functions move to a separate file, the Super-I/O
++ * bus will manage the lifetime of the device and this module will only keep
++ * track of the nct6775 driver. But since we use platform_device_alloc(), we
++ * must keep track of the device
++ */
++static struct platform_device *pdev[2];
++
++static int nct6775_probe(struct platform_device *pdev)
++{
++ struct device *dev = &pdev->dev;
++ struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
++ struct resource *res;
++
++ res = platform_get_resource(pdev, IORESOURCE_IO, 0);
++ if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH,
++ DRVNAME))
++ return -EBUSY;
++
++ switch (sio_data->kind) {
++ case nct6791:
++ case nct6792:
++ case nct6793:
++ case nct6795:
++ case nct6796:
++ case nct6798:
++ nct6775_add_adapter(res->start, "", &nct6775_adapter);
++ break;
++ default:
++ return -ENODEV;
++ }
++
++ return 0;
++}
++/*
++static void nct6791_enable_io_mapping(int sioaddr)
++{
++ int val;
++
++ val = superio_inb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE);
++ if (val & 0x10) {
++ pr_info("Enabling hardware monitor logical device mappings.\n");
++ superio_outb(sioaddr, NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE,
++ val & ~0x10);
++ }
++}*/
++
++static struct platform_driver i2c_nct6775_driver = {
++ .driver = {
++ .name = DRVNAME,
++// .pm = &nct6775_dev_pm_ops,
++ },
++ .probe = nct6775_probe,
++};
++
++static void __exit i2c_nct6775_exit(void)
++{
++ int i;
++
++ if(nct6775_adapter)
++ nct6775_remove_adapter(nct6775_adapter);
++
++ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
++ if (pdev[i])
++ platform_device_unregister(pdev[i]);
++ }
++ platform_driver_unregister(&i2c_nct6775_driver);
++}
++
++/* nct6775_find() looks for a '627 in the Super-I/O config space */
++static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
++{
++ u16 val;
++ int err;
++ int addr;
++
++ err = superio_enter(sioaddr);
++ if (err)
++ return err;
++
++ val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
++ superio_inb(sioaddr, SIO_REG_DEVID + 1);
++
++ switch (val & SIO_ID_MASK) {
++ case SIO_NCT6106_ID:
++ sio_data->kind = nct6106;
++ break;
++ case SIO_NCT6775_ID:
++ sio_data->kind = nct6775;
++ break;
++ case SIO_NCT6776_ID:
++ sio_data->kind = nct6776;
++ break;
++ case SIO_NCT6779_ID:
++ sio_data->kind = nct6779;
++ break;
++ case SIO_NCT6791_ID:
++ sio_data->kind = nct6791;
++ break;
++ case SIO_NCT6792_ID:
++ sio_data->kind = nct6792;
++ break;
++ case SIO_NCT6793_ID:
++ sio_data->kind = nct6793;
++ break;
++ case SIO_NCT6795_ID:
++ sio_data->kind = nct6795;
++ break;
++ case SIO_NCT6796_ID:
++ sio_data->kind = nct6796;
++ break;
++ case SIO_NCT6798_ID:
++ sio_data->kind = nct6798;
++ break;
++ default:
++ if (val != 0xffff)
++ pr_debug("unsupported chip ID: 0x%04x\n", val);
++ superio_exit(sioaddr);
++ return -ENODEV;
++ }
++
++ /* We have a known chip, find the SMBus I/O address */
++ superio_select(sioaddr, NCT6775_LD_SMBUS);
++ val = (superio_inb(sioaddr, SIO_REG_SMBA) << 8)
++ | superio_inb(sioaddr, SIO_REG_SMBA + 1);
++ addr = val & IOREGION_ALIGNMENT;
++ if (addr == 0) {
++ pr_err("Refusing to enable a Super-I/O device with a base I/O port 0\n");
++ superio_exit(sioaddr);
++ return -ENODEV;
++ }
++
++ //if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
++ // sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
++ // sio_data->kind == nct6796)
++ // nct6791_enable_io_mapping(sioaddr);
++
++ superio_exit(sioaddr);
++ pr_info("Found %s or compatible chip at %#x:%#x\n",
++ nct6775_sio_names[sio_data->kind], sioaddr, addr);
++ sio_data->sioreg = sioaddr;
++
++ return addr;
++}
++
++static int __init i2c_nct6775_init(void)
++{
++ int i, err;
++ bool found = false;
++ int address;
++ struct resource res;
++ struct nct6775_sio_data sio_data;
++ int sioaddr[2] = { 0x2e, 0x4e };
++
++ err = platform_driver_register(&i2c_nct6775_driver);
++ if (err)
++ return err;
++
++ /*
++ * initialize sio_data->kind and sio_data->sioreg.
++ *
++ * when Super-I/O functions move to a separate file, the Super-I/O
++ * driver will probe 0x2e and 0x4e and auto-detect the presence of a
++ * nct6775 hardware monitor, and call probe()
++ */
++ for (i = 0; i < ARRAY_SIZE(pdev); i++) {
++ address = nct6775_find(sioaddr[i], &sio_data);
++ if (address <= 0)
++ continue;
++
++ found = true;
++
++ pdev[i] = platform_device_alloc(DRVNAME, address);
++ if (!pdev[i]) {
++ err = -ENOMEM;
++ goto exit_device_unregister;
++ }
++
++ err = platform_device_add_data(pdev[i], &sio_data,
++ sizeof(struct nct6775_sio_data));
++ if (err)
++ goto exit_device_put;
++
++ memset(&res, 0, sizeof(res));
++ res.name = DRVNAME;
++ res.start = address;
++ res.end = address + IOREGION_LENGTH - 1;
++ res.flags = IORESOURCE_IO;
++
++ err = acpi_check_resource_conflict(&res);
++ if (err) {
++ platform_device_put(pdev[i]);
++ pdev[i] = NULL;
++ continue;
++ }
++
++ err = platform_device_add_resources(pdev[i], &res, 1);
++ if (err)
++ goto exit_device_put;
++
++ /* platform_device_add calls probe() */
++ err = platform_device_add(pdev[i]);
++ if (err)
++ goto exit_device_put;
++ }
++ if (!found) {
++ err = -ENODEV;
++ goto exit_unregister;
++ }
++
++ return 0;
++
++exit_device_put:
++ platform_device_put(pdev[i]);
++exit_device_unregister:
++ while (--i >= 0) {
++ if (pdev[i])
++ platform_device_unregister(pdev[i]);
++ }
++exit_unregister:
++ platform_driver_unregister(&i2c_nct6775_driver);
++ return err;
++}
++
++MODULE_AUTHOR("Adam Honse <calcprogrammer1@gmail.com>");
++MODULE_DESCRIPTION("SMBus driver for NCT6775F and compatible chips");
++MODULE_LICENSE("GPL");
++
++module_init(i2c_nct6775_init);
++module_exit(i2c_nct6775_exit);
+diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
+index 8c1b31ed0c42..0b1b36fa0b71 100644
+--- a/drivers/i2c/busses/i2c-piix4.c
++++ b/drivers/i2c/busses/i2c-piix4.c
+@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
+ if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
+ usleep_range(2000, 2100);
+ else
+- usleep_range(250, 500);
++ usleep_range(25, 50);
+
+ while ((++timeout < MAX_TIMEOUT) &&
+ ((temp = inb_p(SMBHSTSTS)) & 0x01))
+- usleep_range(250, 500);
++ usleep_range(25, 50);
+
+ /* If the SMBus is still busy, we give up */
+ if (timeout == MAX_TIMEOUT) {
+--
+2.35.1
+
diff --git a/0006-ZEN-Disable-stack-conservation-for-GCC.patch b/0006-ZEN-Disable-stack-conservation-for-GCC.patch
new file mode 100644
index 000000000000..3d3f89344baf
--- /dev/null
+++ b/0006-ZEN-Disable-stack-conservation-for-GCC.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Sun, 8 Mar 2020 00:31:35 -0800
+Subject: [PATCH] ZEN: Disable stack conservation for GCC
+
+There's plenty of room on the stack for a few more inlined bytes here
+and there. The measured stack usage at runtime is still safe without
+this, and performance is surely improved at a microscopic level, so
+remove it.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ Makefile | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d77a8ca61656..d4dba8af1ac2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -984,11 +984,6 @@ KBUILD_CFLAGS += -fno-strict-overflow
+ # Make sure -fstack-check isn't enabled (like gentoo apparently did)
+ KBUILD_CFLAGS += -fno-stack-check
+
+-# conserve stack if available
+-ifdef CONFIG_CC_IS_GCC
+-KBUILD_CFLAGS += -fconserve-stack
+-endif
+-
+ # Prohibit date/time macros, which would make the build non-deterministic
+ KBUILD_CFLAGS += -Werror=date-time
+
+--
+2.35.1
+
diff --git a/0007-ZEN-Initialize-ata-before-graphics.patch b/0007-ZEN-Initialize-ata-before-graphics.patch
new file mode 100644
index 000000000000..952ddb4e306c
--- /dev/null
+++ b/0007-ZEN-Initialize-ata-before-graphics.patch
@@ -0,0 +1,50 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Arjan van de Ven <arjan@linux.intel.com>
+Date: Thu, 2 Jun 2016 23:36:32 -0500
+Subject: [PATCH] ZEN: Initialize ata before graphics
+
+ATA init is the long pole in the boot process, and its asynchronous.
+move the graphics init after it so that ata and graphics initialize
+in parallel
+---
+ drivers/Makefile | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/Makefile b/drivers/Makefile
+index a110338c860c..f91099276a78 100644
+--- a/drivers/Makefile
++++ b/drivers/Makefile
+@@ -59,15 +59,8 @@ obj-y += char/
+ # iommu/ comes before gpu as gpu are using iommu controllers
+ obj-y += iommu/
+
+-# gpu/ comes after char for AGP vs DRM startup and after iommu
+-obj-y += gpu/
+-
+ obj-$(CONFIG_CONNECTOR) += connector/
+
+-# i810fb and intelfb depend on char/agp/
+-obj-$(CONFIG_FB_I810) += video/fbdev/i810/
+-obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/
+-
+ obj-$(CONFIG_PARPORT) += parport/
+ obj-y += base/ block/ misc/ mfd/ nfc/
+ obj-$(CONFIG_LIBNVDIMM) += nvdimm/
+@@ -79,6 +72,14 @@ obj-y += macintosh/
+ obj-y += scsi/
+ obj-y += nvme/
+ obj-$(CONFIG_ATA) += ata/
++
++# gpu/ comes after char for AGP vs DRM startup and after iommu
++obj-y += gpu/
++
++# i810fb and intelfb depend on char/agp/
++obj-$(CONFIG_FB_I810) += video/fbdev/i810/
++obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/
++
+ obj-$(CONFIG_TARGET_CORE) += target/
+ obj-$(CONFIG_MTD) += mtd/
+ obj-$(CONFIG_SPI) += spi/
+--
+2.35.1
+
diff --git a/0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch b/0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch
new file mode 100644
index 000000000000..dbc1360bab79
--- /dev/null
+++ b/0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch
@@ -0,0 +1,110 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kenny Levinsen <kl@kl.wtf>
+Date: Sun, 27 Dec 2020 14:43:13 +0000
+Subject: [PATCH] ZEN: Input: evdev - use call_rcu when detaching client
+
+Significant time was spent on synchronize_rcu in evdev_detach_client
+when applications closed evdev devices. Switching VT away from a
+graphical environment commonly leads to mass input device closures,
+which could lead to noticable delays on systems with many input devices.
+
+Replace synchronize_rcu with call_rcu, deferring reclaim of the evdev
+client struct till after the RCU grace period instead of blocking the
+calling application.
+
+While this does not solve all slow evdev fd closures, it takes care of a
+good portion of them, including this simple test:
+
+ #include <fcntl.h>
+ #include <unistd.h>
+
+ int main(int argc, char *argv[])
+ {
+ int idx, fd;
+ const char *path = "/dev/input/event0";
+ for (idx = 0; idx < 1000; idx++) {
+ if ((fd = open(path, O_RDWR)) == -1) {
+ return -1;
+ }
+ close(fd);
+ }
+ return 0;
+ }
+
+Time to completion of above test when run locally:
+
+ Before: 0m27.111s
+ After: 0m0.018s
+
+Signed-off-by: Kenny Levinsen <kl@kl.wtf>
+---
+ drivers/input/evdev.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
+index 95f90699d2b1..2b10fe29d2c8 100644
+--- a/drivers/input/evdev.c
++++ b/drivers/input/evdev.c
+@@ -46,6 +46,7 @@ struct evdev_client {
+ struct fasync_struct *fasync;
+ struct evdev *evdev;
+ struct list_head node;
++ struct rcu_head rcu;
+ enum input_clock_type clk_type;
+ bool revoked;
+ unsigned long *evmasks[EV_CNT];
+@@ -377,13 +378,22 @@ static void evdev_attach_client(struct evdev *evdev,
+ spin_unlock(&evdev->client_lock);
+ }
+
++static void evdev_reclaim_client(struct rcu_head *rp)
++{
++ struct evdev_client *client = container_of(rp, struct evdev_client, rcu);
++ unsigned int i;
++ for (i = 0; i < EV_CNT; ++i)
++ bitmap_free(client->evmasks[i]);
++ kvfree(client);
++}
++
+ static void evdev_detach_client(struct evdev *evdev,
+ struct evdev_client *client)
+ {
+ spin_lock(&evdev->client_lock);
+ list_del_rcu(&client->node);
+ spin_unlock(&evdev->client_lock);
+- synchronize_rcu();
++ call_rcu(&client->rcu, evdev_reclaim_client);
+ }
+
+ static int evdev_open_device(struct evdev *evdev)
+@@ -436,7 +446,6 @@ static int evdev_release(struct inode *inode, struct file *file)
+ {
+ struct evdev_client *client = file->private_data;
+ struct evdev *evdev = client->evdev;
+- unsigned int i;
+
+ mutex_lock(&evdev->mutex);
+
+@@ -448,11 +457,6 @@ static int evdev_release(struct inode *inode, struct file *file)
+
+ evdev_detach_client(evdev, client);
+
+- for (i = 0; i < EV_CNT; ++i)
+- bitmap_free(client->evmasks[i]);
+-
+- kvfree(client);
+-
+ evdev_close_device(evdev);
+
+ return 0;
+@@ -495,7 +499,6 @@ static int evdev_open(struct inode *inode, struct file *file)
+
+ err_free_client:
+ evdev_detach_client(evdev, client);
+- kvfree(client);
+ return error;
+ }
+
+--
+2.35.1
+
diff --git a/0009-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0009-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
new file mode 100644
index 000000000000..ee3e1cf0abdb
--- /dev/null
+++ b/0009-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
@@ -0,0 +1,154 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 16 Sep 2019 04:53:20 +0200
+Subject: [PATCH] ZEN: Add sysctl and CONFIG to disallow unprivileged
+ CLONE_NEWUSER
+
+Our default behavior continues to match the vanilla kernel.
+---
+ include/linux/user_namespace.h | 4 ++++
+ init/Kconfig | 16 ++++++++++++++++
+ kernel/fork.c | 14 ++++++++++++++
+ kernel/sysctl.c | 12 ++++++++++++
+ kernel/user_namespace.c | 7 +++++++
+ 5 files changed, 53 insertions(+)
+
+diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
+index 33a4240e6a6f..82213f9c4c17 100644
+--- a/include/linux/user_namespace.h
++++ b/include/linux/user_namespace.h
+@@ -139,6 +139,8 @@ static inline void set_rlimit_ucount_max(struct user_namespace *ns,
+
+ #ifdef CONFIG_USER_NS
+
++extern int unprivileged_userns_clone;
++
+ static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
+ {
+ if (ns)
+@@ -172,6 +174,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns);
+ struct ns_common *ns_get_owner(struct ns_common *ns);
+ #else
+
++#define unprivileged_userns_clone 0
++
+ static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
+ {
+ return &init_user_ns;
+diff --git a/init/Kconfig b/init/Kconfig
+index 98b648e3cef6..2fce0d599a91 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1231,6 +1231,22 @@ config USER_NS
+
+ If unsure, say N.
+
++config USER_NS_UNPRIVILEGED
++ bool "Allow unprivileged users to create namespaces"
++ default y
++ depends on USER_NS
++ help
++ When disabled, unprivileged users will not be able to create
++ new namespaces. Allowing users to create their own namespaces
++ has been part of several recent local privilege escalation
++ exploits, so if you need user namespaces but are
++ paranoid^Wsecurity-conscious you want to disable this.
++
++ This setting can be overridden at runtime via the
++ kernel.unprivileged_userns_clone sysctl.
++
++ If unsure, say Y.
++
+ config PID_NS
+ bool "PID Namespaces"
+ default y
+diff --git a/kernel/fork.c b/kernel/fork.c
+index f1e89007f228..49144b49a3d1 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -98,6 +98,10 @@
+ #include <linux/io_uring.h>
+ #include <linux/bpf.h>
+
++#ifdef CONFIG_USER_NS
++#include <linux/user_namespace.h>
++#endif
++
+ #include <asm/pgalloc.h>
+ #include <linux/uaccess.h>
+ #include <asm/mmu_context.h>
+@@ -1922,6 +1926,10 @@ static __latent_entropy struct task_struct *copy_process(
+ if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
+ return ERR_PTR(-EINVAL);
+
++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
++ if (!capable(CAP_SYS_ADMIN))
++ return ERR_PTR(-EPERM);
++
+ /*
+ * Thread groups must share signals as well, and detached threads
+ * can only be started up within the thread group.
+@@ -3036,6 +3044,12 @@ int ksys_unshare(unsigned long unshare_flags)
+ if (unshare_flags & CLONE_NEWNS)
+ unshare_flags |= CLONE_FS;
+
++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
++ err = -EPERM;
++ if (!capable(CAP_SYS_ADMIN))
++ goto bad_unshare_out;
++ }
++
+ err = check_unshare_flags(unshare_flags);
+ if (err)
+ goto bad_unshare_out;
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c
+index 730ab56d9e92..6cf4e5c36ec9 100644
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
+@@ -91,6 +91,9 @@
+ #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
+ #include <linux/lockdep.h>
+ #endif
++#ifdef CONFIG_USER_NS
++#include <linux/user_namespace.h>
++#endif
+
+ #if defined(CONFIG_SYSCTL)
+
+@@ -1814,6 +1817,15 @@ static struct ctl_table kern_table[] = {
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
++#ifdef CONFIG_USER_NS
++ {
++ .procname = "unprivileged_userns_clone",
++ .data = &unprivileged_userns_clone,
++ .maxlen = sizeof(int),
++ .mode = 0644,
++ .proc_handler = proc_dointvec,
++ },
++#endif
+ #ifdef CONFIG_PROC_SYSCTL
+ {
+ .procname = "tainted",
+diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
+index 5481ba44a8d6..423ab2563ad7 100644
+--- a/kernel/user_namespace.c
++++ b/kernel/user_namespace.c
+@@ -21,6 +21,13 @@
+ #include <linux/bsearch.h>
+ #include <linux/sort.h>
+
++/* sysctl */
++#ifdef CONFIG_USER_NS_UNPRIVILEGED
++int unprivileged_userns_clone = 1;
++#else
++int unprivileged_userns_clone;
++#endif
++
+ static struct kmem_cache *user_ns_cachep __read_mostly;
+ static DEFINE_MUTEX(userns_state_mutex);
+
+--
+2.35.1
+
diff --git a/0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch b/0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch
new file mode 100644
index 000000000000..45af66c2cf5f
--- /dev/null
+++ b/0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch
@@ -0,0 +1,91 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 25 Nov 2019 22:53:25 +0100
+Subject: [PATCH] ZEN: Add CONFIG to rename the mq-deadline scheduler
+
+Increase ELV_NAME_MAX to 24 so we can support our longer IO scheduler names.
+---
+ block/Kconfig.iosched | 9 +++++++++
+ block/elevator.c | 4 ++++
+ block/elevator.h | 2 +-
+ block/mq-deadline.c | 9 +++++++++
+ 4 files changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
+index 615516146086..1c88a9279d17 100644
+--- a/block/Kconfig.iosched
++++ b/block/Kconfig.iosched
+@@ -7,6 +7,15 @@ config MQ_IOSCHED_DEADLINE
+ help
+ MQ version of the deadline IO scheduler.
+
++config MQ_IOSCHED_DEADLINE_NODEFAULT
++ bool "Rename mq-deadline scheduler to mq-deadline-nodefault"
++ depends on MQ_IOSCHED_DEADLINE
++ default n
++ help
++ This renames the mq-deadline scheduler to "mq-deadline-nodefault" and
++ also drops its alias of "deadline". This can prevent existing
++ userspace from forcing this scheduler over the kernel's choice.
++
+ config MQ_IOSCHED_KYBER
+ tristate "Kyber I/O scheduler"
+ default y
+diff --git a/block/elevator.c b/block/elevator.c
+index 482df2a350fc..b18f38f7e88a 100644
+--- a/block/elevator.c
++++ b/block/elevator.c
+@@ -642,7 +642,11 @@ static struct elevator_type *elevator_get_default(struct request_queue *q)
+ !blk_mq_is_shared_tags(q->tag_set->flags))
+ return NULL;
+
++#if defined(CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT)
++ return elevator_get(q, "mq-deadline-nodefault", false);
++#else
+ return elevator_get(q, "mq-deadline", false);
++#endif
+ }
+
+ /*
+diff --git a/block/elevator.h b/block/elevator.h
+index 16cd8bdedb7e..8d488775faaf 100644
+--- a/block/elevator.h
++++ b/block/elevator.h
+@@ -48,7 +48,7 @@ struct elevator_mq_ops {
+ void (*exit_icq)(struct io_cq *);
+ };
+
+-#define ELV_NAME_MAX (16)
++#define ELV_NAME_MAX (24)
+
+ struct elv_fs_entry {
+ struct attribute attr;
+diff --git a/block/mq-deadline.c b/block/mq-deadline.c
+index 3ed5eaf3446a..32a6c35de2f0 100644
+--- a/block/mq-deadline.c
++++ b/block/mq-deadline.c
+@@ -1147,12 +1147,21 @@ static struct elevator_type mq_deadline = {
+ .queue_debugfs_attrs = deadline_queue_debugfs_attrs,
+ #endif
+ .elevator_attrs = deadline_attrs,
++#ifdef CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
++ .elevator_name = "mq-deadline-nodefault",
++ .elevator_alias = "deadline-nodefault",
++#else
+ .elevator_name = "mq-deadline",
+ .elevator_alias = "deadline",
++#endif
+ .elevator_features = ELEVATOR_F_ZBD_SEQ_WRITE,
+ .elevator_owner = THIS_MODULE,
+ };
++#ifdef CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
++MODULE_ALIAS("mq-deadline-nodefault-iosched");
++#else
+ MODULE_ALIAS("mq-deadline-iosched");
++#endif
+
+ static int __init deadline_init(void)
+ {
+--
+2.35.1
+
diff --git a/0011-ZEN-intel-pstate-Implement-enable-parameter.patch b/0011-ZEN-intel-pstate-Implement-enable-parameter.patch
new file mode 100644
index 000000000000..8b70b48959c5
--- /dev/null
+++ b/0011-ZEN-intel-pstate-Implement-enable-parameter.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Wed, 15 Jan 2020 20:43:56 -0600
+Subject: [PATCH] ZEN: intel-pstate: Implement "enable" parameter
+
+If intel-pstate is compiled into the kernel, it will preempt the loading
+of acpi-cpufreq so you can take advantage of hardware p-states without
+any friction.
+
+However, intel-pstate is not completely superior to cpufreq's ondemand
+for one reason. There's no concept of an up_threshold property.
+
+In ondemand, up_threshold essentially reduces the maximum utilization to
+compare against, allowing you to hit max frequencies and turbo boost
+from a much lower core utilization.
+
+With intel-pstate, you have the concept of minimum and maximum
+performance, but no tunable that lets you define, maximum frequency
+means 50% core utilization. For just this oversight, there's reasons
+you may want ondemand.
+
+Lets support setting "enable" in kernel boot parameters. This lets
+kernel maintainers include "intel_pstate=disable" statically in the
+static boot parameters, but let users of the kernel override this
+selection.
+---
+ Documentation/admin-guide/kernel-parameters.txt | 3 +++
+ drivers/cpufreq/intel_pstate.c | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
+index 7123524a86b8..ac333f71ad29 100644
+--- a/Documentation/admin-guide/kernel-parameters.txt
++++ b/Documentation/admin-guide/kernel-parameters.txt
+@@ -1999,6 +1999,9 @@
+ disable
+ Do not enable intel_pstate as the default
+ scaling driver for the supported processors
++ enable
++ Enable intel_pstate in-case "disable" was passed
++ previously in the kernel boot parameters
+ passive
+ Use intel_pstate as a scaling driver, but configure it
+ to work with generic cpufreq governors (instead of
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
+index bc7f7e6759bd..a8c3779e1857 100644
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -3512,6 +3512,8 @@ static int __init intel_pstate_setup(char *str)
+
+ if (!strcmp(str, "disable"))
+ no_load = 1;
++ else if (!strcmp(str, "enable"))
++ no_load = 0;
+ else if (!strcmp(str, "active"))
+ default_driver = &intel_pstate;
+ else if (!strcmp(str, "passive"))
+--
+2.35.1
+
diff --git a/0012-ZEN-Add-ACS-override-support.patch b/0012-ZEN-Add-ACS-override-support.patch
new file mode 100644
index 000000000000..e4934a6ec730
--- /dev/null
+++ b/0012-ZEN-Add-ACS-override-support.patch
@@ -0,0 +1,153 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Sat, 30 Jan 2021 11:34:18 -0600
+Subject: [PATCH] ZEN: Add ACS override support
+
+Source: https://gitlab.com/Queuecumber/linux-acs-override/-/raw/master/workspaces/5.10.4/acso.patch
+---
+ .../admin-guide/kernel-parameters.txt | 9 ++
+ drivers/pci/quirks.c | 101 ++++++++++++++++++
+ 2 files changed, 110 insertions(+)
+
+diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
+index ac333f71ad29..c940cadc992d 100644
+--- a/Documentation/admin-guide/kernel-parameters.txt
++++ b/Documentation/admin-guide/kernel-parameters.txt
+@@ -3941,6 +3941,15 @@
+ nomsi [MSI] If the PCI_MSI kernel config parameter is
+ enabled, this kernel boot option can be used to
+ disable the use of MSI interrupts system-wide.
++ pcie_acs_override =
++ [PCIE] Override missing PCIe ACS support for:
++ downstream
++ All downstream ports - full ACS capabilities
++ multfunction
++ All multifunction devices - multifunction ACS subset
++ id:nnnn:nnnn
++ Specfic device - full ACS capabilities
++ Specified as vid:did (vendor/device ID) in hex
+ noioapicquirk [APIC] Disable all boot interrupt quirks.
+ Safety option to keep boot IRQs enabled. This
+ should never be necessary.
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index 65f7f6b0576c..1f184327fbe3 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -3588,6 +3588,106 @@ static void quirk_no_bus_reset(struct pci_dev *dev)
+ dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
+ }
+
++static bool acs_on_downstream;
++static bool acs_on_multifunction;
++
++#define NUM_ACS_IDS 16
++struct acs_on_id {
++ unsigned short vendor;
++ unsigned short device;
++};
++static struct acs_on_id acs_on_ids[NUM_ACS_IDS];
++static u8 max_acs_id;
++
++static __init int pcie_acs_override_setup(char *p)
++{
++ if (!p)
++ return -EINVAL;
++
++ while (*p) {
++ if (!strncmp(p, "downstream", 10))
++ acs_on_downstream = true;
++ if (!strncmp(p, "multifunction", 13))
++ acs_on_multifunction = true;
++ if (!strncmp(p, "id:", 3)) {
++ char opt[5];
++ int ret;
++ long val;
++
++ if (max_acs_id >= NUM_ACS_IDS - 1) {
++ pr_warn("Out of PCIe ACS override slots (%d)\n",
++ NUM_ACS_IDS);
++ goto next;
++ }
++
++ p += 3;
++ snprintf(opt, 5, "%s", p);
++ ret = kstrtol(opt, 16, &val);
++ if (ret) {
++ pr_warn("PCIe ACS ID parse error %d\n", ret);
++ goto next;
++ }
++ acs_on_ids[max_acs_id].vendor = val;
++
++ p += strcspn(p, ":");
++ if (*p != ':') {
++ pr_warn("PCIe ACS invalid ID\n");
++ goto next;
++ }
++
++ p++;
++ snprintf(opt, 5, "%s", p);
++ ret = kstrtol(opt, 16, &val);
++ if (ret) {
++ pr_warn("PCIe ACS ID parse error %d\n", ret);
++ goto next;
++ }
++ acs_on_ids[max_acs_id].device = val;
++ max_acs_id++;
++ }
++next:
++ p += strcspn(p, ",");
++ if (*p == ',')
++ p++;
++ }
++
++ if (acs_on_downstream || acs_on_multifunction || max_acs_id)
++ pr_warn("Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA\n");
++
++ return 0;
++}
++early_param("pcie_acs_override", pcie_acs_override_setup);
++
++static int pcie_acs_overrides(struct pci_dev *dev, u16 acs_flags)
++{
++ int i;
++
++ /* Never override ACS for legacy devices or devices with ACS caps */
++ if (!pci_is_pcie(dev) ||
++ pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS))
++ return -ENOTTY;
++
++ for (i = 0; i < max_acs_id; i++)
++ if (acs_on_ids[i].vendor == dev->vendor &&
++ acs_on_ids[i].device == dev->device)
++ return 1;
++
++ switch (pci_pcie_type(dev)) {
++ case PCI_EXP_TYPE_DOWNSTREAM:
++ case PCI_EXP_TYPE_ROOT_PORT:
++ if (acs_on_downstream)
++ return 1;
++ break;
++ case PCI_EXP_TYPE_ENDPOINT:
++ case PCI_EXP_TYPE_UPSTREAM:
++ case PCI_EXP_TYPE_LEG_END:
++ case PCI_EXP_TYPE_RC_END:
++ if (acs_on_multifunction && dev->multifunction)
++ return 1;
++ }
++
++ return -ENOTTY;
++}
+ /*
+ * Some NVIDIA GPU devices do not work with bus reset, SBR needs to be
+ * prevented for those affected devices.
+@@ -4953,6 +5053,7 @@ static const struct pci_dev_acs_enabled {
+ { PCI_VENDOR_ID_NXP, 0x8d9b, pci_quirk_nxp_rp_acs },
+ /* Zhaoxin Root/Downstream Ports */
+ { PCI_VENDOR_ID_ZHAOXIN, PCI_ANY_ID, pci_quirk_zhaoxin_pcie_ports_acs },
++ { PCI_ANY_ID, PCI_ANY_ID, pcie_acs_overrides },
+ { 0 }
+ };
+
+--
+2.35.1
+
diff --git a/0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch b/0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch
new file mode 100644
index 000000000000..55f26861d040
--- /dev/null
+++ b/0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch
@@ -0,0 +1,640 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Daniel Drake <drake@endlessm.com>
+Date: Tue, 4 Jun 2019 14:51:21 +0800
+Subject: [PATCH] ZEN: PCI: Add Intel remapped NVMe device support
+
+Contains:
+ - PCI: Add Intel remapped NVMe device support
+
+ Consumer products that are configured by default to run the Intel SATA AHCI
+ controller in "RAID" or "Intel RST Premium With Intel Optane System
+ Acceleration" mode are becoming increasingly prevalent.
+
+ Unde this mode, NVMe devices are remapped into the SATA device and become
+ hidden from the PCI bus, which means that Linux users cannot access their
+ storage devices unless they go into the firmware setup menu to revert back
+ to AHCI mode - assuming such option is available. Lack of support for this
+ mode is also causing complications for vendors who distribute Linux.
+
+ Add support for the remapped NVMe mode by creating a virtual PCI bus,
+ where the AHCI and NVMe devices are presented separately, allowing the
+ ahci and nvme drivers to bind in the normal way.
+
+ Unfortunately the NVMe device configuration space is inaccesible under
+ this scheme, so we provide a fake one, and hope that no DeviceID-based
+ quirks are needed. The interrupt is shared between the AHCI and NVMe
+ devices.
+
+ Allow pci_real_dma_dev() to traverse back to the real DMA device from
+ the PCI devices created on our virtual bus, in case the iommu driver
+ will be involved with data transfers here.
+
+ The existing ahci driver is modified to not claim devices where remapped
+ NVMe devices are present, allowing this new driver to step in.
+
+ The details of the remapping scheme came from patches previously
+ posted by Dan Williams and the resulting discussion.
+
+ https://phabricator.endlessm.com/T24358
+ https://phabricator.endlessm.com/T29119
+
+ Signed-off-by: Daniel Drake <drake@endlessm.com>
+
+ - PCI: Fix order of remapped NVMe devices
+---
+ arch/x86/include/asm/pci.h | 6 +
+ arch/x86/pci/common.c | 7 +-
+ drivers/ata/ahci.c | 23 +-
+ drivers/pci/controller/Makefile | 6 +
+ drivers/pci/controller/intel-nvme-remap.c | 462 ++++++++++++++++++++++
+ 5 files changed, 488 insertions(+), 16 deletions(-)
+ create mode 100644 drivers/pci/controller/intel-nvme-remap.c
+
+diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
+index d2c76c8d8cfd..47c3b333f2c6 100644
+--- a/arch/x86/include/asm/pci.h
++++ b/arch/x86/include/asm/pci.h
+@@ -27,6 +27,7 @@ struct pci_sysdata {
+ #if IS_ENABLED(CONFIG_VMD)
+ struct pci_dev *vmd_dev; /* VMD Device if in Intel VMD domain */
+ #endif
++ struct pci_dev *nvme_remap_dev; /* AHCI Device if NVME remapped bus */
+ };
+
+ extern int pci_routeirq;
+@@ -70,6 +71,11 @@ static inline bool is_vmd(struct pci_bus *bus)
+ #define is_vmd(bus) false
+ #endif /* CONFIG_VMD */
+
++static inline bool is_nvme_remap(struct pci_bus *bus)
++{
++ return to_pci_sysdata(bus)->nvme_remap_dev != NULL;
++}
++
+ /* Can be used to override the logic in pci_scan_bus for skipping
+ already-configured bus numbers - to be used for buggy BIOSes
+ or architectures with incomplete PCI setup by the loader */
+diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
+index 9e1e6b8d8876..5cef919e26b6 100644
+--- a/arch/x86/pci/common.c
++++ b/arch/x86/pci/common.c
+@@ -715,12 +715,15 @@ int pci_ext_cfg_avail(void)
+ return 0;
+ }
+
+-#if IS_ENABLED(CONFIG_VMD)
+ struct pci_dev *pci_real_dma_dev(struct pci_dev *dev)
+ {
++#if IS_ENABLED(CONFIG_VMD)
+ if (is_vmd(dev->bus))
+ return to_pci_sysdata(dev->bus)->vmd_dev;
++#endif
++
++ if (is_nvme_remap(dev->bus))
++ return to_pci_sysdata(dev->bus)->nvme_remap_dev;
+
+ return dev;
+ }
+-#endif
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
+index ab5811ef5a53..50c37f27cd91 100644
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -1499,7 +1499,7 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance)
+ }
+ #endif
+
+-static void ahci_remap_check(struct pci_dev *pdev, int bar,
++static int ahci_remap_check(struct pci_dev *pdev, int bar,
+ struct ahci_host_priv *hpriv)
+ {
+ int i;
+@@ -1512,7 +1512,7 @@ static void ahci_remap_check(struct pci_dev *pdev, int bar,
+ pci_resource_len(pdev, bar) < SZ_512K ||
+ bar != AHCI_PCI_BAR_STANDARD ||
+ !(readl(hpriv->mmio + AHCI_VSCAP) & 1))
+- return;
++ return 0;
+
+ cap = readq(hpriv->mmio + AHCI_REMAP_CAP);
+ for (i = 0; i < AHCI_MAX_REMAP; i++) {
+@@ -1527,18 +1527,11 @@ static void ahci_remap_check(struct pci_dev *pdev, int bar,
+ }
+
+ if (!hpriv->remapped_nvme)
+- return;
+-
+- dev_warn(&pdev->dev, "Found %u remapped NVMe devices.\n",
+- hpriv->remapped_nvme);
+- dev_warn(&pdev->dev,
+- "Switch your BIOS from RAID to AHCI mode to use them.\n");
++ return 0;
+
+- /*
+- * Don't rely on the msi-x capability in the remap case,
+- * share the legacy interrupt across ahci and remapped devices.
+- */
+- hpriv->flags |= AHCI_HFLAG_NO_MSI;
++ /* Abort probe, allowing intel-nvme-remap to step in when available */
++ dev_info(&pdev->dev, "Device will be handled by intel-nvme-remap.\n");
++ return -ENODEV;
+ }
+
+ static int ahci_get_irq_vector(struct ata_host *host, int port)
+@@ -1761,7 +1754,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar];
+
+ /* detect remapped nvme devices */
+- ahci_remap_check(pdev, ahci_pci_bar, hpriv);
++ rc = ahci_remap_check(pdev, ahci_pci_bar, hpriv);
++ if (rc)
++ return rc;
+
+ sysfs_add_file_to_group(&pdev->dev.kobj,
+ &dev_attr_remapped_nvme.attr,
+diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile
+index 37c8663de7fe..897d19f92ede 100644
+--- a/drivers/pci/controller/Makefile
++++ b/drivers/pci/controller/Makefile
+@@ -1,4 +1,10 @@
+ # SPDX-License-Identifier: GPL-2.0
++ifdef CONFIG_X86_64
++ifdef CONFIG_SATA_AHCI
++obj-y += intel-nvme-remap.o
++endif
++endif
++
+ obj-$(CONFIG_PCIE_CADENCE) += cadence/
+ obj-$(CONFIG_PCI_FTPCI100) += pci-ftpci100.o
+ obj-$(CONFIG_PCI_IXP4XX) += pci-ixp4xx.o
+diff --git a/drivers/pci/controller/intel-nvme-remap.c b/drivers/pci/controller/intel-nvme-remap.c
+new file mode 100644
+index 000000000000..e105e6f5cc91
+--- /dev/null
++++ b/drivers/pci/controller/intel-nvme-remap.c
+@@ -0,0 +1,462 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * Intel remapped NVMe device support.
++ *
++ * Copyright (c) 2019 Endless Mobile, Inc.
++ * Author: Daniel Drake <drake@endlessm.com>
++ *
++ * Some products ship by default with the SATA controller in "RAID" or
++ * "Intel RST Premium With Intel Optane System Acceleration" mode. Under this
++ * mode, which we refer to as "remapped NVMe" mode, any installed NVMe
++ * devices disappear from the PCI bus, and instead their I/O memory becomes
++ * available within the AHCI device BARs.
++ *
++ * This scheme is understood to be a way of avoiding usage of the standard
++ * Windows NVMe driver under that OS, instead mandating usage of Intel's
++ * driver instead, which has better power management, and presumably offers
++ * some RAID/disk-caching solutions too.
++ *
++ * Here in this driver, we support the remapped NVMe mode by claiming the
++ * AHCI device and creating a fake PCIe root port. On the new bus, the
++ * original AHCI device is exposed with only minor tweaks. Then, fake PCI
++ * devices corresponding to the remapped NVMe devices are created. The usual
++ * ahci and nvme drivers are then expected to bind to these devices and
++ * operate as normal.
++ *
++ * The PCI configuration space for the NVMe devices is completely
++ * unavailable, so we fake a minimal one and hope for the best.
++ *
++ * Interrupts are shared between the AHCI and NVMe devices. For simplicity,
++ * we only support the legacy interrupt here, although MSI support
++ * could potentially be added later.
++ */
++
++#define MODULE_NAME "intel-nvme-remap"
++
++#include <linux/ahci-remap.h>
++#include <linux/irq.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/pci.h>
++
++#define AHCI_PCI_BAR_STANDARD 5
++
++struct nvme_remap_dev {
++ struct pci_dev *dev; /* AHCI device */
++ struct pci_bus *bus; /* our fake PCI bus */
++ struct pci_sysdata sysdata;
++ int irq_base; /* our fake interrupts */
++
++ /*
++ * When we detect an all-ones write to a BAR register, this flag
++ * is set, so that we return the BAR size on the next read (a
++ * standard PCI behaviour).
++ * This includes the assumption that an all-ones BAR write is
++ * immediately followed by a read of the same register.
++ */
++ bool bar_sizing;
++
++ /*
++ * Resources copied from the AHCI device, to be regarded as
++ * resources on our fake bus.
++ */
++ struct resource ahci_resources[PCI_NUM_RESOURCES];
++
++ /* Resources corresponding to the NVMe devices. */
++ struct resource remapped_dev_mem[AHCI_MAX_REMAP];
++
++ /* Number of remapped NVMe devices found. */
++ int num_remapped_devices;
++};
++
++static inline struct nvme_remap_dev *nrdev_from_bus(struct pci_bus *bus)
++{
++ return container_of(bus->sysdata, struct nvme_remap_dev, sysdata);
++}
++
++
++/******** PCI configuration space **********/
++
++/*
++ * Helper macros for tweaking returned contents of PCI configuration space.
++ *
++ * value contains len bytes of data read from reg.
++ * If fixup_reg is included in that range, fix up the contents of that
++ * register to fixed_value.
++ */
++#define NR_FIX8(fixup_reg, fixed_value) do { \
++ if (reg <= fixup_reg && fixup_reg < reg + len) \
++ ((u8 *) value)[fixup_reg - reg] = (u8) (fixed_value); \
++ } while (0)
++
++#define NR_FIX16(fixup_reg, fixed_value) do { \
++ NR_FIX8(fixup_reg, fixed_value); \
++ NR_FIX8(fixup_reg + 1, fixed_value >> 8); \
++ } while (0)
++
++#define NR_FIX24(fixup_reg, fixed_value) do { \
++ NR_FIX8(fixup_reg, fixed_value); \
++ NR_FIX8(fixup_reg + 1, fixed_value >> 8); \
++ NR_FIX8(fixup_reg + 2, fixed_value >> 16); \
++ } while (0)
++
++#define NR_FIX32(fixup_reg, fixed_value) do { \
++ NR_FIX16(fixup_reg, (u16) fixed_value); \
++ NR_FIX16(fixup_reg + 2, fixed_value >> 16); \
++ } while (0)
++
++/*
++ * Read PCI config space of the slot 0 (AHCI) device.
++ * We pass through the read request to the underlying device, but
++ * tweak the results in some cases.
++ */
++static int nvme_remap_pci_read_slot0(struct pci_bus *bus, int reg,
++ int len, u32 *value)
++{
++ struct nvme_remap_dev *nrdev = nrdev_from_bus(bus);
++ struct pci_bus *ahci_dev_bus = nrdev->dev->bus;
++ int ret;
++
++ ret = ahci_dev_bus->ops->read(ahci_dev_bus, nrdev->dev->devfn,
++ reg, len, value);
++ if (ret)
++ return ret;
++
++ /*
++ * Adjust the device class, to prevent this driver from attempting to
++ * additionally probe the device we're simulating here.
++ */
++ NR_FIX24(PCI_CLASS_PROG, PCI_CLASS_STORAGE_SATA_AHCI);
++
++ /*
++ * Unset interrupt pin, otherwise ACPI tries to find routing
++ * info for our virtual IRQ, fails, and complains.
++ */
++ NR_FIX8(PCI_INTERRUPT_PIN, 0);
++
++ /*
++ * Truncate the AHCI BAR to not include the region that covers the
++ * hidden devices. This will cause the ahci driver to successfully
++ * probe th new device (instead of handing it over to this driver).
++ */
++ if (nrdev->bar_sizing) {
++ NR_FIX32(PCI_BASE_ADDRESS_5, ~(SZ_16K - 1));
++ nrdev->bar_sizing = false;
++ }
++
++ return PCIBIOS_SUCCESSFUL;
++}
++
++/*
++ * Read PCI config space of a remapped device.
++ * Since the original PCI config space is inaccessible, we provide a minimal,
++ * fake config space instead.
++ */
++static int nvme_remap_pci_read_remapped(struct pci_bus *bus, unsigned int port,
++ int reg, int len, u32 *value)
++{
++ struct nvme_remap_dev *nrdev = nrdev_from_bus(bus);
++ struct resource *remapped_mem;
++
++ if (port > nrdev->num_remapped_devices)
++ return PCIBIOS_DEVICE_NOT_FOUND;
++
++ *value = 0;
++ remapped_mem = &nrdev->remapped_dev_mem[port - 1];
++
++ /* Set a Vendor ID, otherwise Linux assumes no device is present */
++ NR_FIX16(PCI_VENDOR_ID, PCI_VENDOR_ID_INTEL);
++
++ /* Always appear on & bus mastering */
++ NR_FIX16(PCI_COMMAND, PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
++
++ /* Set class so that nvme driver probes us */
++ NR_FIX24(PCI_CLASS_PROG, PCI_CLASS_STORAGE_EXPRESS);
++
++ if (nrdev->bar_sizing) {
++ NR_FIX32(PCI_BASE_ADDRESS_0,
++ ~(resource_size(remapped_mem) - 1));
++ nrdev->bar_sizing = false;
++ } else {
++ resource_size_t mem_start = remapped_mem->start;
++
++ mem_start |= PCI_BASE_ADDRESS_MEM_TYPE_64;
++ NR_FIX32(PCI_BASE_ADDRESS_0, mem_start);
++ mem_start >>= 32;
++ NR_FIX32(PCI_BASE_ADDRESS_1, mem_start);
++ }
++
++ return PCIBIOS_SUCCESSFUL;
++}
++
++/* Read PCI configuration space. */
++static int nvme_remap_pci_read(struct pci_bus *bus, unsigned int devfn,
++ int reg, int len, u32 *value)
++{
++ if (PCI_SLOT(devfn) == 0)
++ return nvme_remap_pci_read_slot0(bus, reg, len, value);
++ else
++ return nvme_remap_pci_read_remapped(bus, PCI_SLOT(devfn),
++ reg, len, value);
++}
++
++/*
++ * Write PCI config space of the slot 0 (AHCI) device.
++ * Apart from the special case of BAR sizing, we disable all writes.
++ * Otherwise, the ahci driver could make changes (e.g. unset PCI bus master)
++ * that would affect the operation of the NVMe devices.
++ */
++static int nvme_remap_pci_write_slot0(struct pci_bus *bus, int reg,
++ int len, u32 value)
++{
++ struct nvme_remap_dev *nrdev = nrdev_from_bus(bus);
++ struct pci_bus *ahci_dev_bus = nrdev->dev->bus;
++
++ if (reg >= PCI_BASE_ADDRESS_0 && reg <= PCI_BASE_ADDRESS_5) {
++ /*
++ * Writing all-ones to a BAR means that the size of the
++ * memory region is being checked. Flag this so that we can
++ * reply with an appropriate size on the next read.
++ */
++ if (value == ~0)
++ nrdev->bar_sizing = true;
++
++ return ahci_dev_bus->ops->write(ahci_dev_bus,
++ nrdev->dev->devfn,
++ reg, len, value);
++ }
++
++ return PCIBIOS_SET_FAILED;
++}
++
++/*
++ * Write PCI config space of a remapped device.
++ * Since the original PCI config space is inaccessible, we reject all
++ * writes, except for the special case of BAR probing.
++ */
++static int nvme_remap_pci_write_remapped(struct pci_bus *bus,
++ unsigned int port,
++ int reg, int len, u32 value)
++{
++ struct nvme_remap_dev *nrdev = nrdev_from_bus(bus);
++
++ if (port > nrdev->num_remapped_devices)
++ return PCIBIOS_DEVICE_NOT_FOUND;
++
++ /*
++ * Writing all-ones to a BAR means that the size of the memory
++ * region is being checked. Flag this so that we can reply with
++ * an appropriate size on the next read.
++ */
++ if (value == ~0 && reg >= PCI_BASE_ADDRESS_0
++ && reg <= PCI_BASE_ADDRESS_5) {
++ nrdev->bar_sizing = true;
++ return PCIBIOS_SUCCESSFUL;
++ }
++
++ return PCIBIOS_SET_FAILED;
++}
++
++/* Write PCI configuration space. */
++static int nvme_remap_pci_write(struct pci_bus *bus, unsigned int devfn,
++ int reg, int len, u32 value)
++{
++ if (PCI_SLOT(devfn) == 0)
++ return nvme_remap_pci_write_slot0(bus, reg, len, value);
++ else
++ return nvme_remap_pci_write_remapped(bus, PCI_SLOT(devfn),
++ reg, len, value);
++}
++
++static struct pci_ops nvme_remap_pci_ops = {
++ .read = nvme_remap_pci_read,
++ .write = nvme_remap_pci_write,
++};
++
++
++/******** Initialization & exit **********/
++
++/*
++ * Find a PCI domain ID to use for our fake bus.
++ * Start at 0x10000 to not clash with ACPI _SEG domains (16 bits).
++ */
++static int find_free_domain(void)
++{
++ int domain = 0xffff;
++ struct pci_bus *bus = NULL;
++
++ while ((bus = pci_find_next_bus(bus)) != NULL)
++ domain = max_t(int, domain, pci_domain_nr(bus));
++
++ return domain + 1;
++}
++
++static int find_remapped_devices(struct nvme_remap_dev *nrdev,
++ struct list_head *resources)
++{
++ void __iomem *mmio;
++ int i, count = 0;
++ u32 cap;
++
++ mmio = pcim_iomap(nrdev->dev, AHCI_PCI_BAR_STANDARD,
++ pci_resource_len(nrdev->dev,
++ AHCI_PCI_BAR_STANDARD));
++ if (!mmio)
++ return -ENODEV;
++
++ /* Check if this device might have remapped nvme devices. */
++ if (pci_resource_len(nrdev->dev, AHCI_PCI_BAR_STANDARD) < SZ_512K ||
++ !(readl(mmio + AHCI_VSCAP) & 1))
++ return -ENODEV;
++
++ cap = readq(mmio + AHCI_REMAP_CAP);
++ for (i = AHCI_MAX_REMAP-1; i >= 0; i--) {
++ struct resource *remapped_mem;
++
++ if ((cap & (1 << i)) == 0)
++ continue;
++ if (readl(mmio + ahci_remap_dcc(i))
++ != PCI_CLASS_STORAGE_EXPRESS)
++ continue;
++
++ /* We've found a remapped device */
++ remapped_mem = &nrdev->remapped_dev_mem[count++];
++ remapped_mem->start =
++ pci_resource_start(nrdev->dev, AHCI_PCI_BAR_STANDARD)
++ + ahci_remap_base(i);
++ remapped_mem->end = remapped_mem->start
++ + AHCI_REMAP_N_SIZE - 1;
++ remapped_mem->flags = IORESOURCE_MEM | IORESOURCE_PCI_FIXED;
++ pci_add_resource(resources, remapped_mem);
++ }
++
++ pcim_iounmap(nrdev->dev, mmio);
++
++ if (count == 0)
++ return -ENODEV;
++
++ nrdev->num_remapped_devices = count;
++ dev_info(&nrdev->dev->dev, "Found %d remapped NVMe devices\n",
++ nrdev->num_remapped_devices);
++ return 0;
++}
++
++static void nvme_remap_remove_root_bus(void *data)
++{
++ struct pci_bus *bus = data;
++
++ pci_stop_root_bus(bus);
++ pci_remove_root_bus(bus);
++}
++
++static int nvme_remap_probe(struct pci_dev *dev,
++ const struct pci_device_id *id)
++{
++ struct nvme_remap_dev *nrdev;
++ LIST_HEAD(resources);
++ int i;
++ int ret;
++ struct pci_dev *child;
++
++ nrdev = devm_kzalloc(&dev->dev, sizeof(*nrdev), GFP_KERNEL);
++ nrdev->sysdata.domain = find_free_domain();
++ nrdev->sysdata.nvme_remap_dev = dev;
++ nrdev->dev = dev;
++ pci_set_drvdata(dev, nrdev);
++
++ ret = pcim_enable_device(dev);
++ if (ret < 0)
++ return ret;
++
++ pci_set_master(dev);
++
++ ret = find_remapped_devices(nrdev, &resources);
++ if (ret)
++ return ret;
++
++ /* Add resources from the original AHCI device */
++ for (i = 0; i < PCI_NUM_RESOURCES; i++) {
++ struct resource *res = &dev->resource[i];
++
++ if (res->start) {
++ struct resource *nr_res = &nrdev->ahci_resources[i];
++
++ nr_res->start = res->start;
++ nr_res->end = res->end;
++ nr_res->flags = res->flags;
++ pci_add_resource(&resources, nr_res);
++ }
++ }
++
++ /* Create virtual interrupts */
++ nrdev->irq_base = devm_irq_alloc_descs(&dev->dev, -1, 0,
++ nrdev->num_remapped_devices + 1,
++ 0);
++ if (nrdev->irq_base < 0)
++ return nrdev->irq_base;
++
++ /* Create and populate PCI bus */
++ nrdev->bus = pci_create_root_bus(&dev->dev, 0, &nvme_remap_pci_ops,
++ &nrdev->sysdata, &resources);
++ if (!nrdev->bus)
++ return -ENODEV;
++
++ if (devm_add_action_or_reset(&dev->dev, nvme_remap_remove_root_bus,
++ nrdev->bus))
++ return -ENOMEM;
++
++ /* We don't support sharing MSI interrupts between these devices */
++ nrdev->bus->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
++
++ pci_scan_child_bus(nrdev->bus);
++
++ list_for_each_entry(child, &nrdev->bus->devices, bus_list) {
++ /*
++ * Prevent PCI core from trying to move memory BARs around.
++ * The hidden NVMe devices are at fixed locations.
++ */
++ for (i = 0; i < PCI_NUM_RESOURCES; i++) {
++ struct resource *res = &child->resource[i];
++
++ if (res->flags & IORESOURCE_MEM)
++ res->flags |= IORESOURCE_PCI_FIXED;
++ }
++
++ /* Share the legacy IRQ between all devices */
++ child->irq = dev->irq;
++ }
++
++ pci_assign_unassigned_bus_resources(nrdev->bus);
++ pci_bus_add_devices(nrdev->bus);
++
++ return 0;
++}
++
++static const struct pci_device_id nvme_remap_ids[] = {
++ /*
++ * Match all Intel RAID controllers.
++ *
++ * There's overlap here with the set of devices detected by the ahci
++ * driver, but ahci will only successfully probe when there
++ * *aren't* any remapped NVMe devices, and this driver will only
++ * successfully probe when there *are* remapped NVMe devices that
++ * need handling.
++ */
++ {
++ PCI_VDEVICE(INTEL, PCI_ANY_ID),
++ .class = PCI_CLASS_STORAGE_RAID << 8,
++ .class_mask = 0xffffff00,
++ },
++ {0,}
++};
++MODULE_DEVICE_TABLE(pci, nvme_remap_ids);
++
++static struct pci_driver nvme_remap_drv = {
++ .name = MODULE_NAME,
++ .id_table = nvme_remap_ids,
++ .probe = nvme_remap_probe,
++};
++module_pci_driver(nvme_remap_drv);
++
++MODULE_AUTHOR("Daniel Drake <drake@endlessm.com>");
++MODULE_LICENSE("GPL v2");
+--
+2.35.1
+
diff --git a/0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch b/0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch
new file mode 100644
index 000000000000..1e907413a316
--- /dev/null
+++ b/0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch
@@ -0,0 +1,167 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Almeida?= <andrealmeid@collabora.com>
+Date: Mon, 25 Oct 2021 09:49:42 -0300
+Subject: [PATCH] ZEN: futex: Add entry point for FUTEX_WAIT_MULTIPLE (opcode
+ 31)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add an option to wait on multiple futexes using the old interface, that
+uses opcode 31 through futex() syscall. Do that by just translation the
+old interface to use the new code. This allows old and stable versions
+of Proton to still use fsync in new kernel releases.
+
+Signed-off-by: André Almeida <andrealmeid@collabora.com>
+---
+ include/uapi/linux/futex.h | 13 +++++++
+ kernel/futex/syscalls.c | 75 +++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 87 insertions(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h
+index 71a5df8d2689..d375ab21cbf8 100644
+--- a/include/uapi/linux/futex.h
++++ b/include/uapi/linux/futex.h
+@@ -22,6 +22,7 @@
+ #define FUTEX_WAIT_REQUEUE_PI 11
+ #define FUTEX_CMP_REQUEUE_PI 12
+ #define FUTEX_LOCK_PI2 13
++#define FUTEX_WAIT_MULTIPLE 31
+
+ #define FUTEX_PRIVATE_FLAG 128
+ #define FUTEX_CLOCK_REALTIME 256
+@@ -68,6 +69,18 @@ struct futex_waitv {
+ __u32 __reserved;
+ };
+
++/**
++ * struct futex_wait_block - Block of futexes to be waited for
++ * @uaddr: User address of the futex
++ * @val: Futex value expected by userspace
++ * @bitset: Bitset for the optional bitmasked wakeup
++ */
++struct futex_wait_block {
++ __u32 __user *uaddr;
++ __u32 val;
++ __u32 bitset;
++};
++
+ /*
+ * Support for robust futexes: the kernel cleans up held futexes at
+ * thread exit time.
+diff --git a/kernel/futex/syscalls.c b/kernel/futex/syscalls.c
+index 086a22d1adb7..c6f5f1e84e09 100644
+--- a/kernel/futex/syscalls.c
++++ b/kernel/futex/syscalls.c
+@@ -142,6 +142,7 @@ static __always_inline bool futex_cmd_has_timeout(u32 cmd)
+ case FUTEX_LOCK_PI2:
+ case FUTEX_WAIT_BITSET:
+ case FUTEX_WAIT_REQUEUE_PI:
++ case FUTEX_WAIT_MULTIPLE:
+ return true;
+ }
+ return false;
+@@ -154,13 +155,79 @@ futex_init_timeout(u32 cmd, u32 op, struct timespec64 *ts, ktime_t *t)
+ return -EINVAL;
+
+ *t = timespec64_to_ktime(*ts);
+- if (cmd == FUTEX_WAIT)
++ if (cmd == FUTEX_WAIT || cmd == FUTEX_WAIT_MULTIPLE)
+ *t = ktime_add_safe(ktime_get(), *t);
+ else if (cmd != FUTEX_LOCK_PI && !(op & FUTEX_CLOCK_REALTIME))
+ *t = timens_ktime_to_host(CLOCK_MONOTONIC, *t);
+ return 0;
+ }
+
++/**
++ * futex_read_wait_block - Read an array of futex_wait_block from userspace
++ * @uaddr: Userspace address of the block
++ * @count: Number of blocks to be read
++ *
++ * This function creates and allocate an array of futex_q (we zero it to
++ * initialize the fields) and then, for each futex_wait_block element from
++ * userspace, fill a futex_q element with proper values.
++ */
++inline struct futex_vector *futex_read_wait_block(u32 __user *uaddr, u32 count)
++{
++ unsigned int i;
++ struct futex_vector *futexv;
++ struct futex_wait_block fwb;
++ struct futex_wait_block __user *entry =
++ (struct futex_wait_block __user *)uaddr;
++
++ if (!count || count > FUTEX_WAITV_MAX)
++ return ERR_PTR(-EINVAL);
++
++ futexv = kcalloc(count, sizeof(*futexv), GFP_KERNEL);
++ if (!futexv)
++ return ERR_PTR(-ENOMEM);
++
++ for (i = 0; i < count; i++) {
++ if (copy_from_user(&fwb, &entry[i], sizeof(fwb))) {
++ kfree(futexv);
++ return ERR_PTR(-EFAULT);
++ }
++
++ futexv[i].w.flags = FUTEX_32;
++ futexv[i].w.val = fwb.val;
++ futexv[i].w.uaddr = (uintptr_t) (fwb.uaddr);
++ futexv[i].q = futex_q_init;
++ }
++
++ return futexv;
++}
++
++int futex_wait_multiple(struct futex_vector *vs, unsigned int count,
++ struct hrtimer_sleeper *to);
++
++int futex_opcode_31(ktime_t *abs_time, u32 __user *uaddr, int count)
++{
++ int ret;
++ struct futex_vector *vs;
++ struct hrtimer_sleeper *to = NULL, timeout;
++
++ to = futex_setup_timer(abs_time, &timeout, 0, 0);
++
++ vs = futex_read_wait_block(uaddr, count);
++
++ if (IS_ERR(vs))
++ return PTR_ERR(vs);
++
++ ret = futex_wait_multiple(vs, count, abs_time ? to : NULL);
++ kfree(vs);
++
++ if (to) {
++ hrtimer_cancel(&to->timer);
++ destroy_hrtimer_on_stack(&to->timer);
++ }
++
++ return ret;
++}
++
+ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
+ const struct __kernel_timespec __user *, utime,
+ u32 __user *, uaddr2, u32, val3)
+@@ -180,6 +247,9 @@ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
+ tp = &t;
+ }
+
++ if (cmd == FUTEX_WAIT_MULTIPLE)
++ return futex_opcode_31(tp, uaddr, val);
++
+ return do_futex(uaddr, op, val, tp, uaddr2, (unsigned long)utime, val3);
+ }
+
+@@ -370,6 +440,9 @@ SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val,
+ tp = &t;
+ }
+
++ if (cmd == FUTEX_WAIT_MULTIPLE)
++ return futex_opcode_31(tp, uaddr, val);
++
+ return do_futex(uaddr, op, val, tp, uaddr2, (unsigned long)utime, val3);
+ }
+ #endif /* CONFIG_COMPAT_32BIT_TIME */
+--
+2.35.1
+
diff --git a/0015-ZEN-mm-Disable-watermark-boosting-by-default.patch b/0015-ZEN-mm-Disable-watermark-boosting-by-default.patch
new file mode 100644
index 000000000000..0ef0887d7df8
--- /dev/null
+++ b/0015-ZEN-mm-Disable-watermark-boosting-by-default.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Sat, 28 Mar 2020 13:06:28 -0700
+Subject: [PATCH] ZEN: mm: Disable watermark boosting by default
+
+What watermark boosting does is preemptively fire up kswapd to free
+memory when there hasn't been an allocation failure. It does this by
+increasing kswapd's high watermark goal and then firing up kswapd. The
+reason why this causes freezes is because, with the increased high
+watermark goal, kswapd will steal memory from processes that need it in
+order to make forward progress. These processes will, in turn, try to
+allocate memory again, which will cause kswapd to steal necessary pages
+from those processes again, in a positive feedback loop known as page
+thrashing. When page thrashing occurs, your system is essentially
+livelocked until the necessary forward progress can be made to stop
+processes from trying to continuously allocate memory and trigger
+kswapd to steal it back.
+
+This problem already occurs with kswapd *without* watermark boosting,
+but it's usually only encountered on machines with a small amount of
+memory and/or a slow CPU. Watermark boosting just makes the existing
+problem worse enough to notice on higher spec'd machines.
+
+Disable watermark boosting by default since it's a total dumpster fire.
+I can't imagine why anyone would want to explicitly enable it, but the
+option is there in case someone does.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ mm/page_alloc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 3589febc6d31..5690ef37d2bf 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -341,7 +341,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = {
+
+ int min_free_kbytes = 1024;
+ int user_min_free_kbytes = -1;
+-int watermark_boost_factor __read_mostly = 15000;
++int watermark_boost_factor __read_mostly;
+ int watermark_scale_factor = 10;
+
+ static unsigned long nr_kernel_pages __initdata;
+--
+2.35.1
+
diff --git a/0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch b/0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch
new file mode 100644
index 000000000000..8f52ee5d8a8b
--- /dev/null
+++ b/0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch
@@ -0,0 +1,111 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Sun, 19 Apr 2020 19:59:18 -0700
+Subject: [PATCH] ZEN: mm: Stop kswapd early when nothing's waiting for it to
+ free pages
+
+Contains:
+ - mm: Stop kswapd early when nothing's waiting for it to free pages
+
+ Keeping kswapd running when all the failed allocations that invoked it
+ are satisfied incurs a high overhead due to unnecessary page eviction
+ and writeback, as well as spurious VM pressure events to various
+ registered shrinkers. When kswapd doesn't need to work to make an
+ allocation succeed anymore, stop it prematurely to save resources.
+
+ Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+
+ - mm: Don't stop kswapd on a per-node basis when there are no waiters
+
+ The page allocator wakes all kswapds in an allocation context's allowed
+ nodemask in the slow path, so it doesn't make sense to have the kswapd-
+ waiter count per each NUMA node. Instead, it should be a global counter
+ to stop all kswapds when there are no failed allocation requests.
+
+ Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ mm/internal.h | 1 +
+ mm/page_alloc.c | 17 ++++++++++++++---
+ mm/vmscan.c | 3 ++-
+ 3 files changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/mm/internal.h b/mm/internal.h
+index d80300392a19..96aa50e46119 100644
+--- a/mm/internal.h
++++ b/mm/internal.h
+@@ -248,6 +248,7 @@ extern void prep_compound_page(struct page *page, unsigned int order);
+ extern void post_alloc_hook(struct page *page, unsigned int order,
+ gfp_t gfp_flags);
+ extern int user_min_free_kbytes;
++extern atomic_long_t kswapd_waiters;
+
+ extern void free_unref_page(struct page *page, unsigned int order);
+ extern void free_unref_page_list(struct list_head *list);
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 5690ef37d2bf..d3ab6e198718 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -121,6 +121,8 @@ typedef int __bitwise fpi_t;
+ */
+ #define FPI_SKIP_KASAN_POISON ((__force fpi_t)BIT(2))
+
++atomic_long_t kswapd_waiters = ATOMIC_LONG_INIT(0);
++
+ /* prevent >1 _updater_ of zone percpu pageset ->high and ->batch fields */
+ static DEFINE_MUTEX(pcp_batch_high_lock);
+ #define MIN_PERCPU_PAGELIST_HIGH_FRACTION (8)
+@@ -4878,6 +4880,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
+ int no_progress_loops;
+ unsigned int cpuset_mems_cookie;
+ int reserve_flags;
++ bool woke_kswapd = false;
+
+ /*
+ * We also sanity check to catch abuse of atomic reserves being used by
+@@ -4924,8 +4927,13 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
+ goto nopage;
+ }
+
+- if (alloc_flags & ALLOC_KSWAPD)
++ if (alloc_flags & ALLOC_KSWAPD) {
++ if (!woke_kswapd) {
++ atomic_long_inc(&kswapd_waiters);
++ woke_kswapd = true;
++ }
+ wake_all_kswapds(order, gfp_mask, ac);
++ }
+
+ /*
+ * The adjusted alloc_flags might result in immediate success, so try
+@@ -5130,9 +5138,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
+ goto retry;
+ }
+ fail:
+- warn_alloc(gfp_mask, ac->nodemask,
+- "page allocation failure: order:%u", order);
+ got_pg:
++ if (woke_kswapd)
++ atomic_long_dec(&kswapd_waiters);
++ if (!page)
++ warn_alloc(gfp_mask, ac->nodemask,
++ "page allocation failure: order:%u", order);
+ return page;
+ }
+
+diff --git a/mm/vmscan.c b/mm/vmscan.c
+index 59b14e0d696c..3d8cbc64af8c 100644
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -4275,7 +4275,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx)
+ __fs_reclaim_release(_THIS_IP_);
+ ret = try_to_freeze();
+ __fs_reclaim_acquire(_THIS_IP_);
+- if (ret || kthread_should_stop())
++ if (ret || kthread_should_stop() ||
++ !atomic_long_read(&kswapd_waiters))
+ break;
+
+ /*
+--
+2.35.1
+
diff --git a/0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch b/0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch
new file mode 100644
index 000000000000..dbfc3e3f0a71
--- /dev/null
+++ b/0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch
@@ -0,0 +1,81 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Fri, 16 Jul 2021 23:35:47 -0700
+Subject: [PATCH] ZEN: mm: Increment kswapd_waiters for throttled direct
+ reclaimers
+
+Throttled direct reclaimers will wake up kswapd and wait for kswapd to
+satisfy their page allocation request, even when the failed allocation
+lacks the __GFP_KSWAPD_RECLAIM flag in its gfp mask. As a result, kswapd
+may think that there are no waiters and thus exit prematurely, causing
+throttled direct reclaimers lacking __GFP_KSWAPD_RECLAIM to stall on
+waiting for kswapd to wake them up. Incrementing the kswapd_waiters
+counter when such direct reclaimers become throttled fixes the problem.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ mm/vmscan.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/mm/vmscan.c b/mm/vmscan.c
+index 3d8cbc64af8c..478df26db0e9 100644
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -3658,7 +3658,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
+ return 0;
+ }
+
+-static bool allow_direct_reclaim(pg_data_t *pgdat)
++static bool allow_direct_reclaim(pg_data_t *pgdat, bool using_kswapd)
+ {
+ struct zone *zone;
+ unsigned long pfmemalloc_reserve = 0;
+@@ -3687,6 +3687,10 @@ static bool allow_direct_reclaim(pg_data_t *pgdat)
+
+ wmark_ok = free_pages > pfmemalloc_reserve / 2;
+
++ /* The throttled direct reclaimer is now a kswapd waiter */
++ if (unlikely(!using_kswapd && !wmark_ok))
++ atomic_long_inc(&kswapd_waiters);
++
+ /* kswapd must be awake if processes are being throttled */
+ if (!wmark_ok && waitqueue_active(&pgdat->kswapd_wait)) {
+ if (READ_ONCE(pgdat->kswapd_highest_zoneidx) > ZONE_NORMAL)
+@@ -3752,7 +3756,7 @@ static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
+
+ /* Throttle based on the first usable node */
+ pgdat = zone->zone_pgdat;
+- if (allow_direct_reclaim(pgdat))
++ if (allow_direct_reclaim(pgdat, gfp_mask & __GFP_KSWAPD_RECLAIM))
+ goto out;
+ break;
+ }
+@@ -3774,11 +3778,14 @@ static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
+ */
+ if (!(gfp_mask & __GFP_FS))
+ wait_event_interruptible_timeout(pgdat->pfmemalloc_wait,
+- allow_direct_reclaim(pgdat), HZ);
++ allow_direct_reclaim(pgdat, true), HZ);
+ else
+ /* Throttle until kswapd wakes the process */
+ wait_event_killable(zone->zone_pgdat->pfmemalloc_wait,
+- allow_direct_reclaim(pgdat));
++ allow_direct_reclaim(pgdat, true));
++
++ if (unlikely(!(gfp_mask & __GFP_KSWAPD_RECLAIM)))
++ atomic_long_dec(&kswapd_waiters);
+
+ if (fatal_signal_pending(current))
+ return true;
+@@ -4268,7 +4275,7 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx)
+ * able to safely make forward progress. Wake them
+ */
+ if (waitqueue_active(&pgdat->pfmemalloc_wait) &&
+- allow_direct_reclaim(pgdat))
++ allow_direct_reclaim(pgdat, true))
+ wake_up_all(&pgdat->pfmemalloc_wait);
+
+ /* Check if kswapd should be suspending */
+--
+2.35.1
+
diff --git a/0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch b/0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch
new file mode 100644
index 000000000000..5b4467c1de07
--- /dev/null
+++ b/0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Wed, 20 Oct 2021 20:50:11 -0700
+Subject: [PATCH] ZEN: mm: Lower the non-hugetlbpage pageblock size to reduce
+ scheduling delays
+
+The page allocator processes free pages in groups of pageblocks, where
+the size of a pageblock is typically quite large (1024 pages without
+hugetlbpage support). Pageblocks are processed atomically with the zone
+lock held, which can cause severe scheduling delays on both the CPU
+going through the pageblock and any other CPUs waiting to acquire the
+zone lock. A frequent offender is move_freepages_block(), which is used
+by rmqueue() for page allocation.
+
+As it turns out, there's no requirement for pageblocks to be so large,
+so the pageblock order can simply be reduced to ease the scheduling
+delays and zone lock contention. PAGE_ALLOC_COSTLY_ORDER is used as a
+reasonable setting to ensure non-costly page allocation requests can
+still be serviced without always needing to free up more than one
+pageblock's worth of pages at a time.
+
+This has a noticeable effect on overall system latency when memory
+pressure is elevated. The various mm functions which operate on
+pageblocks no longer appear in the preemptoff tracer, where previously
+they would spend up to 100 ms on a mobile arm64 CPU processing a
+pageblock with preemption disabled and the zone lock held.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ include/linux/pageblock-flags.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
+index 973fd731a520..4fd8f258972a 100644
+--- a/include/linux/pageblock-flags.h
++++ b/include/linux/pageblock-flags.h
+@@ -45,7 +45,7 @@ extern unsigned int pageblock_order;
+ #else /* CONFIG_HUGETLB_PAGE */
+
+ /* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
+-#define pageblock_order (MAX_ORDER-1)
++#define pageblock_order PAGE_ALLOC_COSTLY_ORDER
+
+ #endif /* CONFIG_HUGETLB_PAGE */
+
+--
+2.35.1
+
diff --git a/0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch b/0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch
new file mode 100644
index 000000000000..d16660ec6b50
--- /dev/null
+++ b/0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch
@@ -0,0 +1,78 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Wed, 20 Oct 2021 20:50:32 -0700
+Subject: [PATCH] ZEN: mm: Don't hog the CPU and zone lock in rmqueue_bulk()
+
+There is noticeable scheduling latency and heavy zone lock contention
+stemming from rmqueue_bulk's single hold of the zone lock while doing
+its work, as seen with the preemptoff tracer. There's no actual need for
+rmqueue_bulk() to hold the zone lock the entire time; it only does so
+for supposed efficiency. As such, we can relax the zone lock and even
+reschedule when IRQs are enabled in order to keep the scheduling delays
+and zone lock contention at bay. Forward progress is still guaranteed,
+as the zone lock can only be relaxed after page removal.
+
+With this change, rmqueue_bulk() no longer appears as a serious offender
+in the preemptoff tracer, and system latency is noticeably improved.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ mm/page_alloc.c | 23 ++++++++++++++++++-----
+ 1 file changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index d3ab6e198718..4d930d095ca9 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -3018,15 +3018,16 @@ __rmqueue(struct zone *zone, unsigned int order, int migratetype,
+ }
+
+ /*
+- * Obtain a specified number of elements from the buddy allocator, all under
+- * a single hold of the lock, for efficiency. Add them to the supplied list.
+- * Returns the number of new pages which were placed at *list.
++ * Obtain a specified number of elements from the buddy allocator, and relax the
++ * zone lock when needed. Add them to the supplied list. Returns the number of
++ * new pages which were placed at *list.
+ */
+ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+ unsigned long count, struct list_head *list,
+ int migratetype, unsigned int alloc_flags)
+ {
+- int i, allocated = 0;
++ const bool can_resched = !preempt_count() && !irqs_disabled();
++ int i, allocated = 0, last_mod = 0;
+
+ /*
+ * local_lock_irq held so equivalent to spin_lock_irqsave for
+@@ -3039,6 +3040,18 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+ if (unlikely(page == NULL))
+ break;
+
++ /* Reschedule and ease the contention on the lock if needed */
++ if (i + 1 < count && ((can_resched && need_resched()) ||
++ spin_needbreak(&zone->lock))) {
++ __mod_zone_page_state(zone, NR_FREE_PAGES,
++ -((i + 1 - last_mod) << order));
++ last_mod = i + 1;
++ spin_unlock(&zone->lock);
++ if (can_resched)
++ cond_resched();
++ spin_lock(&zone->lock);
++ }
++
+ if (unlikely(check_pcp_refill(page)))
+ continue;
+
+@@ -3065,7 +3078,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+ * on i. Do not confuse with 'allocated' which is the number of
+ * pages added to the pcp list.
+ */
+- __mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order));
++ __mod_zone_page_state(zone, NR_FREE_PAGES, -((i - last_mod) << order));
+ spin_unlock(&zone->lock);
+ return allocated;
+ }
+--
+2.35.1
+
diff --git a/0020-ZEN-INTERACTIVE-Base-config-item.patch b/0020-ZEN-INTERACTIVE-Base-config-item.patch
new file mode 100644
index 000000000000..5fe11eeb28f5
--- /dev/null
+++ b/0020-ZEN-INTERACTIVE-Base-config-item.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:10:06 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Base config item
+
+---
+ init/Kconfig | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 2fce0d599a91..344ca4b9f15a 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -107,6 +107,12 @@ config THREAD_INFO_IN_TASK
+
+ menu "General setup"
+
++config ZEN_INTERACTIVE
++ bool "Tune kernel for interactivity"
++ default y
++ help
++ Tunes the kernel for responsiveness at the cost of throughput and power usage.
++
+ config BROKEN
+ bool
+
+--
+2.35.1
+
diff --git a/0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch b/0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch
new file mode 100644
index 000000000000..73e2d4d97fac
--- /dev/null
+++ b/0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch
@@ -0,0 +1,51 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:11:05 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Use BFQ as our elevator
+
+Add a scheduler even to multi-queue block devices: We prefer
+interactivity to throughput and want BFQ if possible.
+---
+ block/elevator.c | 6 +++++-
+ init/Kconfig | 4 ++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/block/elevator.c b/block/elevator.c
+index b18f38f7e88a..a3e85e2f4d96 100644
+--- a/block/elevator.c
++++ b/block/elevator.c
+@@ -638,11 +638,15 @@ static struct elevator_type *elevator_get_default(struct request_queue *q)
+ if (q->tag_set && q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT)
+ return NULL;
+
++#ifndef CONFIG_ZEN_INTERACTIVE
+ if (q->nr_hw_queues != 1 &&
+ !blk_mq_is_shared_tags(q->tag_set->flags))
+ return NULL;
++#endif
+
+-#if defined(CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT)
++#if defined(CONFIG_ZEN_INTERACTIVE) && defined(CONFIG_IOSCHED_BFQ)
++ return elevator_get(q, "bfq", false);
++#elif defined(CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT)
+ return elevator_get(q, "mq-deadline-nodefault", false);
+ #else
+ return elevator_get(q, "mq-deadline", false);
+diff --git a/init/Kconfig b/init/Kconfig
+index 344ca4b9f15a..450355b8aa2a 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -113,6 +113,10 @@ config ZEN_INTERACTIVE
+ help
+ Tunes the kernel for responsiveness at the cost of throughput and power usage.
+
++ --- Block Layer ----------------------------------------
++
++ Default scheduler.........: mq-deadline -> bfq
++
+ config BROKEN
+ bool
+
+--
+2.35.1
+
diff --git a/0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch b/0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch
new file mode 100644
index 000000000000..fa1cba6a0238
--- /dev/null
+++ b/0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch
@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:21:09 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Enable background reclaim of hugepages
+
+Use [defer+madvise] as default khugepaged defrag strategy:
+
+For some reason, the default strategy to respond to THP fault fallbacks
+is still just madvise, meaning stall if the program wants transparent
+hugepages, but don't trigger a background reclaim / compaction if THP
+begins to fail allocations. This creates a snowball affect where we
+still use the THP code paths, but we almost always fail once a system
+has been active and busy for a while.
+
+The option "defer" was created for interactive systems where THP can
+still improve performance. If we have to fallback to a regular page due
+to an allocation failure or anything else, we will trigger a background
+reclaim and compaction so future THP attempts succeed and previous
+attempts eventually have their smaller pages combined without stalling
+running applications.
+
+We still want madvise to stall applications that explicitely want THP,
+so defer+madvise _does_ make a ton of sense. Make it the default for
+interactive systems, especially if the kernel maintainer left
+transparent hugepages on "always".
+
+Reasoning and details in the original patch: https://lwn.net/Articles/711248/
+---
+ init/Kconfig | 4 ++++
+ mm/huge_memory.c | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 450355b8aa2a..a77e78d1c9eb 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -117,6 +117,10 @@ config ZEN_INTERACTIVE
+
+ Default scheduler.........: mq-deadline -> bfq
+
++ --- Virtual Memory Subsystem ---------------------------
++
++ Background-reclaim hugepages...: no -> yes
++
+ config BROKEN
+ bool
+
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c
+index 406a3c28c026..3538923b48ab 100644
+--- a/mm/huge_memory.c
++++ b/mm/huge_memory.c
+@@ -54,7 +54,11 @@ unsigned long transparent_hugepage_flags __read_mostly =
+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE_MADVISE
+ (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)|
+ #endif
++#ifdef CONFIG_ZEN_INTERACTIVE
++ (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KSWAPD_OR_MADV_FLAG)|
++#else
+ (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG)|
++#endif
+ (1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
+ (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG);
+
+--
+2.35.1
+
diff --git a/0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch b/0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch
new file mode 100644
index 000000000000..a91eb83ca76b
--- /dev/null
+++ b/0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Wed, 11 Aug 2021 18:47:46 -0500
+Subject: [PATCH] ZEN: INTERACTIVE: Add help text for the MG-LRU tweaks
+
+The tweaks themselves get merged with the MG-LRU patchset.
+---
+ init/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index a77e78d1c9eb..7420e7b3e53c 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -120,6 +120,7 @@ config ZEN_INTERACTIVE
+ --- Virtual Memory Subsystem ---------------------------
+
+ Background-reclaim hugepages...: no -> yes
++ MG-LRU minimum cache TTL.......: 0 -> 1000 ms
+
+ config BROKEN
+ bool
+--
+2.35.1
+
diff --git a/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch b/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
new file mode 100644
index 000000000000..15cd1187c850
--- /dev/null
+++ b/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
@@ -0,0 +1,138 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:28:13 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Tune CFS for interactivity
+
+5.7:
+Take "sysctl_sched_nr_migrate" tune from early XanMod builds of 128. As
+of 5.7, XanMod uses 256 but that may affect applications that require
+timely response to IRQs.
+
+5.15:
+Per comment [1] on our ZEN INTERACTIVE commit, reducing the cost of
+migration causes the system less responsive under high load. Most
+likely the combination of reduced migration cost + the higher number of
+tasks that can be migrated at once contributes to this.
+
+To better handle this situation, restore the mainline migration cost
+value and also reduce the max number of tasks that can be migrated in
+batch from 128 to 64.
+
+If this doesn't help, we'll restore the reduced migration cost and keep
+total number of tasks that can be migrated at once to 32.
+
+[1] https://github.com/zen-kernel/zen-kernel/commit/be5ba234ca0a5aabe74bfc7e1f636f085bd3823c#commitcomment-63159674
+---
+ init/Kconfig | 8 ++++++++
+ kernel/sched/core.c | 4 +++-
+ kernel/sched/fair.c | 23 +++++++++++++++++++++++
+ 3 files changed, 34 insertions(+), 1 deletion(-)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 7420e7b3e53c..79ed6a865a5b 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -122,6 +122,14 @@ config ZEN_INTERACTIVE
+ Background-reclaim hugepages...: no -> yes
+ MG-LRU minimum cache TTL.......: 0 -> 1000 ms
+
++ --- CFS CPU Scheduler ----------------------------------
++
++ Scheduling latency.............: 6 -> 4 ms
++ Minimal granularity............: 0.75 -> 0.4 ms
++ Wakeup granularity.............: 1 -> 0.5 ms
++ Bandwidth slice size...........: 5 -> 3 ms
++ Task rebalancing threshold.....: 32 -> 64
++
+ config BROKEN
+ bool
+
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c
+index 9745613d531c..613b5823bf60 100644
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -74,7 +74,9 @@ __read_mostly int sysctl_resched_latency_warn_once = 1;
+ * Number of tasks to iterate in a single balance run.
+ * Limited because this is done with IRQs disabled.
+ */
+-#ifdef CONFIG_PREEMPT_RT
++#ifdef CONFIG_ZEN_INTERACTIVE
++const_debug unsigned int sysctl_sched_nr_migrate = 64;
++#elif defined(CONFIG_PREEMPT_RT)
+ const_debug unsigned int sysctl_sched_nr_migrate = 8;
+ #else
+ const_debug unsigned int sysctl_sched_nr_migrate = 32;
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
+index 5146163bfabb..27028558eeb2 100644
+--- a/kernel/sched/fair.c
++++ b/kernel/sched/fair.c
+@@ -35,8 +35,13 @@
+ *
+ * (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_latency = 4000000ULL;
++static unsigned int normalized_sysctl_sched_latency = 4000000ULL;
++#else
+ unsigned int sysctl_sched_latency = 6000000ULL;
+ static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
++#endif
+
+ /*
+ * The initial- and re-scaling of tunables is configurable
+@@ -56,8 +61,13 @@ unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG;
+ *
+ * (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_min_granularity = 400000ULL;
++static unsigned int normalized_sysctl_sched_min_granularity = 400000ULL;
++#else
+ unsigned int sysctl_sched_min_granularity = 750000ULL;
+ static unsigned int normalized_sysctl_sched_min_granularity = 750000ULL;
++#endif
+
+ /*
+ * Minimal preemption granularity for CPU-bound SCHED_IDLE tasks.
+@@ -70,7 +80,11 @@ unsigned int sysctl_sched_idle_min_granularity = 750000ULL;
+ /*
+ * This value is kept at sysctl_sched_latency/sysctl_sched_min_granularity
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++static unsigned int sched_nr_latency = 10;
++#else
+ static unsigned int sched_nr_latency = 8;
++#endif
+
+ /*
+ * After fork, child runs first. If set to 0 (default) then
+@@ -87,8 +101,13 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
+ *
+ * (default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_wakeup_granularity = 500000UL;
++static unsigned int normalized_sysctl_sched_wakeup_granularity = 500000UL;
++#else
+ unsigned int sysctl_sched_wakeup_granularity = 1000000UL;
+ static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
++#endif
+
+ const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
+
+@@ -141,8 +160,12 @@ int __weak arch_asym_cpu_priority(int cpu)
+ *
+ * (default: 5 msec, units: microseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_cfs_bandwidth_slice = 3000UL;
++#else
+ unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
+ #endif
++#endif
+
+ static inline void update_load_add(struct load_weight *lw, unsigned long inc)
+ {
+--
+2.35.1
+
diff --git a/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch b/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
new file mode 100644
index 000000000000..62cb915ad4d5
--- /dev/null
+++ b/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
@@ -0,0 +1,97 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:27:16 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Tune ondemand governor for interactivity
+
+4.10:
+During some personal testing with the Dolphin emulator, MuQSS has
+serious problems scaling its frequencies causing poor performance where
+boosting the CPU frequencies would have fixed them. Reducing the
+up_threshold to 45 with MuQSS appears to fix the issue, letting the
+introduction to "Star Wars: Rogue Leader" run at 100% speed versus about
+80% on my test system.
+
+Also, lets refactor the definitions and include some indentation to help
+the reader discern what the scope of all the macros are.
+
+5.4:
+On the last custom kernel benchmark from Phoronix with Xanmod, Michael
+configured all the kernels to run using ondemand instead of the kernel's
+[default selection][1]. This reminded me that another option outside of
+the kernels control is the user's choice to change the cpufreq governor,
+for better or for worse.
+
+In Liquorix, performance is the default governor whether you're running
+acpi-cpufreq or intel-pstate. I expect laptop users to install TLP or
+LMT to control the power balance on their system, especially when
+they're plugged in or on battery. However, it's pretty clear to me a
+lot of people would choose ondemand over performance since it's not
+obvious it has huge performance ramifications with MuQSS, and ondemand
+otherwise is "good enough" for most people.
+
+Lets codify lower up thresholds for MuQSS to more closely synergize with
+its aggressive thread migration behavior. This way when ondemand is
+configured, you get sort of a "performance-lite" type of result but with
+the power savings you expect when leaving the running system idle.
+
+[1]: https://www.phoronix.com/scan.php?page=article&item=xanmod-2020-kernel
+
+5.14:
+Although CFS and similar schedulers (BMQ, PDS, and CacULE), reuse a lot
+more of mainline scheduling and do a good job of pinning single threaded
+tasks to their respective core, there's still applications that
+confusingly run steady near 50% and benefit from going full speed or
+turbo when they need to run (emulators for more recent consoles come to
+mind).
+
+Drop the up threshold for all non-MuQSS schedulers from 80/95 to 55/60.
+
+5.15:
+Remove MuQSS cpufreq configuration.
+---
+ drivers/cpufreq/cpufreq_ondemand.c | 8 +++++++-
+ init/Kconfig | 6 ++++++
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
+index 6a41ea4729b8..b47804173462 100644
+--- a/drivers/cpufreq/cpufreq_ondemand.c
++++ b/drivers/cpufreq/cpufreq_ondemand.c
+@@ -18,10 +18,16 @@
+ #include "cpufreq_ondemand.h"
+
+ /* On-demand governor macros */
++#if defined(CONFIG_ZEN_INTERACTIVE)
++#define DEF_FREQUENCY_UP_THRESHOLD (55)
++#define MICRO_FREQUENCY_UP_THRESHOLD (60)
++#define DEF_SAMPLING_DOWN_FACTOR (5)
++#else
+ #define DEF_FREQUENCY_UP_THRESHOLD (80)
++#define MICRO_FREQUENCY_UP_THRESHOLD (95)
+ #define DEF_SAMPLING_DOWN_FACTOR (1)
++#endif
+ #define MAX_SAMPLING_DOWN_FACTOR (100000)
+-#define MICRO_FREQUENCY_UP_THRESHOLD (95)
+ #define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
+ #define MIN_FREQUENCY_UP_THRESHOLD (1)
+ #define MAX_FREQUENCY_UP_THRESHOLD (100)
+diff --git a/init/Kconfig b/init/Kconfig
+index 79ed6a865a5b..3c2026636085 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -130,6 +130,12 @@ config ZEN_INTERACTIVE
+ Bandwidth slice size...........: 5 -> 3 ms
+ Task rebalancing threshold.....: 32 -> 64
+
++ --- CPUFreq Settings -----------------------------------
++
++ Ondemand sampling down factor..: 1 -> 5
++ Ondemand default up threshold..: 80 -> 55
++ Ondemand micro up threshold....: 95 -> 60
++
+ config BROKEN
+ bool
+
+--
+2.35.1
+
diff --git a/0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch b/0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch
new file mode 100644
index 000000000000..46f6f6b847b5
--- /dev/null
+++ b/0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Sun, 19 Sep 2021 16:03:36 -0500
+Subject: [PATCH] ZEN: INTERACTIVE: Document PDS/BMQ configuration
+
+---
+ init/Kconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 3c2026636085..9ca9b0e43e3e 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -130,6 +130,10 @@ config ZEN_INTERACTIVE
+ Bandwidth slice size...........: 5 -> 3 ms
+ Task rebalancing threshold.....: 32 -> 64
+
++ --- PDS/BMQ CPU Scheduler ------------------------------
++
++ Scheduling timeslice...........: 4 -> 2 ms
++
+ --- CPUFreq Settings -----------------------------------
+
+ Ondemand sampling down factor..: 1 -> 5
+--
+2.35.1
+
diff --git a/0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch b/0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch
new file mode 100644
index 000000000000..dd439bb44e38
--- /dev/null
+++ b/0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Sat, 5 Mar 2022 11:37:14 -0600
+Subject: [PATCH] ZEN: INTERACTIVE: mm: Disable unevictable compaction
+
+This option is already disabled when CONFIG_PREEMPT_RT is enabled, lets
+turn it off when CONFIG_ZEN_INTERACTIVE is set as well.
+---
+ init/Kconfig | 1 +
+ mm/compaction.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 9ca9b0e43e3e..0e478db562b0 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -121,6 +121,7 @@ config ZEN_INTERACTIVE
+
+ Background-reclaim hugepages...: no -> yes
+ MG-LRU minimum cache TTL.......: 0 -> 1000 ms
++ Compact Unevictable............: 1 -> 0
+
+ --- CFS CPU Scheduler ----------------------------------
+
+diff --git a/mm/compaction.c b/mm/compaction.c
+index b4e94cda3019..f713c3ca03fa 100644
+--- a/mm/compaction.c
++++ b/mm/compaction.c
+@@ -1699,7 +1699,7 @@ typedef enum {
+ * Allow userspace to control policy on scanning the unevictable LRU for
+ * compactable pages.
+ */
+-#ifdef CONFIG_PREEMPT_RT
++#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_ZEN_INTERACTIVE)
+ int sysctl_compact_unevictable_allowed __read_mostly = 0;
+ #else
+ int sysctl_compact_unevictable_allowed __read_mostly = 1;
+--
+2.35.1
+
diff --git a/0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch b/0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch
new file mode 100644
index 000000000000..906a7f805aa5
--- /dev/null
+++ b/0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Sat, 24 Oct 2020 22:17:49 -0700
+Subject: [PATCH] ZEN: INTERACTIVE: mm: Disable proactive compaction by default
+
+On-demand compaction works fine assuming that you don't have a need to
+spam the page allocator nonstop for large order page allocations.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ init/Kconfig | 1 +
+ mm/compaction.c | 4 ++++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 0e478db562b0..b7c05783bde6 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -122,6 +122,7 @@ config ZEN_INTERACTIVE
+ Background-reclaim hugepages...: no -> yes
+ MG-LRU minimum cache TTL.......: 0 -> 1000 ms
+ Compact Unevictable............: 1 -> 0
++ Proactive Compaction...........: 20 -> 0
+
+ --- CFS CPU Scheduler ----------------------------------
+
+diff --git a/mm/compaction.c b/mm/compaction.c
+index f713c3ca03fa..63c536175152 100644
+--- a/mm/compaction.c
++++ b/mm/compaction.c
+@@ -2705,7 +2705,11 @@ static void compact_nodes(void)
+ * aggressively the kernel should compact memory in the
+ * background. It takes values in the range [0, 100].
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int __read_mostly sysctl_compaction_proactiveness;
++#else
+ unsigned int __read_mostly sysctl_compaction_proactiveness = 20;
++#endif
+
+ int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int write,
+ void *buffer, size_t *length, loff_t *ppos)
+--
+2.35.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 4bbaf865b99f..ff283ba915b9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -56,7 +56,7 @@ _BATCH_MODE=n # enable batch mode
##
_major=5
-_minor=16
+_minor=17
#_patchlevel=0
#_subversion=1
_basekernel=${_major}.${_minor}
@@ -92,6 +92,33 @@ source=("https://www.kernel.org/pub/linux/kernel/v${_major}.x/linux-${_basekerne
# "https://gitlab.com/alfredchen/projectc/raw/master/$_major.$_minor/$_projectcpatchname"
"90-linux.hook"
"60-linux.hook"
+ # ZEN
+ 0002-ZEN-Add-VHBA-driver.patch
+ 0003-ZEN-Add-OpenRGB-patches.patch
+ 0006-ZEN-Disable-stack-conservation-for-GCC.patch
+ 0007-ZEN-Initialize-ata-before-graphics.patch
+ 0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch
+ 0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch
+ 0011-ZEN-intel-pstate-Implement-enable-parameter.patch
+ 0012-ZEN-Add-ACS-override-support.patch
+ 0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch
+ 0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch
+ 0015-ZEN-mm-Disable-watermark-boosting-by-default.patch
+ 0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch
+ 0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch
+ 0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch
+ 0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch
+ 0020-ZEN-INTERACTIVE-Base-config-item.patch
+ 0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch
+ 0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch
+ 0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch
+ 0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
+ 0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
+ 0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch
+ 0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch
+ 0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch
+ # ZEN END
+ # https://bugzilla.kernel.org/show_bug.cgi?id=211005
'asus_zenith_ii_map.patch::https://bugzilla.kernel.org/attachment.cgi?id=294489'
)
# 'cx23885_move_CI_AC_registration_to_a_separate_function.patch'
@@ -104,6 +131,34 @@ prepare() {
patch -Np1 < ${srcdir}/${_pfpatchname}
#patch -Np1 < ${srcdir}/${_projectcpatchname}
+ patch -p1 -i ${srcdir}/0002-ZEN-Add-VHBA-driver.patch
+ patch -p1 -i ${srcdir}/0003-ZEN-Add-OpenRGB-patches.patch
+ # already applied by pf
+ #patch -p1 -i ${srcdir}/0005-ZEN-Unrestrict-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch
+ patch -p1 -i ${srcdir}/0006-ZEN-Disable-stack-conservation-for-GCC.patch
+ patch -p1 -i ${srcdir}/0007-ZEN-Initialize-ata-before-graphics.patch
+ patch -p1 -i ${srcdir}/0008-ZEN-Input-evdev-use-call_rcu-when-detaching-client.patch
+ # already applied by pf
+ #patch -p1 -i ${srcdir}/0009-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
+ patch -p1 -i ${srcdir}/0010-ZEN-Add-CONFIG-to-rename-the-mq-deadline-scheduler.patch
+ patch -p1 -i ${srcdir}/0011-ZEN-intel-pstate-Implement-enable-parameter.patch
+ patch -p1 -i ${srcdir}/0012-ZEN-Add-ACS-override-support.patch
+ patch -p1 -i ${srcdir}/0013-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch
+ patch -p1 -i ${srcdir}/0014-ZEN-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch
+ patch -p1 -i ${srcdir}/0015-ZEN-mm-Disable-watermark-boosting-by-default.patch
+ patch -p1 -i ${srcdir}/0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch
+ patch -p1 -i ${srcdir}/0017-ZEN-mm-Increment-kswapd_waiters-for-throttled-direct.patch
+ patch -p1 -i ${srcdir}/0018-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch
+ patch -p1 -i ${srcdir}/0019-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch
+ patch -p1 -i ${srcdir}/0020-ZEN-INTERACTIVE-Base-config-item.patch
+ patch -p1 -i ${srcdir}/0021-ZEN-INTERACTIVE-Use-BFQ-as-our-elevator.patch
+ patch -p1 -i ${srcdir}/0022-ZEN-INTERACTIVE-Enable-background-reclaim-of-hugepag.patch
+ patch -p1 -i ${srcdir}/0023-ZEN-INTERACTIVE-Add-help-text-for-the-MG-LRU-tweaks.patch
+ patch -p1 -i ${srcdir}/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
+ patch -p1 -i ${srcdir}/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
+ patch -p1 -i ${srcdir}/0026-ZEN-INTERACTIVE-Document-PDS-BMQ-configuration.patch
+ patch -p1 -i ${srcdir}/0027-ZEN-INTERACTIVE-mm-Disable-unevictable-compaction.patch
+ patch -p1 -i ${srcdir}/0028-ZEN-INTERACTIVE-mm-Disable-proactive-compaction-by-d.patch
# Add port map for ASUS Zenith II
patch -p1 -i ${srcdir}/asus_zenith_ii_map.patch
@@ -665,13 +720,37 @@ eval "package_linux-pf${LCPU+-$LCPU}() {
}"
-sha256sums=('027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb'
- '7cbba374356a189faac71001c5344ce8f02434684b1ce1accefc0cc4bd6718e5'
- '425743a84ca63599680f28ed2ebb7885483805104953579b6452c6c3ba24d22a'
+sha256sums=('555fef61dddb591a83d62dd04e252792f9af4ba9ef14683f64840e46fa20b1b1'
+ '27f59cb7d4adb08a81da3de822ce07d5b103c799e89aa36370e16e0b4d1f8672'
+ '969470b3c6d05fc68fdfbaf39296327edbd091a1a997ce9335822a06d690e60e'
'30566498a4f549e972fcd430d2fc44b2bd643c55bae20096f083f8837d8c43e4'
'82d660caa11db0cd34fd550a049d7296b4a9dcd28f2a50c81418066d6e598864'
- '1eb6a4d75c4aa9ba32ec92e60b502c9d04a3869004f1f2686db8631d5f573561'
+ '7759d47d620eb74afbce916b9932bdeb331377104daafa4dfa3931e0855ea17c'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
+ 'f7b461945a51af055630d396474f3cf981b5798830fb165346162680e672f842'
+ '5be0363210051e0df9b48fd745f7fe4cfa70963f98971d1b2ee55c27b4393d1a'
+ '5f007c21adfb68d84d4b63d26213b9212d956d69fee84953058b71faf4661517'
+ 'c8d29bc2579dc9a954d6b13ed50f8b07abcd058f5dcf18f170bdfd230283f926'
+ 'dd5829548fe2802fa70938359e3606fa4d97c21dbec315a12fb7836dd7caec30'
+ 'de128f4bb0d74bd5cb5ad4e52cbbc04b5f8475f9b754452ebf36b40d933784db'
+ 'fbaf3aad0e0fb84a18d43a647330a25edb6b24f21902d33aff4f0169a0287e21'
+ '0dae3fc9a283e45c30d35745ab5832336304a94f414e9f8d97b39d8a768d665f'
+ 'eeb37f5cd79f2e53018d28afbbab36d903f9203b6a7e27a514313afa9bfeff1b'
+ '6ebc39aa1d31a3745d7dcd14d6628e62877c9b8572d19c128f45fd180ca3ac7b'
+ 'ff87ca1fb418061ed09cbd4656094ef14978edd23d772b5b4ceaa3481b6f570b'
+ '47d18389f5ad85b54456be88634eec020da11d632e9af72e8423104947ef685b'
+ 'f827d78d3eecb948e3eb79219c2eafb98b1e0199f4c1bc00ecb9db1ffad723aa'
+ '02030b2ae2d912ccb64c6900cacafc799f01a35f599018007f316427d0daa39b'
+ '697db5c22b7ae716eb017c478fa7104e700f3231a88b60fa20bcbb82edc1ae94'
+ '77c921dbcf84adfea460e02fbd28542dd988f7e023c4bc75719a24805e7a9c71'
+ 'dd582720ea98321c227a4a98fb45db93afbf172f6531a34ef4a65c0ae0400c59'
+ '9e9ccb6cd669fa136669d721a3f5b3b44d522ee686b89e1cf51b92d52a0e82d8'
+ 'b1807be87aa49b7ef40bdc78596ef524c5832e556bf0ff1f62f89e77abd8d773'
+ 'fef891030e93438be1dd32fa2af28d2f5c033e7e03aad5a152eaee51b0e5f178'
+ 'b9f98e665b570d95da7b55c797bcef206fd48c017de86b5c64e22ff5b45a4713'
+ '9ffc360f1a1b354bbae4cf7f4f90fb131a80e65e35afdc3a2e52994c2740eae3'
+ '75f3929497e6de49337fc4c83a215856397261fb8be726e55656c621b45c1fba'
+ 'a23472c56b3f14ab976fc19cb0a214fd881d7519b47a1bd4f919b29324b2d3a8'
'67558840c3e1f1de229b23a54342cb126735282353a4d0a8cd10e4d582e6d9d6')
# vim:set ts=2 sw=2 tw=0 et:
diff --git a/asus_zenith_ii_map.patch b/asus_zenith_ii_map.patch
new file mode 100644
index 000000000000..97a673fdd081
--- /dev/null
+++ b/asus_zenith_ii_map.patch
@@ -0,0 +1,72 @@
+diff --git a/sound/usb/card.c b/sound/usb/card.c
+index d731ca62d599..39a4cdb28499 100644
+--- a/sound/usb/card.c
++++ b/sound/usb/card.c
+@@ -380,6 +380,14 @@ static const struct usb_audio_device_name usb_audio_names[] = {
+
+ DEVICE_NAME(0x046d, 0x0990, "Logitech, Inc.", "QuickCam Pro 9000"),
+
++ /* ASUS ROG Zenith II: this machine has also two devices, one for
++ * the front headphone and another for the rest
++ */
++ PROFILE_NAME(0x0b05, 0x1915, "ASUS", "Zenith II Front Headphone",
++ "Zenith-II-Front-Headphone"),
++ PROFILE_NAME(0x0b05, 0x1916, "ASUS", "Zenith II Main Audio",
++ "Zenith-II-Main-Audio"),
++
+ /* ASUS ROG Strix */
+ PROFILE_NAME(0x0b05, 0x1917,
+ "Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
+diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
+index a7212f16660e..0ce0f702ce3d 100644
+--- a/sound/usb/mixer_maps.c
++++ b/sound/usb/mixer_maps.c
+@@ -360,13 +360,28 @@ static const struct usbmix_name_map corsair_virtuoso_map[] = {
+ { 0 }
+ };
+
+-/* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
+- * response for Input Gain Pad (id=19, control=12) and the connector status
+- * for SPDIF terminal (id=18). Skip them.
+- */
+-static const struct usbmix_name_map asus_rog_map[] = {
+- { 18, NULL }, /* OT, connector control */
+- { 19, NULL, 12 }, /* FU, Input Gain Pad */
++/* ASUS ROG Zenith II with Realtek ALC1220-VB */
++static const struct usbmix_name_map asus_zenith_ii_map[] = {
++ { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
++ { 16, "Speaker" }, /* OT */
++ { 22, "Speaker Playback" }, /* FU */
++ { 7, "Line" }, /* IT */
++ { 19, "Line Capture" }, /* FU */
++ { 8, "Mic" }, /* IT */
++ { 20, "Mic Capture" }, /* FU */
++ { 9, "Front Mic" }, /* IT */
++ { 21, "Front Mic Capture" }, /* FU */
++ { 17, "IEC958" }, /* OT */
++ { 23, "IEC958 Playback" }, /* FU */
++ {}
++};
++
++static const struct usbmix_connector_map asus_zenith_ii_connector_map[] = {
++ { 10, 16 }, /* (Back) Speaker */
++ { 11, 17 }, /* SPDIF */
++ { 13, 7 }, /* Line */
++ { 14, 8 }, /* Mic */
++ { 15, 9 }, /* Front Mic */
+ {}
+ };
+
+@@ -555,9 +570,10 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
+ .map = trx40_mobo_map,
+ .connector_map = trx40_mobo_connector_map,
+ },
+- { /* ASUS ROG Zenith II */
++ { /* ASUS ROG Zenith II (main audio) */
+ .id = USB_ID(0x0b05, 0x1916),
+- .map = asus_rog_map,
++ .map = asus_zenith_ii_map,
++ .connector_map = asus_zenith_ii_connector_map,
+ },
+ { /* ASUS ROG Strix */
+ .id = USB_ID(0x0b05, 0x1917),
diff --git a/config.i686 b/config.i686
index 07968000a49f..d4698d186b1b 100644
--- a/config.i686
+++ b/config.i686
@@ -1,18 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.16.0-arch1 Kernel Configuration
+# Linux/x86 5.16.14-zen1 Kernel Configuration
#
-CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.1.0"
+CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
CONFIG_CC_IS_GCC=y
-CONFIG_GCC_VERSION=110100
+CONFIG_GCC_VERSION=110200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23601
+CONFIG_AS_VERSION=23800
CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23601
+CONFIG_LD_VERSION=23800
CONFIG_LLD_VERSION=0
-CONFIG_CC_CAN_LINK=y
-CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
CONFIG_CC_HAS_ASM_INLINE=y
@@ -24,11 +22,12 @@ CONFIG_THREAD_INFO_IN_TASK=y
#
# General setup
#
+CONFIG_ZEN_INTERACTIVE=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
+CONFIG_LOCALVERSION="-zen"
+# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
@@ -40,10 +39,10 @@ CONFIG_HAVE_KERNEL_ZSTD=y
# CONFIG_KERNEL_GZIP is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
-# CONFIG_KERNEL_XZ is not set
+CONFIG_KERNEL_XZ=y
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
-CONFIG_KERNEL_ZSTD=y
+# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="archlinux"
CONFIG_SWAP=y
@@ -179,6 +178,7 @@ CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
#
# Scheduler features
#
+# CONFIG_SCHED_ALT is not set
CONFIG_UCLAMP_TASK=y
CONFIG_UCLAMP_BUCKETS_COUNT=5
# end of Scheduler features
@@ -206,7 +206,7 @@ CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
-# CONFIG_CGROUP_BPF is not set
+CONFIG_CGROUP_BPF=y
CONFIG_CGROUP_MISC=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
@@ -232,7 +232,8 @@ CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_SYSCTL=y
@@ -336,7 +337,7 @@ CONFIG_X86_MPPARSE=y
# CONFIG_GOLDFISH is not set
CONFIG_RETPOLINE=y
CONFIG_X86_CPU_RESCTRL=y
-CONFIG_X86_BIGSMP=y
+# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_X86_INTEL_LPSS=y
CONFIG_X86_AMD_PLATFORM_DEVICE=y
@@ -368,6 +369,18 @@ CONFIG_M686=y
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
+# CONFIG_MK8SSE3 is not set
+# CONFIG_MK10 is not set
+# CONFIG_MBARCELONA is not set
+# CONFIG_MBOBCAT is not set
+# CONFIG_MJAGUAR is not set
+# CONFIG_MBULLDOZER is not set
+# CONFIG_MPILEDRIVER is not set
+# CONFIG_MSTEAMROLLER is not set
+# CONFIG_MEXCAVATOR is not set
+# CONFIG_MZEN is not set
+# CONFIG_MZEN2 is not set
+# CONFIG_MZEN3 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
@@ -380,6 +393,27 @@ CONFIG_M686=y
# CONFIG_MVIAC7 is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
+# CONFIG_MNEHALEM is not set
+# CONFIG_MWESTMERE is not set
+# CONFIG_MSILVERMONT is not set
+# CONFIG_MGOLDMONT is not set
+# CONFIG_MGOLDMONTPLUS is not set
+# CONFIG_MSANDYBRIDGE is not set
+# CONFIG_MIVYBRIDGE is not set
+# CONFIG_MHASWELL is not set
+# CONFIG_MBROADWELL is not set
+# CONFIG_MSKYLAKE is not set
+# CONFIG_MSKYLAKEX is not set
+# CONFIG_MCANNONLAKE is not set
+# CONFIG_MICELAKE is not set
+# CONFIG_MCASCADELAKE is not set
+# CONFIG_MCOOPERLAKE is not set
+# CONFIG_MTIGERLAKE is not set
+# CONFIG_MSAPPHIRERAPIDS is not set
+# CONFIG_MROCKETLAKE is not set
+# CONFIG_MALDERLAKE is not set
+# CONFIG_MNATIVE_INTEL is not set
+# CONFIG_MNATIVE_AMD is not set
CONFIG_X86_GENERIC=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
@@ -403,9 +437,9 @@ CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_NR_CPUS_RANGE_BEGIN=2
-CONFIG_NR_CPUS_RANGE_END=64
-CONFIG_NR_CPUS_DEFAULT=32
-CONFIG_NR_CPUS=64
+CONFIG_NR_CPUS_RANGE_END=8
+CONFIG_NR_CPUS_DEFAULT=8
+CONFIG_NR_CPUS=8
CONFIG_SCHED_CLUSTER=y
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
@@ -473,9 +507,9 @@ CONFIG_EFI=y
CONFIG_EFI_STUB=y
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
-CONFIG_HZ_300=y
-# CONFIG_HZ_1000 is not set
-CONFIG_HZ=300
+# CONFIG_HZ_300 is not set
+CONFIG_HZ_1000=y
+CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
@@ -909,6 +943,7 @@ CONFIG_BLOCK_HOLDER_DEPRECATED=y
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
+# CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT is not set
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
@@ -970,8 +1005,8 @@ CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
CONFIG_HWPOISON_INJECT=m
CONFIG_TRANSPARENT_HUGEPAGE=y
-# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
-CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
+# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
CONFIG_CMA=y
@@ -1011,6 +1046,11 @@ CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_KMAP_LOCAL=y
CONFIG_SECRETMEM=y
+CONFIG_LRU_GEN=y
+CONFIG_LRU_GEN_ENABLED=y
+CONFIG_NR_LRU_GENS=7
+CONFIG_TIERS_PER_GEN=4
+# CONFIG_LRU_GEN_STATS is not set
#
# Data Access Monitoring
@@ -1106,7 +1146,8 @@ CONFIG_TCP_CONG_YEAH=m
CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_TCP_CONG_DCTCP=m
CONFIG_TCP_CONG_CDG=m
-CONFIG_TCP_CONG_BBR=m
+# CONFIG_TCP_CONG_BBR is not set
+# CONFIG_TCP_CONG_BBR2 is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
@@ -1748,6 +1789,7 @@ CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
+CONFIG_BPF_STREAM_PARSER=y
CONFIG_NET_FLOW_LIMIT=y
#
@@ -2733,6 +2775,7 @@ CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
CONFIG_SCSI_DH_EMC=m
CONFIG_SCSI_DH_ALUA=m
+CONFIG_VHBA=m
# end of SCSI device support
CONFIG_ATA=y
@@ -3676,7 +3719,6 @@ CONFIG_IWLWIFI_LEDS=y
CONFIG_IWLDVM=m
CONFIG_IWLMVM=m
CONFIG_IWLWIFI_OPMODE_MODULAR=y
-# CONFIG_IWLWIFI_BCAST_FILTERING is not set
#
# Debugging Options
@@ -4487,6 +4529,7 @@ CONFIG_I2C_ISCH=m
CONFIG_I2C_ISMT=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_CHT_WC=m
+CONFIG_I2C_NCT6775=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_NVIDIA_GPU=m
@@ -5618,7 +5661,7 @@ CONFIG_REGULATOR_WM8994=m
CONFIG_RC_CORE=y
CONFIG_RC_MAP=m
CONFIG_LIRC=y
-# CONFIG_BPF_LIRC_MODE2 is not set
+CONFIG_BPF_LIRC_MODE2=y
CONFIG_RC_DECODERS=y
CONFIG_IR_NEC_DECODER=m
CONFIG_IR_RC5_DECODER=m
@@ -6687,9 +6730,7 @@ CONFIG_FB_I810_I2C=y
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
-CONFIG_FB_SAVAGE=m
-CONFIG_FB_SAVAGE_I2C=y
-CONFIG_FB_SAVAGE_ACCEL=y
+# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
@@ -6775,6 +6816,7 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER=y
@@ -6813,7 +6855,7 @@ CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
# CONFIG_SND_PCM_XRUN_DEBUG is not set
-CONFIG_SND_CTL_VALIDATION=y
+# CONFIG_SND_CTL_VALIDATION is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
@@ -8147,7 +8189,7 @@ CONFIG_LEDS_MENF21BMC=m
#
CONFIG_LEDS_BLINKM=m
# CONFIG_LEDS_SYSCON is not set
-# CONFIG_LEDS_MLXCPLD is not set
+CONFIG_LEDS_MLXCPLD=m
CONFIG_LEDS_MLXREG=m
CONFIG_LEDS_USER=m
CONFIG_LEDS_NIC78BX=m
@@ -8626,6 +8668,7 @@ CONFIG_DVB_SP8870=m
#
# Android
#
+CONFIG_ASHMEM=y
# end of Android
# CONFIG_STAGING_BOARD is not set
@@ -9657,7 +9700,11 @@ CONFIG_USB4=m
#
# Android
#
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES=""
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
# end of Android
CONFIG_DAX=y
@@ -10636,9 +10683,9 @@ CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
CONFIG_DEBUG_INFO_DWARF4=y
-# CONFIG_DEBUG_INFO_DWARF5 is not set
-# CONFIG_DEBUG_INFO_BTF is not set
+CONFIG_DEBUG_INFO_BTF=y
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
+CONFIG_DEBUG_INFO_BTF_MODULES=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=1024
CONFIG_STRIP_ASM_SYMS=y
@@ -10846,7 +10893,7 @@ CONFIG_UPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
-# CONFIG_BPF_KPROBE_OVERRIDE is not set
+CONFIG_BPF_KPROBE_OVERRIDE=y
CONFIG_FTRACE_MCOUNT_RECORD=y
CONFIG_FTRACE_MCOUNT_USE_CC=y
CONFIG_TRACING_MAP=y
diff --git a/config.x86_64 b/config.x86_64
index 40c80191b040..b20218cefecd 100644
--- a/config.x86_64
+++ b/config.x86_64
@@ -1,15 +1,15 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.16.0-arch1 Kernel Configuration
+# Linux/x86 5.17.0-zen1 Kernel Configuration
#
-CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.1.0"
+CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
CONFIG_CC_IS_GCC=y
-CONFIG_GCC_VERSION=110100
+CONFIG_GCC_VERSION=110200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23601
+CONFIG_AS_VERSION=23800
CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23601
+CONFIG_LD_VERSION=23800
CONFIG_LLD_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
@@ -24,6 +24,7 @@ CONFIG_THREAD_INFO_IN_TASK=y
#
# General setup
#
+CONFIG_ZEN_INTERACTIVE=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
@@ -116,7 +117,7 @@ CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_BPF_JIT_ALWAYS_ON=y
CONFIG_BPF_JIT_DEFAULT_ON=y
-# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
+CONFIG_BPF_UNPRIV_DEFAULT_OFF=y
CONFIG_USERMODE_DRIVER=y
CONFIG_BPF_PRELOAD=y
CONFIG_BPF_PRELOAD_UMD=m
@@ -167,7 +168,6 @@ CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
-CONFIG_RCU_FAST_NO_HZ=y
CONFIG_RCU_BOOST=y
CONFIG_RCU_BOOST_DELAY=500
# CONFIG_RCU_NOCB_CPU is not set
@@ -245,7 +245,8 @@ CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
-CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_LD_ORPHAN_WARN=y
CONFIG_SYSCTL=y
@@ -287,6 +288,7 @@ CONFIG_KCMP=y
CONFIG_RSEQ=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_GUEST_PERF_EVENTS=y
#
# Kernel Performance Events And Counters
@@ -329,9 +331,6 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_FILTER_PGPROT=y
-CONFIG_HAVE_SETUP_PER_CPU_AREA=y
-CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
-CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_NR_GPIO=1024
CONFIG_ARCH_SUSPEND_POSSIBLE=y
@@ -388,10 +387,46 @@ CONFIG_PARAVIRT_CLOCK=y
CONFIG_JAILHOUSE_GUEST=y
CONFIG_ACRN_GUEST=y
# CONFIG_MK8 is not set
+# CONFIG_MK8SSE3 is not set
+# CONFIG_MK10 is not set
+# CONFIG_MBARCELONA is not set
+# CONFIG_MBOBCAT is not set
+# CONFIG_MJAGUAR is not set
+# CONFIG_MBULLDOZER is not set
+# CONFIG_MPILEDRIVER is not set
+# CONFIG_MSTEAMROLLER is not set
+# CONFIG_MEXCAVATOR is not set
+# CONFIG_MZEN is not set
+# CONFIG_MZEN2 is not set
+# CONFIG_MZEN3 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
+# CONFIG_MNEHALEM is not set
+# CONFIG_MWESTMERE is not set
+# CONFIG_MSILVERMONT is not set
+# CONFIG_MGOLDMONT is not set
+# CONFIG_MGOLDMONTPLUS is not set
+# CONFIG_MSANDYBRIDGE is not set
+# CONFIG_MIVYBRIDGE is not set
+# CONFIG_MHASWELL is not set
+# CONFIG_MBROADWELL is not set
+# CONFIG_MSKYLAKE is not set
+# CONFIG_MSKYLAKEX is not set
+# CONFIG_MCANNONLAKE is not set
+# CONFIG_MICELAKE is not set
+# CONFIG_MCASCADELAKE is not set
+# CONFIG_MCOOPERLAKE is not set
+# CONFIG_MTIGERLAKE is not set
+# CONFIG_MSAPPHIRERAPIDS is not set
+# CONFIG_MROCKETLAKE is not set
+# CONFIG_MALDERLAKE is not set
CONFIG_GENERIC_CPU=y
+# CONFIG_GENERIC_CPU2 is not set
+# CONFIG_GENERIC_CPU3 is not set
+# CONFIG_GENERIC_CPU4 is not set
+# CONFIG_MNATIVE_INTEL is not set
+# CONFIG_MNATIVE_AMD is not set
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
@@ -453,6 +488,7 @@ CONFIG_X86_CPUID=y
CONFIG_X86_5LEVEL=y
CONFIG_X86_DIRECT_GBPAGES=y
CONFIG_X86_CPA_STATISTICS=y
+CONFIG_X86_MEM_ENCRYPT=y
CONFIG_AMD_MEM_ENCRYPT=y
# CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT is not set
CONFIG_NUMA=y
@@ -489,9 +525,9 @@ CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
-CONFIG_HZ_300=y
-# CONFIG_HZ_1000 is not set
-CONFIG_HZ=300
+# CONFIG_HZ_300 is not set
+CONFIG_HZ_1000=y
+CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
CONFIG_KEXEC_FILE=y
@@ -523,7 +559,6 @@ CONFIG_HAVE_LIVEPATCH=y
CONFIG_ARCH_HAS_ADD_PAGES=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
-CONFIG_USE_PERCPU_NUMA_NODE_ID=y
#
# Power management and ACPI options
@@ -556,6 +591,7 @@ CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
+CONFIG_ACPI_TABLE_LIB=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
CONFIG_ACPI_FPDT=y
@@ -610,6 +646,8 @@ CONFIG_ACPI_WATCHDOG=y
CONFIG_ACPI_EXTLOG=m
CONFIG_ACPI_ADXL=y
CONFIG_ACPI_CONFIGFS=m
+CONFIG_ACPI_PFRUT=m
+CONFIG_ACPI_PCC=y
CONFIG_PMIC_OPREGION=y
CONFIG_BYTCRC_PMIC_OPREGION=y
CONFIG_CHTCRC_PMIC_OPREGION=y
@@ -645,6 +683,7 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
#
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=m
+CONFIG_X86_AMD_PSTATE=m
CONFIG_X86_ACPI_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ_CPB=y
CONFIG_X86_POWERNOW_K8=m
@@ -695,9 +734,11 @@ CONFIG_SYSVIPC_COMPAT=y
# end of Binary Emulations
CONFIG_HAVE_KVM=y
+CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
+CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
@@ -817,6 +858,7 @@ CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
+CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_HAVE_STACK_VALIDATION=y
CONFIG_HAVE_RELIABLE_STACKTRACE=y
CONFIG_ISA_BUS_API=y
@@ -841,9 +883,12 @@ CONFIG_HAVE_STATIC_CALL_INLINE=y
CONFIG_HAVE_PREEMPT_DYNAMIC=y
CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y
CONFIG_ARCH_HAS_ELFCORE_COMPAT=y
CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y
CONFIG_DYNAMIC_SIGFRAME=y
+CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y
+CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y
#
# GCOV-based kernel profiling
@@ -887,6 +932,7 @@ CONFIG_BLOCK=y
CONFIG_BLK_RQ_ALLOC_TIME=y
CONFIG_BLK_CGROUP_RWSTAT=y
CONFIG_BLK_DEV_BSG_COMMON=y
+CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_INTEGRITY_T10=y
@@ -942,6 +988,7 @@ CONFIG_BLOCK_HOLDER_DEPRECATED=y
# IO Schedulers
#
CONFIG_MQ_IOSCHED_DEADLINE=y
+# CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT is not set
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y
@@ -1016,11 +1063,14 @@ CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
CONFIG_HWPOISON_INJECT=m
CONFIG_TRANSPARENT_HUGEPAGE=y
-# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
-CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
+# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
CONFIG_ARCH_WANTS_THP_SWAP=y
CONFIG_THP_SWAP=y
-CONFIG_CLEANCACHE=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
+CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
+CONFIG_USE_PERCPU_NUMA_NODE_ID=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_FRONTSWAP=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUG is not set
@@ -1067,11 +1117,19 @@ CONFIG_READ_ONLY_THP_FOR_FS=y
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_MAPPING_DIRTY_HELPERS=y
CONFIG_SECRETMEM=y
+CONFIG_ANON_VMA_NAME=y
+CONFIG_LRU_GEN=y
+CONFIG_LRU_GEN_ENABLED=y
+# CONFIG_LRU_GEN_STATS is not set
#
# Data Access Monitoring
#
-# CONFIG_DAMON is not set
+CONFIG_DAMON=y
+CONFIG_DAMON_VADDR=y
+CONFIG_DAMON_PADDR=y
+CONFIG_DAMON_DBGFS=y
+CONFIG_DAMON_RECLAIM=y
# end of Data Access Monitoring
# end of Memory Management options
@@ -1166,6 +1224,7 @@ CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_TCP_CONG_DCTCP=m
CONFIG_TCP_CONG_CDG=m
CONFIG_TCP_CONG_BBR=m
+CONFIG_TCP_CONG_BBR2=m
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
@@ -1271,7 +1330,6 @@ CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=m
CONFIG_NFT_CT=m
CONFIG_NFT_FLOW_OFFLOAD=m
-CONFIG_NFT_COUNTER=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
@@ -1471,7 +1529,6 @@ CONFIG_NFT_REJECT_IPV4=m
CONFIG_NFT_DUP_IPV4=m
CONFIG_NFT_FIB_IPV4=m
CONFIG_NF_TABLES_ARP=y
-CONFIG_NF_FLOW_TABLE_IPV4=m
CONFIG_NF_DUP_IPV4=m
CONFIG_NF_LOG_ARP=m
CONFIG_NF_LOG_IPV4=m
@@ -1511,7 +1568,6 @@ CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=m
CONFIG_NFT_DUP_IPV6=m
CONFIG_NFT_FIB_IPV6=m
-CONFIG_NF_FLOW_TABLE_IPV6=m
CONFIG_NF_DUP_IPV6=m
CONFIG_NF_REJECT_IPV6=m
CONFIG_NF_LOG_IPV6=m
@@ -1933,6 +1989,7 @@ CONFIG_BT_INTEL=m
CONFIG_BT_BCM=m
CONFIG_BT_RTL=m
CONFIG_BT_QCA=m
+CONFIG_BT_MTK=m
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
CONFIG_BT_HCIBTUSB_BCM=y
@@ -2015,6 +2072,7 @@ CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
CONFIG_RFKILL_GPIO=m
CONFIG_NET_9P=m
+CONFIG_NET_9P_FD=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_NET_9P_XEN=m
CONFIG_NET_9P_RDMA=m
@@ -2199,6 +2257,7 @@ CONFIG_AUXILIARY_BUS=y
# CONFIG_UEVENT_HELPER is not set
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DEVTMPFS_SAFE=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
@@ -2270,7 +2329,7 @@ CONFIG_ISCSI_IBFT=m
CONFIG_FW_CFG_SYSFS=m
# CONFIG_FW_CFG_SYSFS_CMDLINE is not set
CONFIG_SYSFB=y
-# CONFIG_SYSFB_SIMPLEFB is not set
+CONFIG_SYSFB_SIMPLEFB=y
CONFIG_CS_DSP=m
CONFIG_GOOGLE_FIRMWARE=y
# CONFIG_GOOGLE_SMI is not set
@@ -2319,6 +2378,7 @@ CONFIG_GNSS_SERIAL=m
CONFIG_GNSS_MTK_SERIAL=m
CONFIG_GNSS_SIRF_SERIAL=m
CONFIG_GNSS_UBX_SERIAL=m
+CONFIG_GNSS_USB=m
CONFIG_MTD=m
# CONFIG_MTD_TESTS is not set
@@ -2503,7 +2563,6 @@ CONFIG_XEN_BLKDEV_FRONTEND=m
CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_VIRTIO_BLK=m
CONFIG_BLK_DEV_RBD=m
-CONFIG_BLK_DEV_RSXX=m
CONFIG_BLK_DEV_RNBD=y
CONFIG_BLK_DEV_RNBD_CLIENT=m
CONFIG_BLK_DEV_RNBD_SERVER=m
@@ -2765,6 +2824,7 @@ CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
CONFIG_SCSI_DH_EMC=m
CONFIG_SCSI_DH_ALUA=m
+CONFIG_VHBA=m
# end of SCSI device support
CONFIG_ATA=y
@@ -2801,7 +2861,6 @@ CONFIG_ATA_BMDMA=y
CONFIG_ATA_PIIX=m
CONFIG_SATA_DWC=m
# CONFIG_SATA_DWC_OLD_DMA is not set
-# CONFIG_SATA_DWC_DEBUG is not set
CONFIG_SATA_MV=m
CONFIG_SATA_NV=m
CONFIG_SATA_PROMISE=m
@@ -3180,6 +3239,9 @@ CONFIG_BE2NET_BE2=y
CONFIG_BE2NET_BE3=y
CONFIG_BE2NET_LANCER=y
CONFIG_BE2NET_SKYHAWK=y
+CONFIG_NET_VENDOR_ENGLEDER=y
+CONFIG_TSNEP=m
+# CONFIG_TSNEP_SELFTESTS is not set
CONFIG_NET_VENDOR_EZCHIP=y
CONFIG_NET_VENDOR_FUJITSU=y
CONFIG_PCMCIA_FMVJ18X=m
@@ -3211,6 +3273,7 @@ CONFIG_IAVF=m
CONFIG_I40EVF=m
CONFIG_ICE=m
CONFIG_ICE_SWITCHDEV=y
+CONFIG_ICE_HWTS=y
CONFIG_FM10K=m
CONFIG_IGC=m
CONFIG_NET_VENDOR_MICROSOFT=y
@@ -3382,6 +3445,8 @@ CONFIG_TEHUTI=m
CONFIG_NET_VENDOR_TI=y
# CONFIG_TI_CPSW_PHY_SEL is not set
CONFIG_TLAN=m
+CONFIG_NET_VENDOR_VERTEXCOM=y
+CONFIG_MSE102X=m
CONFIG_NET_VENDOR_VIA=y
CONFIG_VIA_RHINE=m
CONFIG_VIA_RHINE_MMIO=y
@@ -3464,6 +3529,9 @@ CONFIG_MICREL_KS8995MA=m
#
# MCTP Device Drivers
#
+CONFIG_MCTP_SERIAL=m
+# end of MCTP Device Drivers
+
CONFIG_MDIO_DEVICE=m
CONFIG_MDIO_BUS=m
CONFIG_FWNODE_MDIO=m
@@ -3692,7 +3760,6 @@ CONFIG_IWLWIFI_LEDS=y
CONFIG_IWLDVM=m
CONFIG_IWLMVM=m
CONFIG_IWLWIFI_OPMODE_MODULAR=y
-# CONFIG_IWLWIFI_BCAST_FILTERING is not set
#
# Debugging Options
@@ -3702,6 +3769,7 @@ CONFIG_IWLWIFI_DEBUGFS=y
CONFIG_IWLWIFI_DEVICE_TRACING=y
# end of Debugging Options
+CONFIG_IWLMEI=m
CONFIG_WLAN_VENDOR_INTERSIL=y
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
@@ -3893,6 +3961,7 @@ CONFIG_IEEE802154_HWSIM=m
# Wireless WAN
#
CONFIG_WWAN=y
+CONFIG_WWAN_DEBUGFS=y
CONFIG_WWAN_HWSIM=m
CONFIG_MHI_WWAN_CTRL=m
CONFIG_MHI_WWAN_MBIM=m
@@ -4308,6 +4377,7 @@ CONFIG_SERIAL_8250_DW=m
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
+CONFIG_SERIAL_8250_PERICOM=y
#
# Non-8250 serial port support
@@ -4422,8 +4492,8 @@ CONFIG_XILLYBUS_CLASS=m
CONFIG_XILLYBUS=m
CONFIG_XILLYBUS_PCIE=m
CONFIG_XILLYUSB=m
-# CONFIG_RANDOM_TRUST_CPU is not set
-# CONFIG_RANDOM_TRUST_BOOTLOADER is not set
+CONFIG_RANDOM_TRUST_CPU=y
+CONFIG_RANDOM_TRUST_BOOTLOADER=y
# end of Character devices
#
@@ -4471,6 +4541,7 @@ CONFIG_I2C_ISCH=m
CONFIG_I2C_ISMT=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_CHT_WC=m
+CONFIG_I2C_NCT6775=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_NVIDIA_GPU=m
@@ -4626,6 +4697,12 @@ CONFIG_PINCTRL_MCP23S08_I2C=m
CONFIG_PINCTRL_MCP23S08_SPI=m
CONFIG_PINCTRL_MCP23S08=m
CONFIG_PINCTRL_SX150X=y
+CONFIG_PINCTRL_MADERA=m
+CONFIG_PINCTRL_CS47L15=y
+CONFIG_PINCTRL_CS47L35=y
+CONFIG_PINCTRL_CS47L85=y
+CONFIG_PINCTRL_CS47L90=y
+CONFIG_PINCTRL_CS47L92=y
#
# Intel pinctrl drivers
@@ -4655,12 +4732,6 @@ CONFIG_PINCTRL_TIGERLAKE=y
#
# end of Renesas pinctrl drivers
-CONFIG_PINCTRL_MADERA=m
-CONFIG_PINCTRL_CS47L15=y
-CONFIG_PINCTRL_CS47L35=y
-CONFIG_PINCTRL_CS47L85=y
-CONFIG_PINCTRL_CS47L90=y
-CONFIG_PINCTRL_CS47L92=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_GPIO_ACPI=y
@@ -4774,6 +4845,7 @@ CONFIG_GPIO_VIPERBOARD=m
CONFIG_GPIO_AGGREGATOR=m
CONFIG_GPIO_MOCKUP=m
CONFIG_GPIO_VIRTIO=m
+CONFIG_GPIO_SIM=m
# end of Virtual GPIO drivers
CONFIG_W1=m
@@ -4870,6 +4942,7 @@ CONFIG_CHARGER_LT3651=m
CONFIG_CHARGER_LTC4162L=m
CONFIG_CHARGER_MAX14577=m
CONFIG_CHARGER_MAX77693=m
+CONFIG_CHARGER_MAX77976=m
CONFIG_CHARGER_MAX8997=m
CONFIG_CHARGER_MAX8998=m
CONFIG_CHARGER_MP2629=m
@@ -5020,6 +5093,7 @@ CONFIG_SENSORS_NCT7802=m
CONFIG_SENSORS_NCT7904=m
CONFIG_SENSORS_NPCM7XX=m
CONFIG_SENSORS_NZXT_KRAKEN2=m
+CONFIG_SENSORS_NZXT_SMART2=m
CONFIG_SENSORS_PCF8591=m
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
@@ -5027,6 +5101,7 @@ CONFIG_SENSORS_ADM1266=m
CONFIG_SENSORS_ADM1275=m
CONFIG_SENSORS_BEL_PFE=m
CONFIG_SENSORS_BPA_RS600=m
+CONFIG_SENSORS_DELTA_AHE50DC_FAN=m
CONFIG_SENSORS_FSP_3Y=m
CONFIG_SENSORS_IBM_CFFPS=m
CONFIG_SENSORS_DPS920AB=m
@@ -5034,6 +5109,7 @@ CONFIG_SENSORS_INSPUR_IPSPS=m
CONFIG_SENSORS_IR35221=m
CONFIG_SENSORS_IR36021=m
CONFIG_SENSORS_IR38064=m
+CONFIG_SENSORS_IR38064_REGULATOR=y
CONFIG_SENSORS_IRPS5401=m
CONFIG_SENSORS_ISL68137=m
CONFIG_SENSORS_LM25066=m
@@ -5050,6 +5126,7 @@ CONFIG_SENSORS_MAX34440=m
CONFIG_SENSORS_MAX8688=m
CONFIG_SENSORS_MP2888=m
CONFIG_SENSORS_MP2975=m
+CONFIG_SENSORS_MP5023=m
CONFIG_SENSORS_PIM4328=m
CONFIG_SENSORS_PM6764TR=m
CONFIG_SENSORS_PXE1610=m
@@ -5087,6 +5164,7 @@ CONFIG_SENSORS_ADS7871=m
CONFIG_SENSORS_AMC6821=m
CONFIG_SENSORS_INA209=m
CONFIG_SENSORS_INA2XX=m
+CONFIG_SENSORS_INA238=m
CONFIG_SENSORS_INA3221=m
CONFIG_SENSORS_TC74=m
CONFIG_SENSORS_THMC50=m
@@ -5121,6 +5199,8 @@ CONFIG_SENSORS_INTEL_M10_BMC_HWMON=m
#
CONFIG_SENSORS_ACPI_POWER=m
CONFIG_SENSORS_ATK0110=m
+CONFIG_SENSORS_ASUS_WMI=m
+CONFIG_SENSORS_ASUS_WMI_EC=m
CONFIG_THERMAL=y
CONFIG_THERMAL_NETLINK=y
# CONFIG_THERMAL_STATISTICS is not set
@@ -5243,6 +5323,7 @@ CONFIG_SBC_EPX_C3_WATCHDOG=m
CONFIG_INTEL_MEI_WDT=m
CONFIG_NI903X_WDT=m
CONFIG_NIC7018_WDT=m
+CONFIG_SIEMENS_SIMATIC_IPC_WDT=m
CONFIG_MEN_A21_WDT=m
CONFIG_XEN_WDT=m
@@ -5328,7 +5409,6 @@ CONFIG_MFD_INTEL_LPSS=m
CONFIG_MFD_INTEL_LPSS_ACPI=m
CONFIG_MFD_INTEL_LPSS_PCI=m
CONFIG_MFD_INTEL_PMC_BXT=m
-CONFIG_MFD_INTEL_PMT=m
CONFIG_MFD_IQS62X=m
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_KEMPLD=m
@@ -5452,6 +5532,7 @@ CONFIG_REGULATOR_MAX8925=m
CONFIG_REGULATOR_MAX8952=m
CONFIG_REGULATOR_MAX8997=m
CONFIG_REGULATOR_MAX8998=m
+CONFIG_REGULATOR_MAX20086=m
CONFIG_REGULATOR_MAX77693=m
CONFIG_REGULATOR_MAX77826=m
CONFIG_REGULATOR_MC13XXX_CORE=m
@@ -5496,6 +5577,7 @@ CONFIG_REGULATOR_TPS6524X=m
CONFIG_REGULATOR_TPS6586X=m
CONFIG_REGULATOR_TPS65910=m
CONFIG_REGULATOR_TPS65912=m
+CONFIG_REGULATOR_TPS68470=m
CONFIG_REGULATOR_TWL4030=m
CONFIG_REGULATOR_WM831X=m
CONFIG_REGULATOR_WM8350=m
@@ -5994,6 +6076,7 @@ CONFIG_VIDEO_OV5648=m
CONFIG_VIDEO_OV6650=m
CONFIG_VIDEO_OV5670=m
CONFIG_VIDEO_OV5675=m
+CONFIG_VIDEO_OV5693=m
CONFIG_VIDEO_OV5695=m
CONFIG_VIDEO_OV7251=m
CONFIG_VIDEO_OV772X=m
@@ -6292,8 +6375,7 @@ CONFIG_DRM_DP_CEC=y
CONFIG_DRM_TTM=m
CONFIG_DRM_VRAM_HELPER=m
CONFIG_DRM_TTM_HELPER=m
-CONFIG_DRM_GEM_CMA_HELPER=y
-CONFIG_DRM_KMS_CMA_HELPER=y
+CONFIG_DRM_GEM_CMA_HELPER=m
CONFIG_DRM_GEM_SHMEM_HELPER=y
CONFIG_DRM_SCHED=m
@@ -6396,6 +6478,7 @@ CONFIG_DRM_CIRRUS_QEMU=m
CONFIG_DRM_GM12U320=m
CONFIG_DRM_SIMPLEDRM=y
CONFIG_TINYDRM_HX8357D=m
+CONFIG_TINYDRM_ILI9163=m
CONFIG_TINYDRM_ILI9225=m
CONFIG_TINYDRM_ILI9341=m
CONFIG_TINYDRM_ILI9486=m
@@ -6410,6 +6493,8 @@ CONFIG_DRM_GUD=m
CONFIG_DRM_HYPERV=m
# CONFIG_DRM_LEGACY is not set
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
+CONFIG_DRM_NOMODESET=y
+CONFIG_DRM_PRIVACY_SCREEN=y
#
# Frame buffer Devices
@@ -6417,7 +6502,7 @@ CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
CONFIG_FB_CMDLINE=y
CONFIG_FB_NOTIFY=y
CONFIG_FB=y
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_FIRMWARE_EDID is not set
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
@@ -6428,8 +6513,8 @@ CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
#
# Frame buffer hardware drivers
@@ -6541,8 +6626,9 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER=y
# end of Console display driver support
@@ -6695,6 +6781,9 @@ CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=0
CONFIG_SND_HDA_PATCH_LOADER=y
+CONFIG_SND_HDA_SCODEC_CS35L41=m
+CONFIG_SND_HDA_SCODEC_CS35L41_I2C=m
+CONFIG_SND_HDA_SCODEC_CS35L41_SPI=m
CONFIG_SND_HDA_CODEC_REALTEK=m
CONFIG_SND_HDA_CODEC_ANALOG=m
CONFIG_SND_HDA_CODEC_SIGMATEL=m
@@ -6774,6 +6863,7 @@ CONFIG_SND_SOC_AMD_ACP5x=m
CONFIG_SND_SOC_AMD_VANGOGH_MACH=m
CONFIG_SND_SOC_AMD_ACP6x=m
CONFIG_SND_SOC_AMD_YC_MACH=m
+CONFIG_SND_AMD_ACP_CONFIG=m
CONFIG_SND_SOC_AMD_ACP_COMMON=m
CONFIG_SND_SOC_AMD_ACP_I2S=m
CONFIG_SND_SOC_AMD_ACP_PCM=m
@@ -6872,6 +6962,7 @@ CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m
CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH=m
CONFIG_SND_SOC_INTEL_SOF_PCM512x_MACH=m
CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m
+CONFIG_SND_SOC_INTEL_SOF_NAU8825_MACH=m
CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH=m
CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH=m
CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH=m
@@ -6886,6 +6977,9 @@ CONFIG_SND_SOC_SOF_ACPI_DEV=m
# CONFIG_SND_SOC_SOF_DEBUG_PROBES is not set
CONFIG_SND_SOC_SOF=m
CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE=y
+CONFIG_SND_SOC_SOF_AMD_TOPLEVEL=m
+CONFIG_SND_SOC_SOF_AMD_COMMON=m
+CONFIG_SND_SOC_SOF_AMD_RENOIR=m
CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y
CONFIG_SND_SOC_SOF_INTEL_HIFI_EP_IPC=m
CONFIG_SND_SOC_SOF_INTEL_ATOM_HIFI_EP=m
@@ -6948,6 +7042,7 @@ CONFIG_SND_SOC_ADAU7118_HW=m
CONFIG_SND_SOC_ADAU7118_I2C=m
CONFIG_SND_SOC_AK4104=m
CONFIG_SND_SOC_AK4118=m
+CONFIG_SND_SOC_AK4375=m
CONFIG_SND_SOC_AK4458=m
CONFIG_SND_SOC_AK4554=m
CONFIG_SND_SOC_AK4613=m
@@ -6963,6 +7058,8 @@ CONFIG_SND_SOC_CS35L33=m
CONFIG_SND_SOC_CS35L34=m
CONFIG_SND_SOC_CS35L35=m
CONFIG_SND_SOC_CS35L36=m
+CONFIG_SND_SOC_CS35L41_LIB=m
+CONFIG_SND_SOC_CS35L41=m
CONFIG_SND_SOC_CS35L41_SPI=m
CONFIG_SND_SOC_CS35L41_I2C=m
CONFIG_SND_SOC_CS42L42=m
@@ -7098,6 +7195,7 @@ CONFIG_SND_SOC_TAS6424=m
CONFIG_SND_SOC_TDA7419=m
CONFIG_SND_SOC_TFA9879=m
CONFIG_SND_SOC_TFA989X=m
+CONFIG_SND_SOC_TLV320ADC3XXX=m
CONFIG_SND_SOC_TLV320AIC23=m
CONFIG_SND_SOC_TLV320AIC23_I2C=m
CONFIG_SND_SOC_TLV320AIC23_SPI=m
@@ -7236,6 +7334,7 @@ CONFIG_HID_KENSINGTON=m
CONFIG_HID_LCPOWER=m
CONFIG_HID_LED=m
CONFIG_HID_LENOVO=m
+CONFIG_HID_LETSKETCH=m
CONFIG_HID_LOGITECH=m
CONFIG_HID_LOGITECH_DJ=m
CONFIG_HID_LOGITECH_HIDPP=m
@@ -7398,6 +7497,7 @@ CONFIG_USB_R8A66597_HCD=m
CONFIG_USB_HCD_BCMA=m
CONFIG_USB_HCD_SSB=m
# CONFIG_USB_HCD_TEST_MODE is not set
+CONFIG_USB_XEN_HCD=m
#
# USB Device Class drivers
@@ -7893,6 +7993,11 @@ CONFIG_LEDS_TRIGGER_NETDEV=m
CONFIG_LEDS_TRIGGER_PATTERN=m
CONFIG_LEDS_TRIGGER_AUDIO=m
CONFIG_LEDS_TRIGGER_TTY=m
+
+#
+# Simple LED drivers
+#
+CONFIG_LEDS_SIEMENS_SIMATIC_IPC=m
CONFIG_ACCESSIBILITY=y
CONFIG_A11Y_BRAILLE_CONSOLE=y
@@ -8380,6 +8485,7 @@ CONFIG_DVB_SP8870=m
#
# Android
#
+CONFIG_ASHMEM=y
# end of Android
CONFIG_LTE_GDM724X=m
@@ -8410,6 +8516,7 @@ CONFIG_PEAQ_WMI=m
CONFIG_NVIDIA_WMI_EC_BACKLIGHT=m
CONFIG_XIAOMI_WMI=m
CONFIG_GIGABYTE_WMI=m
+CONFIG_YOGABOOK_WMI=m
CONFIG_ACERHDF=m
CONFIG_ACER_WIRELESS=m
CONFIG_ACER_WMI=m
@@ -8420,6 +8527,7 @@ CONFIG_ASUS_LAPTOP=m
CONFIG_ASUS_WIRELESS=m
CONFIG_ASUS_WMI=m
CONFIG_ASUS_NB_WMI=m
+CONFIG_ASUS_TF103C_DOCK=m
CONFIG_MERAKI_MX100=m
CONFIG_EEEPC_LAPTOP=m
CONFIG_EEEPC_WMI=m
@@ -8490,6 +8598,7 @@ CONFIG_INTEL_RST=m
CONFIG_INTEL_SMARTCONNECT=m
CONFIG_INTEL_TURBO_MAX_3=y
CONFIG_INTEL_UNCORE_FREQ_CONTROL=m
+CONFIG_INTEL_VSEC=m
CONFIG_MSI_LAPTOP=m
CONFIG_MSI_WMI=m
CONFIG_PCENGINES_APU2=m
@@ -8511,6 +8620,7 @@ CONFIG_TOPSTAR_LAPTOP=m
CONFIG_I2C_MULTI_INSTANTIATE=m
CONFIG_MLX_PLATFORM=m
CONFIG_TOUCHSCREEN_DMI=y
+CONFIG_X86_ANDROID_TABLETS=m
CONFIG_FW_ATTR_CLASS=m
CONFIG_INTEL_IPS=m
CONFIG_INTEL_SCU_IPC=y
@@ -8518,6 +8628,7 @@ CONFIG_INTEL_SCU=y
CONFIG_INTEL_SCU_PCI=y
CONFIG_INTEL_SCU_PLATFORM=m
CONFIG_INTEL_SCU_IPC_UTIL=m
+CONFIG_SIEMENS_SIMATIC_IPC=m
CONFIG_PMC_ATOM=y
CONFIG_CHROME_PLATFORMS=y
CONFIG_CHROMEOS_LAPTOP=m
@@ -8571,6 +8682,7 @@ CONFIG_COMMON_CLK_SI5341=m
CONFIG_COMMON_CLK_SI5351=m
CONFIG_COMMON_CLK_SI544=m
CONFIG_COMMON_CLK_CDCE706=m
+CONFIG_COMMON_CLK_TPS68470=m
CONFIG_COMMON_CLK_CS2000_CP=m
CONFIG_CLK_TWL6040=m
CONFIG_COMMON_CLK_PALMAS=m
@@ -8862,6 +8974,9 @@ CONFIG_TI_ADC128S052=m
CONFIG_TI_ADC161S626=m
CONFIG_TI_ADS1015=m
CONFIG_TI_ADS7950=m
+CONFIG_TI_ADS8344=m
+CONFIG_TI_ADS8688=m
+CONFIG_TI_ADS124S08=m
CONFIG_TI_ADS131E08=m
CONFIG_TI_AM335X_ADC=m
CONFIG_TI_TLC4541=m
@@ -8873,6 +8988,12 @@ CONFIG_XILINX_XADC=m
# end of Analog to digital converters
#
+# Analog to digital and digital to analog converters
+#
+CONFIG_AD74413R=m
+# end of Analog to digital and digital to analog converters
+
+#
# Analog Front Ends
#
# end of Analog Front Ends
@@ -8946,6 +9067,7 @@ CONFIG_IIO_ST_SENSORS_CORE=m
#
# Digital to analog converters
#
+CONFIG_AD3552R=m
CONFIG_AD5064=m
CONFIG_AD5360=m
CONFIG_AD5380=m
@@ -8967,6 +9089,7 @@ CONFIG_AD5764=m
CONFIG_AD5766=m
CONFIG_AD5770R=m
CONFIG_AD5791=m
+CONFIG_AD7293=m
CONFIG_AD7303=m
CONFIG_AD8801=m
CONFIG_DS4424=m
@@ -8974,6 +9097,7 @@ CONFIG_LTC1660=m
CONFIG_LTC2632=m
CONFIG_M62332=m
CONFIG_MAX517=m
+CONFIG_MAX5821=m
CONFIG_MCP4725=m
CONFIG_MCP4922=m
CONFIG_TI_DAC082S085=m
@@ -8989,6 +9113,12 @@ CONFIG_TI_DAC7612=m
# end of IIO dummy driver
#
+# Filters
+#
+CONFIG_ADMV8818=m
+# end of Filters
+
+#
# Frequency Synthesizers DDS/PLL
#
@@ -9003,6 +9133,7 @@ CONFIG_AD9523=m
#
CONFIG_ADF4350=m
CONFIG_ADF4371=m
+CONFIG_ADMV1013=m
CONFIG_ADRF6780=m
# end of Phase-Locked Loop (PLL) frequency synthesizers
# end of Frequency Synthesizers DDS/PLL
@@ -9390,7 +9521,11 @@ CONFIG_USB4=m
#
# Android
#
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES=""
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
# end of Android
CONFIG_LIBNVDIMM=y
@@ -9402,14 +9537,12 @@ CONFIG_BTT=y
CONFIG_ND_PFN=m
CONFIG_NVDIMM_PFN=y
CONFIG_NVDIMM_DAX=y
-CONFIG_DAX_DRIVER=y
CONFIG_DAX=y
CONFIG_DEV_DAX=m
CONFIG_DEV_DAX_PMEM=m
CONFIG_DEV_DAX_HMEM=m
CONFIG_DEV_DAX_HMEM_DEVICES=y
CONFIG_DEV_DAX_KMEM=m
-CONFIG_DEV_DAX_PMEM_COMPAT=m
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
CONFIG_RAVE_SP_EEPROM=m
@@ -9602,6 +9735,7 @@ CONFIG_FSCACHE_STATS=y
# CONFIG_FSCACHE_DEBUG is not set
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
+# CONFIG_CACHEFILES_ERROR_INJECTION is not set
# end of Caches
#
@@ -9974,7 +10108,7 @@ CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
-CONFIG_ZERO_CALL_USED_REGS=y
+# CONFIG_ZERO_CALL_USED_REGS is not set
# end of Memory initialization
# end of Kernel hardening options
# end of Security options
@@ -10159,6 +10293,7 @@ CONFIG_CRYPTO_DRBG_HASH=y
CONFIG_CRYPTO_DRBG_CTR=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
+CONFIG_CRYPTO_KDF800108_CTR=y
CONFIG_CRYPTO_USER_API=m
CONFIG_CRYPTO_USER_API_HASH=m
CONFIG_CRYPTO_USER_API_SKCIPHER=m
@@ -10168,29 +10303,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
# CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE is not set
CONFIG_CRYPTO_STATS=y
CONFIG_CRYPTO_HASH_INFO=y
-
-#
-# Crypto library routines
-#
-CONFIG_CRYPTO_LIB_AES=y
-CONFIG_CRYPTO_LIB_ARC4=m
-CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=m
-CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=m
-CONFIG_CRYPTO_LIB_BLAKE2S=m
-CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
-CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m
-CONFIG_CRYPTO_LIB_CHACHA=m
-CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=m
-CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m
-CONFIG_CRYPTO_LIB_CURVE25519=m
-CONFIG_CRYPTO_LIB_DES=m
-CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
-CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=m
-CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m
-CONFIG_CRYPTO_LIB_POLY1305=m
-CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
-CONFIG_CRYPTO_LIB_SHA256=y
-CONFIG_CRYPTO_LIB_SM4=m
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=m
CONFIG_CRYPTO_DEV_PADLOCK_AES=m
@@ -10258,7 +10370,6 @@ CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
-CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_CORDIC=m
# CONFIG_PRIME_NUMBERS is not set
CONFIG_RATIONAL=y
@@ -10267,6 +10378,30 @@ CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y
+
+#
+# Crypto library routines
+#
+CONFIG_CRYPTO_LIB_AES=y
+CONFIG_CRYPTO_LIB_ARC4=m
+CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y
+CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
+CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
+CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m
+CONFIG_CRYPTO_LIB_CHACHA=m
+CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=m
+CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m
+CONFIG_CRYPTO_LIB_CURVE25519=m
+CONFIG_CRYPTO_LIB_DES=m
+CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
+CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=m
+CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m
+CONFIG_CRYPTO_LIB_POLY1305=m
+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
+CONFIG_CRYPTO_LIB_SHA256=y
+CONFIG_CRYPTO_LIB_SM4=m
+# end of Crypto library routines
+
CONFIG_CRC_CCITT=y
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=y
@@ -10462,11 +10597,19 @@ CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_MISC is not set
#
+# Networking Debugging
+#
+# CONFIG_NET_DEV_REFCNT_TRACKER is not set
+# CONFIG_NET_NS_REFCNT_TRACKER is not set
+# end of Networking Debugging
+
+#
# Memory Debugging
#
# CONFIG_PAGE_EXTENSION is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_PAGE_OWNER is not set
+# CONFIG_PAGE_TABLE_CHECK is not set
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_PAGE_REF is not set
CONFIG_DEBUG_RODATA_TEST=y
@@ -10603,6 +10746,8 @@ CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
+CONFIG_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
@@ -10652,6 +10797,7 @@ CONFIG_HIST_TRIGGERS=y
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_RECORD_RECURSION is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_FTRACE_SORT_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set
# CONFIG_MMIOTRACE_TEST is not set
@@ -10709,6 +10855,7 @@ CONFIG_RUNTIME_TESTING_MENU=y
# CONFIG_TEST_MIN_HEAP is not set
# CONFIG_TEST_DIV64 is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_TEST_REF_TRACKER is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_REED_SOLOMON_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
@@ -10727,7 +10874,7 @@ CONFIG_ASYNC_RAID6_TEST=m
# CONFIG_TEST_XARRAY is not set
# CONFIG_TEST_OVERFLOW is not set
# CONFIG_TEST_RHASHTABLE is not set
-# CONFIG_TEST_HASH is not set
+# CONFIG_TEST_SIPHASH is not set
# CONFIG_TEST_IDA is not set
# CONFIG_TEST_PARMAN is not set
# CONFIG_TEST_LKM is not set
diff --git a/update_kernel_config.sh b/update_kernel_config.sh
index a10351611dbd..f70c2f16cee4 100644
--- a/update_kernel_config.sh
+++ b/update_kernel_config.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-wget https://git.archlinux32.org/packages/plain/core/linux/config.i686 \
+wget https://git.archlinux32.org/packages/plain/extra/linux-zen/config \
-O config.i686
-wget 'https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/linux/trunk/config' \
+wget 'https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/linux-zen/trunk/config' \
-O config.x86_64