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 7443AC433EF for ; Mon, 16 May 2022 09:36:44 +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=Otz4HkMTtj4LOsL4PlS60faOeP71wSb8ri/bpaLDCpA=; b=lg/l63UHUyjzjw H/huWqS25DXCTKDHkTkgdJau/tmg3IeJTYNcptcQvCjlyucvr8pwFAap+M0bWvhLjuCaqGyB8uSSp 3m6QGg9+fYA4w7Xala8fALErUHLqWfyz9qslJ4YW6xd/27cs49c7CQN2Qbj3F1Um/yD75nQVpwGnD yVeAx3ru1zqmw8mbGzwMpDNbbzrZk5JkdGpOVPuatCqEFez7aaW1bWPB/21C3OgRZmW7BeibMhhGh asjmhhm+PPT+HzgXTWODGGIkpdVFD3TA/gdmzZq/B3yGpSgyqarng72n1z6KhRhA3sneOXU7dA4jB VaPu64x+anNau7cSockQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqX8T-006uN5-Bf; Mon, 16 May 2022 09:35:29 +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 1nqX8P-006uME-Ur for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 09:35:27 +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 51293612B7; Mon, 16 May 2022 09:35:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E9EAC34116; Mon, 16 May 2022 09:35:23 +0000 (UTC) Date: Mon, 16 May 2022 10:35:19 +0100 From: Catalin Marinas To: Andre Przywara Cc: Will Deacon , Shuah Khan , linux-arm-kernel@lists.infradead.org, Mark Brown , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kselftest/arm64: bti: force static linking Message-ID: References: <20220511172129.2078337-1-andre.przywara@arm.com> <20220516102935.67505a91@donnerap.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220516102935.67505a91@donnerap.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220516_023526_069012_C9852657 X-CRM114-Status: GOOD ( 22.90 ) 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, May 16, 2022 at 10:29:35AM +0100, Andre Przywara wrote: > On Sun, 15 May 2022 11:05:23 +0100 > Catalin Marinas wrote: > > On Wed, May 11, 2022 at 06:21:29PM +0100, Andre Przywara wrote: > > > The "bti" selftests are built with -nostdlib, which apparently > > > automatically creates a statically linked binary, which is what we want > > > and need for BTI (to avoid interactions with the dynamic linker). > > > > > > However this is not true when building a PIE binary, which some > > > toolchains (Ubuntu) configure as the default. > > > When compiling btitest with such a toolchain, it will create a > > > dynamically linked binary, which will probably fail some tests, as the > > > dynamic linker might not support BTI: > > > =================== > > > TAP version 13 > > > 1..18 > > > not ok 1 nohint_func/call_using_br_x0 > > > not ok 2 nohint_func/call_using_br_x16 > > > not ok 3 nohint_func/call_using_blr > > > .... > > > =================== > > > > > > To make sure we create static binaries, add an explicit -static on the > > > linker command line. This forces static linking even if the toolchain > > > defaults to PIE builds, and fixes btitest runs on BTI enabled machines. > > > > > > Signed-off-by: Andre Przywara > > > > Does this need to go in as a fix (cc stable, fixes tag)? > > I dimly remember some discussion about stable fixes not being a real thing > for the selftests? In any case: > > Fixes: 314bcbf09f14 ("kselftest: arm64: Add BTI tests") I'll add the fixes tag. I can see the occasional cc stable for kselftest patches. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel