Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4021589iog; Tue, 28 Jun 2022 07:31:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t9Lq6xYALSC4JfNZyT38uEKbkRixP3t2YOPzRTEHJFiaFfkLq61O35TMH0GplcHb+D2J6/ X-Received: by 2002:a05:6a00:ac1:b0:4f1:29e4:b3a1 with SMTP id c1-20020a056a000ac100b004f129e4b3a1mr5118374pfl.63.1656426694541; Tue, 28 Jun 2022 07:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656426694; cv=none; d=google.com; s=arc-20160816; b=VToxugy0+esQc4G3MsYdG0GAo8rC7mZ0FCrvtDRv++J4sxJynZrN9VW2f6Sbz+/LnN zGC1RckG6V+HMVxoSb+9R0Ez+ZFnyGDDUhWyMD0tUwjnOoXOABJ8GA6r7gVSWFbOw1UN eGOQZYHyNFLljNjALoS5E3X0BjlzHVj+sEySEuTsrKH4xR0eA33tEIt5d/LQwPbx5iMR KOSxSxzh7NVFVojyzyHoQs5QitvK0hVwhz/MANfPbAX0KJVH4E/nqgd+SnOkgqnXNj3V jvUkNLNDz09+esrkn+m/kKY96SD9z337T6BXM2wgKViai1OWJVK46NQOKDFTqy9+nOf8 DOSw== 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=BNQZfOe/P4nfAGL8NepknLyUIOXlW6knV0NF/TLauS8=; b=Go2k26OeWEtSwwo08uhbzL9ETI0LeseLUIEWsmY3fLNm3LevuCsrcLCXQN1JEJr0DD iS8RRZxFP0xdEEmnzuisZJhMB/crneJlBbY97B/XS/y6Ceke1pIq13w2QjCuZXpghCis cnZy4ENXl4G1R4CVUTl6kKMM28SDGeFoFolKcs5HE7OfmDWaApmuYEDlywYh2/KaXIBz 2WH873z6hkyWTIips4PmYk4utUyFbrUtXgZ3G1bjLzQIYa1SJQ17Ilh79Aj+HNimsvsm 60OoFuQm6StDd9qim75nsI4heVixTEBvMaJ11JLZ0EDSWtWZTvkDakwSxuMgIu8YyfLb stuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=XayXK7RI; 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 h11-20020a170902f7cb00b00167895f904bsi16667888plw.140.2022.06.28.07.31.18; Tue, 28 Jun 2022 07:31:34 -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=XayXK7RI; 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 S1347104AbiF1N5b (ORCPT + 99 others); Tue, 28 Jun 2022 09:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346937AbiF1N4l (ORCPT ); Tue, 28 Jun 2022 09:56:41 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECDE3338B7; Tue, 28 Jun 2022 06:56:33 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25SDl5lm024461; Tue, 28 Jun 2022 13:56:33 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=BNQZfOe/P4nfAGL8NepknLyUIOXlW6knV0NF/TLauS8=; b=XayXK7RIjrVaweGDtMoEWvrJrF1S/DpiCpua7YIevZZOEtBIzKE/8FZ0RfymJ3rtTZIR 4dyvmKVZsC2xxgiAjV50LlaiFZIHmfZFJO5fYa4/naxRKNLrxB1wDPlGy7a+g71Z2gvN 6J/IWzIuzFgDaUGusEtyIxYf+ZlWvwz+UvpUufUMIcMp5ktvlc5viL0qiJVO00ObLv2e VikfiuqX0qNR67zL01ggPYuGxFbN887sH+IlTq8L4dUcppcnR/ty1NlDE/gkcfRU9Rzm wcUMT1BPUVXcpH4Ls5FT98nCAfow1DI3P5N220nZIiknyHoH9/oo/6UtKNdH7XlhCdjo bg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3h02u2raee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 13:56:33 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25SDpiVU012905; Tue, 28 Jun 2022 13:56:33 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3h02u2racu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 13:56:33 +0000 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 25SDps3N013766; Tue, 28 Jun 2022 13:56:30 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3gwt08upfd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jun 2022 13:56:30 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25SDuRAQ21102964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Jun 2022 13:56:27 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E1534C040; Tue, 28 Jun 2022 13:56:27 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A02BB4C046; Tue, 28 Jun 2022 13:56:26 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.40]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Jun 2022 13:56:26 +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 v12 16/18] KVM: s390: pv: avoid export before import if possible Date: Tue, 28 Jun 2022 15:56:17 +0200 Message-Id: <20220628135619.32410-17-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220628135619.32410-1-imbrenda@linux.ibm.com> References: <20220628135619.32410-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 5MEKP4MvxMCXQOYlpbavMB9LHM9HZDW- X-Proofpoint-GUID: eaLXA95WHCmfZBXkVmu9vbw22dYnaN3n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-28_07,2022-06-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 mlxscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 priorityscore=1501 clxscore=1015 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206280057 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 Reviewed-by: Nico Boehr --- arch/s390/kernel/uv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index 87b176008785..bfc85b0376e4 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -255,6 +255,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) { + if (test_bit_inv(BIT_UV_FEAT_MISC, &uv_info.uv_feature_indications)) + return false; if (uvcb->cmd == UVC_CMD_UNPIN_PAGE_SHARED) return false; return atomic_read(&mm->context.protected_count) > 1; -- 2.36.1