All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>,
	borntraeger@linux.ibm.com, imbrenda@linux.ibm.com
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v3 1/1] KVM: s390: pv: fix external interruption loop not always detected
Date: Mon, 13 Feb 2023 13:00:25 +0100	[thread overview]
Message-ID: <914807eb-ec75-0de1-abe4-2b928917edef@linux.ibm.com> (raw)
In-Reply-To: <38deba59-ac91-0196-d7f0-e7846a7531b3@linux.ibm.com>

On 2/13/23 10:21, Janosch Frank wrote:
> On 2/13/23 09:55, Nico Boehr wrote:
>> 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>
> 

I'll add this when picking:
Fixes: 201ae986ead7 ("KVM: s390: protvirt: Implement interrupt injection")

  reply	other threads:[~2023-02-13 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  8:55 [PATCH v3 0/1] KVM: s390: pv: fix external interruption loop not always detected Nico Boehr
2023-02-13  8:55 ` [PATCH v3 1/1] " Nico Boehr
2023-02-13  9:06   ` Christian Borntraeger
2023-02-13  9:21   ` Janosch Frank
2023-02-13 12:00     ` Janosch Frank [this message]
2023-02-13 13:02       ` Nico Boehr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=914807eb-ec75-0de1-abe4-2b928917edef@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.