Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp239347pxj; Thu, 3 Jun 2021 05:38:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/30IW8jv9PC0+3Len6B6Hg/Ih/nbjBP61oAruRwP2O42vHveBJiGqSrMwnpDJZq+TR8MN X-Received: by 2002:a17:906:2b85:: with SMTP id m5mr39609102ejg.141.1622723912687; Thu, 03 Jun 2021 05:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622723912; cv=none; d=google.com; s=arc-20160816; b=W6Ft/earV5Zh7ZI24rY5P0EvdciVPh5d8TVQogby+EOHttUstW7GpBvdIFmPu6b/Wt UrkExa1E8uLQvHAUCXDLflfHaFWlhrIpKp5suFos/6MkbIUaI2VyZpJMRzDo0cm1i4Lt ctyrgn6K1U8RKwiGnRRI0YcE1jTrMTWkHMR9u3t6BoE23oSfsBhyH1wcfZGY/CJDt7XH t1J3K+W7KPYdMrokaDASPO8P/pF0/lxZBmDT6WrCYb0PubUpeZXSkghvw/SbE1GimlxI CyCNtSBR6L7YmmNDye46NJ0b4L38AZQmWiV5Eegi+swmovhCw256InUekDONnrpbdwJQ RPcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=HJXz2XtqQjbhjh0WzplT7Q0wAq/ompg6Zc8z6SKQELA=; b=FaxD1Z7hg8WlPnN3MVkQGkjTSlDKgbG/8HSoM1NFP8uJsLPu4W2gddvGm3Z4dIKQ9E njNM/vYLZ5nLRFhTJ5mrADX6cOfFF7JlZBE+lDIk5nKP4viGMCh3VLFn/pDEkH5m/4It XqE1Cet3TwaaB/IrGSsp5thjdAscpOAH8U/FxesXJWcE1RO2CDbbG8CPqGK2t9tXnkyA CIecHpD1NBYFnot00noFPcf+CvrQV4SpMefxlnSkhG2oVAcMVc9oSfwUmO3L6tk/8b3O KjTB3T4t5Rn5S8QXXqnz/Y6lxl2Z+ASP6V8k/arSYG9gcJYgNxZ0bEF2Li8HxVaSpPku UaEw== 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 a24si2186267edy.7.2021.06.03.05.38.10; Thu, 03 Jun 2021 05:38: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 S230404AbhFCMgw (ORCPT + 99 others); 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: linux-kernel@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. >