Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp188422pxt; Wed, 4 Aug 2021 08:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCmZPktwMp0pp2O0wPaBBbONmTLGe9bboAkOxREs2FBFqQreR2xneNjn5s58KkyUX/bpWD X-Received: by 2002:a05:6402:408:: with SMTP id q8mr428394edv.13.1628091861920; Wed, 04 Aug 2021 08:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628091861; cv=none; d=google.com; s=arc-20160816; b=LZQUGZMisRcynY3J7fzWB8Nj0x1VbqVp6Bw/9YfADJC2meYoknNbtIeGHcdOFcryzL zRp7RCauqttftI1W7BWZ/LvkghATHWJrjWjDgJ1HF7cgf2ATnS9M9J4kA3gYzBFA8W4q 1saCf7yzSfqUGnH3PYnrxgOyW4KbeBW40ZKtoIwUhxXgrj62bAgY6tYO7qS9AYRwfR6k ECJYEGL2vC0cYaT5yXQfZ6kxukoRozf69AJNeO1tMavSgdYOjzCjoiH69JY3D5MaFKcg sp3WK0/uPPj79iGo0cG6j44SiO85ZfhSUgWm069AobCombFgWZcO39pf52PFawByUP2b mc/A== 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=0IK1pM9XsIQB3W+jkhCHKT+44Ne00EWSYPCtnniUu10=; b=nznve5QwA/p3vCCCZj6mFK6Fj8fjVwJXza7X8x+uTrRkdSdv4S9JnunibWN2T4w101 KhJcCqFpvc67+Ax8gi+J3DpPeYlQaok3Ks0rIjnYmuzdS5S9rjA1ihNTdcy+I+gEUlJB 9KIIyv4hz8G30ajs+fjDJH4ESgqU4N5Jtdtafz4Jed4QZjIuZewZiR0xl0uKJ7BYfH4p yyIoYTj7bpYkPoFG3lXiOR/tjTdBcorZRd4PnPrJWZERL0e7VHCMCE6Kk+hLp6ZqmLzV +mFb9QHVgZRpOhWZqJYsqVWuFSM2hvezaqlPX0od+wnywVG9jE7Cpq70KVS06qxQBNPX YXSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=F3Zzza1O; 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 u25si2606822edq.517.2021.08.04.08.43.57; Wed, 04 Aug 2021 08:44:21 -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=F3Zzza1O; 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 S239377AbhHDPlo (ORCPT + 99 others); Wed, 4 Aug 2021 11:41:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3188 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239255AbhHDPlU (ORCPT ); Wed, 4 Aug 2021 11:41:20 -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 174FXkR7174297; Wed, 4 Aug 2021 11:41:07 -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=0IK1pM9XsIQB3W+jkhCHKT+44Ne00EWSYPCtnniUu10=; b=F3Zzza1O9cbmSiyEgiWZDPTU85AaStWm1aMO+NRzk1/idCd9Wssqc0LeTs6hx14ya82B xuKE563+E6DiohED82To1OvK8AnPsTuqQF4ulVD+2dMOLNFw0xUVK+yrVtyW4OgLzC4R FngYw2NVG/upEjItNnsIvdh9SKM8S6Fw5tJKH7tISnAZ7I7SICyjUow110l/kSsC2rlR 2TQJRI3OCQ0WfH9u+n/apXRCNFHmMKLegog5mb5PCGsuatSr2AA3iCMVpdeOX2fR+t8j AKrL3BkCLw6UvJyqIzbKOZG+PBE5FDSZf3UTrt4++qSSYqFz8GR1mp7Di28ZHMQkbsmj GA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a7rjba58n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Aug 2021 11:41:07 -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 174FZIaW185564; Wed, 4 Aug 2021 11:41:07 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a7rjba57p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Aug 2021 11:41:06 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 174FaAGL028647; Wed, 4 Aug 2021 15:41:05 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04fra.de.ibm.com with ESMTP id 3a4x598h5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Aug 2021 15:41:05 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 174Ff0jj55312688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Aug 2021 15:41:00 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B7044C058; Wed, 4 Aug 2021 15:41:00 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B72A4C05C; Wed, 4 Aug 2021 15:41:00 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.2.150]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Aug 2021 15:41:00 +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 v3 14/14] KVM: s390: pv: avoid export before import if possible Date: Wed, 4 Aug 2021 17:40:46 +0200 Message-Id: <20210804154046.88552-15-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210804154046.88552-1-imbrenda@linux.ibm.com> References: <20210804154046.88552-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: OoKkOZKnQyYCU71rkLd6YCHzUnx3kF9r X-Proofpoint-ORIG-GUID: sPXGm94v9Uhh7m581g0Jt6rmKKoooPaQ X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-04_03:2021-08-04,2021-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 impostorscore=0 clxscore=1015 mlxscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108040089 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 5b632846c4a4..fa0a51121136 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -298,7 +298,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