Skip to content

KVM: s390: pv: fix external interruption loop not always detected

Nico Boehr kvm linux-s390 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 4 repliesIn review
  2. v21 patch 3 repliesSuperseded
  3. v11 patch 1 replySuperseded

Changes in v3 from the cover letter

---
* fix some checkpatch warnings

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1KVM: s390: pv: fix external interruption loop not always detectedarch/s390/kvm/intercept.c+24 -84 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchChristian BorntraegerJanosch Frank
1/1R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/1] KVM: s390: pv: fix external interruption loop not always detected

v3:
---
* fix some checkpatch warnings

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/[email protected]/

Nico Boehr (1):
KVM: s390: pv: fix external interruption loop not always detected

 arch/s390/kvm/intercept.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
Signature · 1 line
2.39.1