From owner-dev-commits-src-all@freebsd.org Wed Dec 30 23:00:05 2020 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CFA04D21D3; Wed, 30 Dec 2020 23:00:05 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5mvn17HXz4q2l; Wed, 30 Dec 2020 23:00:05 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 18E527AE7; Wed, 30 Dec 2020 23:00:05 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 0F9D127C0054; Wed, 30 Dec 2020 18:00:05 -0500 (EST) Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Wed, 30 Dec 2020 18:00:05 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepheeiieekkeffkeelkeel geetgfeltdetgffhudetieekveefvdfhgefgffdujefgnecuffhomhgrihhnpehfrhgvvg gsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhf rhhomhepsggurhgrghhonhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqud dtgedvfeehkeeigedqudekuddtkeehuddqsggurhgrghhonheppefhrhgvvgeuufffrdho rhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 518D2C200A5; Wed, 30 Dec 2020 18:00:05 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.1-61-gb52c239-fm-20201210.001-gb52c2396 Mime-Version: 1.0 Message-Id: <63205fd6-7a3b-4e7e-a717-4d250c49ecc9@www.fastmail.com> In-Reply-To: <202012302245.0BUMjrBF032453@gitrepo.freebsd.org> References: <202012302245.0BUMjrBF032453@gitrepo.freebsd.org> Date: Wed, 30 Dec 2020 16:59:44 -0600 From: "Brandon Bergren" To: "Piotr Kubaj" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: =?UTF-8?Q?Re:_git:_7d7f26f5b613_-_main_-_powerpc/radix=5Fmmu:_Apply_erra?= =?UTF-8?Q?ta_fixes_for_POWER9_TLB_invalidation_bug?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 23:00:05 -0000 Approved-By: bdragon (in IRC) On Wed, Dec 30, 2020, at 4:45 PM, Piotr Kubaj wrote: > The branch main has been updated by pkubaj (ports committer): > > URL: > https://cgit.FreeBSD.org/src/commit/?id=7d7f26f5b613bf54ab30b86f9a03ca8bb3f10bb9 > > commit 7d7f26f5b613bf54ab30b86f9a03ca8bb3f10bb9 > Author: Justin Hibbits > AuthorDate: 2020-05-14 15:50:27 +0000 > Commit: Piotr Kubaj > CommitDate: 2020-12-30 22:45:21 +0000 > > powerpc/radix_mmu: Apply errata fixes for POWER9 TLB invalidation bug > > Found in Linux, the only apparent source of errata documentation. > --- > sys/powerpc/aim/mmu_radix.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c > index cd067f96d90a..5833739a25df 100644 > --- a/sys/powerpc/aim/mmu_radix.c > +++ b/sys/powerpc/aim/mmu_radix.c > @@ -193,7 +193,19 @@ radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, > uint32_t pid, uint32_t lpid, > rs = ((uint64_t)pid << 32) | lpid; > rb = va | is | ap; > __asm __volatile(PPC_TLBIE_5(%0, %1, %2, %3, 1) : : > - "r" (rb), "r" (rs), "i" (ric), "i" (prs)); > + "r" (rb), "r" (rs), "i" (ric), "i" (prs) : "memory"); > +} > + > +static __inline void > +radix_tlbie_fixup(uint32_t pid, vm_offset_t va, int ap) > +{ > + > + __asm __volatile("ptesync" ::: "memory"); > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, ap); > + __asm __volatile("ptesync" ::: "memory"); > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, pid, 0, va, ap); > } > > static __inline void > @@ -202,6 +214,7 @@ radix_tlbie_invlpg_user_4k(uint32_t pid, vm_offset_t va) > > radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_4K); > + radix_tlbie_fixup(pid, va, TLBIE_ACTUAL_PAGE_4K); > } > > static __inline void > @@ -210,6 +223,7 @@ radix_tlbie_invlpg_user_2m(uint32_t pid, vm_offset_t va) > > radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_2M); > + radix_tlbie_fixup(pid, va, TLBIE_ACTUAL_PAGE_2M); > } > > static __inline void > @@ -234,6 +248,7 @@ radix_tlbie_invlpg_kernel_4k(vm_offset_t va) > > radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_4K); > + radix_tlbie_fixup(0, va, TLBIE_ACTUAL_PAGE_4K); > } > > static __inline void > @@ -242,6 +257,7 @@ radix_tlbie_invlpg_kernel_2m(vm_offset_t va) > > radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_2M); > + radix_tlbie_fixup(0, va, TLBIE_ACTUAL_PAGE_2M); > } > > /* 1GB pages aren't currently supported. */ > @@ -251,6 +267,7 @@ radix_tlbie_invlpg_kernel_1g(vm_offset_t va) > > radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_1G); > + radix_tlbie_fixup(0, va, TLBIE_ACTUAL_PAGE_1G); > } > > static __inline void > @@ -2757,6 +2774,7 @@ setpte: > pmap_pv_promote_l3e(pmap, va, newpde & PG_PS_FRAME, lockp); > > pte_store(pde, PG_PROMOTED | newpde); > + ptesync(); > atomic_add_long(&pmap_l3e_promotions, 1); > CTR2(KTR_PMAP, "pmap_promote_l3e: success for va %#lx" > " in pmap %p", va, pmap); > -- Brandon Bergren bdragon@FreeBSD.org