linux-stable/arch/powerpc/kvm
Suraj Jitindar Singh 9b28291237 KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors
[ Upstream commit 77bbbc0cf8 ]

The POWER9 vCPU TLB management code assumes all threads in a core share
a TLB, and that TLBIEL execued by one thread will invalidate TLBs for
all threads. This is not the case for SMT8 capable POWER9 and POWER10
(big core) processors, where the TLB is split between groups of threads.
This results in TLB multi-hits, random data corruption, etc.

Fix this by introducing cpu_first_tlb_thread_sibling etc., to determine
which siblings share TLBs, and use that in the guest TLB flushing code.

[npiggin@gmail.com: add changelog and comment]

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210602040441.3984352-1-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:55:55 +02:00
..
book3s.c KVM: PPC: Don't return -ENOTSUPP to userspace in ioctls 2020-09-17 11:38:17 +10:00
book3s.h KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
book3s_32_mmu.c KVM: PPC: Use fallthrough; 2020-03-19 16:39:52 +11:00
book3s_32_mmu_host.c KVM: PPC: Book3S PR: Move kvmppc_mmu_init() into PR KVM 2020-03-19 16:39:52 +11:00
book3s_32_sr.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_64_mmu.c KVM: PPC: Use fallthrough; 2020-03-19 16:39:52 +11:00
book3s_64_mmu_host.c KVM: PPC: Book3S PR: Move kvmppc_mmu_init() into PR KVM 2020-03-19 16:39:52 +11:00
book3s_64_mmu_hv.c KVM: PPC: Book3S HV: Increase KVMPPC_NR_LPIDS on POWER8 and POWER9 2020-07-21 15:38:03 +10:00
book3s_64_mmu_radix.c KVM: PPC: Book3S: Fix symbol undeclared warnings 2020-09-22 11:53:55 +10:00
book3s_64_slb.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_64_vio.c KVM: PPC: Book3S: Fix symbol undeclared warnings 2020-09-22 11:53:55 +10:00
book3s_64_vio_hv.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
book3s_emulate.c KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
book3s_exports.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_hv.c KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors 2021-07-14 16:55:55 +02:00
book3s_hv_builtin.c KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors 2021-07-14 16:55:55 +02:00
book3s_hv_hmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 114 2019-05-24 17:39:01 +02:00
book3s_hv_interrupts.S KVM: PPC: Book3S HV: Set LPCR[HDICE] before writing HDEC 2020-09-17 11:38:17 +10:00
book3s_hv_nested.c KVM: PPC: Book3S HV: Workaround high stack usage with clang 2021-07-14 16:55:42 +02:00
book3s_hv_ras.c powerpc/64s: Move HMI IRQ stat from percpu variable to paca. 2020-07-29 23:47:53 +10:00
book3s_hv_rm_mmu.c KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors 2021-07-14 16:55:55 +02:00
book3s_hv_rm_xics.c KVM: PPC: Book3S: Fix symbol undeclared warnings 2020-09-22 11:53:55 +10:00
book3s_hv_rm_xive.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
book3s_hv_rmhandlers.S powerpc/64s: handle ISA v3.1 local copy-paste context switches 2020-09-08 22:57:12 +10:00
book3s_hv_tm.c KVM: PPC: Book3S HV: Treat TM-related invalid form instructions on P9 like the valid ones 2020-03-19 16:39:52 +11:00
book3s_hv_tm_builtin.c KVM: PPC: Book3S HV: Treat TM-related invalid form instructions on P9 like the valid ones 2020-03-19 16:39:52 +11:00
book3s_hv_uvmem.c mm/memremap_pages: support multiple ranges per invocation 2020-10-13 18:38:28 -07:00
book3s_interrupts.S PPC KVM update for 5.9 2020-08-09 13:24:02 -04:00
book3s_mmu_hpte.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_paired_singles.c KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
book3s_pr.c KVM: PPC: Book3S: Fix symbol undeclared warnings 2020-09-22 11:53:55 +10:00
book3s_pr_papr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_rmhandlers.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 266 2019-06-05 17:30:28 +02:00
book3s_rtas.c KVM: PPC: Protect kvm_vcpu_read_guest with srcu locks 2020-07-21 15:38:03 +10:00
book3s_segment.S powerpc/64s/exception: Move KVM test to common code 2020-04-01 13:42:11 +11:00
book3s_xics.c KVM: PPC: Book3S HV: XICS: Replace the 'destroy' method by a 'release' method 2020-09-03 14:12:48 +10:00
book3s_xics.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
book3s_xive.c KVM: PPC: Book3S HV: XIVE: Fix vCPU id sanity check 2020-12-01 21:45:51 +11:00
book3s_xive.h KVM: PPC: Book3S HV: XIVE: Make VP block size configurable 2019-10-22 16:29:02 +11:00
book3s_xive_native.c KVM: PPC: Book3S HV: XIVE: Fix possible oops when accessing ESB page 2020-11-16 23:28:30 +11:00
book3s_xive_template.c powerpc/xive: Enforce load-after-store ordering when StoreEOI is active 2020-05-07 22:58:31 +10:00
booke.c KVM: PPC: Don't return -ENOTSUPP to userspace in ioctls 2020-09-17 11:38:17 +10:00
booke.h KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
booke_emulate.c KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
booke_interrupts.S KVM: PPC: Clean up redundant kvm_run parameters in assembly 2020-07-23 15:50:01 +10:00
bookehv_interrupts.S KVM: PPC: Clean up redundant kvm_run parameters in assembly 2020-07-23 15:50:01 +10:00
e500.c KVM: PPC: Kill kvmppc_ops::mmu_destroy() and kvmppc_mmu_destroy() 2020-03-19 16:43:07 +11:00
e500.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500_emulate.c KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
e500_mmu.c KVM: PPC: Kill kvmppc_ops::mmu_destroy() and kvmppc_mmu_destroy() 2020-03-19 16:43:07 +11:00
e500_mmu_host.c KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() 2020-08-21 18:03:47 -04:00
e500_mmu_host.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
e500mc.c KVM: PPC: Kill kvmppc_ops::mmu_destroy() and kvmppc_mmu_destroy() 2020-03-19 16:43:07 +11:00
emulate.c KVM: PPC: Clean up redundant 'kvm_run' parameters 2020-05-27 11:39:31 +10:00
emulate_loadstore.c MIPS: 2020-06-12 11:05:52 -07:00
fpu.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
irq.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile KVM: PPC: Book3S HV: Support for running secure guests 2019-11-28 16:30:02 +11:00
mpic.c KVM: Remove unnecessary asm/kvm_host.h includes 2020-03-16 17:57:34 +01:00
powerpc.c KVM: PPC: Make the VMX instruction emulation routines static 2021-03-04 11:38:01 +01:00
timing.c powerpc/kvm: no need to check return value of debugfs_create functions 2020-03-04 22:44:25 +11:00
timing.h KVM: Remove unnecessary asm/kvm_host.h includes 2020-03-16 17:57:34 +01:00
tm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
trace.h
trace_book3s.h
trace_booke.h
trace_hv.h KVM: PPC: Fix typo on H_DISABLE_AND_GET hcall 2020-07-23 17:43:35 +10:00
trace_pr.h