Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp248233imm; Wed, 22 Aug 2018 03:33:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPydLaASbLilZ5xnrNra2ac7joOEHPyCHgboEyfhbUCnkn3lhddH5s5vVFGkGG/IkW4+5+MU X-Received: by 2002:a17:902:a5:: with SMTP id a34-v6mr53713150pla.60.1534934017414; Wed, 22 Aug 2018 03:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534934017; cv=none; d=google.com; s=arc-20160816; b=JRJjbDTkN+QnGqsS5A0LF9dHU992StOTwy4wil1gTIlsuzedcIaXyKAuzhh6lm1bFf uZt4aSvzS90v3pNkHbRHgFHQonrVfGsEMHdAgGcFU1Ha3IEDMDv5YTPpwZM/rW2nI4Qc B1eQmkzOAtlEdwB7TeT7/9Yy4Sz9FhRzSZxJR7nmRtdta/rJWakWnPla0xSm3qj5UTc+ Yvwpkf1lfAa8yg6DcvblzUerqQ0tQap8K4fnHKh97ZQ4pPCJRx9inrCL1fiOFO7UVugk 0XrC0zBKvh2KZqsD4vHTleva+aFkvP2K1Vl6sT+mVokp63YyEF7XOzycY569Ty6jixKL kGhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:mime-version :user-agent:date:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=dwN3JYDmBKlh27hLyo74V5ZbVGwJVNbdcpZpCUMZM7E=; b=gqi3Lg0YmiqBr8PY6Q0/xjSFFSURj6E+VMDkRaenY3GrVpOYxdeZk9LHHLkElyvgCu klJ2sI2X//Gff8Nw3eWFUt+vP/m+F5gawv4lAf5lMelbxjKUGxB8xjEBjYjUUy1GpHiL /frR/wMVLKZ3timHAEK2UJiEcZ42EHyDOfh7IpLhSsVjendivNuoX6VD+lxnC5QDusoH FP//iio8+zwWb8ey7I5ApXaIGunYp1LjUBNRnuURuMjnKTPPI2TmhLkBx+JH+xKsWlgO 6v6tc4fksEF80Aya9ZQtqH7mfrUxpcubVLawuY/LLFUvTf64iDfkQcB8qj8DAmCihxZQ 9csQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11-v6si1317843pgk.665.2018.08.22.03.33.21; Wed, 22 Aug 2018 03:33:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728633AbeHVN4Z (ORCPT + 99 others); Wed, 22 Aug 2018 09:56:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48646 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeHVN4Y (ORCPT ); Wed, 22 Aug 2018 09:56:24 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7MASmZk011841 for ; Wed, 22 Aug 2018 06:32:04 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m13spn0fm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 22 Aug 2018 06:32:04 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Aug 2018 11:32:02 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 22 Aug 2018 11:32:00 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7MAVxha32833684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Aug 2018 10:31:59 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1203352051; Wed, 22 Aug 2018 13:31:59 +0100 (BST) Received: from [9.152.224.110] (unknown [9.152.224.110]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id B4A705204F; Wed, 22 Aug 2018 13:31:58 +0100 (BST) Subject: Re: [PATCH v1] KVM: s390: store DXC/VXC in fpc on DATA/Vector-processing exceptions To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, Heiko Carstens , Martin Schwidefsky , Cornelia Huck , Christian Borntraeger , Hendrik Brueckner References: <20180822095310.29145-1-david@redhat.com> From: Janosch Frank Openpgp: preference=signencrypt Autocrypt: addr=frankja@linux.ibm.com; prefer-encrypt=mutual; keydata= xsFNBFfqIWIBEAC9u1ku3alDY4YilAfKidqWZ46kCnu7WPXkdcgH3ww/9CcgIDoeSr90SnaU T9gQRO92ESh2OO0ff3RMfmQpPG7hivVKu9G8z4Fsblxqi3sSHBNpZu3wYE81UQTlG2EJpccX DXlBUGmMI44Ra3+NoeYbsTn0vU2ke69NgOz9Mx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2c5NZjCCubY1tb8548x6IprwAYtpmx3XlOXb12Jki/HT qHgeSscyleLbneNO+s8LfhJKY15smPqVKG6leCbtIpliZ0TI2Zif+gYvDZRruHYgHwi9bQzH +wEVDrgess/1dDq3Pt+W7NRhFoKKq7ZQOYkyHE1qdck/cGvq4/XCL9np7+3CBEql+QOtuR2o AdES5cnZwKm7peagQBEaFqgni26de11pW294pJRG0U36mSqxEoyqe97vKUYzsdy1hPPbOPfy 7img6Ifh6WL1b4FIIn9TFbooQ1WRSQvbOzxL+E2x+vmEPfNxpzAuuS+ASLJ6Zv9QCOUAvzBn Lfg7BvkfUhALMIZnAoyYmxutcWL4XYYAvMG13l8hFYpoQcF4WEnUoP0UuNwXmR4QZvOuiE8u CyL9U2LEYbrPVTIsEtUVmDlCyD1Kq+6LE3aU+n06soITGp9a3/WNLpXUbUYfzRvYJ3p6jssI Pe50r3yPfdgbWIWzeWuLimNVTlbIZAi1Y0VIdCDbDQpXl2DDTB9zZw2yz0kRKxasMCAEsvlA CT0NLoyQplUjM1ir5e6QTwy9+v3niCCesupe7owsFfrg/YZsE9jCy8vWgdPjSnRJkwQqV2Fw lFM6NIuMAY1Y Date: Wed, 22 Aug 2018 12:31:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180822095310.29145-1-david@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l4bQxt9GGF8Px9Rf8rR7Qe6dO42zMoX4V" X-TM-AS-GCONF: 00 x-cbid: 18082210-0020-0000-0000-000002BA1DAC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18082210-0021-0000-0000-000021077346 Message-Id: <02f9379d-d20d-8b69-94b9-959f46490a26@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-22_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808220107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --l4bQxt9GGF8Px9Rf8rR7Qe6dO42zMoX4V Content-Type: multipart/mixed; boundary="0jNstAGar3fITyMN608yC3fb0xBQ5VF0a"; protected-headers="v1" From: Janosch Frank To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, Heiko Carstens , Martin Schwidefsky , Cornelia Huck , Christian Borntraeger , Hendrik Brueckner Message-ID: <02f9379d-d20d-8b69-94b9-959f46490a26@linux.ibm.com> Subject: Re: [PATCH v1] KVM: s390: store DXC/VXC in fpc on DATA/Vector-processing exceptions References: <20180822095310.29145-1-david@redhat.com> In-Reply-To: <20180822095310.29145-1-david@redhat.com> --0jNstAGar3fITyMN608yC3fb0xBQ5VF0a Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 22.08.2018 11:53, David Hildenbrand wrote: > When DATA exceptions and vector-processing exceptions (program interrup= ts) > are injected, the DXC/VXC is also to be stored in the fpc, if AFP is > enabled in CR0. >=20 > This can happen inside KVM when reinjecting an interrupt during program= > interrupt intercepts. These are triggered for example when debugging th= e > guest (concurrent PER events result in an intercept instead of an > injection of such interrupts). >=20 > Signed-off-by: David Hildenbrand > --- >=20 > Only compile-tested. It baffles me that AFP is still a thing in zArch mode. I would have expected it to be a default 1. But then again, I just found out about it.= POP checks out: Reviewed-by: Janosch Frank >=20 > arch/s390/include/asm/ctl_reg.h | 1 + > arch/s390/kvm/interrupt.c | 8 ++++++++ > 2 files changed, 9 insertions(+) >=20 > diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ct= l_reg.h > index 4600453536c2..88f3f14baee9 100644 > --- a/arch/s390/include/asm/ctl_reg.h > +++ b/arch/s390/include/asm/ctl_reg.h > @@ -11,6 +11,7 @@ > #include > =20 > #define CR0_CLOCK_COMPARATOR_SIGN _BITUL(63 - 10) > +#define CR0_AFP_REGISTER_CONTROL _BITUL(63 - 45) > #define CR0_EMERGENCY_SIGNAL_SUBMASK _BITUL(63 - 49) > #define CR0_EXTERNAL_CALL_SUBMASK _BITUL(63 - 50) > #define CR0_CLOCK_COMPARATOR_SUBMASK _BITUL(63 - 52) > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index fcb55b02990e..5b5754d8f460 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -765,6 +765,14 @@ static int __must_check __deliver_prog(struct kvm_= vcpu *vcpu) > break; > case PGM_VECTOR_PROCESSING: > case PGM_DATA: > + if (vcpu->arch.sie_block->gcr[0] & CR0_AFP_REGISTER_CONTROL) { > + /* make sure the new fpc will be lazily loaded */ > + save_fpu_regs(); > + /* the DXC/VXC cannot make the fpc invalid */ > + current->thread.fpu.fpc &=3D ~0xff00u; > + current->thread.fpu.fpc |=3D (pgm_info.data_exc_code << 8) > + & 0xff00u; Everything except that byte should be 0 anyway when it comes from lowcore, why do you mask? > + } > rc =3D put_guest_lc(vcpu, pgm_info.data_exc_code, > (u32 *)__LC_DATA_EXC_CODE); > break; >=20 --0jNstAGar3fITyMN608yC3fb0xBQ5VF0a-- --l4bQxt9GGF8Px9Rf8rR7Qe6dO42zMoX4V Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIbBAEBCAAGBQJbfTueAAoJEBcO/8Q8ZEV5UBcP9ilVHxrfn6HY5cD1l4nmOkE0 5/mopesnG+opPNTzwr6ywc92fmqrEp+v48T4oi50IGTrPS7HSWJLyVJ2L5YAw0Jg ba+bgnbrFCVrPJEWaWDIBrFa3/qm84MFTBmJm1d25uVmlA/pVaMRWu735XBgkoB3 Tt+aQ66FHiMXDEYvX8HrpYjA6nNMpLh15lXnRROmS9XeYFXvYq3lO8dKGA+Jk1KW D3lyFRn6/DbUbwEpS9zOj/C5WgzZWnLjTn4SpHSIyKmi855IHsST/w5ptS8UOt7h U/s3dEPpK07fj1M4xa5KVwIFeqjSZz5XYg+hobnOpaBPvu09ujVLbr9QBwUDXnLq d5nr7PaUIAI1uZUspZMRRw9ApOjbHJjHNLsror5nef26YdX5hP/1fXebP9ZIRb1T pgUWVRZVd0MeVWQVg26jbFr1e2ZQPdQqts0uJQn2StjRLkk2LDnQDNMqp4tz0G2o PAl45ABZj1oxdXjyvPnzCh/2u+Ktp/9GXpLk5X6+ZB9lVuKIf5npUE9JZnMXns/P c4uMKCYrUKjXsJ331Jw+ttCVHGOi+7IyuQpM7HSPDwlEgxFh8Q1LDEnxWfnZaRZS NGDCcSV7WrwoeR5OYDk2yPt1aE5P3PF1cecQVnYCcSlLCOw+RCVZwrGk+YWmFWpN jwV+YmP043wz/HXHDTM= =JTGO -----END PGP SIGNATURE----- --l4bQxt9GGF8Px9Rf8rR7Qe6dO42zMoX4V--