Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp306604pxj; Wed, 16 Jun 2021 02:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeegZmL4tfwhoJ3KYGnITBSM2OaFWDi9xfu9y6KiHU1vWVXu//QkYlg8lj/KW0jW8ncFHS X-Received: by 2002:a6b:7d03:: with SMTP id c3mr3128807ioq.2.1623837257715; Wed, 16 Jun 2021 02:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623837257; cv=none; d=google.com; s=arc-20160816; b=BWWysYyovDvodaFc9zRf+y0CiZsBP9DWHSf7OwVlIQvN1v/QxzxG2rMq3IXY0QlFVE Zzh3YaavHMl4H/sDrJeAksV4yPGaUseShA3JzanhmMYeRBSRB34pV4gizOPX9hseluDo UPLT7eMDK0afbAfHb7KjymUPRzoWJZecmJ3Rq+DoCthWeE8dZTC28HofPKWNZgXsQxJ/ wLQlu1XHW109FtagKQhkhZpXL4jmdnjwOb56RrjAUSZmWzvcXItSlKihflIcffpB2r3Z oVkQibhiEkftULi1tK2zymP1fgGxcW9lGGGnlrTSFNAZlkiecUcMrHpggSEbV9AoojWF umCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=9QGKVJHRQ2ARHyZnB1S+Ep2guEt2xjWaoYmdn+Z5Gdk=; b=zUlWYwbqrxPH2xNnq/xiVdkxNoez/hVYw2T2NuB1GcGi+3ti6f6Q2kryQO3gPreocs 9FUJdIFov2ErA2QKBdieyJotx6pPVNBDV8BglhJPkEELJ2b2Ce1rg3zgPR2iHQauqKs3 FCRCdDeKgZQtyu3FoA5ELDjGEHuREqNu7lwNc9n/Le2ekYOs8aqWdUSnTGkqBW3Rlx6h bEsu9G6W+17mdgmeoNQbev+VK73dKaoqHhuVUiIoXwLt17j0DPJW+OVBZcGQyz8xPBjs l2ZgG7V/wmrSDJv48YVZmV7jPVsWUXPxHq6rlfm5t00i4lXr4sCkgK8NLoUqiaIE//P8 7dWQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d25si2116684iop.15.2021.06.16.02.54.04; Wed, 16 Jun 2021 02:54:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbhFPJzJ (ORCPT + 99 others); Wed, 16 Jun 2021 05:55:09 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:10104 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232333AbhFPJyz (ORCPT ); Wed, 16 Jun 2021 05:54:55 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G4gQS3SjbzZf1L; Wed, 16 Jun 2021 17:49:52 +0800 (CST) Received: from dggpemm500023.china.huawei.com (7.185.36.83) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 16 Jun 2021 17:52:47 +0800 Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 16 Jun 2021 17:52:46 +0800 From: Yanan Wang To: Marc Zyngier , Will Deacon , "Quentin Perret" , Alexandru Elisei , , , , CC: Catalin Marinas , James Morse , Julien Thierry , "Suzuki K Poulose" , Gavin Shan , , , , Yanan Wang Subject: [PATCH v6 2/4] KVM: arm64: Introduce mm_ops member for structure stage2_attr_data Date: Wed, 16 Jun 2021 17:51:58 +0800 Message-ID: <20210616095200.38008-3-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20210616095200.38008-1-wangyanan55@huawei.com> References: <20210616095200.38008-1-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Also add a mm_ops member for structure stage2_attr_data, since we will move I-cache maintenance for guest stage-2 to the permission path and as a result will need mm_ops for some callbacks. Signed-off-by: Yanan Wang --- arch/arm64/kvm/hyp/pgtable.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index c37c1dc4feaf..d99789432b05 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -861,10 +861,11 @@ int kvm_pgtable_stage2_unmap(struct kvm_pgtable *pgt, u64 addr, u64 size) } struct stage2_attr_data { - kvm_pte_t attr_set; - kvm_pte_t attr_clr; - kvm_pte_t pte; - u32 level; + kvm_pte_t attr_set; + kvm_pte_t attr_clr; + kvm_pte_t pte; + u32 level; + struct kvm_pgtable_mm_ops *mm_ops; }; static int stage2_attr_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep, @@ -903,6 +904,7 @@ static int stage2_update_leaf_attrs(struct kvm_pgtable *pgt, u64 addr, struct stage2_attr_data data = { .attr_set = attr_set & attr_mask, .attr_clr = attr_clr & attr_mask, + .mm_ops = pgt->mm_ops, }; struct kvm_pgtable_walker walker = { .cb = stage2_attr_walker, -- 2.23.0