From: Greg Kroah-Hartman Date: Mon, 15 Jun 2020 14:39:57 +0000 (+0200) Subject: 5.6-stable patches X-Git-Tag: v5.4.47~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2a879634b567e735120a8e85c8735889edb2a9e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.6-stable patches added patches: asoc-max9867-fix-volume-controls.patch efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch io_uring-use-kvfree-in-io_sqe_buffer_register.patch kvm-x86-allow-kvm_state_nested_mtf_pending-in-kvm_state-flags.patch kvm-x86-fix-apic-page-invalidation-race.patch kvm-x86-mmu-set-mmio_value-to-0-if-reserved-pf-can-t-be-generated.patch kvm-x86-respect-singlestep-when-emulating-instruction.patch perf-x86-intel-add-more-available-bits-for-offcore_response-of-intel-tremont.patch powerpc-ptdump-properly-handle-non-standard-page-size.patch x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch --- diff --git a/queue-5.6/asoc-max9867-fix-volume-controls.patch b/queue-5.6/asoc-max9867-fix-volume-controls.patch new file mode 100644 index 00000000000..3f5fc9faedf --- /dev/null +++ b/queue-5.6/asoc-max9867-fix-volume-controls.patch @@ -0,0 +1,42 @@ +From 8ba4dc3cff8cbe2c571063a5fd7116e8bde563ca Mon Sep 17 00:00:00 2001 +From: Pavel Dobias +Date: Fri, 15 May 2020 14:07:57 +0200 +Subject: ASoC: max9867: fix volume controls + +From: Pavel Dobias + +commit 8ba4dc3cff8cbe2c571063a5fd7116e8bde563ca upstream. + +The xmax values for Master Playback Volume and Mic Boost +Capture Volume are specified incorrectly (one greater) +which results in the wrong dB gain being shown to the user +in the case of Master Playback Volume. + +Signed-off-by: Pavel Dobias +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200515120757.24669-1-dobias@2n.cz +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/max9867.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/max9867.c ++++ b/sound/soc/codecs/max9867.c +@@ -46,13 +46,13 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_R + + static const struct snd_kcontrol_new max9867_snd_controls[] = { + SOC_DOUBLE_R_TLV("Master Playback Volume", MAX9867_LEFTVOL, +- MAX9867_RIGHTVOL, 0, 41, 1, max9867_master_tlv), ++ MAX9867_RIGHTVOL, 0, 40, 1, max9867_master_tlv), + SOC_DOUBLE_R_TLV("Line Capture Volume", MAX9867_LEFTLINELVL, + MAX9867_RIGHTLINELVL, 0, 15, 1, max9867_line_tlv), + SOC_DOUBLE_R_TLV("Mic Capture Volume", MAX9867_LEFTMICGAIN, + MAX9867_RIGHTMICGAIN, 0, 20, 1, max9867_mic_tlv), + SOC_DOUBLE_R_TLV("Mic Boost Capture Volume", MAX9867_LEFTMICGAIN, +- MAX9867_RIGHTMICGAIN, 5, 4, 0, max9867_micboost_tlv), ++ MAX9867_RIGHTMICGAIN, 5, 3, 0, max9867_micboost_tlv), + SOC_SINGLE("Digital Sidetone Volume", MAX9867_SIDETONE, 0, 31, 1), + SOC_SINGLE_TLV("Digital Playback Volume", MAX9867_DACLEVEL, 0, 15, 1, + max9867_dac_tlv), diff --git a/queue-5.6/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch b/queue-5.6/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch new file mode 100644 index 00000000000..db028e7f7e5 --- /dev/null +++ b/queue-5.6/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch @@ -0,0 +1,39 @@ +From d8bd8c6e2cfab8b78b537715255be8d7557791c0 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Fri, 22 May 2020 18:15:49 +0200 +Subject: efi/efivars: Add missing kobject_put() in sysfs entry creation error path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ard Biesheuvel + +commit d8bd8c6e2cfab8b78b537715255be8d7557791c0 upstream. + +The documentation provided by kobject_init_and_add() clearly spells out +the need to call kobject_put() on the kobject if an error is returned. +Add this missing call to the error path. + +Cc: +Reported-by: 亿一 +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/efi/efivars.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/firmware/efi/efivars.c ++++ b/drivers/firmware/efi/efivars.c +@@ -522,8 +522,10 @@ efivar_create_sysfs_entry(struct efivar_ + ret = kobject_init_and_add(&new_var->kobj, &efivar_ktype, + NULL, "%s", short_name); + kfree(short_name); +- if (ret) ++ if (ret) { ++ kobject_put(&new_var->kobj); + return ret; ++ } + + kobject_uevent(&new_var->kobj, KOBJ_ADD); + if (efivar_entry_add(new_var, &efivar_sysfs_list)) { diff --git a/queue-5.6/io_uring-use-kvfree-in-io_sqe_buffer_register.patch b/queue-5.6/io_uring-use-kvfree-in-io_sqe_buffer_register.patch new file mode 100644 index 00000000000..dce704077f6 --- /dev/null +++ b/queue-5.6/io_uring-use-kvfree-in-io_sqe_buffer_register.patch @@ -0,0 +1,36 @@ +From a8c73c1a614f6da6c0b04c393f87447e28cb6de4 Mon Sep 17 00:00:00 2001 +From: Denis Efremov +Date: Fri, 5 Jun 2020 12:32:03 +0300 +Subject: io_uring: use kvfree() in io_sqe_buffer_register() + +From: Denis Efremov + +commit a8c73c1a614f6da6c0b04c393f87447e28cb6de4 upstream. + +Use kvfree() to free the pages and vmas, since they are allocated by +kvmalloc_array() in a loop. + +Fixes: d4ef647510b1 ("io_uring: avoid page allocation warnings") +Signed-off-by: Denis Efremov +Signed-off-by: Jens Axboe +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200605093203.40087-1-efremov@linux.com +Signed-off-by: Greg Kroah-Hartman + +--- + fs/io_uring.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/io_uring.c ++++ b/fs/io_uring.c +@@ -6254,8 +6254,8 @@ static int io_sqe_buffer_register(struct + + ret = 0; + if (!pages || nr_pages > got_pages) { +- kfree(vmas); +- kfree(pages); ++ kvfree(vmas); ++ kvfree(pages); + pages = kvmalloc_array(nr_pages, sizeof(struct page *), + GFP_KERNEL); + vmas = kvmalloc_array(nr_pages, diff --git a/queue-5.6/kvm-x86-allow-kvm_state_nested_mtf_pending-in-kvm_state-flags.patch b/queue-5.6/kvm-x86-allow-kvm_state_nested_mtf_pending-in-kvm_state-flags.patch new file mode 100644 index 00000000000..87b2b112b8c --- /dev/null +++ b/queue-5.6/kvm-x86-allow-kvm_state_nested_mtf_pending-in-kvm_state-flags.patch @@ -0,0 +1,35 @@ +From df2a69af85bef169ab6810cc57f6b6b943941e7e Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 19 May 2020 12:51:32 -0400 +Subject: KVM: x86: allow KVM_STATE_NESTED_MTF_PENDING in kvm_state flags + +From: Paolo Bonzini + +commit df2a69af85bef169ab6810cc57f6b6b943941e7e upstream. + +The migration functionality was left incomplete in commit 5ef8acbdd687 +("KVM: nVMX: Emulate MTF when performing instruction emulation", 2020-02-23), +fix it. + +Fixes: 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing instruction emulation") +Cc: stable@vger.kernel.org +Reviewed-by: Oliver Upton +Reviewed-by: Vitaly Kuznetsov +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -4568,7 +4568,7 @@ long kvm_arch_vcpu_ioctl(struct file *fi + + if (kvm_state.flags & + ~(KVM_STATE_NESTED_RUN_PENDING | KVM_STATE_NESTED_GUEST_MODE +- | KVM_STATE_NESTED_EVMCS)) ++ | KVM_STATE_NESTED_EVMCS | KVM_STATE_NESTED_MTF_PENDING)) + break; + + /* nested_run_pending implies guest_mode. */ diff --git a/queue-5.6/kvm-x86-fix-apic-page-invalidation-race.patch b/queue-5.6/kvm-x86-fix-apic-page-invalidation-race.patch new file mode 100644 index 00000000000..774d0ea2144 --- /dev/null +++ b/queue-5.6/kvm-x86-fix-apic-page-invalidation-race.patch @@ -0,0 +1,163 @@ +From e649b3f0188f8fd34dd0dde8d43fd3312b902fb2 Mon Sep 17 00:00:00 2001 +From: Eiichi Tsukata +Date: Sat, 6 Jun 2020 13:26:27 +0900 +Subject: KVM: x86: Fix APIC page invalidation race + +From: Eiichi Tsukata + +commit e649b3f0188f8fd34dd0dde8d43fd3312b902fb2 upstream. + +Commit b1394e745b94 ("KVM: x86: fix APIC page invalidation") tried +to fix inappropriate APIC page invalidation by re-introducing arch +specific kvm_arch_mmu_notifier_invalidate_range() and calling it from +kvm_mmu_notifier_invalidate_range_start. However, the patch left a +possible race where the VMCS APIC address cache is updated *before* +it is unmapped: + + (Invalidator) kvm_mmu_notifier_invalidate_range_start() + (Invalidator) kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD) + (KVM VCPU) vcpu_enter_guest() + (KVM VCPU) kvm_vcpu_reload_apic_access_page() + (Invalidator) actually unmap page + +Because of the above race, there can be a mismatch between the +host physical address stored in the APIC_ACCESS_PAGE VMCS field and +the host physical address stored in the EPT entry for the APIC GPA +(0xfee0000). When this happens, the processor will not trap APIC +accesses, and will instead show the raw contents of the APIC-access page. +Because Windows OS periodically checks for unexpected modifications to +the LAPIC register, this will show up as a BSOD crash with BugCheck +CRITICAL_STRUCTURE_CORRUPTION (109) we are currently seeing in +https://bugzilla.redhat.com/show_bug.cgi?id=1751017. + +The root cause of the issue is that kvm_arch_mmu_notifier_invalidate_range() +cannot guarantee that no additional references are taken to the pages in +the range before kvm_mmu_notifier_invalidate_range_end(). Fortunately, +this case is supported by the MMU notifier API, as documented in +include/linux/mmu_notifier.h: + + * If the subsystem + * can't guarantee that no additional references are taken to + * the pages in the range, it has to implement the + * invalidate_range() notifier to remove any references taken + * after invalidate_range_start(). + +The fix therefore is to reload the APIC-access page field in the VMCS +from kvm_mmu_notifier_invalidate_range() instead of ..._range_start(). + +Cc: stable@vger.kernel.org +Fixes: b1394e745b94 ("KVM: x86: fix APIC page invalidation") +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=197951 +Signed-off-by: Eiichi Tsukata +Message-Id: <20200606042627.61070-1-eiichi.tsukata@nutanix.com> +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 7 ++----- + include/linux/kvm_host.h | 4 ++-- + virt/kvm/kvm_main.c | 26 ++++++++++++++++---------- + 3 files changed, 20 insertions(+), 17 deletions(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -8115,9 +8115,8 @@ static void vcpu_load_eoi_exitmap(struct + kvm_x86_ops->load_eoi_exitmap(vcpu, eoi_exit_bitmap); + } + +-int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, +- unsigned long start, unsigned long end, +- bool blockable) ++void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, ++ unsigned long start, unsigned long end) + { + unsigned long apic_address; + +@@ -8128,8 +8127,6 @@ int kvm_arch_mmu_notifier_invalidate_ran + apic_address = gfn_to_hva(kvm, APIC_DEFAULT_PHYS_BASE >> PAGE_SHIFT); + if (start <= apic_address && apic_address < end) + kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD); +- +- return 0; + } + + void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu) +--- a/include/linux/kvm_host.h ++++ b/include/linux/kvm_host.h +@@ -1394,8 +1394,8 @@ static inline long kvm_arch_vcpu_async_i + } + #endif /* CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL */ + +-int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, +- unsigned long start, unsigned long end, bool blockable); ++void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, ++ unsigned long start, unsigned long end); + + #ifdef CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE + int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu); +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -157,10 +157,9 @@ static void kvm_uevent_notify_change(uns + static unsigned long long kvm_createvm_count; + static unsigned long long kvm_active_vms; + +-__weak int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, +- unsigned long start, unsigned long end, bool blockable) ++__weak void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, ++ unsigned long start, unsigned long end) + { +- return 0; + } + + bool kvm_is_zone_device_pfn(kvm_pfn_t pfn) +@@ -378,6 +377,18 @@ static inline struct kvm *mmu_notifier_t + return container_of(mn, struct kvm, mmu_notifier); + } + ++static void kvm_mmu_notifier_invalidate_range(struct mmu_notifier *mn, ++ struct mm_struct *mm, ++ unsigned long start, unsigned long end) ++{ ++ struct kvm *kvm = mmu_notifier_to_kvm(mn); ++ int idx; ++ ++ idx = srcu_read_lock(&kvm->srcu); ++ kvm_arch_mmu_notifier_invalidate_range(kvm, start, end); ++ srcu_read_unlock(&kvm->srcu, idx); ++} ++ + static void kvm_mmu_notifier_change_pte(struct mmu_notifier *mn, + struct mm_struct *mm, + unsigned long address, +@@ -402,7 +413,6 @@ static int kvm_mmu_notifier_invalidate_r + { + struct kvm *kvm = mmu_notifier_to_kvm(mn); + int need_tlb_flush = 0, idx; +- int ret; + + idx = srcu_read_lock(&kvm->srcu); + spin_lock(&kvm->mmu_lock); +@@ -419,14 +429,9 @@ static int kvm_mmu_notifier_invalidate_r + kvm_flush_remote_tlbs(kvm); + + spin_unlock(&kvm->mmu_lock); +- +- ret = kvm_arch_mmu_notifier_invalidate_range(kvm, range->start, +- range->end, +- mmu_notifier_range_blockable(range)); +- + srcu_read_unlock(&kvm->srcu, idx); + +- return ret; ++ return 0; + } + + static void kvm_mmu_notifier_invalidate_range_end(struct mmu_notifier *mn, +@@ -532,6 +537,7 @@ static void kvm_mmu_notifier_release(str + } + + static const struct mmu_notifier_ops kvm_mmu_notifier_ops = { ++ .invalidate_range = kvm_mmu_notifier_invalidate_range, + .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start, + .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end, + .clear_flush_young = kvm_mmu_notifier_clear_flush_young, diff --git a/queue-5.6/kvm-x86-mmu-set-mmio_value-to-0-if-reserved-pf-can-t-be-generated.patch b/queue-5.6/kvm-x86-mmu-set-mmio_value-to-0-if-reserved-pf-can-t-be-generated.patch new file mode 100644 index 00000000000..f45a498df12 --- /dev/null +++ b/queue-5.6/kvm-x86-mmu-set-mmio_value-to-0-if-reserved-pf-can-t-be-generated.patch @@ -0,0 +1,64 @@ +From 6129ed877d409037b79866327102c9dc59a302fe Mon Sep 17 00:00:00 2001 +From: Sean Christopherson +Date: Wed, 27 May 2020 01:49:09 -0700 +Subject: KVM: x86/mmu: Set mmio_value to '0' if reserved #PF can't be generated + +From: Sean Christopherson + +commit 6129ed877d409037b79866327102c9dc59a302fe upstream. + +Set the mmio_value to '0' instead of simply clearing the present bit to +squash a benign warning in kvm_mmu_set_mmio_spte_mask() that complains +about the mmio_value overlapping the lower GFN mask on systems with 52 +bits of PA space. + +Opportunistically clean up the code and comments. + +Cc: stable@vger.kernel.org +Fixes: d43e2675e96fc ("KVM: x86: only do L1TF workaround on affected processors") +Signed-off-by: Sean Christopherson +Message-Id: <20200527084909.23492-1-sean.j.christopherson@intel.com> +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/mmu/mmu.c | 27 +++++++++------------------ + 1 file changed, 9 insertions(+), 18 deletions(-) + +--- a/arch/x86/kvm/mmu/mmu.c ++++ b/arch/x86/kvm/mmu/mmu.c +@@ -6132,25 +6132,16 @@ static void kvm_set_mmio_spte_mask(void) + u64 mask; + + /* +- * Set the reserved bits and the present bit of an paging-structure +- * entry to generate page fault with PFER.RSV = 1. ++ * Set a reserved PA bit in MMIO SPTEs to generate page faults with ++ * PFEC.RSVD=1 on MMIO accesses. 64-bit PTEs (PAE, x86-64, and EPT ++ * paging) support a maximum of 52 bits of PA, i.e. if the CPU supports ++ * 52-bit physical addresses then there are no reserved PA bits in the ++ * PTEs and so the reserved PA approach must be disabled. + */ +- +- /* +- * Mask the uppermost physical address bit, which would be reserved as +- * long as the supported physical address width is less than 52. +- */ +- mask = 1ull << 51; +- +- /* Set the present bit. */ +- mask |= 1ull; +- +- /* +- * If reserved bit is not supported, clear the present bit to disable +- * mmio page fault. +- */ +- if (shadow_phys_bits == 52) +- mask &= ~1ull; ++ if (shadow_phys_bits < 52) ++ mask = BIT_ULL(51) | PT_PRESENT_MASK; ++ else ++ mask = 0; + + kvm_mmu_set_mmio_spte_mask(mask, mask, ACC_WRITE_MASK | ACC_USER_MASK); + } diff --git a/queue-5.6/kvm-x86-respect-singlestep-when-emulating-instruction.patch b/queue-5.6/kvm-x86-respect-singlestep-when-emulating-instruction.patch new file mode 100644 index 00000000000..805ef5b5920 --- /dev/null +++ b/queue-5.6/kvm-x86-respect-singlestep-when-emulating-instruction.patch @@ -0,0 +1,43 @@ +From 384dea1c9183880be183cfaae161d99aafd16df6 Mon Sep 17 00:00:00 2001 +From: Felipe Franciosi +Date: Tue, 19 May 2020 08:11:22 +0000 +Subject: KVM: x86: respect singlestep when emulating instruction + +From: Felipe Franciosi + +commit 384dea1c9183880be183cfaae161d99aafd16df6 upstream. + +When userspace configures KVM_GUESTDBG_SINGLESTEP, KVM will manage the +presence of X86_EFLAGS_TF via kvm_set/get_rflags on vcpus. The actual +rflag bit is therefore hidden from callers. + +That includes init_emulate_ctxt() which uses the value returned from +kvm_get_flags() to set ctxt->tf. As a result, x86_emulate_instruction() +will skip a single step, leaving singlestep_rip stale and not returning +to userspace. + +This resolves the issue by observing the vcpu guest_debug configuration +alongside ctxt->tf in x86_emulate_instruction(), performing the single +step if set. + +Cc: stable@vger.kernel.org +Signed-off-by: Felipe Franciosi +Message-Id: <20200519081048.8204-1-felipe@nutanix.com> +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -6908,7 +6908,7 @@ restart: + if (!ctxt->have_exception || + exception_type(ctxt->exception.vector) == EXCPT_TRAP) { + kvm_rip_write(vcpu, ctxt->eip); +- if (r && ctxt->tf) ++ if (r && (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP))) + r = kvm_vcpu_do_singlestep(vcpu); + if (kvm_x86_ops->update_emulated_instruction) + kvm_x86_ops->update_emulated_instruction(vcpu); diff --git a/queue-5.6/perf-x86-intel-add-more-available-bits-for-offcore_response-of-intel-tremont.patch b/queue-5.6/perf-x86-intel-add-more-available-bits-for-offcore_response-of-intel-tremont.patch new file mode 100644 index 00000000000..46ef31afa52 --- /dev/null +++ b/queue-5.6/perf-x86-intel-add-more-available-bits-for-offcore_response-of-intel-tremont.patch @@ -0,0 +1,39 @@ +From 0813c40556fce1eeefb996e020cc5339e0b84137 Mon Sep 17 00:00:00 2001 +From: Kan Liang +Date: Fri, 1 May 2020 05:54:42 -0700 +Subject: perf/x86/intel: Add more available bits for OFFCORE_RESPONSE of Intel Tremont + +From: Kan Liang + +commit 0813c40556fce1eeefb996e020cc5339e0b84137 upstream. + +The mask in the extra_regs for Intel Tremont need to be extended to +allow more defined bits. + +"Outstanding Requests" (bit 63) is only available on MSR_OFFCORE_RSP0; + +Fixes: 6daeb8737f8a ("perf/x86/intel: Add Tremont core PMU support") +Reported-by: Stephane Eranian +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/20200501125442.7030-1-kan.liang@linux.intel.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/events/intel/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/x86/events/intel/core.c ++++ b/arch/x86/events/intel/core.c +@@ -1892,8 +1892,8 @@ static __initconst const u64 tnt_hw_cach + + static struct extra_reg intel_tnt_extra_regs[] __read_mostly = { + /* must define OFFCORE_RSP_X first, see intel_fixup_er() */ +- INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0xffffff9fffull, RSP_0), +- INTEL_UEVENT_EXTRA_REG(0x02b7, MSR_OFFCORE_RSP_1, 0xffffff9fffull, RSP_1), ++ INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x800ff0ffffff9fffull, RSP_0), ++ INTEL_UEVENT_EXTRA_REG(0x02b7, MSR_OFFCORE_RSP_1, 0xff0ffffff9fffull, RSP_1), + EVENT_EXTRA_END + }; + diff --git a/queue-5.6/powerpc-ptdump-properly-handle-non-standard-page-size.patch b/queue-5.6/powerpc-ptdump-properly-handle-non-standard-page-size.patch new file mode 100644 index 00000000000..c33c79607bd --- /dev/null +++ b/queue-5.6/powerpc-ptdump-properly-handle-non-standard-page-size.patch @@ -0,0 +1,124 @@ +From b00ff6d8c1c3898b0f768cbb38ef722d25bd2f39 Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Tue, 19 May 2020 05:48:54 +0000 +Subject: powerpc/ptdump: Properly handle non standard page size + +From: Christophe Leroy + +commit b00ff6d8c1c3898b0f768cbb38ef722d25bd2f39 upstream. + +In order to properly display information regardless of the page size, +it is necessary to take into account real page size. + +Fixes: cabe8138b23c ("powerpc: dump as a single line areas mapping a single physical page.") +Cc: stable@vger.kernel.org +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/a53b2a0ffd042a8d85464bf90d55bc5b970e00a1.1589866984.git.christophe.leroy@csgroup.eu +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/mm/ptdump/ptdump.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/arch/powerpc/mm/ptdump/ptdump.c ++++ b/arch/powerpc/mm/ptdump/ptdump.c +@@ -60,6 +60,7 @@ struct pg_state { + unsigned long start_address; + unsigned long start_pa; + unsigned long last_pa; ++ unsigned long page_size; + unsigned int level; + u64 current_flags; + bool check_wx; +@@ -157,9 +158,9 @@ static void dump_addr(struct pg_state *s + #endif + + pt_dump_seq_printf(st->seq, REG "-" REG " ", st->start_address, addr - 1); +- if (st->start_pa == st->last_pa && st->start_address + PAGE_SIZE != addr) { ++ if (st->start_pa == st->last_pa && st->start_address + st->page_size != addr) { + pt_dump_seq_printf(st->seq, "[" REG "]", st->start_pa); +- delta = PAGE_SIZE >> 10; ++ delta = st->page_size >> 10; + } else { + pt_dump_seq_printf(st->seq, " " REG " ", st->start_pa); + delta = (addr - st->start_address) >> 10; +@@ -190,7 +191,7 @@ static void note_prot_wx(struct pg_state + } + + static void note_page(struct pg_state *st, unsigned long addr, +- unsigned int level, u64 val) ++ unsigned int level, u64 val, unsigned long page_size) + { + u64 flag = val & pg_level[level].mask; + u64 pa = val & PTE_RPN_MASK; +@@ -202,6 +203,7 @@ static void note_page(struct pg_state *s + st->start_address = addr; + st->start_pa = pa; + st->last_pa = pa; ++ st->page_size = page_size; + pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name); + /* + * Dump the section of virtual memory when: +@@ -213,7 +215,7 @@ static void note_page(struct pg_state *s + */ + } else if (flag != st->current_flags || level != st->level || + addr >= st->marker[1].start_address || +- (pa != st->last_pa + PAGE_SIZE && ++ (pa != st->last_pa + st->page_size && + (pa != st->start_pa || st->start_pa != st->last_pa))) { + + /* Check the PTE flags */ +@@ -241,6 +243,7 @@ static void note_page(struct pg_state *s + st->start_address = addr; + st->start_pa = pa; + st->last_pa = pa; ++ st->page_size = page_size; + st->current_flags = flag; + st->level = level; + } else { +@@ -256,7 +259,7 @@ static void walk_pte(struct pg_state *st + + for (i = 0; i < PTRS_PER_PTE; i++, pte++) { + addr = start + i * PAGE_SIZE; +- note_page(st, addr, 4, pte_val(*pte)); ++ note_page(st, addr, 4, pte_val(*pte), PAGE_SIZE); + + } + } +@@ -273,7 +276,7 @@ static void walk_pmd(struct pg_state *st + /* pmd exists */ + walk_pte(st, pmd, addr); + else +- note_page(st, addr, 3, pmd_val(*pmd)); ++ note_page(st, addr, 3, pmd_val(*pmd), PMD_SIZE); + } + } + +@@ -289,7 +292,7 @@ static void walk_pud(struct pg_state *st + /* pud exists */ + walk_pmd(st, pud, addr); + else +- note_page(st, addr, 2, pud_val(*pud)); ++ note_page(st, addr, 2, pud_val(*pud), PUD_SIZE); + } + } + +@@ -308,7 +311,7 @@ static void walk_pagetables(struct pg_st + /* pgd exists */ + walk_pud(st, pgd, addr); + else +- note_page(st, addr, 1, pgd_val(*pgd)); ++ note_page(st, addr, 1, pgd_val(*pgd), PGDIR_SIZE); + } + } + +@@ -363,7 +366,7 @@ static int ptdump_show(struct seq_file * + + /* Traverse kernel page tables */ + walk_pagetables(&st); +- note_page(&st, 0, 0, 0); ++ note_page(&st, 0, 0, 0, 0); + return 0; + } + diff --git a/queue-5.6/series b/queue-5.6/series index 02e94e7a57b..7203b11d7c4 100644 --- a/queue-5.6/series +++ b/queue-5.6/series @@ -51,3 +51,13 @@ x86-pci-mark-intel-c620-mroms-as-having-non-compliant-bars.patch x86-speculation-prevent-rogue-cross-process-ssbd-shutdown.patch x86-speculation-avoid-force-disabling-ibpb-based-on-stibp-and-enhanced-ibrs.patch x86-speculation-pr_spec_force_disable-enforcement-for-indirect-branches.patch +x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch +perf-x86-intel-add-more-available-bits-for-offcore_response-of-intel-tremont.patch +kvm-x86-allow-kvm_state_nested_mtf_pending-in-kvm_state-flags.patch +kvm-x86-mmu-set-mmio_value-to-0-if-reserved-pf-can-t-be-generated.patch +kvm-x86-respect-singlestep-when-emulating-instruction.patch +kvm-x86-fix-apic-page-invalidation-race.patch +powerpc-ptdump-properly-handle-non-standard-page-size.patch +asoc-max9867-fix-volume-controls.patch +io_uring-use-kvfree-in-io_sqe_buffer_register.patch +efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch diff --git a/queue-5.6/x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch b/queue-5.6/x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch new file mode 100644 index 00000000000..a309f57a9b3 --- /dev/null +++ b/queue-5.6/x86-reboot-quirks-add-macbook6-1-reboot-quirk.patch @@ -0,0 +1,39 @@ +From 140fd4ac78d385e6c8e6a5757585f6c707085f87 Mon Sep 17 00:00:00 2001 +From: Hill Ma +Date: Sat, 25 Apr 2020 13:06:41 -0700 +Subject: x86/reboot/quirks: Add MacBook6,1 reboot quirk + +From: Hill Ma + +commit 140fd4ac78d385e6c8e6a5757585f6c707085f87 upstream. + +On MacBook6,1 reboot would hang unless parameter reboot=pci is added. +Make it automatic. + +Signed-off-by: Hill Ma +Signed-off-by: Borislav Petkov +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/20200425200641.GA1554@cslab.localdomain +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/reboot.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -197,6 +197,14 @@ static const struct dmi_system_id reboot + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"), + }, + }, ++ { /* Handle problems with rebooting on Apple MacBook6,1 */ ++ .callback = set_pci_reboot, ++ .ident = "Apple MacBook6,1", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "MacBook6,1"), ++ }, ++ }, + { /* Handle problems with rebooting on Apple MacBookPro5 */ + .callback = set_pci_reboot, + .ident = "Apple MacBookPro5",