From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55849 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725915AbgEEHxo (ORCPT ); Tue, 5 May 2020 03:53:44 -0400 Date: Tue, 5 May 2020 09:53:32 +0200 From: Cornelia Huck Subject: Re: [PATCH] KVM: s390: Remove false WARN_ON_ONCE for the PQAP instruction Message-ID: <20200505095332.528254e5.cohuck@redhat.com> In-Reply-To: <20200505073525.2287-1-borntraeger@de.ibm.com> References: <20200505073525.2287-1-borntraeger@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: Christian Borntraeger Cc: Janosch Frank , KVM , David Hildenbrand , linux-s390 , Qian Cai , Pierre Morel , Tony Krowiak On Tue, 5 May 2020 09:35:25 +0200 Christian Borntraeger wrote: > In LPAR we will only get an intercept for FC==3 for the PQAP > instruction. Running nested under z/VM can result in other intercepts as > well, for example PQAP(QCI). So the WARN_ON_ONCE is not right. Let > us simply remove it. While I agree with removing the WARN_ON_ONCE, I'm wondering why z/VM gives us intercepts for those fcs... is that just a result of nesting (or the z/VM implementation), or is there anything we might want to do? > > Cc: Pierre Morel > Cc: Tony Krowiak > Reported-by: Qian Cai > Signed-off-by: Christian Borntraeger > --- > arch/s390/kvm/priv.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c > index 69a824f9ef0b..bbe46c6aedbf 100644 > --- a/arch/s390/kvm/priv.c > +++ b/arch/s390/kvm/priv.c > @@ -626,10 +626,12 @@ static int handle_pqap(struct kvm_vcpu *vcpu) > * available for the guest are AQIC and TAPQ with the t bit set > * since we do not set IC.3 (FIII) we currently will only intercept > * the AQIC function code. > + * Note: running nested under z/VM can result in intercepts, e.g. s/intercepts/intercepts for other function codes/ > + * for PQAP(QCI). We do not support this and bail out. > */ > reg0 = vcpu->run->s.regs.gprs[0]; > fc = (reg0 >> 24) & 0xff; > - if (WARN_ON_ONCE(fc != 0x03)) > + if (fc != 0x03) > return -EOPNOTSUPP; > > /* PQAP instruction is allowed for guest kernel only */