From: Greg Kroah-Hartman Date: Tue, 4 Jun 2019 09:34:46 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.1.8~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abec23ee44d66f3272081e479a79d7432a03b2e0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: alsa-hda-realtek-set-default-power-save-node-to-0.patch kvm-ppc-book3s-hv-xive-do-not-clear-irq-data-of-passthrough-interrupts.patch powerpc-perf-fix-mmcra-corruption-by-bhrb_filter.patch --- diff --git a/queue-4.14/alsa-hda-realtek-set-default-power-save-node-to-0.patch b/queue-4.14/alsa-hda-realtek-set-default-power-save-node-to-0.patch new file mode 100644 index 00000000000..13756fab032 --- /dev/null +++ b/queue-4.14/alsa-hda-realtek-set-default-power-save-node-to-0.patch @@ -0,0 +1,36 @@ +From 317d9313925cd8388304286c0d3c8dda7f060a2d Mon Sep 17 00:00:00 2001 +From: Kailang Yang +Date: Thu, 23 May 2019 14:43:04 +0800 +Subject: ALSA: hda/realtek - Set default power save node to 0 + +From: Kailang Yang + +commit 317d9313925cd8388304286c0d3c8dda7f060a2d upstream. + +I measured power consumption between power_save_node=1 and power_save_node=0. +It's almost the same. +Codec will enter to runtime suspend and suspend. +That pin also will enter to D3. Don't need to enter to D3 by single pin. +So, Disable power_save_node as default. It will avoid more issues. +Windows Driver also has not this option at runtime PM. + +Signed-off-by: Kailang Yang +Cc: +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7078,7 +7078,7 @@ static int patch_alc269(struct hda_codec + + spec = codec->spec; + spec->gen.shared_mic_vref_pin = 0x18; +- codec->power_save_node = 1; ++ codec->power_save_node = 0; + + #ifdef CONFIG_PM + codec->patch_ops.suspend = alc269_suspend; diff --git a/queue-4.14/kvm-ppc-book3s-hv-xive-do-not-clear-irq-data-of-passthrough-interrupts.patch b/queue-4.14/kvm-ppc-book3s-hv-xive-do-not-clear-irq-data-of-passthrough-interrupts.patch new file mode 100644 index 00000000000..89377b0cdcd --- /dev/null +++ b/queue-4.14/kvm-ppc-book3s-hv-xive-do-not-clear-irq-data-of-passthrough-interrupts.patch @@ -0,0 +1,99 @@ +From ef9740204051d0e00f5402fe96cf3a43ddd2bbbf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= +Date: Tue, 28 May 2019 14:17:15 +0200 +Subject: KVM: PPC: Book3S HV: XIVE: Do not clear IRQ data of passthrough interrupts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cédric Le Goater + +commit ef9740204051d0e00f5402fe96cf3a43ddd2bbbf upstream. + +The passthrough interrupts are defined at the host level and their IRQ +data should not be cleared unless specifically deconfigured (shutdown) +by the host. They differ from the IPI interrupts which are allocated +by the XIVE KVM device and reserved to the guest usage only. + +This fixes a host crash when destroying a VM in which a PCI adapter +was passed-through. In this case, the interrupt is cleared and freed +by the KVM device and then shutdown by vfio at the host level. + +[ 1007.360265] BUG: Kernel NULL pointer dereference at 0x00000d00 +[ 1007.360285] Faulting instruction address: 0xc00000000009da34 +[ 1007.360296] Oops: Kernel access of bad area, sig: 7 [#1] +[ 1007.360303] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV +[ 1007.360314] Modules linked in: vhost_net vhost iptable_mangle ipt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 tun bridge stp llc kvm_hv kvm xt_tcpudp iptable_filter squashfs fuse binfmt_misc vmx_crypto ib_iser rdma_cm iw_cm ib_cm libiscsi scsi_transport_iscsi nfsd ip_tables x_tables autofs4 btrfs zstd_decompress zstd_compress lzo_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq multipath mlx5_ib ib_uverbs ib_core crc32c_vpmsum mlx5_core +[ 1007.360425] CPU: 9 PID: 15576 Comm: CPU 18/KVM Kdump: loaded Not tainted 5.1.0-gad7e7d0ef #4 +[ 1007.360454] NIP: c00000000009da34 LR: c00000000009e50c CTR: c00000000009e5d0 +[ 1007.360482] REGS: c000007f24ccf330 TRAP: 0300 Not tainted (5.1.0-gad7e7d0ef) +[ 1007.360500] MSR: 900000000280b033 CR: 24002484 XER: 00000000 +[ 1007.360532] CFAR: c00000000009da10 DAR: 0000000000000d00 DSISR: 00080000 IRQMASK: 1 +[ 1007.360532] GPR00: c00000000009e62c c000007f24ccf5c0 c000000001510600 c000007fe7f947c0 +[ 1007.360532] GPR04: 0000000000000d00 0000000000000000 0000000000000000 c000005eff02d200 +[ 1007.360532] GPR08: 0000000000400000 0000000000000000 0000000000000000 fffffffffffffffd +[ 1007.360532] GPR12: c00000000009e5d0 c000007fffff7b00 0000000000000031 000000012c345718 +[ 1007.360532] GPR16: 0000000000000000 0000000000000008 0000000000418004 0000000000040100 +[ 1007.360532] GPR20: 0000000000000000 0000000008430000 00000000003c0000 0000000000000027 +[ 1007.360532] GPR24: 00000000000000ff 0000000000000000 00000000000000ff c000007faa90d98c +[ 1007.360532] GPR28: c000007faa90da40 00000000000fe040 ffffffffffffffff c000007fe7f947c0 +[ 1007.360689] NIP [c00000000009da34] xive_esb_read+0x34/0x120 +[ 1007.360706] LR [c00000000009e50c] xive_do_source_set_mask.part.0+0x2c/0x50 +[ 1007.360732] Call Trace: +[ 1007.360738] [c000007f24ccf5c0] [c000000000a6383c] snooze_loop+0x15c/0x270 (unreliable) +[ 1007.360775] [c000007f24ccf5f0] [c00000000009e62c] xive_irq_shutdown+0x5c/0xe0 +[ 1007.360795] [c000007f24ccf630] [c00000000019e4a0] irq_shutdown+0x60/0xe0 +[ 1007.360813] [c000007f24ccf660] [c000000000198c44] __free_irq+0x3a4/0x420 +[ 1007.360831] [c000007f24ccf700] [c000000000198dc8] free_irq+0x78/0xe0 +[ 1007.360849] [c000007f24ccf730] [c00000000096c5a8] vfio_msi_set_vector_signal+0xa8/0x350 +[ 1007.360878] [c000007f24ccf7f0] [c00000000096c938] vfio_msi_set_block+0xe8/0x1e0 +[ 1007.360899] [c000007f24ccf850] [c00000000096cae0] vfio_msi_disable+0xb0/0x110 +[ 1007.360912] [c000007f24ccf8a0] [c00000000096cd04] vfio_pci_set_msi_trigger+0x1c4/0x3d0 +[ 1007.360922] [c000007f24ccf910] [c00000000096d910] vfio_pci_set_irqs_ioctl+0xa0/0x170 +[ 1007.360941] [c000007f24ccf930] [c00000000096b400] vfio_pci_disable+0x80/0x5e0 +[ 1007.360963] [c000007f24ccfa10] [c00000000096b9bc] vfio_pci_release+0x5c/0x90 +[ 1007.360991] [c000007f24ccfa40] [c000000000963a9c] vfio_device_fops_release+0x3c/0x70 +[ 1007.361012] [c000007f24ccfa70] [c0000000003b5668] __fput+0xc8/0x2b0 +[ 1007.361040] [c000007f24ccfac0] [c0000000001409b0] task_work_run+0x140/0x1b0 +[ 1007.361059] [c000007f24ccfb20] [c000000000118f8c] do_exit+0x3ac/0xd00 +[ 1007.361076] [c000007f24ccfc00] [c0000000001199b0] do_group_exit+0x60/0x100 +[ 1007.361094] [c000007f24ccfc40] [c00000000012b514] get_signal+0x1a4/0x8f0 +[ 1007.361112] [c000007f24ccfd30] [c000000000021cc8] do_notify_resume+0x1a8/0x430 +[ 1007.361141] [c000007f24ccfe20] [c00000000000e444] ret_from_except_lite+0x70/0x74 +[ 1007.361159] Instruction dump: +[ 1007.361175] 38422c00 e9230000 712a0004 41820010 548a2036 7d442378 78840020 71290020 +[ 1007.361194] 4082004c e9230010 7c892214 7c0004ac 0c090000 4c00012c 792a0022 + +Cc: stable@vger.kernel.org # v4.12+ +Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller") +Signed-off-by: Cédric Le Goater +Signed-off-by: Greg Kurz +Signed-off-by: Paul Mackerras +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kvm/book3s_xive.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/kvm/book3s_xive.c ++++ b/arch/powerpc/kvm/book3s_xive.c +@@ -1675,7 +1675,6 @@ static void kvmppc_xive_cleanup_irq(u32 + { + xive_vm_esb_load(xd, XIVE_ESB_SET_PQ_01); + xive_native_configure_irq(hw_num, 0, MASKED, 0); +- xive_cleanup_irq_data(xd); + } + + static void kvmppc_xive_free_sources(struct kvmppc_xive_src_block *sb) +@@ -1689,9 +1688,10 @@ static void kvmppc_xive_free_sources(str + continue; + + kvmppc_xive_cleanup_irq(state->ipi_number, &state->ipi_data); ++ xive_cleanup_irq_data(&state->ipi_data); + xive_native_free_irq(state->ipi_number); + +- /* Pass-through, cleanup too */ ++ /* Pass-through, cleanup too but keep IRQ hw data */ + if (state->pt_number) + kvmppc_xive_cleanup_irq(state->pt_number, state->pt_data); + diff --git a/queue-4.14/powerpc-perf-fix-mmcra-corruption-by-bhrb_filter.patch b/queue-4.14/powerpc-perf-fix-mmcra-corruption-by-bhrb_filter.patch new file mode 100644 index 00000000000..155def10ecf --- /dev/null +++ b/queue-4.14/powerpc-perf-fix-mmcra-corruption-by-bhrb_filter.patch @@ -0,0 +1,106 @@ +From 3202e35ec1c8fc19cea24253ff83edf702a60a02 Mon Sep 17 00:00:00 2001 +From: Ravi Bangoria +Date: Sat, 11 May 2019 08:12:17 +0530 +Subject: powerpc/perf: Fix MMCRA corruption by bhrb_filter + +From: Ravi Bangoria + +commit 3202e35ec1c8fc19cea24253ff83edf702a60a02 upstream. + +Consider a scenario where user creates two events: + + 1st event: + attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; + attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY; + fd = perf_event_open(attr, 0, 1, -1, 0); + + This sets cpuhw->bhrb_filter to 0 and returns valid fd. + + 2nd event: + attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; + attr.branch_sample_type = PERF_SAMPLE_BRANCH_CALL; + fd = perf_event_open(attr, 0, 1, -1, 0); + + It overrides cpuhw->bhrb_filter to -1 and returns with error. + +Now if power_pmu_enable() gets called by any path other than +power_pmu_add(), ppmu->config_bhrb(-1) will set MMCRA to -1. + +Fixes: 3925f46bb590 ("powerpc/perf: Enable branch stack sampling framework") +Cc: stable@vger.kernel.org # v3.10+ +Signed-off-by: Ravi Bangoria +Reviewed-by: Madhavan Srinivasan +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/perf/core-book3s.c | 6 ++++-- + arch/powerpc/perf/power8-pmu.c | 3 +++ + arch/powerpc/perf/power9-pmu.c | 3 +++ + 3 files changed, 10 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/perf/core-book3s.c ++++ b/arch/powerpc/perf/core-book3s.c +@@ -1845,6 +1845,7 @@ static int power_pmu_event_init(struct p + int n; + int err; + struct cpu_hw_events *cpuhw; ++ u64 bhrb_filter; + + if (!ppmu) + return -ENOENT; +@@ -1941,13 +1942,14 @@ static int power_pmu_event_init(struct p + err = power_check_constraints(cpuhw, events, cflags, n + 1); + + if (has_branch_stack(event)) { +- cpuhw->bhrb_filter = ppmu->bhrb_filter_map( ++ bhrb_filter = ppmu->bhrb_filter_map( + event->attr.branch_sample_type); + +- if (cpuhw->bhrb_filter == -1) { ++ if (bhrb_filter == -1) { + put_cpu_var(cpu_hw_events); + return -EOPNOTSUPP; + } ++ cpuhw->bhrb_filter = bhrb_filter; + } + + put_cpu_var(cpu_hw_events); +--- a/arch/powerpc/perf/power8-pmu.c ++++ b/arch/powerpc/perf/power8-pmu.c +@@ -29,6 +29,7 @@ enum { + #define POWER8_MMCRA_IFM1 0x0000000040000000UL + #define POWER8_MMCRA_IFM2 0x0000000080000000UL + #define POWER8_MMCRA_IFM3 0x00000000C0000000UL ++#define POWER8_MMCRA_BHRB_MASK 0x00000000C0000000UL + + /* PowerISA v2.07 format attribute structure*/ + extern struct attribute_group isa207_pmu_format_group; +@@ -179,6 +180,8 @@ static u64 power8_bhrb_filter_map(u64 br + + static void power8_config_bhrb(u64 pmu_bhrb_filter) + { ++ pmu_bhrb_filter &= POWER8_MMCRA_BHRB_MASK; ++ + /* Enable BHRB filter in PMU */ + mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); + } +--- a/arch/powerpc/perf/power9-pmu.c ++++ b/arch/powerpc/perf/power9-pmu.c +@@ -100,6 +100,7 @@ enum { + #define POWER9_MMCRA_IFM1 0x0000000040000000UL + #define POWER9_MMCRA_IFM2 0x0000000080000000UL + #define POWER9_MMCRA_IFM3 0x00000000C0000000UL ++#define POWER9_MMCRA_BHRB_MASK 0x00000000C0000000UL + + /* PowerISA v2.07 format attribute structure*/ + extern struct attribute_group isa207_pmu_format_group; +@@ -289,6 +290,8 @@ static u64 power9_bhrb_filter_map(u64 br + + static void power9_config_bhrb(u64 pmu_bhrb_filter) + { ++ pmu_bhrb_filter &= POWER9_MMCRA_BHRB_MASK; ++ + /* Enable BHRB filter in PMU */ + mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); + } diff --git a/queue-4.14/series b/queue-4.14/series index e3dc4feeecb..3ef8e034d19 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -40,3 +40,6 @@ btrfs-fix-wrong-ctime-and-mtime-of-a-directory-after-log-replay.patch btrfs-fix-race-updating-log-root-item-during-fsync.patch btrfs-fix-fsync-not-persisting-changed-attributes-of-a-directory.patch btrfs-incremental-send-fix-file-corruption-when-no-holes-feature-is-enabled.patch +kvm-ppc-book3s-hv-xive-do-not-clear-irq-data-of-passthrough-interrupts.patch +powerpc-perf-fix-mmcra-corruption-by-bhrb_filter.patch +alsa-hda-realtek-set-default-power-save-node-to-0.patch