Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4047553pxb; Tue, 26 Jan 2021 10:59:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdkTgWS32tfAdfCEuA+zJb+EYvbxic0j9io4N5x2uhqx/lVRjKPzFOP3YvJZHgVmvogt9v X-Received: by 2002:aa7:d1d7:: with SMTP id g23mr5696566edp.6.1611687542975; Tue, 26 Jan 2021 10:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611687542; cv=none; d=google.com; s=arc-20160816; b=eQ0jJjldPaRNPiUBKt9WRVGeUxXxPKMoGM4ZdhrXvrD6iRDDcLW1lxI4NVyN8fO26W gUlh40RklkxFv5kA7MITWHyeTnGn6Lg6RmAFWtwLra+tWKGOgfS8OQDxDRYFVoCw6Qqh 3lKTau4KFhb5ba6NjWNS2R+gAuDamaOmFga9W81PFVELc/NVzLyOEvax7PTTl/DE5EcV UHXSaH89CyiclHYphTUvP0Q0TIVnUW73fHfIHyj/P1ylBJKXslArdzZ4YhsX5istr8I0 qVY5Y92YVEL+wuqmjDqrm2vhjcPyuX/THaRJl272nEJ+yBq18OfguvxJMmov0cTj2v5S esxg== 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=LQU2Wv+yJbu5HJ9Fpi2BweN3G2DQ7/BXoWy2/xoVml4=; b=DOnT5PPKDKH0ofhuhhuv8JxrqYNBXk0sNP/DB5IE/bWUKhodAk5vV4MmAhH5ePQOdH mvqJFTiXpx3ubhLgwMQHk36/vYX8zF9lWQDikitKQoDksiQ7sTNnOofi01Hm4GhOXnCQ RFnjdcYM2R1d+7qgmfdOaLb3TGrQJrz+uhVLiyOWHsaDpBs6Xw+NNSRmzJszO1PK7FdY 4eRe/n/1hrjK2+O20dWs1mVU+3lmKFLG8mzTufFKOOjInKswfNCrHdebdqfWk2BJMlyZ xC58SIUAxsziBTcjz9xucS8MdXL0h5p6JusAlbPrsvWao/DurUBd9jDW1UV02HBKoMIF /riQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq23si7280752ejb.140.2021.01.26.10.58.37; Tue, 26 Jan 2021 10:59:02 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404998AbhAZNny (ORCPT + 99 others); Tue, 26 Jan 2021 08:43:54 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11889 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404879AbhAZNnB (ORCPT ); Tue, 26 Jan 2021 08:43:01 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQ7DK21PRz7bHL; Tue, 26 Jan 2021 21:41:05 +0800 (CST) Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 21:42:08 +0800 From: Yanan Wang To: , , , , Marc Zyngier , Will Deacon , Catalin Marinas CC: Mark Rutland , James Morse , Julien Thierry , Suzuki K Poulose , , , , , Yanan Wang Subject: [RFC PATCH v1 3/5] KVM: arm64: Support usage of TTRem in guest stage-2 translation Date: Tue, 26 Jan 2021 21:42:00 +0800 Message-ID: <20210126134202.381996-4-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20210126134202.381996-1-wangyanan55@huawei.com> References: <20210126134202.381996-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 As TTrem can be used when coalesce existing table mappings into a block in guest stage-2 translation, so just support usage of it. Signed-off-by: Yanan Wang --- arch/arm64/kvm/hyp/pgtable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index 4d177ce1d536..c8b959e3951b 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -437,6 +437,7 @@ struct stage2_map_data { struct kvm_s2_mmu *mmu; struct kvm_mmu_memory_cache *memcache; + u32 ttrem_level; }; static int stage2_map_set_prot_attr(enum kvm_pgtable_prot prot, @@ -633,6 +634,7 @@ int kvm_pgtable_stage2_map(struct kvm_pgtable *pgt, u64 addr, u64 size, .phys = ALIGN_DOWN(phys, PAGE_SIZE), .mmu = pgt->mmu, .memcache = mc, + .ttrem_level = system_support_level_of_ttrem(), }; struct kvm_pgtable_walker walker = { .cb = stage2_map_walker, -- 2.19.1