From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED2BB1FC5 for ; Sun, 12 Mar 2023 13:22:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 994FBC433EF; Sun, 12 Mar 2023 13:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678627363; bh=2oojGcK9XMIoko0m8o7s0z2Z4DWvZglP3fcAzCm/6rY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g3v2EKa08TvXU+KbqPkKHdCjoiMBqwSGyZbt/nahjaVS4gkhiw4oyWvU8GinYdFpp o1P37+mFapE8kuF8tB1dOiaNsrHlF9stcZsF2Tu5jlKMs9fAhyXFoIm1q4w44p7uyp XC5K7jRo4kRCaSElSlS4hvQHH5Ogfx814Yyp4HIxJfvTNu8RQzeBMfWaPh/uQv6Mv4 IvY1I6DScV4vIFFsPPFJ5GIVB+plNPLpS3M4QbTn/P4siRLJJ3uFL6003W96ib3mN8 57WiY7AzhyS5veTpmeSZpeYpAh3h88ZBQThXbFEuscD/9Ljz/Zm0NbYCMeQ4PYb7zP vN7iy/zCALSng== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pbLer-00Gztq-DE; Sun, 12 Mar 2023 13:22:41 +0000 Date: Sun, 12 Mar 2023 13:22:40 +0000 Message-ID: <87356a5ckf.wl-maz@kernel.org> From: Marc Zyngier To: Ricardo Koller Cc: pbonzini@redhat.com, oupton@google.com, yuzenghui@huawei.com, dmatlack@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, qperret@google.com, catalin.marinas@arm.com, andrew.jones@linux.dev, seanjc@google.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, eric.auger@redhat.com, gshan@redhat.com, reijiw@google.com, rananta@google.com, bgardon@google.com, ricarkol@gmail.com Subject: Re: [PATCH v6 12/12] KVM: arm64: Use local TLBI on permission relaxation In-Reply-To: <20230307034555.39733-13-ricarkol@google.com> References: <20230307034555.39733-1-ricarkol@google.com> <20230307034555.39733-13-ricarkol@google.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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ricarkol@google.com, pbonzini@redhat.com, oupton@google.com, yuzenghui@huawei.com, dmatlack@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, qperret@google.com, catalin.marinas@arm.com, andrew.jones@linux.dev, seanjc@google.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, eric.auger@redhat.com, gshan@redhat.com, reijiw@google.com, rananta@google.com, bgardon@google.com, ricarkol@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 07 Mar 2023 03:45:55 +0000, Ricardo Koller wrote: > > From: Marc Zyngier Thanks for writing a commit message for my hacks! > > Broadcasted TLB invalidations (TLBI) are usually less performant than More precisely, TLBIs targeting the Inner Shareable domain. Also, 's/broadcasted/broadcast/', as this is an adjective and not a verb indicative of the past tense.. > their local variant. In particular, we observed some implementations non-shareable rather than local. 'Local' has all sort of odd implementation specific meanings (local to *what* is the usual question that follows...). > that take millliseconds to complete parallel broadcasted TLBIs. > > It's safe to use local, non-shareable, TLBIs when relaxing permissions s/local// > on a PTE in the KVM case for a couple of reasons. First, according to > the ARM Arm (DDI 0487H.a D5-4913), permission relaxation does not need > break-before-make. This requires some more details, and references to the latest revision of the ARM ARM (0487I.a). In that particular revision, the relevant information is contained in D8.13.1 "Using break-before-make when updating translation table entries", and more importantly in the rule R_WHZWS, which states that only a change of output address or block size require a BBM. > Second, the VTTBR_EL2.CnP==0 case, where each PE > has its own TLB entry for the same page, is tolerated correctly by KVM > when doing permission relaxation. Not having changes broadcasted to > all PEs is correct for this case, as it's safe to have other PEs fault > on permission on the same page. I'm not sure mentioning CnP is relevant here. If CnP==1, the TLBI will nuke the TLB visible by the sibling PE, but not any other. So this is always a partial TLB invalidation, irrespective of CnP. Thanks, M. -- Without deviation from the norm, progress is not possible.