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 8E56AC433EF for ; Thu, 23 Dec 2021 11:45:03 +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=FhfHyg5NgAPhyl2G4EdyZpKUwfIZp3lnHBUxaqclypM=; b=UgPj6hnfr0mUXr /rVo6GUfu/nRRbA4lVHbP/3AOiuadLB2VI6hOXBOVllbF5wJtgp1gZzVHJa8s4pZMTrHAFJWLK2Y1 QW58/vkH73V+k0PAh6eKwHHhw8djf61zRMz62GgwfA7iZVgtIh3cqRWh5HvF0juGOQSCdCToVRQx2 ixhUwUbxumZgJiDG0gbD/NAJ00g1Fxd3iP/HnU11YZPqR22cyOOXFmLCSaA1KFOEzPbVEJ1qtU/lh G99idvue6g4Z2IMu7G7yQeZVAn3HuewCQirV+8Bdzy5D0LCUNpK7r6wxM3olcEIjTEH6rwbnhnCKC w7Cn2CgOyaeAHhZfc06Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0MVo-00CbuD-IF; Thu, 23 Dec 2021 11:43:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0MVl-00Cbtk-3c for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 11:43:54 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 9DFD761E2E; Thu, 23 Dec 2021 11:43:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA6D0C36AE9; Thu, 23 Dec 2021 11:43:50 +0000 (UTC) Date: Thu, 23 Dec 2021 11:43:47 +0000 From: Catalin Marinas To: D Scott Phillips Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , Will Deacon , Darren Hart , patches@amperecomputing.com Subject: Re: [PATCH v5] arm64: errata: Fix exec handling in erratum 1418040 workaround Message-ID: References: <20211220234114.3926-1-scott@os.amperecomputing.com> <86wnjwfwk4.fsf@scott-ph-mail.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <86wnjwfwk4.fsf@scott-ph-mail.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_034353_213472_BF051D3A X-CRM114-Status: GOOD ( 21.18 ) 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 Wed, Dec 22, 2021 at 08:12:27AM -0800, D Scott Phillips wrote: > Catalin Marinas writes: > > On Mon, Dec 20, 2021 at 03:41:14PM -0800, D Scott Phillips wrote: > >> The erratum 1418040 workaround enables CNTVCT_EL1 access trapping in EL0 > >> when executing compat threads. The workaround is applied when switching > >> between tasks, but the need for the workaround could also change at an > >> exec(), when a non-compat task execs a compat binary or vice versa. Apply > >> the workaround in arch_setup_new_exec(). > >> > >> This leaves a small window of time between SET_PERSONALITY and > >> arch_setup_new_exec where preemption could occur and confuse the old > >> workaround logic that compares TIF_32BIT between prev and next. Instead, we > >> can just read cntkctl to make sure it's in the state that the next task > >> needs. I measured cntkctl read time to be about the same as a mov from a > >> general-purpose register on N1. Update the workaround logic to examine the > >> current value of cntkctl instead of the previous task's compat state. > >> > >> Fixes: d49f7d7376d0 ("arm64: Move handling of erratum 1418040 into C code") > >> Signed-off-by: D Scott Phillips > >> Cc: # 5.4.x > > > > Why 5.4? I think the fixed commit is 5.9. > > d49f7d7376d0 got backported into v5.4.62's 82b05f0838aa. That looks like > that's the farthest it's made it back. Is this the correct way to handle > fixing the backported change, or should a separate backport be sent to > 5.4 for the fix? If it applies cleanly to 5.4.62, I'll just tweak the fixes line back to 5.4 (I changed it to 5.9 as I have a git hook that adjusts the Fixes line automatically when applying). If it doesn't apply cleanly, you can send it separately. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel