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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB976C77B73 for ; Thu, 27 Apr 2023 16:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244108AbjD0Qf2 (ORCPT ); Thu, 27 Apr 2023 12:35:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243284AbjD0Qf1 (ORCPT ); Thu, 27 Apr 2023 12:35:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A070746BE for ; Thu, 27 Apr 2023 09:35:26 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33RFn0qj002556; Thu, 27 Apr 2023 16:35:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=s96Eq/nNhlzG3nsRQVxx5cuExfxP081CKBLulXkW1Nc=; b=V9tuKj+FmPM4CXf896Ys1p8VSv/8Nz4JicScX0iAnKy2byzAh3MNGJ00vL2B7gxOrdoZ 8TnMvEoxnmwQ2QvsyR8UjjXBv4ecggxLpBdMtSGzJ7wiAkp6A3ELNXyb925jqYKf/3ir r+uemMUcqcf2JKsnDR6rsEMRQ4NTFIN3BKJCPlnoahYmOyvQ7aYb6dDCvChst3w2am8F 0lI7uKpPA8QwFA+wF7BhGiDL0QlgqwmK9sYw9IAngcvmR04q88NliItk22LcREh5QvM2 0ku5+WAWnOBZHbE0guxH+sHW0kW9tpgKkykw3UR5HbNGi02sBIp6JTU6GpusimEDFNHi vQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q484uve03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Apr 2023 16:35:20 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33RFTsad007340; Thu, 27 Apr 2023 16:35:19 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2043.outbound.protection.outlook.com [104.47.74.43]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4619jxw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Apr 2023 16:35:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mD61xr6i7dwby2KOck3+UV4bwYMjjEmt3MO4UhuBjU0+aFT6mbqOM/LKaoap9LpUE27nTiAJhm5rEAXGe+s15LBZ/3Kd5FTpYbpOW2GcWPcLrAV8Q/czzeJwF95CGzIxnusU3ybsxofm0ptgtodUKz/pzOPfr7vKhG5faFwBqi8ux7LqoEwAUUaEval1OOThGsfECtw4YDijG+3FaQUIBAPZHaiJ0fdca/sneWw9u2gyMGVgMCeKUfKfYy/9UU14fSCGVLT7jVQ4DTR+GXKYSz+I8Xh6Y4rVYYLCBITF0dn4aR8P6IGtk/HvY2cU2NUYCBLgvd6ixH0XN3VizD+JxA== 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=s96Eq/nNhlzG3nsRQVxx5cuExfxP081CKBLulXkW1Nc=; b=OlfO3pLYnB84gM9a1JIvjupgOrrNJlNsBkQlXLqibzzV+nOAQ0/VcyCt9DE6zhWNF/pvCZPe5eButJ08PDNiNOtsB8SfgL10lWzlexFNtjuQtkIZCLPuHRu0xwzOA0tVlLSUpdkK6BB4lreI/gZL54EY3PeEserbzSz0no51NLkA8/+1Q0ajPrZ1N9PN05kdg66quzamI39vv1kL2b31A6G41+GRuSHrpFabdP0K85vi+5VCwthynamMMKSAt3ZS+K6OzjUe4qbEpUDuZCsc/+O2fKDhXPfib7PmDBBsx+eLdY8SEg6GafKfjZ3P3mj4Sl+3/Uatj6VyOMpKoF62XQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s96Eq/nNhlzG3nsRQVxx5cuExfxP081CKBLulXkW1Nc=; b=rmsDATUma/2aLI57qTZhblToik1LQW4iMIUQ3WRRxJwTkqgoP1Xe2P0FijE30AF5N/Vaj8SjlBU769kBySr7d/I6nDIecOSMnLE5XbNRp4yHwn87d0/ju5S3tsnOPGYnjlEaSctyigYd8DKsr0x8ux+c0xajhvJulnJlxQiiPZA= Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by DS7PR10MB5135.namprd10.prod.outlook.com (2603:10b6:5:38e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22; Thu, 27 Apr 2023 16:35:17 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::d8ec:1377:664:f516]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::d8ec:1377:664:f516%6]) with mapi id 15.20.6340.022; Thu, 27 Apr 2023 16:35:17 +0000 From: "Jose E. Marchesi" To: Eduard Zingerman Cc: Alexei Starovoitov , Yonghong Song , bpf , James Hilliard , gmartinezq07@gmail.com Subject: Re: Support for the pseudo-C BPF assembler syntax in GAS In-Reply-To: <10266b33214afa1aedf90bb61208abf392cfa7ff.camel@gmail.com> (Eduard Zingerman's message of "Thu, 27 Apr 2023 18:22:08 +0300") References: <878reeilxk.fsf@oracle.com> <733c57eb-1299-57ae-7aa5-a9dbd51f5559@meta.com> <87zg6ufnrr.fsf@oracle.com> <87o7n98wep.fsf@oracle.com> <10266b33214afa1aedf90bb61208abf392cfa7ff.camel@gmail.com> Date: Thu, 27 Apr 2023 18:35:09 +0200 Message-ID: <87354l7076.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P123CA0061.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::12) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2888:EE_|DS7PR10MB5135:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ef67616-7faf-421b-cdd7-08db473d61b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4xZZq/dF2ofeVZsQVtu2a8WH1TpGGGzX3EfqmwnzxNi1MBdKguJz4jp+tS9sP7QblpbKy0fR1YrlwRMPJ7AuTYOmCQlYxXaO7nJYvtxgObisB9tjAf7miyTfQX74kuCHyvmR5MYRwT2DYijT0dqNjjHy/uzUyIW72ZMEDoMqu9MuqtX8202zILCfBbZfrKBypEPQqBw2JCaPHv/DpUJtxbPqN8wy7shiscdlLQXD+Dq0KiJLmOGtIWEBuUUcCub7ue/AH2U1DsEbtB5TNhM/8ZEEnlfelTAXB8eQPw/eQTUUy2Nk54FW9WZOEWZMVUi+NcbSRw4BWULiREXLcYngbTtdhGZ02TOMx8bfUugU7YhS9/hhNbBtYVk8MxmLYioL01LvlATl83Wcy8QbfMjiiOibtW4yXhrpWeItEZv4b7sRcXrmydRQjjzLqG2+iX6pZypZMQ+AiiLw0Yi2uq65dDgejNnUB6CGMVAvest6sMXsfvzVVOiuxEbp0chEFd4q7Bk7CEuohq3C50po3t5wj2ukY18SecPHfVMjrh2dmbpqOOT55MTj73FsKjnwPQARBLs5xUfZPmuzf0jugHxytQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB2888.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(346002)(366004)(396003)(376002)(451199021)(36756003)(83380400001)(966005)(6916009)(478600001)(2616005)(6486002)(6666004)(6512007)(6506007)(54906003)(26005)(186003)(53546011)(2906002)(38100700002)(4326008)(66556008)(66476007)(66946007)(41300700001)(5660300002)(8936002)(316002)(8676002)(86362001)(66899021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?clFPN3h4OXQ5L2FLUElzT2t2YW9ZN0c2aEhFQ0tnUjlFNTA1M3RCOWdEbW9O?= =?utf-8?B?ZFFiL1IwMjM0c0F3RTNtVUFkUGlSM04yOHBuQjBxWnIzR3grZ0MyejZtODVH?= =?utf-8?B?ckRoT0lxanpFTU9haVBwODNrU3YyRStoZitUTkkvMG4yV1pSSHMvQ3hhWmJL?= =?utf-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nJFDpO1r9IdClDPRXV0MIU6lOv8HooqBjweR3O/YAXmQuVWQ6bL4Q4W5cBt7aoHi7AYNuwDlJtKf000tn1W3GvGI X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ef67616-7faf-421b-cdd7-08db473d61b7 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2023 16:35:17.3676 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gvkyx8Dh2UDRmIAO3sqP9ho2/TEak+KUX12Fwjv37BajrjefujmSW0/4ZPjc+OaGt5TqIiW5neBPUyEbUakvjzLnMUaBfjTxCS+cGc5nrVA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5135 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-27_07,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304270145 X-Proofpoint-GUID: JW1W_qh8xwe_mtLPlvnx6WztTGyyeSyD X-Proofpoint-ORIG-GUID: JW1W_qh8xwe_mtLPlvnx6WztTGyyeSyD Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org > On Thu, 2023-04-27 at 12:14 +0200, Jose E. Marchesi wrote: >> Odd. I replied to this yesterday, but somehow it wasn't sent. >>=20 >> > On Wed, Apr 26, 2023 at 12:35=E2=80=AFPM Jose E. Marchesi >> > wrote: >> > >=20 >> > >=20 >> > > > On 4/26/23 10:37 AM, Jose E. Marchesi wrote: >> > > > > Just a heads up, we just committed support for the assembly synt= ax >> > > > > used >> > > > > by clang to the GNU assembler [1]. >> > > >=20 >> > > > Thanks! Do you which gcc release is expected to contain these chan= ges? >> > >=20 >> > > This is the assembler, i.e. binutils. >> > > We don't need to update the compiler. >> > >=20 >> > > > > Salud! >> > > > > [1] https://sourceware.org/pipermail/binutils/2023-April/127222.= html >> >=20 >> > This is awesome! >> > We recently converted tens of thousands of lines of bpf asm from macro= s >> > to inline asm in C. >> > See tools/testing/selftests/bpf/progs/verifier_*.c >> > I wonder how gas-bpf can deal with that. >>=20 >> Inline assembly shall work. > > There is also an LLVM testcase [1] where most of the instructions are cov= ered, > but you probably have something similar. Yes we have extensive instruction testing in the assembler. > Just of the curiosity, is the state machine generated by some tool or > is it "pen and paper" exercise? It is the later :) But I plan to turn that function into a recursive-descend, for maintainability. > [1] https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/BPF/= assembler-disassembler.s > >>=20 >> > We had to fix several inline asm issues in clang to get to this point >> > and probably more to come. >>=20 >> We will give these tests a try and fix problems as we find them :) >>=20 >> We actually came with some ambiguities, undefined stuff, and other >> issues with the syntax while doing the implementation. We hope to >> discuss some of that during the LSF/MM/BPF next week, so we can >> consolidate the language in both toolchains. >>=20 >> Speaking of which, we are preparing the material for the "compiled BPF" >> activity during LSF/MM/BPF. I think the BPF track hasn't been scheduled >> yet, but how much time will we have to discuss about the topic?