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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C498CD11DD for ; Tue, 26 Mar 2024 13:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=koq+vAMjnG2kkqwoDixCwDGttIjATb7P1/OOLZMGJF4=; b=eI1DE5r0vLFOEN EmXp3xSs+AmJycBfPCXDK4Tez4QzfHuuvx4YZJxHc7Ty3AKOJqo+PSWIgjn2g+3SImp6dDnEVMMmS +jQl9q4ZDjE9k09dwoofFx6E5btkDPGTVSaZnVZAWIzSfesvMt8NhozTE14ATe4YwMsKXS53F+VDN iemuvPGjpScTiiMk0OCv6Xpyv7seSeCstUJ2ujLqOdYWg3xvGsGs9sumTzjADCH2o0oIRQPNNmdjw 8Dlnr/xt7FZXxNq8upIfIb6zSrLYXG3Re7dEvKixE79xKpluJHJxFZD+9c7pax6Lm53cTq3+gsiSt f4oMpKEPT8mkDkwCzA4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp7Af-00000004lQ8-1msM; Tue, 26 Mar 2024 13:48:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp7Aa-00000004lO9-2zmP for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 13:48:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42F6C2F4; Tue, 26 Mar 2024 06:49:24 -0700 (PDT) Received: from [10.1.29.179] (XHFQ2J9959.cambridge.arm.com [10.1.29.179]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8E5303F64C; Tue, 26 Mar 2024 06:48:48 -0700 (PDT) Message-ID: Date: Tue, 26 Mar 2024 13:48:46 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] KVM: arm64: Use TLBI_TTL_UNKNOWN in __kvm_tlb_flush_vmid_range() Content-Language: en-GB To: Will Deacon , kvmarm@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Gavin Shan , Marc Zyngier , Mostafa Saleh , Oliver Upton , Quentin Perret , Raghavendra Rao Ananta , Shaoqin Huang , Suzuki K Poulose , Zenghui Yu References: <20240325185158.8565-1-will@kernel.org> <20240325185158.8565-4-will@kernel.org> From: Ryan Roberts In-Reply-To: <20240325185158.8565-4-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_064852_880823_20EABC6F X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 25/03/2024 18:51, Will Deacon wrote: > Commit c910f2b65518 ("arm64/mm: Update tlb invalidation routines for > FEAT_LPA2") updated the __tlbi_level() macro to take the target level > as an argument, with TLBI_TTL_UNKNOWN (rather than 0) indicating that > the caller cannot provide level information. Unfortunately, the two > implementations of __kvm_tlb_flush_vmid_range() were not updated and so > now ask for an level 0 invalidation if FEAT_LPA2 is implemented. Ouch, sorry about this! I remember rebasing my change onto the KVM tlbi range changes and having a few conflicts. Obviously I didn't do a good enough job of reviewing the result and missed this new user. > > Fix the problem by passing TLBI_TTL_UNKNOWN instead of 0 as the level > argument to __flush_s2_tlb_range_op() in __kvm_tlb_flush_vmid_range(). > > Cc: Ryan Roberts > Cc: Catalin Marinas > Cc: Oliver Upton > Cc: Marc Zyngier > Fixes: c910f2b65518 ("arm64/mm: Update tlb invalidation routines for FEAT_LPA2") > Signed-off-by: Will Deacon Reviewed-by: Ryan Roberts > --- > arch/arm64/kvm/hyp/nvhe/tlb.c | 3 ++- > arch/arm64/kvm/hyp/vhe/tlb.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/nvhe/tlb.c b/arch/arm64/kvm/hyp/nvhe/tlb.c > index a60fb13e2192..2fc68da4036d 100644 > --- a/arch/arm64/kvm/hyp/nvhe/tlb.c > +++ b/arch/arm64/kvm/hyp/nvhe/tlb.c > @@ -154,7 +154,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu, > /* Switch to requested VMID */ > __tlb_switch_to_guest(mmu, &cxt, false); > > - __flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0); > + __flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, > + TLBI_TTL_UNKNOWN); > > dsb(ish); > __tlbi(vmalle1is); > diff --git a/arch/arm64/kvm/hyp/vhe/tlb.c b/arch/arm64/kvm/hyp/vhe/tlb.c > index b32e2940df7d..1a60b95381e8 100644 > --- a/arch/arm64/kvm/hyp/vhe/tlb.c > +++ b/arch/arm64/kvm/hyp/vhe/tlb.c > @@ -171,7 +171,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu, > /* Switch to requested VMID */ > __tlb_switch_to_guest(mmu, &cxt); > > - __flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0); > + __flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, > + TLBI_TTL_UNKNOWN); > > dsb(ish); > __tlbi(vmalle1is); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel