Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp412688pxj; Thu, 17 Jun 2021 05:45:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgAEAKJQb51eLni2gwqvmY83w1UbwzhZc2sZnzzghtaA3435wTvG1GEzwmWMiWZwwjws2S X-Received: by 2002:a17:907:206b:: with SMTP id qp11mr5053431ejb.336.1623933932091; Thu, 17 Jun 2021 05:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623933932; cv=none; d=google.com; s=arc-20160816; b=lazaSYAFWZiG9+iZIyVFmTJh0B8kM5/c/9/UfMfdoiBADWOSFUlmWW1qtOcustmgYR WIBnzZ9B+t/gTfpEX8mkq8j/GNjh/yGtu2vHxj4ZhWQY3BfGM7PrrHYZNw0xESVtx+ro NOaMv5MAiJN5F/TtaodTdvu0sFsmXxnSVYjLGRnv+HNM4neELPBXhpj0byxOW06Ssvzi cF+4/3HAW7CQ2R28umvFRqlVOj9an9vCdOu7ck2wmBMDtAvUHgPhrKKZox09BgQUIEOg fP96O1dTprbhdE/6qy4A6LWbB7QHrkidNpuJRFhzUVf0gpSVCSkYUFX2vDszkn+bv4Hn tbbw== 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=fnOGi7RMS2r3HNtB2NQyOgS507yc3w3rHh8PiN7ttJiTTOXU+FTXJlhoZIr3UNC3YT 4tZ7lLNhPm4BnOPMWY4IzAm3i6+mHCsBsWMBskMihYoD7hBD8j+YO7IJckbQgbCJBMux JztodlH7qB0PcXbCurBp810OO5pXJJAzjduLflCcL+EVNKrhNYhaxmEPHdd4fjoEzThO IGrHsZUzjo68f8os3XSVRj9G67sNzwBqJ7uhvt1lK8hrFTZXX0jQN+NQ2lGYHVEdzh0t pXmox0aDMmi/k/CBkhTXFlGi9e3qESzMMowcEPsOKGSgHDTcd0xGlyDTFAeffWtnACAm qD2g== 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 16si5447842ejj.242.2021.06.17.05.45.06; Thu, 17 Jun 2021 05:45:32 -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 S232285AbhFQLA6 (ORCPT + 99 others); Thu, 17 Jun 2021 07:00:58 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7468 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhFQLAx (ORCPT ); Thu, 17 Jun 2021 07:00:53 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G5Jr41wl1zZj4f; Thu, 17 Jun 2021 18:55:48 +0800 (CST) Received: from dggpemm500023.china.huawei.com (7.185.36.83) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 18:58:30 +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; Thu, 17 Jun 2021 18:58:29 +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 v7 2/4] KVM: arm64: Introduce mm_ops member for structure stage2_attr_data Date: Thu, 17 Jun 2021 18:58:22 +0800 Message-ID: <20210617105824.31752-3-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20210617105824.31752-1-wangyanan55@huawei.com> References: <20210617105824.31752-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