Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp708077pxb; Thu, 15 Apr 2021 04:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJWl3rpGgTI+yGqbHUXrrSZv7w/MPVPOIH4uFvlTy801yGkoQjce+p6W2ROs5/eJ3PclOh X-Received: by 2002:aa7:c913:: with SMTP id b19mr3745213edt.170.1618487634832; Thu, 15 Apr 2021 04:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618487634; cv=none; d=google.com; s=arc-20160816; b=BoFBq4hQB7GL+6MuhKZkLpvtL22Msi3w7MO1g62z9/zzlMMk+CNmBcapFB3XUaY3CG h8CCSwd6DrMl8d52U4FmDkj1Zcy6Dl+x1YifcA2xvOC4JUeYtC7FUigJ2XdbTCsHrSfx AS+BTmFEaMh5nLIAbcgudPL8TwxcO9CJsdNwYpWsrELRwDZ0iVazNbxzWbdQK9gUOGXb slJzFypDrqYkBneEFz548TgcYxv+7PmdQCbxBk1Pr3/YcYHuapscay8L/jiN3kGRQ+U4 M5Rq1LRyxVgMKu88U+Vv5Ka0q/hovS68RmYn6ghJLTfqS0JYuafundzeNIChZyEBpVUK mJjQ== 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=2cdk1W2fRyQessHJDQMZUPl3pmyTa/MaxLU2xWhM4/E=; b=eZdM+HY1A5ziWkkmsnQx3lvhqlGDcnGCJDrXs8G+c+MJZHIFR/JtnkuHzhd0TjBh9d OhCZOlGZoHVETJVzOz7tbzl/L+c17Yh7b4LlmAwIi3DtE36T3BWCAoGT3aJjjRDLPitV G/aX4KFy9eI2tvxnlPaZBkb+TzGKS40d8tSZiAKcLnDqzFzIYwMVaLE0Rz4Ymd4XnHa5 K+w4XM5qB/4nbAxnX9Hm+PCa5gcDYACDNxP9Jg5NVAfffeJMmIAZftg+ojYupQ+4v16c O8S2Gn7vpTrJcs5BjcmaFFKY4JmDOJEL5SUDGFCxxomLz77w3OxrgHLYmWMDbuf97pAK BZmA== 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 v16si1925966eja.117.2021.04.15.04.53.32; Thu, 15 Apr 2021 04:53:54 -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 S232854AbhDOLv0 (ORCPT + 99 others); Thu, 15 Apr 2021 07:51:26 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:17341 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232733AbhDOLvM (ORCPT ); Thu, 15 Apr 2021 07:51:12 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FLczw6xrNzB178; Thu, 15 Apr 2021 19:48:28 +0800 (CST) Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 15 Apr 2021 19:50:37 +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 v5 3/6] KVM: arm64: Add mm_ops member for structure stage2_attr_data Date: Thu, 15 Apr 2021 19:50:29 +0800 Message-ID: <20210415115032.35760-4-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20210415115032.35760-1-wangyanan55@huawei.com> References: <20210415115032.35760-1-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.128] 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 address transformation. 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 e3606c9dcec7..b480f6d1171e 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -869,10 +869,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, @@ -911,6 +912,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