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 CE552C433EF for ; Thu, 27 Jan 2022 11:51:55 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yENnIZpsCq49ZvTJj0P/6bSTU5qRRcT3TIx7mo0EB5o=; b=gGHkqRJQz8+dGd QYiTNjIIXxvxkArAm6JoVggd3CGWqGX7oRIE7u2hY288ifk6lZL04VHs4k/djnUkh0Lf+hDh0liVA utDJ/7zgKAubMBcNMGrHdwwokbD3N+ggVjQDYPhuYAwuTQ53ROE08AuqvuDqmw/VWun1tSZizELDX UyEbySe5DQg0YXW+BWFdUWCwh+99IzpQGFiCBp46FStbWXtHM/zTMXmCp5Ydgjv3mtj97cC0Fl9qB 1H/O8clnmNexx+Z0oXu9/8cgJyi7Finmvg99E99ZG8sMQTb/Dgs45/zjSrVX9c4MjO7OMRkvlavGE aGWvpOAHLA2RbRAydy0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD3IX-00FZIz-Hd; Thu, 27 Jan 2022 11:50:41 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD3IS-00FZHm-D6 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jan 2022 11:50:38 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id B1BE0CE21A1; Thu, 27 Jan 2022 11:50:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2314DC340E4; Thu, 27 Jan 2022 11:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643284233; bh=Fj6rO6IaAAe0YbSiAt6fjuOzaeN3xp1+03RZCltF6rs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JQXFBkdwSCOaHmz5Cs6OTKaLnLNHdXTyq3D13G8DzRkTUVG8MExagW9w3SpN4gLVx ANX8bKduLwrEY9MoksbsBVgFy2Sh0BKdy5mrEAFzEmXsWvgqi5w1gOTHMoqSwgoo3g 4ArYBI2Rx4hwjRr/sRJdAmHATuYOt0+kPM+oeLPgM9fgeKeS4feiXrNu2Hmw/y+t6u oBrXWorCAxGA0O29HxquAH9PhmkkmTv4YnxjRsJTH8+BgtsbWJyCMmEJEnTvE1awZ4 nHTiRYS+Q2NwnCFK38PFvFusRyVMtPnsMQsHgFqoiIK2aWAjyGzD8lQfnLS9ktpHFP 6lQO8SJohJe6A== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nD3IN-003UfR-8X; Thu, 27 Jan 2022 11:50:31 +0000 Date: Thu, 27 Jan 2022 11:50:30 +0000 Message-ID: <871r0t75yx.wl-maz@kernel.org> From: Marc Zyngier To: Ganapatrao Kulkarni Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Jintack Lim , Haibo Xu , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH v5 38/69] KVM: arm64: nv: Support multiple nested Stage-2 mmu structures In-Reply-To: <21b0fca8-6b31-dc63-7637-2f80c4b3a272@os.amperecomputing.com> References: <20211129200150.351436-1-maz@kernel.org> <20211129200150.351436-39-maz@kernel.org> <21b0fca8-6b31-dc63-7637-2f80c4b3a272@os.amperecomputing.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: gankulkarni@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, andre.przywara@arm.com, christoffer.dall@arm.com, jintack@cs.columbia.edu, haibo.xu@linaro.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220127_035036_845069_DFC8EB28 X-CRM114-Status: GOOD ( 19.85 ) 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 Tue, 18 Jan 2022 11:24:04 +0000, Ganapatrao Kulkarni wrote: > > > > On 30-11-2021 01:31 am, Marc Zyngier wrote: > > +struct kvm_s2_mmu *lookup_s2_mmu(struct kvm *kvm, u64 vttbr, u64 hcr) > > +{ > > + bool nested_stage2_enabled = hcr & HCR_VM; > > + int i; > > + > > + /* Don't consider the CnP bit for the vttbr match */ > > + vttbr = vttbr & ~VTTBR_CNP_BIT; > > + > > + /* > > + * Two possibilities when looking up a S2 MMU context: > > + * > > + * - either S2 is enabled in the guest, and we need a context that > > + * is S2-enabled and matches the full VTTBR (VMID+BADDR), which > > + * makes it safe from a TLB conflict perspective (a broken guest > > + * won't be able to generate them), > > + * > > + * - or S2 is disabled, and we need a context that is S2-disabled > > + * and matches the VMID only, as all TLBs are tagged by VMID even > > + * if S2 translation is enabled. > > I think you were intended to say "if S2 translation is disabled". Yes, absolutely. Good catch. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel