diff options
author | Thorsten Leemhuis <fedora@leemhuis.info> | 2018-01-04 11:22:53 +0100 |
---|---|---|
committer | Thorsten Leemhuis <fedora@leemhuis.info> | 2018-01-04 11:22:53 +0100 |
commit | b5a51e127bff95933989264561fa9b43668c04c3 (patch) | |
tree | a8c2c0f955905d83c36a0acdf66309382aec433d | |
parent | 6b2401f0cbf9f01f08b5d562e2fa8def64842f0d (diff) | |
parent | b5cf2a10ddc784456e8600fd8a5be116ff542c1d (diff) | |
download | kernel-b5a51e127bff95933989264561fa9b43668c04c3.tar.gz kernel-b5a51e127bff95933989264561fa9b43668c04c3.tar.xz kernel-b5a51e127bff95933989264561fa9b43668c04c3.zip |
Merge remote-tracking branch 'origin/master' into rawhide-user-thl-vanilla-fedora
-rw-r--r-- | 0001-Bluetooth-btusb-Disable-autosuspend-on-QCA-Rome-devi.patch | 47 | ||||
-rw-r--r-- | 0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch | 99 | ||||
-rw-r--r-- | configs/base-generic/x86/CONFIG_ACPI_REV_OVERRIDE_POSSIBLE | 2 | ||||
-rw-r--r-- | kernel-i686-PAE.config | 2 | ||||
-rw-r--r-- | kernel-i686-PAEdebug.config | 2 | ||||
-rw-r--r-- | kernel-i686-debug.config | 2 | ||||
-rw-r--r-- | kernel-i686.config | 2 | ||||
-rw-r--r-- | kernel-x86_64-debug.config | 2 | ||||
-rw-r--r-- | kernel-x86_64.config | 2 | ||||
-rw-r--r-- | kernel.spec | 21 | ||||
-rw-r--r-- | kpti-fix.patch | 129 |
11 files changed, 302 insertions, 8 deletions
diff --git a/0001-Bluetooth-btusb-Disable-autosuspend-on-QCA-Rome-devi.patch b/0001-Bluetooth-btusb-Disable-autosuspend-on-QCA-Rome-devi.patch new file mode 100644 index 000000000..cc1af2ceb --- /dev/null +++ b/0001-Bluetooth-btusb-Disable-autosuspend-on-QCA-Rome-devi.patch @@ -0,0 +1,47 @@ +From a5ffa27c07e06900fcfc50b08de6d11e45830168 Mon Sep 17 00:00:00 2001 +From: Hans de Goede <hdegoede@redhat.com> +Date: Wed, 3 Jan 2018 12:49:44 +0100 +Subject: [PATCH v2] Bluetooth: btusb: Disable autosuspend on QCA Rome devices + +Commit fd865802c66b ("Bluetooth: btusb: fix QCA Rome suspend/resume") fixes +a suspend/resume problem on QCA devices by doing a full reset on resume, +reloading the firmware. + +A similar problem happens when using runtime-pm / autosuspend, when this is +enabled by the user the QCA Rome device stops working. Reloading the +firmware after a runtime suspend is not really an option since the latency +caused by this is unacceptable. + +To fix the runtime-pm issues, this commit disables runtime-pm on QCA Rome +HCIs, by getting (and not releasing) an usb autopm reference on the btusb +interface. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514836 +Signed-off-by: Hans de Goede <hdegoede@redhat.com> +--- + drivers/bluetooth/btusb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index 808c249845db..6ed3a0e5b8f6 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -3122,8 +3122,15 @@ static int btusb_probe(struct usb_interface *intf, + /* QCA Rome devices lose their updated firmware over suspend, + * but the USB hub doesn't notice any status change. + * Explicitly request a device reset on resume. ++ * And disable runtime pm by getting a pm reference, the USB ++ * core will drop our reference on disconnect. + */ + set_bit(BTUSB_RESET_RESUME, &data->flags); ++ err = usb_autopm_get_interface(data->intf); ++ if (err < 0) { ++ BT_ERR("failed to get pm reference %d", err); ++ goto out_free_dev; ++ } + } + + #ifdef CONFIG_BT_HCIBTUSB_RTL +-- +2.14.3 + diff --git a/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch b/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch new file mode 100644 index 000000000..926487b3d --- /dev/null +++ b/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch @@ -0,0 +1,99 @@ +From 714fe15daa07e7691c9731c88de71aa57f84b6c2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede <hdegoede@redhat.com> +Date: Wed, 3 Jan 2018 11:13:54 +0100 +Subject: [PATCH] platform/x86: dell-laptop: Filter out spurious keyboard + backlight change events + +On some Dell XPS models WMI events of type 0x0000 reporting a keycode of +0xe00c get reported when the brightness of the LCD panel changes. + +This leads to us reporting false-positive kbd_led change events to +userspace which in turn leads to the kbd backlight OSD showing when it +should not. + +We already read the current keyboard backlight brightness value when +reporting events because the led_classdev_notify_brightness_hw_changed +API requires this. Compare this value to the last known value and filter +out duplicate events, fixing this. + +Note the fixed issue is esp. a problem on XPS models with an ambient light +sensor and automatic brightness adjustments turned on, this causes the kbd +backlight OSD to show all the time there. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514969 +Signed-off-by: Hans de Goede <hdegoede@redhat.com> +--- + drivers/platform/x86/dell-laptop.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c +index cd4725e7e0b5..2ef3297a9efc 100644 +--- a/drivers/platform/x86/dell-laptop.c ++++ b/drivers/platform/x86/dell-laptop.c +@@ -1133,6 +1133,7 @@ static u8 kbd_previous_mode_bit; + + static bool kbd_led_present; + static DEFINE_MUTEX(kbd_led_mutex); ++static enum led_brightness kbd_led_level; + + /* + * NOTE: there are three ways to set the keyboard backlight level. +@@ -1947,6 +1948,7 @@ static enum led_brightness kbd_led_level_get(struct led_classdev *led_cdev) + static int kbd_led_level_set(struct led_classdev *led_cdev, + enum led_brightness value) + { ++ enum led_brightness new_value = value; + struct kbd_state state; + struct kbd_state new_state; + u16 num; +@@ -1976,6 +1978,9 @@ static int kbd_led_level_set(struct led_classdev *led_cdev, + } + + out: ++ if (ret == 0) ++ kbd_led_level = new_value; ++ + mutex_unlock(&kbd_led_mutex); + return ret; + } +@@ -2003,6 +2008,9 @@ static int __init kbd_led_init(struct device *dev) + if (kbd_led.max_brightness) + kbd_led.max_brightness--; + } ++ ++ kbd_led_level = kbd_led_level_get(NULL); ++ + ret = led_classdev_register(dev, &kbd_led); + if (ret) + kbd_led_present = false; +@@ -2027,13 +2035,25 @@ static void kbd_led_exit(void) + static int dell_laptop_notifier_call(struct notifier_block *nb, + unsigned long action, void *data) + { ++ bool changed = false; ++ enum led_brightness new_kbd_led_level; ++ + switch (action) { + case DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED: + if (!kbd_led_present) + break; + +- led_classdev_notify_brightness_hw_changed(&kbd_led, +- kbd_led_level_get(&kbd_led)); ++ mutex_lock(&kbd_led_mutex); ++ new_kbd_led_level = kbd_led_level_get(&kbd_led); ++ if (kbd_led_level != new_kbd_led_level) { ++ kbd_led_level = new_kbd_led_level; ++ changed = true; ++ } ++ mutex_unlock(&kbd_led_mutex); ++ ++ if (changed) ++ led_classdev_notify_brightness_hw_changed(&kbd_led, ++ kbd_led_level); + break; + } + +-- +2.14.3 + diff --git a/configs/base-generic/x86/CONFIG_ACPI_REV_OVERRIDE_POSSIBLE b/configs/base-generic/x86/CONFIG_ACPI_REV_OVERRIDE_POSSIBLE index 22e6b36cf..021ea2f25 100644 --- a/configs/base-generic/x86/CONFIG_ACPI_REV_OVERRIDE_POSSIBLE +++ b/configs/base-generic/x86/CONFIG_ACPI_REV_OVERRIDE_POSSIBLE @@ -1 +1 @@ -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y diff --git a/kernel-i686-PAE.config b/kernel-i686-PAE.config index 638b83c95..7e9c291da 100644 --- a/kernel-i686-PAE.config +++ b/kernel-i686-PAE.config @@ -72,7 +72,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel-i686-PAEdebug.config b/kernel-i686-PAEdebug.config index 724b391fd..88858c245 100644 --- a/kernel-i686-PAEdebug.config +++ b/kernel-i686-PAEdebug.config @@ -72,7 +72,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel-i686-debug.config b/kernel-i686-debug.config index 995c28093..91011430f 100644 --- a/kernel-i686-debug.config +++ b/kernel-i686-debug.config @@ -72,7 +72,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel-i686.config b/kernel-i686.config index d7ae93a75..1f62c5ef6 100644 --- a/kernel-i686.config +++ b/kernel-i686.config @@ -72,7 +72,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel-x86_64-debug.config b/kernel-x86_64-debug.config index 8a70ee602..a5ea275f3 100644 --- a/kernel-x86_64-debug.config +++ b/kernel-x86_64-debug.config @@ -75,7 +75,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel-x86_64.config b/kernel-x86_64.config index 1886919f5..83ab00e9a 100644 --- a/kernel-x86_64.config +++ b/kernel-x86_64.config @@ -75,7 +75,7 @@ CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCFS_POWER is not set CONFIG_ACPI_PROCFS=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y CONFIG_ACPI_SBS=m CONFIG_ACPI_SLEEP=y CONFIG_ACPI_TABLE_UPGRADE=y diff --git a/kernel.spec b/kernel.spec index e3e2a267e..1afdf17f2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -44,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 1 +%global baserelease 3 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -664,6 +664,15 @@ Patch636: 0001-ahci-Annotate-PCI-ids-for-mobile-Intel-chipsets-as-s.patch Patch637: 0002-ahci-Add-PCI-ids-for-Intel-Bay-Trail-Cherry-Trail-an.patch Patch638: 0003-ahci-Allow-setting-a-default-LPM-policy-for-mobile-c.patch +# KPTI Fixups +Patch639: kpti-fix.patch + +# rhbz1514969, submitted upstream +Patch640: 0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch + +# rhbz1514836, submitted upstream +Patch641: 0001-Bluetooth-btusb-Disable-autosuspend-on-QCA-Rome-devi.patch + # END OF PATCH DEFINITIONS %endif @@ -2218,6 +2227,16 @@ fi # # %changelog +* Thu Jan 04 2018 Hans de Goede <hdegoede@redhat.com> +- Add a patch to filter false positive kbd backlight change events (#1514969) +- Add a patch to disable runtime-pm for QCA bluetooth devices (#1514836) + +* Wed Jan 03 2018 Laura Abbott <labbott@redhat.com> - 4.15.0-0.rc6.git0.3 +- Yet another KPTI fix + +* Wed Jan 03 2018 Laura Abbott <labbott@redhat.com> - 4.15.0-0.rc6.git0.2 +- KPTI Fix + * Mon Jan 01 2018 Laura Abbott <labbott@redhat.com> - 4.15.0-0.rc6.git0.1 - Linux v4.15-rc6 diff --git a/kpti-fix.patch b/kpti-fix.patch new file mode 100644 index 000000000..e01d3bd4b --- /dev/null +++ b/kpti-fix.patch @@ -0,0 +1,129 @@ +From 52994c256df36fda9a715697431cba9daecb6b11 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner <tglx@linutronix.de> +Date: Wed, 3 Jan 2018 15:57:59 +0100 +Subject: x86/pti: Make sure the user/kernel PTEs match + +Meelis reported that his K8 Athlon64 emits MCE warnings when PTI is +enabled: + +[Hardware Error]: Error Addr: 0x0000ffff81e000e0 +[Hardware Error]: MC1 Error: L1 TLB multimatch. +[Hardware Error]: cache level: L1, tx: INSN + +The address is in the entry area, which is mapped into kernel _AND_ user +space. That's special because we switch CR3 while we are executing +there. + +User mapping: +0xffffffff81e00000-0xffffffff82000000 2M ro PSE GLB x pmd + +Kernel mapping: +0xffffffff81000000-0xffffffff82000000 16M ro PSE x pmd + +So the K8 is complaining that the TLB entries differ. They differ in the +GLB bit. + +Drop the GLB bit when installing the user shared mapping. + +Fixes: 6dc72c3cbca0 ("x86/mm/pti: Share entry text PMD") +Reported-by: Meelis Roos <mroos@linux.ee> +Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +Tested-by: Meelis Roos <mroos@linux.ee> +Cc: Borislav Petkov <bp@alien8.de> +Cc: Tom Lendacky <thomas.lendacky@amd.com> +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801031407180.1957@nanos +--- + arch/x86/mm/pti.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c +index bce8aea..2da28ba 100644 +--- a/arch/x86/mm/pti.c ++++ b/arch/x86/mm/pti.c +@@ -367,7 +367,8 @@ static void __init pti_setup_espfix64(void) + static void __init pti_clone_entry_text(void) + { + pti_clone_pmds((unsigned long) __entry_text_start, +- (unsigned long) __irqentry_text_end, _PAGE_RW); ++ (unsigned long) __irqentry_text_end, ++ _PAGE_RW | _PAGE_GLOBAL); + } + + /* +-- +cgit v1.1 + +From fea692ec9308084475c0c93bf74bcb2a35f3d417 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner <tglx@linutronix.de> +Date: Wed, 3 Jan 2018 19:52:04 +0100 +Subject: [PATCH] CONFIG_PAGE_TABLE_ISOLATION=y on x86_64 causes gcc to + segfault when building x86_32 binaries + +On Wed, 3 Jan 2018, Thomas Gleixner wrote: + +> On Wed, 3 Jan 2018, Lars Wendler wrote: +> > Am Wed, 3 Jan 2018 13:05:38 +0100 (CET) +> > schrieb Thomas Gleixner <tglx@linutronix.de>: +> > > Also can you please try Linus v4.15-rc6 with PTI enabled so we can see +> > > whether that's a backport issue or a general one? +> > +> > Same problem with 4.15-rc6. So I suppose that means it's a general +> > issue. +> +> Just a shot in the dark as I just decoded another issue on a AMD CPU. Can +> you please try the patch below? + +Ok. Found the real issue. This is a problem on AMD boxen. + +Fix below. + +Can Xen folks please have a look at that as well? + +Thanks, + + tglx + +8<------------------- + +arch/x86/entry/entry_64_compat.S | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) +--- + arch/x86/entry/entry_64_compat.S | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S +index 40f17009ec20..4c4b9545b848 100644 +--- a/arch/x86/entry/entry_64_compat.S ++++ b/arch/x86/entry/entry_64_compat.S +@@ -190,8 +190,13 @@ ENTRY(entry_SYSCALL_compat) + /* Interrupts are off on entry. */ + swapgs + +- /* Stash user ESP and switch to the kernel stack. */ ++ /* Stash user ESP */ + movl %esp, %r8d ++ ++ /* Use %rsp as scratch reg. User ESP is stashed in r8 */ ++ SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp ++ ++ /* Switch to the kernel stack */ + movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp + + /* Construct struct pt_regs on stack */ +@@ -219,12 +224,6 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe) + pushq $0 /* pt_regs->r14 = 0 */ + pushq $0 /* pt_regs->r15 = 0 */ + +- /* +- * We just saved %rdi so it is safe to clobber. It is not +- * preserved during the C calls inside TRACE_IRQS_OFF anyway. +- */ +- SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi +- + /* + * User mode is traced as though IRQs are on, and SYSENTER + * turned them off. +-- +2.14.3 + |