Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp157866rdh; Mon, 21 Aug 2023 10:34:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFztr1Zr/Z3And+iEVtHLqbxdBzOYuK3msfSVHZEQa34SrCQ7HM9FPDL7lQAbG6Xs3OVFyl X-Received: by 2002:a17:906:aadb:b0:99d:fc31:242f with SMTP id kt27-20020a170906aadb00b0099dfc31242fmr5900144ejb.66.1692639245950; Mon, 21 Aug 2023 10:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692639245; cv=none; d=google.com; s=arc-20160816; b=OMB7yxN2Ahftvk1jMWD17r5ihgufDPMqdvt0ZPnF6N7ihCQyB1ke+aD6Cpr8EMCJ+C tiTnA4GijoDRrLxCS2eoBfSTPH+p43YOazj/dBUXrhGIh0gxyzAvfZ8H1EUP2wsz1w1p wm2P7fWUUGZku77gxYhJIOvaN8E0sal6IsxW8GQYMHnZN/mswUiSu4rQQEWaTlN16lFk TepjvyHGNoaA0Jmnq0ihK+CAlOw/04SKGA+iO9GWpXxpxhiKfMwBnKlTzAgXRYvY5WtB 08j7HtpUcKdHVZiOlHcEN/H+s2KW9wYWlO7vHHZaWk6W+k0KFeUpQvvWxg3U6M0SILZU iKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=h84qWKgjU1fMoYOIcASBmzzUgyNZ0l+ub8Sh/Tq17gw=; fh=sjG75NMdIRxuePNRM8C/198p4yrsBEHnCvu6soxZn9w=; b=nyhPr0h/m5WiDABl0kYil7r3M3ORBFBuvgYKa5XOKYqnHenPdfWnKaHaVKS00Erjwn xuzcyZiVbqY5Ro13bmwQ/Yo6fxirPPdP1Oq42vYCUkzzPFEJmho9O1QdU4vZlKHrY3Rh qFk1LjttkfDXLlZeNmLs3vajhZkQ70tL/xOCYp2/EBc9BGvBaaB0vQdjZw9E7IDDufQn ozRZhNQG+gkkkOfCxlGknkiJWZ6brX0SJGfXRHUnNGGGgIiLg9XyoHbTf6KFIlijM/U9 5TrEvTCR4BkZRy8UVYIaOApeXlC+TXrnJ9OOloszteNO1LiBmtvDQQ5aRrr7z/NEvuUq NN+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a170906264d00b00992e9af8186si6005513ejc.13.2023.08.21.10.33.41; Mon, 21 Aug 2023 10:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236292AbjHUQM7 (ORCPT + 99 others); Mon, 21 Aug 2023 12:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbjHUQM6 (ORCPT ); Mon, 21 Aug 2023 12:12:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 24B5EA8; Mon, 21 Aug 2023 09:12:56 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC8CA2F4; Mon, 21 Aug 2023 09:13:36 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.4.98]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A43153F64C; Mon, 21 Aug 2023 09:12:54 -0700 (PDT) Date: Mon, 21 Aug 2023 17:12:51 +0100 From: Mark Rutland To: "GONG, Ruiqi" , Steven Rostedt Cc: Masami Hiramatsu , Florent Revest , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, gongruiqi1@huawei.com Subject: Re: [PATCH] samples: ftrace: replace bti assembly with hint for older compiler Message-ID: References: <20230820111509.1470826-1-gongruiqi@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230820111509.1470826-1-gongruiqi@huaweicloud.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 20, 2023 at 07:15:09PM +0800, GONG, Ruiqi wrote: > From: "GONG, Ruiqi" > > When cross-building the arm64 kernel with allmodconfig using GCC 9.4, > the following error occurs on multiple files under samples/ftrace/: > > /tmp/ccPC1ODs.s: Assembler messages: > /tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c' > > Fix this issue by replacing `bti c` with `hint 34`, which is compatible > for the older compiler. > > Signed-off-by: GONG, Ruiqi Sorry about this; I'd forgotten about earlier compilers when reviewing the original patch. It's a bit unfortunate to have to hand-code this each time, but I'm not sure that it'd actually be cleaner to have a macro. For the moment, I reckon this is worth taking as-is. Steve, are you happy to add: Fixes: 8c3526fb86060cb5 ("arm64: ftrace: Add direct call trampoline samples support") Acked-by: Mark Rutland ... ? Thanks, Mark. > --- > samples/ftrace/ftrace-direct-modify.c | 4 ++-- > samples/ftrace/ftrace-direct-multi-modify.c | 4 ++-- > samples/ftrace/ftrace-direct-multi.c | 2 +- > samples/ftrace/ftrace-direct-too.c | 2 +- > samples/ftrace/ftrace-direct.c | 2 +- > 5 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c > index e5ed08098ff3..e2a6a69352df 100644 > --- a/samples/ftrace/ftrace-direct-modify.c > +++ b/samples/ftrace/ftrace-direct-modify.c > @@ -105,7 +105,7 @@ asm ( > " .type my_tramp1, @function\n" > " .globl my_tramp1\n" > " my_tramp1:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #16\n" > " stp x9, x30, [sp]\n" > " bl my_direct_func1\n" > @@ -117,7 +117,7 @@ asm ( > " .type my_tramp2, @function\n" > " .globl my_tramp2\n" > " my_tramp2:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #16\n" > " stp x9, x30, [sp]\n" > " bl my_direct_func2\n" > diff --git a/samples/ftrace/ftrace-direct-multi-modify.c b/samples/ftrace/ftrace-direct-multi-modify.c > index 292cff2b3f5d..2e349834d63c 100644 > --- a/samples/ftrace/ftrace-direct-multi-modify.c > +++ b/samples/ftrace/ftrace-direct-multi-modify.c > @@ -112,7 +112,7 @@ asm ( > " .type my_tramp1, @function\n" > " .globl my_tramp1\n" > " my_tramp1:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #32\n" > " stp x9, x30, [sp]\n" > " str x0, [sp, #16]\n" > @@ -127,7 +127,7 @@ asm ( > " .type my_tramp2, @function\n" > " .globl my_tramp2\n" > " my_tramp2:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #32\n" > " stp x9, x30, [sp]\n" > " str x0, [sp, #16]\n" > diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-direct-multi.c > index b4391e08c913..9243dbfe4d0c 100644 > --- a/samples/ftrace/ftrace-direct-multi.c > +++ b/samples/ftrace/ftrace-direct-multi.c > @@ -75,7 +75,7 @@ asm ( > " .type my_tramp, @function\n" > " .globl my_tramp\n" > " my_tramp:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #32\n" > " stp x9, x30, [sp]\n" > " str x0, [sp, #16]\n" > diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-direct-too.c > index e9804c5307c0..e39c3563ae4e 100644 > --- a/samples/ftrace/ftrace-direct-too.c > +++ b/samples/ftrace/ftrace-direct-too.c > @@ -81,7 +81,7 @@ asm ( > " .type my_tramp, @function\n" > " .globl my_tramp\n" > " my_tramp:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #48\n" > " stp x9, x30, [sp]\n" > " stp x0, x1, [sp, #16]\n" > diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c > index 20f4a7caa810..32c477da1e9a 100644 > --- a/samples/ftrace/ftrace-direct.c > +++ b/samples/ftrace/ftrace-direct.c > @@ -72,7 +72,7 @@ asm ( > " .type my_tramp, @function\n" > " .globl my_tramp\n" > " my_tramp:" > -" bti c\n" > +" hint 34\n" // bti c > " sub sp, sp, #32\n" > " stp x9, x30, [sp]\n" > " str x0, [sp, #16]\n" > -- > 2.25.1 >