Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5564055rwn; Mon, 12 Sep 2022 10:53:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Allqq4n4Y3xGbSnyY8TINn0Ql+rEsuS3i+BZM8SRJnZ3Z83lwB6avYj8eTaFQrRcsjvxC X-Received: by 2002:a63:1a1f:0:b0:438:d11b:e23d with SMTP id a31-20020a631a1f000000b00438d11be23dmr8763253pga.335.1663005209142; Mon, 12 Sep 2022 10:53:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663005209; cv=pass; d=google.com; s=arc-20160816; b=APLp9XpXW7vYTxxEHnldnBH+WnyfMD3iX8qSnL+w5gs4oEyr5c6RdUWa1/9pJqWHMM jOBcxgvtMPMu7jYLvDReNH2taUzADyTgGXa3/cvEcegqzhQu21Kw1goqXhny0iFiK3TR AlyUtn0kWRvedHCxk7XXT8cx8WrIxu6kN+n0HDR/mpxlrtiXPjdAN0DoZTcjQlmcYHta CRK0LERvznb59G66e46ouKI7SyMStDO0SJVs9CSWNJqrzmxod3szYdjpsER3krlEPpg4 ia3TZTLn52wLgtDO+7K90hoP0cF2V0Xv6VfHPalluULnX0aP41X5mf+fPCkcssubSYUF 1xFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=oco2PU1eE87Z2buWe2Giwe9gG4oENGG/ZhrUbk9VCcU=; b=eYGs3dph5LTE9SD6pcTGU4JUqAXLFrl8HY1QpCRAOyGwTG7ijzd+RYO929cELpOVrD qBciJIAZ+aBX72RTesUZZrDMa5IjVTbFSskABmhqkuLrkVg9F60TCRrQF2oaEKJ9uaVc ntx1uN927j0R2Ix+ZkQujMBjRfiJeyzgUX2wLrgROlaN7zIkbm+dZgoZkLU+7w0P0Ixc NoPEeGDr0C/y9ybJtvAUM9azn2UIdI9PYhKSL1mxHT/SH6VfRQPKn3Oisrksn13EuTOD rQg9l4jB46+mL/2IVhEWqfO0sQUpsmurJadP4bxaEibtKfS1sSSvKkmGss/c9r2p1KHy Py4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=JX7Pb6fr; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a625403000000b005384c4b7969si5988677pfb.316.2022.09.12.10.53.16; Mon, 12 Sep 2022 10:53:29 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=JX7Pb6fr; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbiILRaO (ORCPT + 99 others); Mon, 12 Sep 2022 13:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbiILRaL (ORCPT ); Mon, 12 Sep 2022 13:30:11 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89B4C1E3EE; Mon, 12 Sep 2022 10:30:09 -0700 (PDT) Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 28CEZrxI015723; Mon, 12 Sep 2022 10:29:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=facebook; bh=oco2PU1eE87Z2buWe2Giwe9gG4oENGG/ZhrUbk9VCcU=; b=JX7Pb6fraCh1RVwBHwjVFbD3vGRInk1/TVrYEU9Q4mNFzhWyDPlBYwqwiuOJv6lpftAj T6XGj3dBBx1IK/MzDGU0TSiBLV35CcsJ2nomPNW5hVbBMAk/+m+2X23EXXusby0o/BtX mFWaKUT50HNNE32utMG5RKRSaH64odbyPXU= Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by m0089730.ppops.net (PPS) with ESMTPS id 3jgp39bvs0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Sep 2022 10:29:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEo0ve6RcRS+jAfCn7zMS8O51rGRjf2ToV5J6t5eyPrCbKYSupuuDm+SKHDvZUURntIrSHJ3E67ofkyhmXuQEr6ZO2UghX5Cvku/zJbiIhX8TM2ozKYmWST0PaU4QsSZ8OgeMhrrd5aKm/9amTum/7ZAelzu2IN8W1QRQhyN1BfWYAx2Fz0bqL6SmzwYjMsAq/xu0Ljl+yRwqmRejH7RxyybH84qYFo5qqn9DM2h7FwZaiHb+4sHDV3Ca2Qe8xB8O0sEFrl28/1s0/P8Tv2WMMm50CTarqQbYc/8IxKXkAEnd3PNprEW5Q3p8UaXd6lE7OI18iBwMvjVNPdYQ4qapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oco2PU1eE87Z2buWe2Giwe9gG4oENGG/ZhrUbk9VCcU=; b=HURv4xyj/k7sFQYo8t6eD3TxFgmcDTlVkH5NYKrVvR5N9kIVUeb7VJgMTf1TW8XNjfEDsJZw86ubT4p+yvvag71VvFJkGtrQFU1Pgdkfimn/bCH0sAzH22Z3qd47F1tWoNWohbDM/KEit0nw+Ez/SqN74Oqj0CgiwjZeenXJXgiDwta6eicbonwv3/2FddjZM0aoDAhPpHW/LkPNDuKgnz44s5IC36jIIiigECfsGgETaj6WlE9aRtgpOhqRzYfTYObXnDszShrjU2gB7BE0Wy5ndvEIJCnCBnd4FFXkQDmaQGPhCThPsid5ApETqnDbqO/ia0qhV36GjDCglZVB+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none Received: from SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) by BYAPR15MB2741.namprd15.prod.outlook.com (2603:10b6:a03:156::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Mon, 12 Sep 2022 17:29:40 +0000 Received: from SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::cdbe:b85f:3620:2dff]) by SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::cdbe:b85f:3620:2dff%4]) with mapi id 15.20.5612.022; Mon, 12 Sep 2022 17:29:40 +0000 Message-ID: <7cb9ebd2-5ee1-f00e-5d8e-0fe454f975a0@fb.com> Date: Mon, 12 Sep 2022 18:29:33 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2] libbpf: define bpf_tail_call_static when __clang__ is not defined Content-Language: en-US To: James Hilliard , bpf@vger.kernel.org Cc: Daniel Borkmann , Andrii Nakryiko , Alexei Starovoitov , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev References: <20220912063514.2824432-1-james.hilliard1@gmail.com> From: Yonghong Song In-Reply-To: <20220912063514.2824432-1-james.hilliard1@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BY3PR10CA0015.namprd10.prod.outlook.com (2603:10b6:a03:255::20) To SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR1501MB2064:EE_|BYAPR15MB2741:EE_ X-MS-Office365-Filtering-Correlation-Id: fbef7fc5-75e7-4fd2-ae6e-08da94e45f8c X-FB-Source: Internal X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KoxgAklexTrbT8kHRFgIvOhSZ+KKA058Zej99UuYsxcL+tq0BU3AxDrJEx7WvxSdaeV8leNKEB/kT9+H80JZzCJs4djA0QWcwKuMUWYK4nrTaLkyfmRBbq7rw1E/idXcihdBpDQ0gANRo7ISLPIV4BYUnxJ9FJjeSH1PUpcTOPpdbqC6gOchH6ekb+Bd5fZyoZJkH5RfHZPJ6ehWxl92ri10c558DkU0wz7iU0Q+LpkbNS0lZelRqVguQrolHJ8qpq51PRcBv/grWghgCpx8kCbY76VSri9oq7v5PgON0PT88pj/cMMprNkaZnakDhtyekzwrd/xsQW308z3ploqwr6rfitXqpVK6U4J+LH2KNT3xySJzZfbbyqqJDnGpSbYt6/2akXqH3nSxuAqbG6Vx303HJJrHJH2S5U61JxOP+Uhi9j2R2ff7zAq0cS0LVjPWgJ4wA6QQGLibyikrCmZBxlNX/lwdYbsOwvVJbuzD+V9U+z98xkpXcmIXfCWfhapcGT7NCla5WwLxO+uTh94jCBwbGFqx4TinYfOJ56sAvuUsrA38mQvlHJqkmG2pY4Kq5yJ0aGT4yQAeoJQyy/biOhbO+cDqdUHqKRPwtxBSJYiqBxAPfndNzDz8ojDnxKgRHAHthUpj/WEkIQ3GNLow55ySxYkHQ9YmFeNpqDwQYsWKlnKnFzcnlHAatNVBGetgw8m6TCxQ/8GMTEMtm6QHREaF3zU8nPw+OBh93GtOniczzNQXylvGrBYaGFn1MNbqpoRgyhkQhveEOxrJJ9rly4xWzxf0MdHt4LSZHi9NOY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR1501MB2064.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199015)(53546011)(6506007)(6486002)(4326008)(186003)(8676002)(36756003)(2906002)(31686004)(41300700001)(6512007)(478600001)(54906003)(66946007)(66556008)(66476007)(7416002)(5660300002)(38100700002)(316002)(6666004)(83380400001)(2616005)(86362001)(8936002)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cHNvbnB2L1NSWnZZc0lNVkNIMUFEZzlHT0hNK0R2MWhsNG1hdVBJeXQybW84?= =?utf-8?B?dDQwVFlqdUJxeldZQUhyTGRQZXFyT3c0OFZnZDVKck93TUVxZmRsQXlMRzZE?= =?utf-8?B?RE11Zyt0ZUdRQWJUVVhPb3BDb0VNNFppWVY1bjF6dkRoUVF3ZHBxOE1XL3ps?= =?utf-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kQ0NmZ0l2cWdQ?= =?utf-8?B?bmxLRWY1Q2ZvbHFnVEp1eUx1eUFDYmJuaHljcnl4T1hpQVdTdHRUV3hoYXNa?= =?utf-8?B?SnhZbUE0c0tvcWRZdFY3ZGJsT1c1dEduL1dKZzBLVjdIZjlhMGx3dzluWCtV?= =?utf-8?Q?RAJqiJsBo5ykpAyT2u+ER98VK?= X-OriginatorOrg: fb.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbef7fc5-75e7-4fd2-ae6e-08da94e45f8c X-MS-Exchange-CrossTenant-AuthSource: SN6PR1501MB2064.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 17:29:40.4105 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +IwIjXc/N3pG2ZW+LUdv8NMXSZsOtyuWOuT+6uFnmg5V1VdG2nQ7dimyXz7mEc96 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2741 X-Proofpoint-GUID: ErESJmRdkgGJiV8c56XQXRzRlskc0FUr X-Proofpoint-ORIG-GUID: ErESJmRdkgGJiV8c56XQXRzRlskc0FUr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-12_12,2022-09-12_02,2022-06-22_01 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 9/12/22 7:35 AM, James Hilliard wrote: > The bpf_tail_call_static function is currently not defined unless > using clang >= 8. > > To support bpf_tail_call_static on GAS we can check if __clang__ is > not defined to enable bpf_tail_call_static. > > We need to use a GAS assembly syntax check so that the assembler > is provided GAS compatible assembly as well. > > We can use gasversion to provide a migration path to llvm syntax > for GAS once llvm syntax is natively supported. I didn't see a gasversion comparison in asm code. Is it possible that we compare gasversion to a known gas version which supports new syntax? If the gasversion is supported, use the same syntax as llvm. If the gasversion is not supported, output an illegal insn and it would be even better if some error information is printed out on the screen. > > Signed-off-by: James Hilliard > Signed-off-by: Daniel Borkmann > --- > Changes v1 -> v2: > - use gasversion to detect assembly variant > --- > tools/lib/bpf/bpf_helpers.h | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h > index 7349b16b8e2f..5b98f5506798 100644 > --- a/tools/lib/bpf/bpf_helpers.h > +++ b/tools/lib/bpf/bpf_helpers.h > @@ -131,7 +131,7 @@ > /* > * Helper function to perform a tail call with a constant/immediate map slot. > */ > -#if __clang_major__ >= 8 && defined(__bpf__) > +#if (!defined(__clang__) || __clang_major__ >= 8) && defined(__bpf__) > static __always_inline void > bpf_tail_call_static(void *ctx, const void *map, const __u32 slot) > { > @@ -139,8 +139,8 @@ bpf_tail_call_static(void *ctx, const void *map, const __u32 slot) > __bpf_unreachable(); > > /* > - * Provide a hard guarantee that LLVM won't optimize setting r2 (map > - * pointer) and r3 (constant map index) from _different paths_ ending > + * Provide a hard guarantee that the compiler won't optimize setting r2 > + * (map pointer) and r3 (constant map index) from _different paths_ ending > * up at the _same_ call insn as otherwise we won't be able to use the > * jmpq/nopl retpoline-free patching by the x86-64 JIT in the kernel > * given they mismatch. See also d2e4c1e6c294 ("bpf: Constant map key > @@ -148,12 +148,18 @@ bpf_tail_call_static(void *ctx, const void *map, const __u32 slot) > * > * Note on clobber list: we need to stay in-line with BPF calling > * convention, so even if we don't end up using r0, r4, r5, we need > - * to mark them as clobber so that LLVM doesn't end up using them > - * before / after the call. > + * to mark them as clobber so that the compiler doesn't end up using > + * them before / after the call. > */ > - asm volatile("r1 = %[ctx]\n\t" > + asm volatile(".ifdef .gasversion.\n\t" > + "mov %%r1,%[ctx]\n\t" > + "mov %%r2,%[map]\n\t" > + "mov %%r3,%[slot]\n\t" > + ".else\n\t" > + "r1 = %[ctx]\n\t" > "r2 = %[map]\n\t" > "r3 = %[slot]\n\t" > + ".endif\n\t" > "call 12" > :: [ctx]"r"(ctx), [map]"r"(map), [slot]"i"(slot) > : "r0", "r1", "r2", "r3", "r4", "r5");