Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2618482pxb; Sat, 6 Feb 2021 02:28:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuX/RXlG7MTTFOnwLZ0rddQs0Cy6vm39SE85XwB46/+Yz3U8xQ590ERyyJAHLM6xDD/VDo X-Received: by 2002:a05:6402:1589:: with SMTP id c9mr7982818edv.282.1612607296872; Sat, 06 Feb 2021 02:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612607296; cv=none; d=google.com; s=arc-20160816; b=Aejwuc2dy6q3BTzHxCpmFLaBzHV+bRLSboYhIfzQu70FJwv8g9jLLgCt4hhhkA/4OG nICwXJBvQg1qu5tadVpVX4OpeEmWH2joZXakmDLa1m1YN+6f2eUg/aPEtoML9p8dIVJ5 HIsgDDX7tMNZQz1+fK/wPpO+4ZmeKx9mqln8UE7QzaRLbeL/X8WRpXKvovIY+VGslqec qpTAw3has9Wpi3oC45f9nyuEvjABtGqY8gnP/fvgEFPNe4s4yBJIQEtLaK4mUHPOoRIj wwNRamy3xUJopV81Lt6sxG0TYvrNzq7a8gSmPVaqNxiXIyDGRSKSacdcCHBv2vE+Cyd8 veNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=DrSEeR5XXqjciPqvAEERURwzS3+CTGHiv1S1iJCiwto=; b=SRoF5GJqXB4QjNLvLJpNpsRyAhO+iwjE4aZxDd68nRNSp5yJhCNVG5iwVFB2EVEMrQ 4jTYPDDRRMyvOGmtBYV+sjGubBVyFQu8UrtqreV3kOP4Ar9cy8cLdT4xS6vT4dT77R/x INKJhpSSbVMyRvjzvpN+3QYaV3gI5XSqKLxf6ygNPshCJBPoKBKZN4lkwFyG+AvUcao5 4iKQu7JgBHN9IYhFoIHc4QNQnX9SoqJ/LUT4dnfaCb1nGmOr5LbbvGXjdqJDql3GxuOe eIPf41ouiJzw3iN6MVZkRMvBURozWh2ldx5P6QJkJVT4Jw/U52MJkPb53zfw4D3lJ4pn M2Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k3rLnJaj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si4031432eds.30.2021.02.06.02.27.52; Sat, 06 Feb 2021 02:28:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k3rLnJaj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbhBFKYs (ORCPT + 99 others); Sat, 6 Feb 2021 05:24:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhBFKYp (ORCPT ); Sat, 6 Feb 2021 05:24:45 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537EEC061788; Sat, 6 Feb 2021 02:24:05 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id u20so9860384iot.9; Sat, 06 Feb 2021 02:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=DrSEeR5XXqjciPqvAEERURwzS3+CTGHiv1S1iJCiwto=; b=k3rLnJajP4OtSJ4mo+L15VXSc16RPcGXO/bTQOhvCRmPyE2P7MvV1xRm+lQ+LmQ/Ss Ck8UUgq8fWWaLcUsvLbKmasGwvXDZT4f1VUbyWFZXMYTDT2RSLAvJRpBaXmtOCx9lxpG z430Hy7qqhZBjVjtcSaHYKAfoNcqmsCiS9YIZiyPeiN7HPoSTgLPRDbBIZQtzh6um5YA jsv5U3CPJGjtpvTxk/D2wzYmvuSUid6PRs75JFudPuVU3zLpeMkW1NnmrIXZENkj9P57 Xmy4eCI7EMmT3LYX3MnWagnwKoj7rsPKn/LJh11WWglc7RSX9sRAp3uFPQSTNe0KJsrR BiNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=DrSEeR5XXqjciPqvAEERURwzS3+CTGHiv1S1iJCiwto=; b=kVPdQ0cnbRavrzC5+igItNHSVHUmahRJ7T31hhhuPtygy4VYVJq9w4y/foJgkkNgVn flCK3USM323X3/pQnmacFDJDfAMZknGgK1qoWad35juVCHueR/xl4JGNDnOim8c8fdwJ yMtQSaBWi5BNDlSqfZ4INaedDwGvpWcIcMqw0DmGo2czLFz47mcvhHXxFvOL6+V4lh9x uywmNE3jKyk2Ms3qiTAQ9inbJPHDPTOs5We0KKpW84LTcgXNBtokbxyldG/6nS3+tg/s b+2F/bW0Qz5ZkBA4EwKHzeJcIEp1hallnfMky0F2sZ0IeAj2+3pw0FGDc4FdyEzvfcI/ OeRg== X-Gm-Message-State: AOAM531ogeIKp+npWXRkbXKTZ843sLJEq85JBTKZdGp+BEAY0ehLCqH5 Fpq8JlvXikMIIN4yt87YqyEIxvyqfaOaOChJMeo= X-Received: by 2002:a6b:e006:: with SMTP id z6mr8037925iog.110.1612607044683; Sat, 06 Feb 2021 02:24:04 -0800 (PST) MIME-Version: 1.0 References: <20210204220741.GA920417@kernel.org> <20210205152823.GD920417@kernel.org> <20210205192446.GH920417@kernel.org> <8ff11fa8-46cd-5f20-b988-20e65e122507@fb.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Sat, 6 Feb 2021 11:23:52 +0100 Message-ID: Subject: Re: ERROR: INT DW_ATE_unsigned_1 Error emitting BTF type To: Yonghong Song Cc: Masahiro Yamada , Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , dwarves@vger.kernel.org, Linux Kernel Mailing List , bpf@vger.kernel.org, Jiri Olsa , Jan Engelhardt , Domenico Andreoli , Matthias Schwarzott , Andrii Nakryiko , Mark Wieelard , Paul Moore , Ondrej Mosnacek , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Tom Stellard Content-Type: multipart/mixed; boundary="0000000000000faae705baa85682" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000000faae705baa85682 Content-Type: text/plain; charset="UTF-8" [ SNIP ] > > > > > Please help do a test. I can submit a formal patch tomorrow. > > > > > > > > Thanks for the patch. > > > > > > > > Can you attach the diff as Gmail has totally truncated/malformed it? > > > > > > > > For the Linux breakage - you will need some additional Clang specific patches. > > > > Is this Linux 5.11-rcX? > > > > The "Blocking bugs" are listed in the first post of "Linux 5.11 release cycle". > > > > Hope this helps. > > > > > > > > This is cool co-working :-). > > > > > > > > - Sedat - > > > > > > > > [1] https://github.com/ClangBuiltLinux/linux/issues/1228 > > > > > > With the attached diff and new selfmade pahole looks good here. > > > > > > Passed (see line-numbers): > > > > > > 11090:+ info LD .tmp_vmlinux.btf > > > 11099:+ info BTF .btf.vmlinux.bin.o > > > 11103:+ LLVM_OBJCOPY=llvm-objcopy /opt/pahole/bin/pahole -J .tmp_vmlinux.btf > > > 11121:+ info LD .tmp_vmlinux.kallsyms1 > > > 11139:+ info KSYMS .tmp_vmlinux.kallsyms1.S > > > 11145:+ info AS .tmp_vmlinux.kallsyms1.S > > > 11160:+ info LD .tmp_vmlinux.kallsyms2 > > > 11178:+ info KSYMS .tmp_vmlinux.kallsyms2.S > > > 11184:+ info AS .tmp_vmlinux.kallsyms2.S > > > 11200:+ info LD vmlinux > > > 11210:+ info BTFIDS vmlinux > > > 11216:+ info SORTTAB vmlinux > > > > > > Still building linux-kernel... > > > > > > Will report later if I was able to boot on bare metal. > > > > > > > When running scripts/Makefile.modfinal: > > > > ... > > not supported bit_size 160 > > Encountered error while encoding BTF. > > ... > > make[5]: *** [scripts/Makefile.modfinal:59: > > drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] Error 1 > > make[5]: *** Deleting file > > 'drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko' > > > > I added "bit_size 160" to libbtf.c: > > static int bits_to_int_bytes(uint16_t bit_size) > { > if (bit_size <= 8) > return 1; > if (bit_size <= 16) > return 2; > if (bit_size <= 32) > return 4; > if (bit_size <= 64) > return 8; > if (bit_size <= 128) > return 16; > if (bit_size <= 160) > return 20; > /* BTF supports upto 16byte int (__int128). */ > return -1; > } > > It still breaks with: > > [521367] INT DW_ATE_unsigned_160 Error emitting BTF type > Encountered error while encoding BTF. > make[5]: *** [scripts/Makefile.modfinal:58: > drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] Error 1 > make[5]: *** Deleting file > 'drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko' > > Comments? > Indeed there is DW_ATE_unsigned_160: $ /opt/llvm-toolchain/bin/llvm-dwarfdump drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.o | grep DW_AT_name | grep DW_ATE_ | sort -u DW_AT_name ("DW_ATE_signed_32") DW_AT_name ("DW_ATE_signed_64") DW_AT_name ("DW_ATE_unsigned_1") DW_AT_name ("DW_ATE_unsigned_128") DW_AT_name ("DW_ATE_unsigned_16") DW_AT_name ("DW_ATE_unsigned_160") DW_AT_name ("DW_ATE_unsigned_32") DW_AT_name ("DW_ATE_unsigned_64") DW_AT_name ("DW_ATE_unsigned_8") Attached is diff v2 with the "bit_size 160" fix. - Sedat - --0000000000000faae705baa85682 Content-Type: text/x-patch; charset="US-ASCII"; name="DW_ATE_unsigned_1-pahole_1_20-dileks-v2.diff" Content-Disposition: attachment; filename="DW_ATE_unsigned_1-pahole_1_20-dileks-v2.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kktkjr0l0 ZGlmZiAtLWdpdCBhL2R3YXJmX2xvYWRlci5jIGIvZHdhcmZfbG9hZGVyLmMKaW5kZXggYjczZDc4 NjdlMWU2Li5hYmExNDY3OWEwN2UgMTAwNjQ0Ci0tLSBhL2R3YXJmX2xvYWRlci5jCisrKyBiL2R3 YXJmX2xvYWRlci5jCkBAIC00NjcsOCArNDY3LDE1IEBAIHN0YXRpYyBzdHJ1Y3QgYmFzZV90eXBl ICpiYXNlX3R5cGVfX25ldyhEd2FyZl9EaWUgKmRpZSwgc3RydWN0IGN1ICpjdSkKIAogCWlmIChi dCAhPSBOVUxMKSB7CiAJCXRhZ19faW5pdCgmYnQtPnRhZywgY3UsIGRpZSk7Ci0JCWJ0LT5uYW1l ID0gc3RyaW5nc19fYWRkKHN0cmluZ3MsIGF0dHJfc3RyaW5nKGRpZSwgRFdfQVRfbmFtZSkpOwot CQlidC0+Yml0X3NpemUgPSBhdHRyX251bWVyaWMoZGllLCBEV19BVF9ieXRlX3NpemUpICogODsK KwkJY29uc3QgY2hhciAqbmFtZSA9IGF0dHJfc3RyaW5nKGRpZSwgRFdfQVRfbmFtZSk7CisJCWJ0 LT5uYW1lID0gc3RyaW5nc19fYWRkKHN0cmluZ3MsIG5hbWUpOworCQkvKiBEV19BVEVfdW5zaWdu ZWRfMSBoYXMgRFdfQVRfYnl0ZV9zaXplID09IDAuCisJCSogc3BlY2lhbGx5IHByb2Nlc3MgaXQu CisJCSovCisJCWlmIChzdHJjbXAobmFtZSwgIkRXX0FURV91bn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