Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp302672pxm; Wed, 2 Mar 2022 15:53:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf9BdWWXcFocH6KfA27ZJRQfB9KW5t4RKNBWbyVDFNGFQORTPArxqmqi71BHYW0ePE2UfV X-Received: by 2002:a63:f511:0:b0:378:3b1e:7600 with SMTP id w17-20020a63f511000000b003783b1e7600mr23337013pgh.247.1646265185350; Wed, 02 Mar 2022 15:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646265185; cv=none; d=google.com; s=arc-20160816; b=Ur7+JAMW3v499SoIiIxjQmnkKtn+b7HNTiqpQ/EVLHiHTqwiAAPs5RaKtfV+We0YjN gRBoI2GycYk2kgfjvkpYdbKPolkCLLGzQtdICcMOZxbN4jv5RD7GWEghRnmUNkGMUHd7 AWtRNKIH3n9I8d7o3TU6FxOZ86hqfolxi1liyVR/fZOORnQfGIcmWSZJ4FTVVrZ0Xizh yBHVoiU6du5FKLhm50CwcYwKFp/eB9JCbzO9E02uzFND0Q7QBuggfPiT3vF4RBh9szcw +sUuEggAq+x4dEojxP97/rR0etJsDvtENSuAVAUpFrmXgBjRZUCB9oKJZxNmwQsCxb0j 56JA== 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=CTqGnfjY4DUxNviVF7xIIKedTZkwxkv2CtOMqQeDWlDlQuO1x2vEjle4DAPxNIGBZF YDU8FtfQ0rAxybPukpZj7Ql7Ys9TnO8ws4iT0kvK2JYxOfPQWQKos2EQQyt4aZ4GG3aj onoYmTcplKmhkn/r8oZSSLB1wxotJfK3ZiKikps8I91Pk7sABW4sTc4Ba1NSH+Puxivh Y0fkOQyZBt6I4X0KBKRfBWqES++tyZKclLboRDEoWq8FghegTPGKNcFsssj8nyc1RmCc eNfKbrXsZ06+URjgy1/qOz81/e8t34CiYXSNjRTkd1LFZoaHXf7YM4KjUtSdxj0aZG4V vAFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OnWscXbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h14-20020a170902f54e00b0015195e2aa37si551794plf.55.2022.03.02.15.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:53:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OnWscXbs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 9B6AC17F69A; Wed, 2 Mar 2022 15:14:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244535AbiCBSO3 (ORCPT + 99 others); Wed, 2 Mar 2022 13:14:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244511AbiCBSMu (ORCPT ); Wed, 2 Mar 2022 13:12:50 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F3A8D225B; Wed, 2 Mar 2022 10:12:00 -0800 (PST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 222HO6rI020113; Wed, 2 Mar 2022 18:12:00 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=OnWscXbstlX5XKe4bHw5NTN9SoUkbl0yJr5qlt5VoNTinmRYB5z9YQOXbvzf7PDUIeni hU2Mx8iH1iadodDyqs5zwRvphyNdbkcQfjknoe5XqfA+jy/Sg1Izn8gRPYQqoHMkhsAb /m8kdFzAV39wtlPxB12P7x9jowtgCmadvmxs75YWNsutjoWjwP2ci4OJOg4WDAYQcFCz E9V0nht8CaCopfDDKXS/BcfhQeEHsWNKZrZcE/VZeIwOVZj4QqnsuwBUQ8+8H+XnF+BI Dx7uxTtR8XvhVZ3oAxFj3fFOQQdrpFkVABtKoGdpMh/SNuy/DlfFADbzWfJp9Fo9qp1u Pg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ejcxk0xdr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Mar 2022 18:11:59 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 222I8tL3014674; Wed, 2 Mar 2022 18:11:59 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ejcxk0xcy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Mar 2022 18:11:59 +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 222I93FF022211; Wed, 2 Mar 2022 18:11:56 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 3efbfjqm30-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Mar 2022 18:11:56 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 222IBsIL45744416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Mar 2022 18:11:54 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E833A5204E; Wed, 2 Mar 2022 18:11:53 +0000 (GMT) Received: from p-imbrenda.ibmuc.com (unknown [9.145.5.37]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6320052051; Wed, 2 Mar 2022 18:11:53 +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 v8 17/17] KVM: s390: pv: avoid export before import if possible Date: Wed, 2 Mar 2022 19:11:43 +0100 Message-Id: <20220302181143.188283-18-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220302181143.188283-1-imbrenda@linux.ibm.com> References: <20220302181143.188283-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: buCHCtvf1vPpKGfDQEQC_lUJEPcqKI88 X-Proofpoint-GUID: KPTqv4hWi-EGYWVeDa1rvvCxZGZkwFK0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-02_12,2022-02-26_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2203020078 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