From cc711d2b438856530e0434f751846b4d3b8368df Mon Sep 17 00:00:00 2001 From: David P Date: Sun, 24 Jun 2018 16:53:57 -0400 Subject: upgpkg: libre/linux-libre-hardened 4.17.2_gnu.a-1 Signed-off-by: David P --- ...og-Prefer-iTCO_wdt-always-when-WDAT-table.patch | 129 ++++++++ ...watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch | 117 -------- libre/linux-libre-hardened/PKGBUILD | 25 +- .../change-console-loglevel-motormouth.patch | 13 - libre/linux-libre-hardened/config.x86_64 | 329 +++++++++------------ 5 files changed, 277 insertions(+), 336 deletions(-) create mode 100644 libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch delete mode 100644 libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch delete mode 100644 libre/linux-libre-hardened/change-console-loglevel-motormouth.patch (limited to 'libre/linux-libre-hardened') diff --git a/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch b/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch new file mode 100644 index 000000000..c2565ceb7 --- /dev/null +++ b/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch @@ -0,0 +1,129 @@ +From a0a37862a4e1844793d39aca9ccb8fecbdcb8659 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +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 +Reported-by: Alois Nespor +Reported-by: Yury Pakin +Reported-by: Ihor Chyhin +Signed-off-by: Mika Westerberg +Acked-by: Guenter Roeck +--- + 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 +-#include + #include + #include + + #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 ++ ++/* ++ * 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 + diff --git a/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch b/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch deleted file mode 100644 index 1855da178..000000000 --- a/libre/linux-libre-hardened/ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch +++ /dev/null @@ -1,117 +0,0 @@ -From a0a37862a4e1844793d39aca9ccb8fecbdcb8659 Mon Sep 17 00:00:00 2001 -From: Mika Westerberg -Date: Mon, 23 Apr 2018 14:16:03 +0300 -Subject: [PATCH] ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70 - -WDAT table on Lenovo Z50-70 is using RTC SRAM (ports 0x70 and 0x71) to -store state of the timer. This conflicts with Linux RTC driver -(rtc-cmos.c) who fails to reserve those ports for itself preventing RTC -from functioning. In addition the WDAT table seems not to be fully -functional because it does not reset the system when the watchdog times -out. - -On this system iTCO_wdt works just fine so we simply prefer to use it -instead of WDAT. This makes RTC working again and also results working -watchdog via iTCO_wdt. - -Reported-by: Peter Milley -Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033 -Signed-off-by: Mika Westerberg -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/acpi_watchdog.c | 59 ++++++++++++++++++++++++++++++------ - 1 file changed, 49 insertions(+), 10 deletions(-) - -diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c -index ebb626ffb5fa..4bde16fb97d8 100644 ---- a/drivers/acpi/acpi_watchdog.c -+++ b/drivers/acpi/acpi_watchdog.c -@@ -12,23 +12,64 @@ - #define pr_fmt(fmt) "ACPI: watchdog: " fmt - - #include -+#include - #include - #include - - #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"), -+ }, -+ }, -+ {} -+}; -+ -+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; -+ } -+ -+ return wdat; -+} -+ - /** - * Returns true if this system should prefer ACPI based watchdog instead of - * the native one (which are typically the same hardware). - */ - bool acpi_has_watchdog(void) - { -- struct acpi_table_header hdr; -- -- if (acpi_disabled) -- return false; -- -- return ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_WDAT, 0, &hdr)); -+ return !!acpi_watchdog_get_wdat(); - } - EXPORT_SYMBOL_GPL(acpi_has_watchdog); - -@@ -41,12 +82,10 @@ void __init acpi_watchdog_init(void) - struct platform_device *pdev; - struct resource *resources; - size_t nresources = 0; -- acpi_status status; - int i; - -- status = acpi_get_table(ACPI_SIG_WDAT, 0, -- (struct acpi_table_header **)&wdat); -- if (ACPI_FAILURE(status)) { -+ wdat = acpi_watchdog_get_wdat(); -+ if (!wdat) { - /* It is fine if there is no WDAT */ - return; - } --- -2.17.0 - diff --git a/libre/linux-libre-hardened/PKGBUILD b/libre/linux-libre-hardened/PKGBUILD index c78319de7..dbb52e0e3 100644 --- a/libre/linux-libre-hardened/PKGBUILD +++ b/libre/linux-libre-hardened/PKGBUILD @@ -8,8 +8,8 @@ # Contributor: Luke R. pkgbase=linux-libre-hardened -_pkgbasever=4.16-gnu -_pkgver=4.16.15-gnu +_pkgbasever=4.17-gnu +_pkgver=4.17.2-gnu _hardenedver=a _replacesarchkernel=('linux%') # '%' gets replaced with _kernelname @@ -24,7 +24,6 @@ arch=('x86_64') url="https://jxself.org/git/linux-libre-hardened.git" license=('GPL2') makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf') -makedepends_armv7h=('git') options=('!strip') source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz"{,.sign} @@ -40,10 +39,9 @@ source=( # standard config files for mkinitcpio ramdisk 'linux.preset' # other patches - 'change-console-loglevel-motormouth.patch' '0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch' '0002-fix-Atmel-maXTouch-touchscreen-support.patch' - 'ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch' + 'ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch' 'Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch' ) validpgpkeys=( @@ -52,11 +50,11 @@ validpgpkeys=( '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. 'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak ) -sha512sums=('c6805b3649cd71cfef272384958b33da23a00908e795592470bf711dd67886ab7d7610e7d4ae8a2230fa7483466636465ed9744444464a078de37b41c3db23e0' +sha512sums=('a09014005d64839e958cabb20dbd50e051907b1afea2f517f41f0a9312fa1bc8447690e64ec0e6488a778be8a7384891c003f39029ff5799f9884482628aadf2' 'SKIP' - 'e71edd8c7f05d1e420fb878542453a09d4a964b568c87d322f4f2cd0d943b75a8e222f3544eaecf7b215fe75fd0dc86443162cf83ed21c2b6c611fee05867047' + '3811c646b357e49f8e1c60635cd81ff530b08b4baa3e9d839dae55810cb3eb0118a7075c8866ec4a2e8a97f6ca8fa02bbb5fc176f4b9055d70e3a79bd69186f2' 'SKIP' - 'e5a89e90f8b4fe0abf6122bce90d133c35034a9cef6d4fcfc76e9432dd946d2e6e9bbacbca7c44d919e8350ba3e00125df184c20058f701e32518592cb254652' + '1336cd756a0f5bd2e0ce00f9041a83bde33f04a4be8f008f118573e6e536686e381ada8af737348f0102ffd70d1e837f3ccda726c328031797c50c5895e8e137' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' @@ -64,14 +62,13 @@ sha512sums=('c6805b3649cd71cfef272384958b33da23a00908e795592470bf711dd67886ab7d7 'SKIP' '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' 'SKIP' - 'b5d8396113641edea75cb9191b56f40b0d8d6517606c98e0d6472bcb6b45ec637feef14984aad26078e996f532bdc80fb3fc9cca351f4abd7e3d582b32012018' + 'fa36bd618a63fcb49f912471a110951ddf975e08c4642cd632906a6b21a424f1c93db9482cefc22a6df545086a16d603555f1c7be7b0b2e23112d6d3bd5d34ef' '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a' '4a8b324aee4cccf3a512ad04ce1a272d14e5b05c8de90feb82075f55ea3845948d817e1b0c6f298f5816834ddd3e5ce0a0e2619866289f3c1ab8fd2f35f04f44' '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf' - '0a1a18aa8a6cbf1bab406d356786d2c35fe52608c25bef8beefe440b8a015ba59375106f8b04051ae2225e158420875a82ee07d5b88a2f2087afeb102e8966c0' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' - '45d4cccb808811d468b33b02d9857b30125962402675e169af58fd1f93bdfaff1b32e4507424c3570f34bd2a44f1e3ec022211f2305ef7c55d5fc3b0cdc32dff' + '994d328326ca1e65fc4b1ea26d858e040367112881af4d2f33b953fd138fa44009f898211f84e29e1158ca61bd7080e871933dba4d7e8f084640a02110cfc920' 'cc8852b089aa24f588ad1af726503ecd1012ad7e1cbc47ea77f03a5f7aecd25306d40f2e16b8a1afeafe7e2e97b6b6840c9f462ed7be358090117e2e024df1bd') _kernelname=${pkgbase#linux-libre} @@ -101,7 +98,7 @@ prepare() { # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git # https://bugs.archlinux.org/task/56780 - patch -Np1 -i ../ACPI-watchdog-Prefer-iTCO_wdt-on-Lenovo-Z50-70.patch + patch -Np1 -i ../ACPI-watchdog-Prefer-iTCO_wdt-always-when-WDAT-table.patch # https://bugs.archlinux.org/task/56711 patch -Np1 -i ../Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch @@ -115,10 +112,6 @@ prepare() { # http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html patch -p1 -i ../0002-fix-Atmel-maXTouch-touchscreen-support.patch - # set CONSOLE_LOGLEVEL_MOTORMOUTH to 1 - # https://labs.parabola.nu/issues/1754 - patch -p1 -i ../change-console-loglevel-motormouth.patch - cat ../config.${CARCH} - >.config <