Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1355324iob; Fri, 29 Apr 2022 03:46:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK/NmWPLN7eA4W1tkVXQstRJyz3emfJ2GESSX6nKVL7jOckK93LW4d70SVqlAZrUdW7bDw X-Received: by 2002:a63:554c:0:b0:3c1:65f2:5543 with SMTP id f12-20020a63554c000000b003c165f25543mr8349819pgm.4.1651229185668; Fri, 29 Apr 2022 03:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651229185; cv=none; d=google.com; s=arc-20160816; b=tOHxvSY+9qx+kW5k9AEy2Q6D1mgVkYnQv0a5ptbfqoYnC0w1W/zRYcCwBPphjw0Ooz Xjcp/LiST0pIvWaUVND1paWDXmr/5dkFoZ39db2qBp+tlfJAJBAWJRM1weIB0Dse2eBJ 1oJsyyO42rYyWGodyadAFpEuxc8XNTFpYgbzfsOuLwCn+TUkhII3aU9RN3kw/1RWdqHW qECu6lUAXfbsPm77IvXz1N0fwgfe6qtCheh7+ihbkuuu8m5XeleQIO0UhidKUglyp6d1 tY/uwidAqk63QX0oTrM6JRy1YO+oUZhNK9o5fvU6/UT9YGaySLMevAirOomjifHTxdgf 1lHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vw3jVl9sakAXhTI6X73MPQh3wYMAWsH4Ay6MIfyWyok=; b=vjKZsEheOyS68i0Dqr6uaSViZnbNFDMlK9eGEo5VcP66WtL3Zzei3HSprPx37uACfl o2hyAxf9OlRTYqxf9spzMbxt8lc4Nq7yXiMLvWja51YIoSvPQ96F0UrOPpfDIhp7PJHi h9tFItclTTQKPDKUsQaAzXwBXjku/GCJKaV+wx4EaGIU58PbRYZFjAL6rHPk9y6dQ8bR Inp6EvZUw6F1pcn77e++8zzn51l9KV4jiMKwXH/WXlKFEOYQ9r2nefzAguxpZn1WTSck +ZpOzxvyzaCIL6at0t2AHaU/bLAmIKBJriQtUXu7dSj7mxtEVyVNEbPORskzeH1cb5Ip 5CtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Hz5KsGBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a139-20020a621a91000000b0050d304dbf4dsi6265502pfa.210.2022.04.29.03.46.11; Fri, 29 Apr 2022 03:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Hz5KsGBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350337AbiD1QwZ (ORCPT + 99 others); Thu, 28 Apr 2022 12:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbiD1QwX (ORCPT ); Thu, 28 Apr 2022 12:52:23 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF5CAB3DF6; Thu, 28 Apr 2022 09:49:08 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23SFUiZV022860; Thu, 28 Apr 2022 16:49:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=vw3jVl9sakAXhTI6X73MPQh3wYMAWsH4Ay6MIfyWyok=; b=Hz5KsGBGPbVP2T+Bntqb8AWWxgztNS0uEuJ5QxtSr9sTDuJuBovGBQeziVXBx+pRXtrP QWOuOBe7yhXF7HL3l5e7udw3gNtjMQfxPMB/H4zHu2+lGM5VIhARFYMkB8nbG8h2AATX 3U7tMB7TYvn7XpGMx6wQGyuKCxTXFY1A5+dgoHkwB3z6Ny+CWj8pOULb7HXu14QZAk2q C8m6iu4qPhl17oG9BblcxajKU95uxPBozTpVwgQfTHBtUjBjPzSnXuujCZ5IRGFAjofG 5FVQgmWxlG8tD230NA1dWIHDw+CSrwXi4Eh241yS87OOMYy67M+xbKtzvuR+S3IKJwjo yA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqnkde0fy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 16:49:06 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23SG7B2b017215; Thu, 28 Apr 2022 16:49:06 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqnkde0f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 16:49:06 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23SGglMr010651; Thu, 28 Apr 2022 16:49:04 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 3fm8qj7ua4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Apr 2022 16:49:03 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23SGnBeh26542418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Apr 2022 16:49:11 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0F9DA404D; Thu, 28 Apr 2022 16:49:00 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50A55A4040; Thu, 28 Apr 2022 16:48:57 +0000 (GMT) Received: from [9.171.92.46] (unknown [9.171.92.46]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 28 Apr 2022 16:48:57 +0000 (GMT) Message-ID: Date: Thu, 28 Apr 2022 18:48:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 2/2] KVM: s390: selftest: Test suppression indication on key prot exception Content-Language: en-US To: Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Paolo Bonzini , kvm@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org References: <20220425100147.1755340-1-scgl@linux.ibm.com> <20220425100147.1755340-3-scgl@linux.ibm.com> From: Janis Schoetterl-Glausch In-Reply-To: <20220425100147.1755340-3-scgl@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: mMWAOfeigfsXYJR7iMql67xsNmxoAB07 X-Proofpoint-GUID: MjjEA3sKilhqhWKHVtTqePLh3_gfYXri X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-28_02,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204280099 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/25/22 12:01, Janis Schoetterl-Glausch wrote: > Check that suppression is not indicated on injection of a key checked > protection exception caused by a memop after it already modified guest > memory, as that violates the definition of suppression. > > Signed-off-by: Janis Schoetterl-Glausch > --- > tools/testing/selftests/kvm/s390x/memop.c | 43 ++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c > index b04c2c1b3c30..ce176ad9f216 100644 > --- a/tools/testing/selftests/kvm/s390x/memop.c > +++ b/tools/testing/selftests/kvm/s390x/memop.c [...] > +static void test_termination(void) > +{ > + struct test_default t = test_default_init(guest_error_key); > + uint64_t prefix; > + uint64_t teid; > + uint64_t psw[2]; > + > + HOST_SYNC(t.vcpu, STAGE_INITED); > + HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); > + > + /* vcpu, mismatching keys after first page */ > + ERR_PROT_MOP(t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), KEY(1), INJECT); > + /* > + * The memop injected a program exception and the test needs to check the > + * Translation-Exception Identification (TEID). It is necessary to run > + * the guest in order to be able to read the TEID from guest memory. > + * Set the guest program new PSW, so the guest state is not clobbered. > + */ > + prefix = t.run->s.regs.prefix; > + psw[0] = t.run->psw_mask; > + psw[1] = t.run->psw_addr; > + MOP(t.vm, ABSOLUTE, WRITE, psw, sizeof(psw), GADDR(prefix + 464)); > + HOST_SYNC(t.vcpu, STAGE_IDLED); > + MOP(t.vm, ABSOLUTE, READ, &teid, sizeof(teid), GADDR(prefix + 168)); > + /* Bits 56, 60, 61 form a code, 0 being the only one allowing for termination */ > + ASSERT_EQ(teid & 0x4c, 0); The constant is wrong, should be 0x8c instead, or better, a more straight forward expression that evaluates to it. [...]