From: Greg Kroah-Hartman Date: Tue, 20 Aug 2019 23:10:07 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v4.19.68~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f93e2b7d1028e4e478ac940a638992ed0fbc13c8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: iommu-amd-move-iommu_init_pci-to-.init-section.patch x86-boot-disable-the-address-of-packed-member-compiler-warning.patch x86-vdso-remove-direct-hpet-access-through-the-vdso.patch --- diff --git a/queue-4.4/iommu-amd-move-iommu_init_pci-to-.init-section.patch b/queue-4.4/iommu-amd-move-iommu_init_pci-to-.init-section.patch new file mode 100644 index 00000000000..a913ed5d46e --- /dev/null +++ b/queue-4.4/iommu-amd-move-iommu_init_pci-to-.init-section.patch @@ -0,0 +1,30 @@ +From 24d2c521749d8547765b555b7a85cca179bb2275 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Fri, 5 Oct 2018 12:32:46 +0200 +Subject: iommu/amd: Move iommu_init_pci() to .init section + +From: Joerg Roedel + +commit 24d2c521749d8547765b555b7a85cca179bb2275 upstream. + +The function is only called from another __init function, so +it should be moved to .init too. + +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/amd_iommu_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iommu/amd_iommu_init.c ++++ b/drivers/iommu/amd_iommu_init.c +@@ -1223,7 +1223,7 @@ static const struct attribute_group *amd + NULL, + }; + +-static int iommu_init_pci(struct amd_iommu *iommu) ++static int __init iommu_init_pci(struct amd_iommu *iommu) + { + int cap_ptr = iommu->cap_ptr; + u32 range, misc, low, high; diff --git a/queue-4.4/series b/queue-4.4/series index bca43ae1475..28ecb043692 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -69,3 +69,6 @@ asm-generic-default-bug_on-x-to-if-x-bug.patch scsi-fcoe-embed-fc_rport_priv-in-fcoe_rport-structure.patch rdma-directly-cast-the-sockaddr-union-to-sockaddr.patch ib-mlx5-make-coding-style-more-consistent.patch +x86-vdso-remove-direct-hpet-access-through-the-vdso.patch +iommu-amd-move-iommu_init_pci-to-.init-section.patch +x86-boot-disable-the-address-of-packed-member-compiler-warning.patch diff --git a/queue-4.4/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch b/queue-4.4/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch new file mode 100644 index 00000000000..937b075fd78 --- /dev/null +++ b/queue-4.4/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch @@ -0,0 +1,52 @@ +From 20c6c189045539d29f4854d92b7ea9c329e1edfc Mon Sep 17 00:00:00 2001 +From: Matthias Kaehlcke +Date: Tue, 25 Jul 2017 14:50:53 -0700 +Subject: x86/boot: Disable the address-of-packed-member compiler warning + +From: Matthias Kaehlcke + +commit 20c6c189045539d29f4854d92b7ea9c329e1edfc upstream. + +The clang warning 'address-of-packed-member' is disabled for the general +kernel code, also disable it for the x86 boot code. + +This suppresses a bunch of warnings like this when building with clang: + +./arch/x86/include/asm/processor.h:535:30: warning: taking address of + packed member 'sp0' of class or structure 'x86_hw_tss' may result in an + unaligned pointer value [-Waddress-of-packed-member] + return this_cpu_read_stable(cpu_tss.x86_tss.sp0); + ^~~~~~~~~~~~~~~~~~~ +./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro + 'this_cpu_read_stable' + #define this_cpu_read_stable(var) percpu_stable_op("mov", var) + ^~~ +./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro + 'percpu_stable_op' + : "p" (&(var))); + ^~~ + +Signed-off-by: Matthias Kaehlcke +Cc: Doug Anderson +Cc: Linus Torvalds +Cc: Masahiro Yamada +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/20170725215053.135586-1-mka@chromium.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/boot/compressed/Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/x86/boot/compressed/Makefile ++++ b/arch/x86/boot/compressed/Makefile +@@ -30,6 +30,7 @@ KBUILD_CFLAGS += $(cflags-y) + KBUILD_CFLAGS += -mno-mmx -mno-sse + KBUILD_CFLAGS += $(call cc-option,-ffreestanding) + KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) ++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) + + KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ + GCOV_PROFILE := n diff --git a/queue-4.4/x86-vdso-remove-direct-hpet-access-through-the-vdso.patch b/queue-4.4/x86-vdso-remove-direct-hpet-access-through-the-vdso.patch new file mode 100644 index 00000000000..cad5e7a78ce --- /dev/null +++ b/queue-4.4/x86-vdso-remove-direct-hpet-access-through-the-vdso.patch @@ -0,0 +1,147 @@ +From 1ed95e52d902035e39a715ff3a314a893a96e5b7 Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Thu, 7 Apr 2016 17:16:59 -0700 +Subject: x86/vdso: Remove direct HPET access through the vDSO + +From: Andy Lutomirski + +commit 1ed95e52d902035e39a715ff3a314a893a96e5b7 upstream. + +Allowing user code to map the HPET is problematic. HPET +implementations are notoriously buggy, and there are probably many +machines on which even MMIO reads from bogus HPET addresses are +problematic. + +We have a report that the Dell Precision M2800 with: + + ACPI: HPET 0x00000000C8FE6238 000038 (v01 DELL CBX3 01072009 AMI. 00000005) + +is either so slow when accessing the HPET or actually hangs in some +regard, causing soft lockups to be reported if users do unexpected +things to the HPET. + +The vclock HPET code has also always been a questionable speedup. +Accessing an HPET is exceedingly slow (on the order of several +microseconds), so the added overhead in requiring a syscall to read +the HPET is a small fraction of the total code of accessing it. + +To avoid future problems, let's just delete the code entirely. + +In the long run, this could actually be a speedup. Waiman Long as a +patch to optimize the case where multiple CPUs contend for the HPET, +but that won't help unless all the accesses are mediated by the +kernel. + +Reported-by: Rasmus Villemoes +Signed-off-by: Andy Lutomirski +Reviewed-by: Thomas Gleixner +Acked-by: Borislav Petkov +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Waiman Long +Cc: Waiman Long +Link: http://lkml.kernel.org/r/d2f90bba98db9905041cff294646d290d378f67a.1460074438.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/entry/vdso/vclock_gettime.c | 15 --------------- + arch/x86/entry/vdso/vdso-layout.lds.S | 5 ++--- + arch/x86/include/asm/clocksource.h | 3 +-- + arch/x86/kernel/hpet.c | 1 - + arch/x86/kvm/trace.h | 3 +-- + 5 files changed, 4 insertions(+), 23 deletions(-) + +--- a/arch/x86/entry/vdso/vclock_gettime.c ++++ b/arch/x86/entry/vdso/vclock_gettime.c +@@ -13,7 +13,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -26,16 +25,6 @@ extern int __vdso_clock_gettime(clockid_ + extern int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); + extern time_t __vdso_time(time_t *t); + +-#ifdef CONFIG_HPET_TIMER +-extern u8 hpet_page +- __attribute__((visibility("hidden"))); +- +-static notrace cycle_t vread_hpet(void) +-{ +- return *(const volatile u32 *)(&hpet_page + HPET_COUNTER); +-} +-#endif +- + #ifdef CONFIG_PARAVIRT_CLOCK + extern u8 pvclock_page + __attribute__((visibility("hidden"))); +@@ -209,10 +198,6 @@ notrace static inline u64 vgetsns(int *m + + if (gtod->vclock_mode == VCLOCK_TSC) + cycles = vread_tsc(); +-#ifdef CONFIG_HPET_TIMER +- else if (gtod->vclock_mode == VCLOCK_HPET) +- cycles = vread_hpet(); +-#endif + #ifdef CONFIG_PARAVIRT_CLOCK + else if (gtod->vclock_mode == VCLOCK_PVCLOCK) + cycles = vread_pvclock(mode); +--- a/arch/x86/entry/vdso/vdso-layout.lds.S ++++ b/arch/x86/entry/vdso/vdso-layout.lds.S +@@ -25,7 +25,7 @@ SECTIONS + * segment. + */ + +- vvar_start = . - 3 * PAGE_SIZE; ++ vvar_start = . - 2 * PAGE_SIZE; + vvar_page = vvar_start; + + /* Place all vvars at the offsets in asm/vvar.h. */ +@@ -35,8 +35,7 @@ SECTIONS + #undef __VVAR_KERNEL_LDS + #undef EMIT_VVAR + +- hpet_page = vvar_start + PAGE_SIZE; +- pvclock_page = vvar_start + 2 * PAGE_SIZE; ++ pvclock_page = vvar_start + PAGE_SIZE; + + . = SIZEOF_HEADERS; + +--- a/arch/x86/include/asm/clocksource.h ++++ b/arch/x86/include/asm/clocksource.h +@@ -5,8 +5,7 @@ + + #define VCLOCK_NONE 0 /* No vDSO clock available. */ + #define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */ +-#define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */ +-#define VCLOCK_PVCLOCK 3 /* vDSO should use vread_pvclock. */ ++#define VCLOCK_PVCLOCK 2 /* vDSO should use vread_pvclock. */ + + struct arch_clocksource_data { + int vclock_mode; +--- a/arch/x86/kernel/hpet.c ++++ b/arch/x86/kernel/hpet.c +@@ -774,7 +774,6 @@ static struct clocksource clocksource_hp + .mask = HPET_MASK, + .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .resume = hpet_resume_counter, +- .archdata = { .vclock_mode = VCLOCK_HPET }, + }; + + static int hpet_clocksource_register(void) +--- a/arch/x86/kvm/trace.h ++++ b/arch/x86/kvm/trace.h +@@ -809,8 +809,7 @@ TRACE_EVENT(kvm_write_tsc_offset, + + #define host_clocks \ + {VCLOCK_NONE, "none"}, \ +- {VCLOCK_TSC, "tsc"}, \ +- {VCLOCK_HPET, "hpet"} \ ++ {VCLOCK_TSC, "tsc"} \ + + TRACE_EVENT(kvm_update_master_clock, + TP_PROTO(bool use_master_clock, unsigned int host_clock, bool offset_matched),