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 8539DC77B61 for ; Thu, 13 Apr 2023 15:54:12 +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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+b65gs9oBUeqnV6jfDpiswh1gwPp0J4gku1d9h0VbNQ=; b=KSt5GlJtjrsK9f n5YYQFhfOSWpzCRZFdUQjS9m7LRNF8e+uWGEdl/ZmvpzjZRjhhIAycshmH1xThVI+dhhPCtDHygE8 neHDNefdI2MA2ycvd3JplGp8UmrkQ2BQJwyIn//QZwV14nTIh1zhMhoo18SSWGFjSgzHuivyXwc6g 0UCLDENggYaV8RxlGdz2vJ1lRGehYa4e5BfH+cEQOKAShWluroUhcOdWEOIgB29kXfgk2nzs0UzoX 3mDFOFJm3rVWgoXTs7iDlIBBs/qLfjuFIjWN4oe36NUGe3p88fpClYHqhmqyYmvwMGN3CSD4rpGfC vZDKABgsL9DPY43+BnjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmzG9-006XOL-0Q; Thu, 13 Apr 2023 15:53:17 +0000 Received: from out-8.mta1.migadu.com ([2001:41d0:203:375::8]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmzG5-006XMN-2P for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 15:53:16 +0000 Date: Thu, 13 Apr 2023 15:53:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1681401188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DDhBJiuoLWfvR3buxL71Lhhnlb72RGsxq/NWY4TUF+U=; b=cokkdAAqL0Xwxvs+5WyToebqEUM68iu5hSg1tsHrLWnRk79gNHwX5Ejea5OnxB/g4lLfeN CVESEZsA39ZeQkEOgZP6btSXjPwQhajL29XOZdaU6KAr2+9Zl4XEEgciWldwjMANFb4fOW h22i6UfavfGiTO6ucMQnjMUpluktsFU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Zenghui Yu , Will Deacon , Ricardo Koller Subject: Re: [PATCH v3 2/5] KVM: arm64: nvhe: Synchronise with page table walker on TLBI Message-ID: References: <20230413081441.165134-1-maz@kernel.org> <20230413081441.165134-3-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230413081441.165134-3-maz@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_085314_428719_D0352B05 X-CRM114-Status: GOOD ( 19.62 ) 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 Thu, Apr 13, 2023 at 09:14:38AM +0100, Marc Zyngier wrote: > A TLBI from EL2 impacting EL1 involves messing with the EL1&0 > translation regime, and the page table walker may still be > performing speculative walks. > > Piggyback on the existing DSBs to always have a DSB ISH that > will synchronise all load/store operations that the PTW may > still have. > > Signed-off-by: Marc Zyngier Reviewed-by: Oliver Upton > --- > arch/arm64/kvm/hyp/nvhe/tlb.c | 38 ++++++++++++++++++++++++++--------- > 1 file changed, 29 insertions(+), 9 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/nvhe/tlb.c b/arch/arm64/kvm/hyp/nvhe/tlb.c > index d296d617f589..1da2fc35f94e 100644 > --- a/arch/arm64/kvm/hyp/nvhe/tlb.c > +++ b/arch/arm64/kvm/hyp/nvhe/tlb.c > @@ -15,8 +15,31 @@ struct tlb_inv_context { > }; > > static void __tlb_switch_to_guest(struct kvm_s2_mmu *mmu, > - struct tlb_inv_context *cxt) > + struct tlb_inv_context *cxt, > + bool nsh) > { > + /* > + * We have two requirements: > + * > + * - ensure that the page table updates are visible to all > + * CPUs, for which a dsb(DOMAIN-st) is what we need, DOMAIN > + * being either ish or nsh, depending on the invalidation > + * type. > + * > + * - complete any speculative page table walk started before > + * we trapped to EL2 so that we can mess with the MM > + * registers out of context, for which dsb(nsh) is enough Looks like a few of these lines are indented with spaces, not tabs. Mind fixing this when you apply the patches? -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel