diff options
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch | 16 | ||||
-rw-r--r-- | 0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch | 10 | ||||
-rw-r--r-- | 0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch | 132 | ||||
-rw-r--r-- | PKGBUILD | 20 |
5 files changed, 166 insertions, 24 deletions
@@ -1,5 +1,5 @@ pkgbase = linux-macbook - pkgver = 4.17 + pkgver = 4.17.1 pkgrel = 1 url = https://www.kernel.org/ arch = x86_64 @@ -12,12 +12,15 @@ pkgbase = linux-macbook options = !strip source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.17.tar.xz source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.17.tar.sign + source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.17.1.xz + source = https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.17.1.sign source = config source = 60-linux.hook source = 90-linux.hook source = linux.preset source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch source = 0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch + source = 0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch source = macbook-wakeup.service source = RFC-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch source = RFC-v2-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch @@ -25,12 +28,15 @@ pkgbase = linux-macbook validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E sha256sums = 9faa1dd896eaea961dc6e886697c0b3301277102e5bc976b2758f9a62d3ccd13 sha256sums = SKIP + sha256sums = 31f2f5309d99db632160538d43cf737166ae8b24c1b8091522ca1f9a804c25a1 + sha256sums = SKIP sha256sums = 0269d9a56f0d0306c9bd5c179a7e32214b0a1c082d3bca581661203b27305f17 sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21 sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919 sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65 - sha256sums = 8d6a5f34b3d79e75b0cb888c6bcf293f84c5cbb2757f7bdadafee7e0ea77d7dd - sha256sums = 92615acad59cbef9fd43b2710f5a77ffea45a86543ccff1b12eb676a9c8058cc + sha256sums = e3c08f9b91611186e5ec579187ecea2a0143e5c2dc7ffc30ac6ea6e2b6d130fd + sha256sums = 5403dead9161344b2c01027526146a250147680f4a2d32a54d40c55fc1becc8a + sha256sums = d55e7de60b12bca26ded4c1bb8eb5860a9092374914a201a0f6a0ed2849d099f sha256sums = c5a714823c3418692bc5c212dd5d094a0e2ae6147d6726822911f1c26e3a1d1b sha256sums = 7c99aaeaea7837f83a3ad215cf07277934ccf39720acee7f1c371dc86bdf89fc sha256sums = 09189eb269a9fd16898cf90a477df23306236fb897791e8d04e5a75d5007bbff diff --git a/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch index 3dd9a7d7039e..ef2a8aa685c8 100644 --- a/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch +++ b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch @@ -1,5 +1,5 @@ -From ee91df95bf010fad44be5d2564e7d40038987f19 Mon Sep 17 00:00:00 2001 -Message-Id: <ee91df95bf010fad44be5d2564e7d40038987f19.1527290717.git.jan.steffens@gmail.com> +From 9a5adbc45b1c7d43fe4b27936f2a6939660617a1 Mon Sep 17 00:00:00 2001 +Message-Id: <9a5adbc45b1c7d43fe4b27936f2a6939660617a1.1528777685.git.jan.steffens@gmail.com> From: Serge Hallyn <serge.hallyn@canonical.com> Date: Fri, 31 May 2013 19:12:12 +0100 Subject: [PATCH 1/3] add sysctl to disallow unprivileged CLONE_NEWUSER by @@ -15,7 +15,7 @@ Signed-off-by: Daniel Micay <danielmicay@gmail.com> 3 files changed, 30 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c -index e5d9d405ae4e..c4be89c51f25 100644 +index a5d21c42acfc..675eb3f3a1d1 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -103,6 +103,11 @@ @@ -30,7 +30,7 @@ index e5d9d405ae4e..c4be89c51f25 100644 /* * Minimum number of threads to boot the kernel -@@ -1591,6 +1596,10 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1592,6 +1597,10 @@ static __latent_entropy struct task_struct *copy_process( if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) return ERR_PTR(-EINVAL); @@ -41,7 +41,7 @@ index e5d9d405ae4e..c4be89c51f25 100644 /* * Thread groups must share signals as well, and detached threads * can only be started up within the thread group. -@@ -2385,6 +2394,12 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) +@@ -2386,6 +2395,12 @@ int ksys_unshare(unsigned long unshare_flags) if (unshare_flags & CLONE_NEWNS) unshare_flags |= CLONE_FS; @@ -55,7 +55,7 @@ index e5d9d405ae4e..c4be89c51f25 100644 if (err) goto bad_unshare_out; diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index f98f28c12020..7256d339a32a 100644 +index 6a78cf70761d..35a1d24282f4 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -105,6 +105,9 @@ extern int core_uses_pid; @@ -68,7 +68,7 @@ index f98f28c12020..7256d339a32a 100644 extern int pid_max; extern int pid_max_min, pid_max_max; extern int percpu_pagelist_fraction; -@@ -515,6 +518,15 @@ static struct ctl_table kern_table[] = { +@@ -519,6 +522,15 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dointvec, }, #endif @@ -99,5 +99,5 @@ index 246d4d4ce5c7..f64432b45cec 100644 static DEFINE_MUTEX(userns_state_mutex); -- -2.17.0 +2.17.1 diff --git a/0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch b/0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch index 83ac849027ed..8d44c5532a8b 100644 --- a/0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch +++ b/0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch @@ -1,10 +1,10 @@ -From 997fbfe5508bc7d29fdf0a7a103f3864d4db380a Mon Sep 17 00:00:00 2001 -Message-Id: <997fbfe5508bc7d29fdf0a7a103f3864d4db380a.1528140572.git.jan.steffens@gmail.com> -In-Reply-To: <b7e3d341f20581dcd72d3640fa8f6f99fd766d21.1528140572.git.jan.steffens@gmail.com> -References: <b7e3d341f20581dcd72d3640fa8f6f99fd766d21.1528140572.git.jan.steffens@gmail.com> +From 6cc33158e691a70111672a6105c7a37e66e6d3c3 Mon Sep 17 00:00:00 2001 +Message-Id: <6cc33158e691a70111672a6105c7a37e66e6d3c3.1528777685.git.jan.steffens@gmail.com> +In-Reply-To: <9a5adbc45b1c7d43fe4b27936f2a6939660617a1.1528777685.git.jan.steffens@gmail.com> +References: <9a5adbc45b1c7d43fe4b27936f2a6939660617a1.1528777685.git.jan.steffens@gmail.com> From: Jani Nikula <jani.nikula@intel.com> Date: Wed, 16 May 2018 11:01:10 +0300 -Subject: [PATCH 2/2] Revert "drm/i915/edp: Allow alternate fixed mode for eDP +Subject: [PATCH 2/3] Revert "drm/i915/edp: Allow alternate fixed mode for eDP if available." This reverts commit dc911f5bd8aacfcf8aabd5c26c88e04c837a938e. diff --git a/0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch b/0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch new file mode 100644 index 000000000000..b4db2ad36a1e --- /dev/null +++ b/0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch @@ -0,0 +1,132 @@ +From 1e45a10dbea00f3a9ead21a9b3d25ad00021261d Mon Sep 17 00:00:00 2001 +Message-Id: <1e45a10dbea00f3a9ead21a9b3d25ad00021261d.1528777685.git.jan.steffens@gmail.com> +In-Reply-To: <9a5adbc45b1c7d43fe4b27936f2a6939660617a1.1528777685.git.jan.steffens@gmail.com> +References: <9a5adbc45b1c7d43fe4b27936f2a6939660617a1.1528777685.git.jan.steffens@gmail.com> +From: Mika Westerberg <mika.westerberg@linux.intel.com> +Date: Tue, 22 May 2018 14:16:50 +0300 +Subject: [PATCH 3/3] ACPI / watchdog: Prefer iTCO_wdt always when WDAT table + uses RTC SRAM + +After we added quirk for Lenovo Z50-70 it turns out there are at least +two more systems where WDAT table includes instructions accessing RTC +SRAM. Instead of quirking each system separately, look for such +instructions in the table and automatically prefer iTCO_wdt if found. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033 +Reported-by: Arnold Guy <aurnoldg@gmail.com> +Reported-by: Alois Nespor <nespor@fssp.cz> +Reported-by: Yury Pakin <zxwarior@gmail.com> +Reported-by: Ihor Chyhin <ihorchyhin@ukr.net> +Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> +Acked-by: Guenter Roeck <linux@roeck-us.net> +--- + drivers/acpi/acpi_watchdog.c | 72 ++++++++++++++++++++++-------------- + 1 file changed, 45 insertions(+), 27 deletions(-) + +diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c +index 4bde16fb97d8..95600309ce42 100644 +--- a/drivers/acpi/acpi_watchdog.c ++++ b/drivers/acpi/acpi_watchdog.c +@@ -12,54 +12,72 @@ + #define pr_fmt(fmt) "ACPI: watchdog: " fmt + + #include <linux/acpi.h> +-#include <linux/dmi.h> + #include <linux/ioport.h> + #include <linux/platform_device.h> + + #include "internal.h" + +-static const struct dmi_system_id acpi_watchdog_skip[] = { +- { +- /* +- * On Lenovo Z50-70 there are two issues with the WDAT +- * table. First some of the instructions use RTC SRAM +- * to store persistent information. This does not work well +- * with Linux RTC driver. Second, more important thing is +- * that the instructions do not actually reset the system. +- * +- * On this particular system iTCO_wdt seems to work just +- * fine so we prefer that over WDAT for now. +- * +- * See also https://bugzilla.kernel.org/show_bug.cgi?id=199033. +- */ +- .ident = "Lenovo Z50-70", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_NAME, "20354"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Z50-70"), +- }, +- }, +- {} +-}; ++#ifdef CONFIG_RTC_MC146818_LIB ++#include <linux/mc146818rtc.h> ++ ++/* ++ * There are several systems where the WDAT table is accessing RTC SRAM to ++ * store persistent information. This does not work well with the Linux RTC ++ * driver so on those systems we skip WDAT driver and prefer iTCO_wdt ++ * instead. ++ * ++ * See also https://bugzilla.kernel.org/show_bug.cgi?id=199033. ++ */ ++static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) ++{ ++ const struct acpi_wdat_entry *entries; ++ int i; ++ ++ entries = (struct acpi_wdat_entry *)(wdat + 1); ++ for (i = 0; i < wdat->entries; i++) { ++ const struct acpi_generic_address *gas; ++ ++ gas = &entries[i].register_region; ++ if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { ++ switch (gas->address) { ++ case RTC_PORT(0): ++ case RTC_PORT(1): ++ case RTC_PORT(2): ++ case RTC_PORT(3): ++ return true; ++ } ++ } ++ } ++ ++ return false; ++} ++#else ++static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) ++{ ++ return false; ++} ++#endif + + static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void) + { + const struct acpi_table_wdat *wdat = NULL; + acpi_status status; + + if (acpi_disabled) + return NULL; + +- if (dmi_check_system(acpi_watchdog_skip)) +- return NULL; +- + status = acpi_get_table(ACPI_SIG_WDAT, 0, + (struct acpi_table_header **)&wdat); + if (ACPI_FAILURE(status)) { + /* It is fine if there is no WDAT */ + return NULL; + } + ++ if (acpi_watchdog_uses_rtc(wdat)) { ++ pr_info("Skipping WDAT on this system because it uses RTC SRAM\n"); ++ return NULL; ++ } ++ + return wdat; + } + +-- +2.17.1 + @@ -6,7 +6,7 @@ #pkgbase=linux # Build stock -ARCH kernel pkgbase=linux-macbook # Build kernel with a different name _srcname=linux-4.17 -pkgver=4.17 +pkgver=4.17.1 pkgrel=1 arch=('x86_64') url="https://www.kernel.org/" @@ -15,13 +15,14 @@ makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf') options=('!strip') source=( https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.{xz,sign} - #https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.{xz,sign} + https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.{xz,sign} config # the main kernel config file 60-linux.hook # pacman hook for depmod 90-linux.hook # pacman hook for initramfs regeneration linux.preset # standard config files for mkinitcpio ramdisk 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch 0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch + 0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch macbook-wakeup.service # service file for suspend/resume events RFC-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch RFC-v2-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch @@ -32,12 +33,15 @@ validpgpkeys=( ) sha256sums=('9faa1dd896eaea961dc6e886697c0b3301277102e5bc976b2758f9a62d3ccd13' 'SKIP' + '31f2f5309d99db632160538d43cf737166ae8b24c1b8091522ca1f9a804c25a1' + 'SKIP' '0269d9a56f0d0306c9bd5c179a7e32214b0a1c082d3bca581661203b27305f17' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' - '8d6a5f34b3d79e75b0cb888c6bcf293f84c5cbb2757f7bdadafee7e0ea77d7dd' - '92615acad59cbef9fd43b2710f5a77ffea45a86543ccff1b12eb676a9c8058cc' + 'e3c08f9b91611186e5ec579187ecea2a0143e5c2dc7ffc30ac6ea6e2b6d130fd' + '5403dead9161344b2c01027526146a250147680f4a2d32a54d40c55fc1becc8a' + 'd55e7de60b12bca26ded4c1bb8eb5860a9092374914a201a0f6a0ed2849d099f' 'c5a714823c3418692bc5c212dd5d094a0e2ae6147d6726822911f1c26e3a1d1b' '7c99aaeaea7837f83a3ad215cf07277934ccf39720acee7f1c371dc86bdf89fc' '09189eb269a9fd16898cf90a477df23306236fb897791e8d04e5a75d5007bbff') @@ -49,14 +53,11 @@ prepare() { cd ${_srcname} # add upstream patch - #patch -p1 -i ../patch-${pkgver} + patch -p1 -i ../patch-${pkgver} # add latest fixes from stable queue, if needed # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git - # start of macbook specific patches - # https://patchwork.kernel.org/patch/9140867/ - msg "patch -Np1 -i ../RFC-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch" patch -Np1 -i ../RFC-PCI-Workaround-to-enable-poweroff-on-Mac-Pro-11.patch @@ -70,6 +71,9 @@ prepare() { # https://bugs.archlinux.org/task/56711 patch -Np1 -i ../0002-Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch + # https://bugs.archlinux.org/task/56780 + patch -Np1 -i ../0003-ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch + cat ../config - >.config <<END CONFIG_LOCALVERSION="${_kernelname}" CONFIG_LOCALVERSION_AUTO=n |