From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yonghong Song Subject: Re: [PATCH bpf-next 4/7] bpf: btf: Remove unused bits from uapi/linux/btf.h Date: Mon, 21 May 2018 14:17:23 -0700 Message-ID: References: <20180519001650.4043980-1-kafai@fb.com> <20180519001650.4043980-5-kafai@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexei Starovoitov , Daniel Borkmann , To: Martin KaFai Lau , Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:39772 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751571AbeEUVRz (ORCPT ); Mon, 21 May 2018 17:17:55 -0400 In-Reply-To: <20180519001650.4043980-5-kafai@fb.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 5/18/18 5:16 PM, Martin KaFai Lau wrote: > This patch does the followings: > 1. Limit BTF_MAX_TYPES and BTF_MAX_NAME_OFFSET to 64k. We can > raise it later. > > 2. Remove the BTF_TYPE_PARENT and BTF_STR_TBL_ELF_ID. They are > currently encoded at the highest bit of a u32. > It is because the current use case does not require supporting > parent type (i.e type_id referring to a type in another BTF file). > It also does not support referring to a string in ELF. > > The BTF_TYPE_PARENT and BTF_STR_TBL_ELF_ID checks are replaced > by BTF_TYPE_ID_CHECK and BTF_STR_OFFSET_CHECK which are > defined in btf.c instead of uapi/linux/btf.h. > > 3. Limit the BTF_INFO_KIND from 5 bits to 4 bits which is enough. > There is unused bits headroom if we ever needed it later. > > 4. The root bit in BTF_INFO is also removed because it is not > used in the current use case. > > The above can be added back later because the verifier > ensures the unused bits are zeros. > > Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song