diff --git a/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch b/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch deleted file mode 100644 index acad1a2..0000000 --- a/linux58-rc-tkg/linux58-tkg-patches/0012-misc-additions.patch +++ /dev/null @@ -1,141 +0,0 @@ -diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig -index 0840d27381ea..73aba9a31064 100644 ---- a/drivers/tty/Kconfig -+++ b/drivers/tty/Kconfig -@@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP - def_bool y - depends on VT_CONSOLE && PM_SLEEP - -+config NR_TTY_DEVICES -+ int "Maximum tty device number" -+ depends on VT -+ range 12 63 -+ default 63 -+ ---help--- -+ This option is used to change the number of tty devices in /dev. -+ The default value is 63. The lowest number you can set is 12, -+ 63 is also the upper limit so we don't overrun the serial -+ consoles. -+ -+ If unsure, say 63. -+ - config HW_CONSOLE - bool - depends on VT && !UML -diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h -index e9d39c48520a..3bceead8da40 100644 ---- a/include/uapi/linux/vt.h -+++ b/include/uapi/linux/vt.h -@@ -3,12 +3,25 @@ - #define _UAPI_LINUX_VT_H - - -+/* -+ * We will make this definition solely for the purpose of making packages -+ * such as splashutils build, because they can not understand that -+ * NR_TTY_DEVICES is defined in the kernel configuration. -+ */ -+#ifndef CONFIG_NR_TTY_DEVICES -+#define CONFIG_NR_TTY_DEVICES 63 -+#endif -+ - /* - * These constants are also useful for user-level apps (e.g., VC - * resizing). - */ - #define MIN_NR_CONSOLES 1 /* must be at least 1 */ --#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ -+/* -+ * NR_TTY_DEVICES: -+ * Value MUST be at least 12 and must never be higher then 63 -+ */ -+#define MAX_NR_CONSOLES CONFIG_NR_TTY_DEVICES /* serial lines start above this */ - /* Note: the ioctl VT_GETSTATE does not work for - consoles 16 and higher (since it returns a short) */ - -diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 86ffa0c2880f..710edc70e37e 100644 ---- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -8717,20 +8717,38 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, - * the same resource. If we have a new DC context as part of - * the DM atomic state from validation we need to free it and - * retain the existing one instead. -+ * -+ * Furthermore, since the DM atomic state only contains the DC -+ * context and can safely be annulled, we can free the state -+ * and clear the associated private object now to free -+ * some memory and avoid a possible use-after-free later. - */ -- struct dm_atomic_state *new_dm_state, *old_dm_state; - -- new_dm_state = dm_atomic_get_new_state(state); -- old_dm_state = dm_atomic_get_old_state(state); -+ for (i = 0; i < state->num_private_objs; i++) { -+ struct drm_private_obj *obj = state->private_objs[i].ptr; - -- if (new_dm_state && old_dm_state) { -- if (new_dm_state->context) -- dc_release_state(new_dm_state->context); -+ if (obj->funcs == adev->dm.atomic_obj.funcs) { -+ int j = state->num_private_objs-1; - -- new_dm_state->context = old_dm_state->context; -+ dm_atomic_destroy_state(obj, -+ state->private_objs[i].state); -+ -+ /* If i is not at the end of the array then the -+ * last element needs to be moved to where i was -+ * before the array can safely be truncated. -+ */ -+ if (i != j) -+ state->private_objs[i] = -+ state->private_objs[j]; - -- if (old_dm_state->context) -- dc_retain_state(old_dm_state->context); -+ state->private_objs[j].ptr = NULL; -+ state->private_objs[j].state = NULL; -+ state->private_objs[j].old_state = NULL; -+ state->private_objs[j].new_state = NULL; -+ -+ state->num_private_objs = j; -+ break; -+ } - } - } - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c -index 02e6f8c4dde0..ebb8a28ff002 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c -@@ -778,7 +778,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, - tmp_str++; - while (isspace(*++tmp_str)); - -- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) { -+ while (tmp_str[0]) { -+ sub_str = strsep(&tmp_str, delimiter); - ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); - if (ret) - return -EINVAL; -@@ -1038,7 +1039,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask) - memcpy(buf_cpy, buf, bytes); - buf_cpy[bytes] = '\0'; - tmp = buf_cpy; -- while ((sub_str = strsep(&tmp, delimiter)) != NULL) { -+ while (tmp[0]) { -+ sub_str = strsep(&tmp, delimiter); - if (strlen(sub_str)) { - ret = kstrtol(sub_str, 0, &level); - if (ret) -@@ -1635,7 +1637,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, - i++; - memcpy(buf_cpy, buf, count-i); - tmp_str = buf_cpy; -- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) { -+ while (tmp_str[0]) { -+ sub_str = strsep(&tmp_str, delimiter); - ret = kstrtol(sub_str, 0, ¶meter[parameter_size]); - if (ret) - return -EINVAL; diff --git a/linux58-rc-tkg/PKGBUILD b/linux58-tkg/PKGBUILD similarity index 97% rename from linux58-rc-tkg/PKGBUILD rename to linux58-tkg/PKGBUILD index ac5dfee..381698d 100644 --- a/linux58-rc-tkg/PKGBUILD +++ b/linux58-tkg/PKGBUILD @@ -82,7 +82,7 @@ else fi pkgname=("${pkgbase}" "${pkgbase}-headers") _basekernel=5.8 -_sub=rc7 +_sub=0 pkgver="${_basekernel}"."${_sub}" pkgrel=1 pkgdesc='Linux-tkg' @@ -92,7 +92,7 @@ license=('GPL2') makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'libelf' 'patchutils' 'pahole' 'flex' 'python-sphinx' 'python-sphinx_rtd_theme' 'graphviz' 'imagemagick' 'git') optdepends=('schedtool') options=('!strip') -source=("https://git.kernel.org/torvalds/t/linux-${_basekernel}-${_sub}.tar.gz" +source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.xz" "https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/master/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch" 'config.x86_64' # stock Arch config #'config_hardened.x86_64' # hardened Arch config @@ -120,7 +120,7 @@ source=("https://git.kernel.org/torvalds/t/linux-${_basekernel}-${_sub}.tar.gz" #0012-linux-hardened.patch 0012-misc-additions.patch ) -sha256sums=('ace7c02ad8577c8fc19b2e6b5d0aeeee06721511527bc38dd975b2c56982ccec' +sha256sums=('e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5' '5ab29eb64e57df83b395a29a6a4f89030d142feffbfbf73b3afc6d97a2a7fd12' '6ee0c373c8aeed0f162f9515a3f82e14b90982bd3180e155cb91c1b6749e854a' '1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898' @@ -135,7 +135,7 @@ sha256sums=('ace7c02ad8577c8fc19b2e6b5d0aeeee06721511527bc38dd975b2c56982ccec' '19661ec0d39f9663452b34433214c755179894528bf73a42f6ba52ccf572832a' 'cd225e86d72eaf6c31ef3d7b20df397f4cc44ddd04389850691292cdf292b204' '49262ce4a8089fa70275aad742fc914baa28d9c384f710c9a62f64796d13e104' - 'b9f724ada90bc7c87c77429278ddbe20cfcbd768bd3cb1e1c132a0f1eda3625f') + '98311deeb474b39e821cd1e64198793d5c4d797155b3b8bbcb1938b7f11e8d74') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase @@ -193,14 +193,14 @@ prepare() { ln -s "${_where}/customization.cfg" "${srcdir}" # workaround - cd "${srcdir}/linux-${_basekernel}-${_sub}" + cd "${srcdir}/linux-${_basekernel}" source "$_where/linux$_basever-tkg-config/prepare" _tkg_srcprep } build() { - cd "${srcdir}/linux-${_basekernel}-${_sub}" + cd "${srcdir}/linux-${_basekernel}" # Use custom compiler paths if defined if [ -n "${CUSTOM_GCC_PATH}" ]; then @@ -238,7 +238,7 @@ hackbase() { provides=("linux=${pkgver}" "${pkgbase}" VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE) replaces=(virtualbox-guest-modules-arch wireguard-arch) - cd "${srcdir}/linux-${_basekernel}-${_sub}" + cd "${srcdir}/linux-${_basekernel}" # get kernel version local _kernver="$(