Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp462542pxb; Wed, 18 Aug 2021 06:30:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxueSld94tCyCP5wyLICi/cz3CfRdOIyg48xwE4U10HjlBSufplwOAzseSi7C5+/RLLUCjZ X-Received: by 2002:a05:6402:4315:: with SMTP id m21mr10178543edc.187.1629293431563; Wed, 18 Aug 2021 06:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629293431; cv=none; d=google.com; s=arc-20160816; b=GASWpJ9ukhmnKa0lZtSXLocdIDIAXHOoE9pjztpTxAeQi3Kv/GJiGrSRiFZ1I2/hvj iWQb4bZviZJhWAtRj/Bgv2cvm5WPt5obo6KBHcyfQ7GhUTcew2T2M6I5Tlso6wxxF+lk rE/7gCdmiwl9seSDuF4mkQLb4gK3mcIKFnEQ7MYhByJZSjcqAi99y4xsxqpJqNgJxLYr bjqsbLlXCoYoRsMDv3rM38M3GR2KJ5QDqzPhV+F+fMiI90X8ePDSFY2wYFB/YtYP8yoO 5cQtIbvPehNA274HrQ9eDgFVH+i7MMv8hZnkx+lipM87CqQMmocQnlOwnslODSlywjeY K1ng== 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=ibzHWFARoWPSSpZxradQsX1czZZu1ZTzHLLwx92Q/gY=; b=nrQ8lRuGIxL2i1QUX0Je4W7Wz6RVc3LZsg7zFK7tI24J4c2dFtomH0oCjieveutimf 9Fd6UHhTUkcNenOweWJHL3vVFgINuHo0N24kCo4U+x31z3fWdekkR3Tf/EAjdI0meiRt nXINmA8aVyB84VQfeNH921XlY/dNqhd37Smh7A9ine5UtgdO97io82LrNK3FGn+MviZG 2rvQWWEZiKPeS7k646At/29H9mcaZ1nRTcVJ1RyAG5AXU2X6YVmG5SdE+9iyPEq4aQay Fl20l3690Yl3XfMklf7gT+71gyXXVWxqE7EgtJWRf+TaSQyOZHa2AZjA2b0ic9RGDWEU 7XPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=MljRe+8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si5577283ejd.436.2021.08.18.06.30.08; Wed, 18 Aug 2021 06:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=MljRe+8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238534AbhHRN22 (ORCPT + 99 others); Wed, 18 Aug 2021 09:28:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:61954 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237458AbhHRN1O (ORCPT ); Wed, 18 Aug 2021 09:27:14 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17ID3kua121363; Wed, 18 Aug 2021 09:26:39 -0400 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=ibzHWFARoWPSSpZxradQsX1czZZu1ZTzHLLwx92Q/gY=; b=MljRe+8RmY8Gd/gV7nU4o9onc11OQt+aXitirHUXUZ2D9MvTprbOV5We6FznwZhI+fhv 5kElZV/nWijTIjim5CUuPKlStMvYcvybgZbEym0R4YHiqIRbOryzIUAUkmAoc0zfJSFl JN9DVBTW84EWP8dlcMpPnIox6oUIutSyuTr8mq5B6Z/b3J1NN62zldtYyNYMIy13FJyJ 7vMiUIjBun3jkBr4KfNgZyRUCTiiwPiNWb50iPxeQLG/H3RAqC1bCsJ1qfjCGxt6p2n/ d9g4aVRuqkk5AHXlW58puQ3VTk87vdMy/UoSLwkwihk+B7/v50jsKQ4JERJUY4/39sMW xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3agf0esaxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Aug 2021 09:26:39 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 17ID4Aht122896; Wed, 18 Aug 2021 09:26:38 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com with ESMTP id 3agf0esaw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Aug 2021 09:26:38 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 17IDECB0018948; Wed, 18 Aug 2021 13:26:35 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 3ae5f8dqgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Aug 2021 13:26:35 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 17IDN0Td33751350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Aug 2021 13:23:00 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CB9A4C052; Wed, 18 Aug 2021 13:26:30 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 000E24C044; Wed, 18 Aug 2021 13:26:29 +0000 (GMT) Received: from p-imbrenda.bredband2.com (unknown [9.145.14.177]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 18 Aug 2021 13:26:29 +0000 (GMT) From: Claudio Imbrenda To: kvm@vger.kernel.org Cc: cohuck@redhat.com, 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, Ulrich.Weigand@de.ibm.com Subject: [PATCH v4 14/14] KVM: s390: pv: avoid export before import if possible Date: Wed, 18 Aug 2021 15:26:20 +0200 Message-Id: <20210818132620.46770-15-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210818132620.46770-1-imbrenda@linux.ibm.com> References: <20210818132620.46770-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: W2SkcQcFKC4t1y566J7A4GQq--Rck-3f X-Proofpoint-GUID: eLV76xqKNX7302yxZrBcRdjH9W3IIKrw X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-18_04:2021-08-17,2021-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 mlxscore=0 impostorscore=0 clxscore=1015 suspectscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108180082 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 bc79085d7152..6f8aef5609c0 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -251,7 +251,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.is_protected) > 1; } -- 2.31.1