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 4F1B9C433EF for ; Wed, 22 Dec 2021 15:26:27 +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=AqQKjZeOvaiD/CNpcr7iOxuNjaGBs2f1n8xsurY6H+U=; b=p/slVlvNVcAurx QKI+v5XUckSYpzMNoo73xCJMM83JP9Piwr0AEkGmnxQR04DEB0Zsq7K214ZOBYp5PdzAvryo/ddx+ 4c5lzCZ/i/jhEahp8LVscLl3/tSdd+eUVR5uPz6MqgnMLQEa0LMIFtIlvfOyFWpL5IC4Glod1m2dM k4FucKPcErSg4avSuo6f+mZrAgeQYAeLtZZQxhkkRebvIf4sj9bB9EtMZjCsuczQseiuQ3exClGXm pRd1kRk4VFpstb9vrd79LqE6cP3ebC25XD6xKd6Eo7t1fIZDPQy/Is2WTp4+JvxnkKTWkUaQ7T6Y5 2COlXiQnHrhSc7/wjeHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n03UP-00Ak2S-FM; Wed, 22 Dec 2021 15:25:13 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n03UL-00Ak16-Cr for linux-arm-kernel@lists.infradead.org; Wed, 22 Dec 2021 15:25:10 +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 ams.source.kernel.org (Postfix) with ESMTPS id 1C3A1B81D12; Wed, 22 Dec 2021 15:25:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6729C36AE5; Wed, 22 Dec 2021 15:25:03 +0000 (UTC) Date: Wed, 22 Dec 2021 15:25:00 +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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211220234114.3926-1-scott@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_072509_600164_63BE75C9 X-CRM114-Status: GOOD ( 15.49 ) 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 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. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel