Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2215098pxb; Wed, 30 Mar 2022 19:35:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt7r6jrNkP9kCBaAzmAHUFAdcQvQZxEOenvPQ0WbyGW9GXLlsfe9GtZFe5Yu3m3pvcRAnT X-Received: by 2002:a17:902:d70e:b0:156:1b99:e909 with SMTP id w14-20020a170902d70e00b001561b99e909mr3062219ply.155.1648694125341; Wed, 30 Mar 2022 19:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648694125; cv=none; d=google.com; s=arc-20160816; b=tiu6yaQieQXgF5XI7H6Nlfcz2BgiRYw6+okuYDCfIyOrOczHLcBx0C4m8U8lCAGjGm IjeU/27SXomZujWqr1wEiJRmXHhwiOrmTI6nBZsoRWcL/t9CirN0qfBi6wQE26aclmNO Rw/AZAr43SMlagiKgv9hledvbX4qyDaTkUPZw1bHcvmes5Q6cyCVSFZazRmdVCtbYbg9 jw92N8IpjBKumqYrSfY9jN2JZLbB2l7PSDJ+FnioY2ZlxWLGOHNV7JwEx602MomEKbG/ b7D1kUhvosadaz2enx1anhzm3gQj+NshkwVrNxJp8zMEIO8pc7OV1ic7l+XeHYip9EDU ct8A== 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=w5mazWHWk4PusB4NZ38NtN9KKXTC/IUUfrtYv0J4kWs6xjsnY8O66PkBniIbmETIyG Ha2kt8NzdbiGrmNvZsCF4a1En+8t6VCBFx9UdMQ4yCsFE1wUKMLDXtCa6KrTE+ePGtAo r/jv4+kedcifUT6UMlCH1W8lEIH5XITPv3Y0CEwHCnw0rizX9oP6iIIyWdcZHMPqqyEx jhPM9HB8MjmIPb/lNJNNDtUtlP79Ndj4y5VcM3pxJUN6ekNQgJoa/9aGvKUXCKDstzsP DH1hINLSUpO4cvtH533/I/nRK4H712MHWwlX2UW4s3wHlB4UFWHlEJY9neheJjgIVLLZ TCDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SH294a8W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c2-20020a17090a558200b001bd14e030c0si1757135pji.152.2022.03.30.19.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:35:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SH294a8W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A05306D96E; Wed, 30 Mar 2022 19:30:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345224AbiC3Mk3 (ORCPT + 99 others); Wed, 30 Mar 2022 08:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344673AbiC3Mha (ORCPT ); Wed, 30 Mar 2022 08:37:30 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52A493BBF5; Wed, 30 Mar 2022 05:26:28 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22UBeK6u011625; Wed, 30 Mar 2022 12:26:27 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=SH294a8WCWV6stxuxQetvi+CU9r2pXZ9UJulrkA2tciNHMKPPXY67YrcsOXvHGWXTcZ0 A43LDnXnkHywFWhwTxI5YlnuyXRkqdPcv2Rud2fkL714kn2laFWJCjPTC/s7KpMuqrFM iwGVDiloIGpIi1zJW9e8VaDwuO57crhq+y1yNKk84aRTcIJq2GswykqOofIUa5RoToYp FJb+94kXZ7p6onJa2QEVaz+ta0AmGpG2K1CPYDvyaseIAcifQQcmPnwy0DeHaKLuPD2c z287ECsUFzdFFrbJyhjGoLCG9VFxKsoQFWGn+M4X6gbPywgMyPD5RLC8y8WLfRMtVJaM Mw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f40c95bm5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Mar 2022 12:26:27 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22UBgwNb018238; Wed, 30 Mar 2022 12:26:26 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f40c95bka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Mar 2022 12:26:26 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22UCMKdj008336; Wed, 30 Mar 2022 12:26:25 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03fra.de.ibm.com with ESMTP id 3f1tf8y8t1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Mar 2022 12:26:24 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22UCQRtf45154790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Mar 2022 12:26:27 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B959F11C04C; Wed, 30 Mar 2022 12:26:21 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2EF8111C04A; Wed, 30 Mar 2022 12:26:21 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.13.95]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 30 Mar 2022 12:26:21 +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 v9 17/18] KVM: s390: pv: avoid export before import if possible Date: Wed, 30 Mar 2022 14:26:04 +0200 Message-Id: <20220330122605.247613-18-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330122605.247613-1-imbrenda@linux.ibm.com> References: <20220330122605.247613-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: oP4fMWJpV2FjgjWQH4vn7QZ3YXvKa6hu X-Proofpoint-GUID: L0EzHHxRcO-ZxFGf4rG82h7_qUCSWVz1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-30_04,2022-03-30_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 mlxscore=0 spamscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203300062 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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