summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorNico Boehr <nrb@linux.ibm.com>2023-02-13 11:55:20 +0300
committerJanosch Frank <frankja@linux.ibm.com>2023-03-28 10:16:37 +0300
commit21f27df854008b86349a203bf97fef79bb11f53e (patch)
treedc321e967bc4320af0006f86f68195941cd095d8 /arch/x86
parent197b6b60ae7bc51dd0814953c562833143b292aa (diff)
downloadlinux-21f27df854008b86349a203bf97fef79bb11f53e.tar.xz
KVM: s390: pv: fix external interruption loop not always detected
To determine whether the guest has caused an external interruption loop upon code 20 (external interrupt) intercepts, the ext_new_psw needs to be inspected to see whether external interrupts are enabled. Under non-PV, ext_new_psw can simply be taken from guest lowcore. Under PV, KVM can only access the encrypted guest lowcore and hence the ext_new_psw must not be taken from guest lowcore. handle_external_interrupt() incorrectly did that and hence was not able to reliably tell whether an external interruption loop is happening or not. False negatives cause spurious failures of my kvm-unit-test for extint loops[1] under PV. Since code 20 is only caused under PV if and only if the guest's ext_new_psw is enabled for external interrupts, false positive detection of a external interruption loop can not happen. Fix this issue by instead looking at the guest PSW in the state description. Since the PSW swap for external interrupt is done by the ultravisor before the intercept is caused, this reliably tells whether the guest is enabled for external interrupts in the ext_new_psw. Also update the comments to explain better what is happening. [1] https://lore.kernel.org/kvm/20220812062151.1980937-4-nrb@linux.ibm.com/ Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Fixes: 201ae986ead7 ("KVM: s390: protvirt: Implement interrupt injection") Link: https://lore.kernel.org/r/20230213085520.100756-2-nrb@linux.ibm.com Message-Id: <20230213085520.100756-2-nrb@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Diffstat (limited to 'arch/x86')
0 files changed, 0 insertions, 0 deletions