Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4319864rwi; Wed, 12 Oct 2022 14:00:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IWjmuC4Rh22dEe6Gcib/PXl2sjSRtd668fEQJkh7/9nUTi0yp176RIqf0tFGINk7Nxkzd X-Received: by 2002:a05:6402:4150:b0:44a:ec16:def4 with SMTP id x16-20020a056402415000b0044aec16def4mr29188912eda.21.1665608441430; Wed, 12 Oct 2022 14:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665608441; cv=none; d=google.com; s=arc-20160816; b=n2d81D8by4PlSu130m+rNv2hgxCIxvyKZAG1q42EIHgOEla4AQHi3hv2TSzU9X+Y0c xbu7E1m93EwssgnzO8C372bIlm48hk5kCTo6bVQNX8sfsmEl97Pa4lypGD7mVgUnGt3r Jx28vHnZn/kiQBO3cjYi6hNtM4KdscVxOGlsDKvADEomYsfWC5yHeZ/2zr8Xia6GvzNu f0nVHmKA5cW+f1nhgZTwAs9+y31P1SRho6BjYUvoL6oSwbREnA3pkUF2DUl4bWc3Jj13 f2pC1WgBc5nB1YjrZdvDbnF4ky50JmE40PzmTn4kgIizgMYpve2/B80Sw9OWZNh0TWiA pzNg== 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=bRsMyRo7qbgJh304THbYg9Jy/rlIw7N2YlCaunhJyX0=; b=svAYQZTCjlhzWDASGM505E5tHTS1eFn9z3bcWEHzJg3YUhCaNJdMIwo10lu88WTAJM EEJdT+/81UW5NjNtZ7hfNwmvCGJ+H47MJA28DS9crdUC1zCiNDLX1nggwvf6H/wRreF7 EB3Rwc3jU/OyHH3gEeeKuCQCEZmzQNv1kq7wKZjbDtmsq6K2GHXBjQGf34ZucoZgWWeO Ol78CQMp/ozE08Syp3X60Eq4tVYXb0hVBAuRGxlxuBp9AbT6ifdjJExiNuRPlB5PPp+1 gYP2eMJJMSOy/tB+ajEtbsLAKGewyHigUli1yGBf5LVTUqAMGlX4J81MMwnlyFq5CHwS V8kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WLIwMGIN; 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 cr2-20020a170906d54200b0078d9d69ae0dsi14446110ejc.877.2022.10.12.14.00.15; Wed, 12 Oct 2022 14:00:41 -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=WLIwMGIN; 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 S229913AbiJLU41 (ORCPT + 99 others); Wed, 12 Oct 2022 16:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbiJLU4Y (ORCPT ); Wed, 12 Oct 2022 16:56:24 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D47E45018C; Wed, 12 Oct 2022 13:56:22 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29CKTbML010428; Wed, 12 Oct 2022 20:56:20 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=bRsMyRo7qbgJh304THbYg9Jy/rlIw7N2YlCaunhJyX0=; b=WLIwMGINFlO3x6YRUWWgn+zucL4F0uAjcmL1mkIOy6gYhQjz5G+nJwluRVZQZeus2+Ub TWV6IrKm86HaDieoLs2IvYzPGFNCHoQlV55SU7bvpFto7oPKxQl45cm+ztiGoVBd0R6Z UcAvqup/df/T0w53hlcgm/Q7fhvUTJcTQgRkDAbeqBy/OLgJz5EqjgslfjBzUftWxNrl gw8KyBVnLWk946WCUeviM9qhn/bY+V68lFyOr+X84NTHe+kE9hijFer3XfbYr1yqStEr NucyHqeyIPEwmlPHndtwxWjUEgDfTjUbMQ4rNauT2ezjRLUV1e4q93KcJRZZafetx3TL RA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3k64nt0hvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 20:56:19 +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 29CKrr3j001032; Wed, 12 Oct 2022 20:56:19 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 3k64nt0hum-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 20:56:19 +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 29CKsZmW002882; Wed, 12 Oct 2022 20:56:16 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06ams.nl.ibm.com with ESMTP id 3k30fjejx0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 20:56:16 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29CKuDjg51839256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Oct 2022 20:56:13 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB7395204E; Wed, 12 Oct 2022 20:56:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 35BAE52051; Wed, 12 Oct 2022 20:56:13 +0000 (GMT) From: Janis Schoetterl-Glausch To: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Heiko Carstens , Vasily Gorbik , Alexander Gordeev Cc: Janis Schoetterl-Glausch , David Hildenbrand , Jonathan Corbet , 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 , Shuah Khan , Sven Schnelle , Thomas Huth Subject: [PATCH v2 4/9] KVM: s390: selftest: memop: Pass mop_desc via pointer Date: Wed, 12 Oct 2022 22:56:04 +0200 Message-Id: <20221012205609.2811294-5-scgl@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221012205609.2811294-1-scgl@linux.ibm.com> References: <20221012205609.2811294-1-scgl@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: A5QD7qdlmMkKPUZWWJ-sfrMcki2oceM8 X-Proofpoint-ORIG-GUID: 9a4z-DrsruziXgouiQXZAruCi5cc8nn2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-12_10,2022-10-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 phishscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 malwarescore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210120131 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 The struct is quite large, so this seems nicer. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Thomas Huth --- tools/testing/selftests/kvm/s390x/memop.c | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c index 9113696d5178..69869c7e2ab1 100644 --- a/tools/testing/selftests/kvm/s390x/memop.c +++ b/tools/testing/selftests/kvm/s390x/memop.c @@ -48,53 +48,53 @@ struct mop_desc { uint8_t key; }; -static struct kvm_s390_mem_op ksmo_from_desc(struct mop_desc desc) +static struct kvm_s390_mem_op ksmo_from_desc(const struct mop_desc *desc) { struct kvm_s390_mem_op ksmo = { - .gaddr = (uintptr_t)desc.gaddr, - .size = desc.size, - .buf = ((uintptr_t)desc.buf), + .gaddr = (uintptr_t)desc->gaddr, + .size = desc->size, + .buf = ((uintptr_t)desc->buf), .reserved = "ignored_ignored_ignored_ignored" }; - switch (desc.target) { + switch (desc->target) { case LOGICAL: - if (desc.mode == READ) + if (desc->mode == READ) ksmo.op = KVM_S390_MEMOP_LOGICAL_READ; - if (desc.mode == WRITE) + if (desc->mode == WRITE) ksmo.op = KVM_S390_MEMOP_LOGICAL_WRITE; break; case SIDA: - if (desc.mode == READ) + if (desc->mode == READ) ksmo.op = KVM_S390_MEMOP_SIDA_READ; - if (desc.mode == WRITE) + if (desc->mode == WRITE) ksmo.op = KVM_S390_MEMOP_SIDA_WRITE; break; case ABSOLUTE: - if (desc.mode == READ) + if (desc->mode == READ) ksmo.op = KVM_S390_MEMOP_ABSOLUTE_READ; - if (desc.mode == WRITE) + if (desc->mode == WRITE) ksmo.op = KVM_S390_MEMOP_ABSOLUTE_WRITE; break; case INVALID: ksmo.op = -1; } - if (desc.f_check) + if (desc->f_check) ksmo.flags |= KVM_S390_MEMOP_F_CHECK_ONLY; - if (desc.f_inject) + if (desc->f_inject) ksmo.flags |= KVM_S390_MEMOP_F_INJECT_EXCEPTION; - if (desc._set_flags) - ksmo.flags = desc.set_flags; - if (desc.f_key) { + if (desc->_set_flags) + ksmo.flags = desc->set_flags; + if (desc->f_key) { ksmo.flags |= KVM_S390_MEMOP_F_SKEY_PROTECTION; - ksmo.key = desc.key; + ksmo.key = desc->key; } - if (desc._ar) - ksmo.ar = desc.ar; + if (desc->_ar) + ksmo.ar = desc->ar; else ksmo.ar = 0; - if (desc._sida_offset) - ksmo.sida_offset = desc.sida_offset; + if (desc->_sida_offset) + ksmo.sida_offset = desc->sida_offset; return ksmo; } @@ -183,7 +183,7 @@ static int err_memop_ioctl(struct test_info info, struct kvm_s390_mem_op *ksmo) else \ __desc.gaddr = __desc.gaddr_v; \ } \ - __ksmo = ksmo_from_desc(__desc); \ + __ksmo = ksmo_from_desc(&__desc); \ print_memop(__info.vcpu, &__ksmo); \ err##memop_ioctl(__info, &__ksmo); \ }) -- 2.34.1