From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F334FC47096 for ; Thu, 3 Jun 2021 12:35:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD3706136E for ; Thu, 3 Jun 2021 12:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbhFCMgw (ORCPT ); Thu, 3 Jun 2021 08:36:52 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3412 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbhFCMgv (ORCPT ); Thu, 3 Jun 2021 08:36:51 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fwldb544qz6tsl; Thu, 3 Jun 2021 20:32:03 +0800 (CST) Received: from dggpemm500023.china.huawei.com (7.185.36.83) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 3 Jun 2021 20:35:01 +0800 Received: from [10.174.187.128] (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_CBC_SHA256) id 15.1.2176.2; Thu, 3 Jun 2021 20:34:59 +0800 Subject: Re: [PATCH v5 4/6] KVM: arm64: Provide invalidate_icache_range at non-VHE EL2 To: Marc Zyngier CC: Will Deacon , Quentin Perret , Alexandru Elisei , , , , , Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , Gavin Shan , , , References: <20210415115032.35760-1-wangyanan55@huawei.com> <20210415115032.35760-5-wangyanan55@huawei.com> <875yyw1s73.wl-maz@kernel.org> From: "wangyanan (Y)" Message-ID: <4169bbfc-0b63-5d2f-9ac5-27bea3e7ea46@huawei.com> Date: Thu, 3 Jun 2021 20:34:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <875yyw1s73.wl-maz@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggeme712-chm.china.huawei.com (10.1.199.108) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, On 2021/6/2 18:22, Marc Zyngier wrote: > On Thu, 15 Apr 2021 12:50:30 +0100, > Yanan Wang wrote: >> We want to move I-cache maintenance for the guest to the stage-2 >> page table code for performance improvement. Before it can work, >> we should first make function invalidate_icache_range available >> to non-VHE EL2 to avoid compiling or program running error, as >> pgtable.c is now linked into the non-VHE EL2 code for pKVM mode. >> >> In this patch, we only introduce symbol of invalidate_icache_range >> with no real functionality in nvhe/cache.S, because there haven't >> been situations found currently where I-cache maintenance is also >> needed in non-VHE EL2 for pKVM mode. >> >> Signed-off-by: Yanan Wang >> --- >> arch/arm64/kvm/hyp/nvhe/cache.S | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/arch/arm64/kvm/hyp/nvhe/cache.S b/arch/arm64/kvm/hyp/nvhe/cache.S >> index 36cef6915428..a125ec9aeed2 100644 >> --- a/arch/arm64/kvm/hyp/nvhe/cache.S >> +++ b/arch/arm64/kvm/hyp/nvhe/cache.S >> @@ -11,3 +11,14 @@ SYM_FUNC_START_PI(__flush_dcache_area) >> dcache_by_line_op civac, sy, x0, x1, x2, x3 >> ret >> SYM_FUNC_END_PI(__flush_dcache_area) >> + >> +/* >> + * invalidate_icache_range(start,end) >> + * >> + * Ensure that the I cache is invalid within specified region. >> + * >> + * - start - virtual start address of region >> + * - end - virtual end address of region >> + */ >> +SYM_FUNC_START(invalidate_icache_range) >> +SYM_FUNC_END(invalidate_icache_range) > This is a good indication that something is really wrong. > > If you were to provide cache management callbacks as part of the > mm_ops themselves (or a similar abstraction), you wouldn't have to do > these things. Yes, we definitely don't need this work if we do that. Thanks, Yanan > > M. >