linux-stable/arch
Nico Boehr 86145725d4 KVM: s390: pv: don't present the ecall interrupt twice
commit c3f0e5fd2d upstream.

When the SIGP interpretation facility is present and a VCPU sends an
ecall to another VCPU in enabled wait, the sending VCPU receives a 56
intercept (partial execution), so KVM can wake up the receiving CPU.
Note that the SIGP interpretation facility will take care of the
interrupt delivery and KVM's only job is to wake the receiving VCPU.

For PV, the sending VCPU will receive a 108 intercept (pv notify) and
should continue like in the non-PV case, i.e. wake the receiving VCPU.

For PV and non-PV guests the interrupt delivery will occur through the
SIGP interpretation facility on SIE entry when SIE finds the X bit in
the status field set.

However, in handle_pv_notification(), there was no special handling for
SIGP, which leads to interrupt injection being requested by KVM for the
next SIE entry. This results in the interrupt being delivered twice:
once by the SIGP interpretation facility and once by KVM through the
IICTL.

Add the necessary special handling in handle_pv_notification(), similar
to handle_partial_execution(), which simply wakes the receiving VCPU and
leave interrupt delivery to the SIGP interpretation facility.

In contrast to external calls, emergency calls are not interpreted but
also cause a 108 intercept, which is why we still need to call
handle_instruction() for SIGP orders other than ecall.

Since kvm_s390_handle_sigp_pei() is now called for all SIGP orders which
cause a 108 intercept - even if they are actually handled by
handle_instruction() - move the tracepoint in kvm_s390_handle_sigp_pei()
to avoid possibly confusing trace messages.

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
Cc: <stable@vger.kernel.org> # 5.7
Fixes: da24a0cc58 ("KVM: s390: protvirt: Instruction emulation")
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Link: https://lore.kernel.org/r/20220718130434.73302-1-nrb@linux.ibm.com
Message-Id: <20220718130434.73302-1-nrb@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-17 15:13:43 +02:00
..
alpha Cleanups (and one fix) around struct mount handling. 2022-06-04 19:00:05 -07:00
arc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
arm ARM fixes for 5.19: 2022-07-30 17:24:16 -07:00
arm64 arm64: set UXN on swapper page tables 2022-08-11 13:22:03 +02:00
csky csky/tlb: Remove tlb_flush() define 2022-07-21 10:50:13 -07:00
hexagon
ia64 Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
loongarch LoongArch: Fix wrong "ROM Size" of boardinfo 2022-07-29 18:22:33 +08:00
m68k This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
microblaze This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
mips mips: lantiq: Add missing of_node_put() in irq.c 2022-06-21 22:34:03 +02:00
nios2 This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
openrisc openrisc: unwinder: Fix grammar issue in comment 2022-06-28 17:31:24 +09:00
parisc parisc: Fix vDSO signal breakage on 32-bit kernel 2022-07-02 18:36:58 +02:00
powerpc powerpc fixes for 5.19 #6 2022-07-29 09:57:07 -07:00
riscv A Single RISC-V Fix for 5.19 2022-07-29 10:46:03 -07:00
s390 KVM: s390: pv: don't present the ecall interrupt twice 2022-08-17 15:13:43 +02:00
sh sh: convert nommu io{re,un}map() to static inline functions 2022-07-03 15:42:32 -07:00
sparc mmu_gather: Remove per arch tlb_{start,end}_vma() 2022-07-21 10:50:13 -07:00
um - Improve the check whether the kernel supports WP mappings so that it 2022-07-17 08:27:30 -07:00
x86 KVM: SVM: Don't BUG if userspace injects an interrupt with GIF=0 2022-08-17 15:13:43 +02:00
xtensa xtensa: change '.bss' to '.section .bss' 2022-06-20 02:50:34 -07:00
.gitignore
Kconfig mmu_gather: Remove per arch tlb_{start,end}_vma() 2022-07-21 10:50:13 -07:00