Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1756794pxb; Thu, 14 Apr 2022 13:21:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCnt/xNWwAxKIDJytzP4WEL6M0CANL0KL7SFR2QpdHP8Qp7/IIlPN+re63pFhcM0y7Iqb4 X-Received: by 2002:a17:902:d714:b0:153:2e9:3bcc with SMTP id w20-20020a170902d71400b0015302e93bccmr49142568ply.83.1649967704282; Thu, 14 Apr 2022 13:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649967704; cv=none; d=google.com; s=arc-20160816; b=wHvvngczbU5AL5c/QA/sPbeph3k2yhZ38Qz0pdONrBruDtrrnSm+zfGIAaRuWFtjVy jrwTwOA+KcrNkaXgUVipiDl+00SGUK4Qb9Ss/I9jX2zmVXsAMumuLER0srVUP/ckDZL/ z6TNHFZQ8ApPCDclSjtABlL615Y4JOxWbkolQhuMAcN/p0i5pVhAH5DpJvcVBlKhMi9b //jur4+V0XIY6XFIFxDchqnxLTgUXTkCsyCuhBPDHC1xZzPtWyBbmC9DW+6nT2Wj0IsX rvMSbtXldyZw7wj+2kUaHYrBpNJrA8s8fZBDuforYIJHjoHYaATtTiPIS/KmPI/+RPkY n+zA== 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=2oWzQ/SNcNYt0kngd9Dogpe/jWJDppi3iZBxylArBcE=; b=LNnFZvPYo1iaKWDSQo8fvKDqTcpeXun/ZqvbOj6x45ks16PuQNSN4Er6JSuU7Ru4/5 pwyJhyC7K7rRWpt298LRV9djH7UXLh9AXVu4oaaJtPcuqexVGQjS98J8O9xeJgRXiBUd 13Gjjh14evS84NbZLTtznLUvX0KqnICJFqMp3I8gBxGbpqmfUKpcO1NLiHC13THaEOqP VoXlNvgPTFr9eZ/glIrI8pogf3KPI55hGkiTGV2sNnGwAc3o2rke0ncqsBF5/OxeK3UB x3CejhZOyfoeG8cKAa2Hcv33VhjokFrLSL2FIXAu02WPBXMSvGKODStlg8cSEkuVrszc xPTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=B9y7JGe8; 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 b4-20020a170902d50400b0015495894d28si6755373plg.412.2022.04.14.13.21.24; Thu, 14 Apr 2022 13:21:44 -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=B9y7JGe8; 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 S240870AbiDNIHV (ORCPT + 99 others); Thu, 14 Apr 2022 04:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240805AbiDNIGF (ORCPT ); Thu, 14 Apr 2022 04:06:05 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF0534D9C5; Thu, 14 Apr 2022 01:03:34 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23E7Jkg0019072; Thu, 14 Apr 2022 08:03:34 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=2oWzQ/SNcNYt0kngd9Dogpe/jWJDppi3iZBxylArBcE=; b=B9y7JGe8aSnVomf4qzRXgh3bMAs7ANSHoZAQlbg5PE4PhoaxdNaNBzskIZEP+25TrD9n jT2vWFp59ZqzAuSYa+9xs6h4lhBf8GoyfajDunI6RCRbKhbR0jYQ4QRDCVjtypCBqJkm X2XabCebS9uOZJ+8p18FkDFt2GE8jUxMyYifOCtffWkg3ckaCCWSLkHJu7MlhHBGsPnd W44CSGvtdb1veFqbqXSXoFHLCau2HWslmqt7cu8q6arlHJEa7lrkBwD94ilPXslv2TWT IciUv8PdytAmgOkE+NWHF20igTCdAXc/konCTGRImw4rBD4kt+xXcQ4pkUg4bKsBBTRn 4Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3febpbmmd7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Apr 2022 08:03:33 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 23E80nJ1021247; Thu, 14 Apr 2022 08:03:33 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3febpbmmcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Apr 2022 08:03:33 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23E7m4sJ006031; Thu, 14 Apr 2022 08:03:31 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 3fb1s8yy6p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Apr 2022 08:03:31 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23E83Sip18284850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Apr 2022 08:03:28 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 545F0AE053; Thu, 14 Apr 2022 08:03:28 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE5E6AE055; Thu, 14 Apr 2022 08:03:27 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.1.140]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 Apr 2022 08:03:27 +0000 (GMT) From: Claudio Imbrenda To: kvm@vger.kernel.org Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, david@redhat.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, scgl@linux.ibm.com, mimu@linux.ibm.com, nrb@linux.ibm.com Subject: [PATCH v10 18/19] KVM: s390: pv: avoid export before import if possible Date: Thu, 14 Apr 2022 10:03:09 +0200 Message-Id: <20220414080311.1084834-19-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220414080311.1084834-1-imbrenda@linux.ibm.com> References: <20220414080311.1084834-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: xZz3ixuF4DQIIAtHEep7Vi2z2RsMhTTi X-Proofpoint-ORIG-GUID: YEo_03VT9e86fjGcdyNbH2lty6qi4UDR 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-14_02,2022-04-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 suspectscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204140044 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 If the appropriate UV feature bit is set, there is no need to perform an export before import. Signed-off-by: Claudio Imbrenda --- arch/s390/kernel/uv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index e358b8bd864b..43393568f844 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -236,7 +236,8 @@ static int make_secure_pte(pte_t *ptep, unsigned long addr, static bool should_export_before_import(struct uv_cb_header *uvcb, struct mm_struct *mm) { - return uvcb->cmd != UVC_CMD_UNPIN_PAGE_SHARED && + return !test_bit_inv(BIT_UV_FEAT_MISC, &uv_info.uv_feature_indications) && + uvcb->cmd != UVC_CMD_UNPIN_PAGE_SHARED && atomic_read(&mm->context.protected_count) > 1; } -- 2.34.1