Message ID | 20230125212608.1860251-8-scgl@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp493141wrn; Wed, 25 Jan 2023 13:27:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXumhXeQi5kzD16A9p23Awe2kZgbAYhIHDEmV6rZML0YOtnwLVYfiMPN9HaAyy8BGn1hpoGh X-Received: by 2002:a17:907:c712:b0:7ba:5085:869 with SMTP id ty18-20020a170907c71200b007ba50850869mr38516709ejc.9.1674682032878; Wed, 25 Jan 2023 13:27:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674682032; cv=none; d=google.com; s=arc-20160816; b=BcOzkOxojFrsIHORLQZGaZVCq8nNZeWv4mkEW9yHcF61RbI+akcG1j43u6kaLXjiZI MJiXBS+NIcSRXRInRSHLBSVPsYxYtUm3DHHfzsJmqc3x4ox6bZyEbIpoXPzK+1dWokxi uzv+qqLULjnSrZvKsyXyKzVEkbhmE0kdLl34NbTVo5Zd4BVyqnYn8taqcihcHjmV5jBs l+xod79bfV+smlK18KkF5rTCeNB7p6V6qKb4N5geu8Gs5YWqyasFFcaQbzQQ7bWuPnlJ BXGGyEnHquLOFfFAUI8raULscGa/IuBs3mXkwQEQwMmsJe3wh+PsjbBjsQ/9hsu1jo6P YM8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rtTtMyPIPfq516k+3j6kStK6SwU+rBBh9j/IRhdSm4E=; b=uC7q93hYmUKB9EuWwvYSvB8ECzi78uEyrMboF0Nbc3TWzGAqKDqD7poF65rosE1ZtW dvtu5aNvtDpqhFWXEMKwz2hpz8TuuuwDoT7zdlFQOzveCjQkR+sSaijDeqpUkZmhwbo7 69KNG/mxZ3qdNz1s3RjQlRpur1zgylqlLs9jMicErryUcz0rjkQKhlObX3t3cf+VqpBl vFX8yoDBjTuqUCBEb4XrY+suG5xtzNdLFktV/tar+9tnqDFfGADCJIyWmU3W3gblyeqO 6dow22QHd4cysb3U4JaDMug5SsbcPXWUADFiodydSBj5eM12sh5u27UdJjt5ZvEciM32 LVvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=b4y4PGcK; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a170906748c00b008736461efe7si8372185ejl.643.2023.01.25.13.26.49; Wed, 25 Jan 2023 13:27:12 -0800 (PST) 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=b4y4PGcK; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236794AbjAYV0i (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Wed, 25 Jan 2023 16:26:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236514AbjAYV03 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 16:26:29 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC40A46140; Wed, 25 Jan 2023 13:26:27 -0800 (PST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30PKLcJQ010757; Wed, 25 Jan 2023 21:26:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=rtTtMyPIPfq516k+3j6kStK6SwU+rBBh9j/IRhdSm4E=; b=b4y4PGcKlGgae2GKy47OaQZGd9jSGYkf/rkx58DUFUHS/DkSHnLKYzk7SyOgjSXpO/YK bVISiqM6sBTzoQ1xULl9NV3USe4jf1jmZXgVtZONAnHjCf+7OQjIXiWa0pXw3o5jahIP GKLSLUZP5T2vbwsVyVYiwyP0PdyEA5DBD+q9bJLc6yQCbRgWlXJLm8FfafN4kwv2f/K5 BVrwzJGfo3W0OZp77E3Pr0HG/uHcwsBESq/OHQaqthUFHe9VTpJK9eS4dpnEzJH+uFTT jk2J2+eiMQs32Ak9ykQAKiHRWzxqOGro7uiZyeqkuEsV2VmrRY5pwll4LyY1or2NB8JW 2g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nb8n9e43c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jan 2023 21:26:25 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30PKst0o009942; Wed, 25 Jan 2023 21:26:25 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nb8n9e42j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jan 2023 21:26:24 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30PGbLHf025220; Wed, 25 Jan 2023 21:26:22 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3n87p6c20g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jan 2023 21:26:22 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30PLQI4s33423770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jan 2023 21:26:18 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBACC20040; Wed, 25 Jan 2023 21:26:18 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C3C920049; Wed, 25 Jan 2023 21:26:18 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 25 Jan 2023 21:26:18 +0000 (GMT) From: Janis Schoetterl-Glausch <scgl@linux.ibm.com> To: Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com> Cc: Janis Schoetterl-Glausch <scgl@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Jonathan Corbet <corbet@lwn.net>, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-s390@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>, Shuah Khan <shuah@kernel.org>, Sven Schnelle <svens@linux.ibm.com> Subject: [PATCH v6 07/14] KVM: s390: selftest: memop: Fix integer literal Date: Wed, 25 Jan 2023 22:26:01 +0100 Message-Id: <20230125212608.1860251-8-scgl@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230125212608.1860251-1-scgl@linux.ibm.com> References: <20230125212608.1860251-1-scgl@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 37-aHu-0MFIHJKjZT_6KSDxGEUQUyB8l X-Proofpoint-ORIG-GUID: KBmjWlSHX995DBdlWgofZ3gcvp9g1Lcj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-25_13,2023-01-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301250187 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756031387077799018?= X-GMAIL-MSGID: =?utf-8?q?1756031387077799018?= |
Series |
KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg
|
|
Commit Message
Janis Schoetterl-Glausch
Jan. 25, 2023, 9:26 p.m. UTC
The address is a 64 bit value, specifying a 32 bit value can crash the
guest. In this case things worked out with -O2 but not -O0.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Fixes: 1bb873495a9e ("KVM: s390: selftests: Add more copy memop tests")
---
tools/testing/selftests/kvm/s390x/memop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 25/01/2023 22.26, Janis Schoetterl-Glausch wrote: > The address is a 64 bit value, specifying a 32 bit value can crash the > guest. In this case things worked out with -O2 but not -O0. > > Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> > Fixes: 1bb873495a9e ("KVM: s390: selftests: Add more copy memop tests") > --- > tools/testing/selftests/kvm/s390x/memop.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c > index 3ec501881c7c..55b856c4d656 100644 > --- a/tools/testing/selftests/kvm/s390x/memop.c > +++ b/tools/testing/selftests/kvm/s390x/memop.c > @@ -514,7 +514,7 @@ static void guest_copy_key_fetch_prot_override(void) > GUEST_SYNC(STAGE_INITED); > set_storage_key_range(0, PAGE_SIZE, 0x18); > set_storage_key_range((void *)last_page_addr, PAGE_SIZE, 0x0); > - asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0), [key] "r"(0x18) : "cc"); > + asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0L), [key] "r"(0x18) : "cc"); > GUEST_SYNC(STAGE_SKEYS_SET); > > for (;;) { Reviewed-by: Thomas Huth <thuth@redhat.com>
diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c index 3ec501881c7c..55b856c4d656 100644 --- a/tools/testing/selftests/kvm/s390x/memop.c +++ b/tools/testing/selftests/kvm/s390x/memop.c @@ -514,7 +514,7 @@ static void guest_copy_key_fetch_prot_override(void) GUEST_SYNC(STAGE_INITED); set_storage_key_range(0, PAGE_SIZE, 0x18); set_storage_key_range((void *)last_page_addr, PAGE_SIZE, 0x0); - asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0), [key] "r"(0x18) : "cc"); + asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0L), [key] "r"(0x18) : "cc"); GUEST_SYNC(STAGE_SKEYS_SET); for (;;) {