Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2120579rdb; Sun, 4 Feb 2024 16:33:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/Z1CFgCim6tlTGusJLSEHFuWNmPgIlfi23yFwZctUYPD0823VhAF4CG165LZdGMBIWS0k X-Received: by 2002:a05:6358:7e54:b0:176:d5c4:1ba0 with SMTP id p20-20020a0563587e5400b00176d5c41ba0mr12775156rwm.31.1707093196980; Sun, 04 Feb 2024 16:33:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707093196; cv=pass; d=google.com; s=arc-20160816; b=eR2vo0lbOm7Nlkyd8I7iF0wWjwg8rkWfAmtGcVeutVBPOiE+HPK//cdmbK8vi+kt5S WrXX9cntRuMTCre0kiPa9rX8v4fSYd3xEp63SlRUiuDeFXNdQ233YrnhwT68Zup57y2U /4aTRlNT8T7y4JKz7A2a24QdrzNsbehOQfFjUWoWEAgTPevT8fMb9Uoik0GJf8pTia/o k8YCqFichJHH7HdqgQx+GVPz4tJLCsnB5UnNs7gYCiXqeTsfYngc6hnX0ePmKXHhhIsO TBOe1E7z1bX9eb+TEerPL/yBxf1Ox1MjrB5wawYV9/yKSVbQaXDF8VlAshQU7c6YBhHs En/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=GslBK7Id8SkfqZIeWf++d62uMBUVShGZNxuE1TE6buU=; fh=heEgTTf1wBAMi/7MVp68Ceu3CYc8+KPZcMFjgLidth0=; b=DN6YlYYSPmu1pHkmRjTeM6hzT02CaIbKBEMrjq77etD63crMutdwvvQJyP3JSCRIva hvI2a8H/PKeZO5UvV+2FgbtDEm0lCViP92N4qdJeQd8NSJ9rc9a41MwDcxMHjW+x5TmX qknYmA9j7vzZzHF8ecL3XUsBl1T+XXj6qfjkgukc6BokUcfNOHUVDy+dxyIP8kD1jAxF phRZrHh6aEI0LZHpqFPiwdmedBWi0rUEcfl9TyCToKwKXNb1xeSFW253fWC1koLojv6X It/1qUJjXg42Zj+n2FZauefLgn5uYRC2RULSJmct9Kn0Pu4CbHIGRlW+lma3breOfKcL YHJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="l6/p7ies"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-51965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCVsmFyGZnjfzxjni/Uqrw9CpIgPXtytMes4nsN+4+Dzjpmn4QVWPxrvllRUz6qrfEm6Qa4AX1nFESqUAnynttdWC3eISNZddw7P7OIhqA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s16-20020a632150000000b005dbdb1b0114si4913077pgm.773.2024.02.04.16.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 16:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="l6/p7ies"; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-51965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 64EECB22076 for ; Mon, 5 Feb 2024 00:33:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFCC19455; Mon, 5 Feb 2024 00:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="l6/p7ies" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D82DF7F for ; Mon, 5 Feb 2024 00:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707093186; cv=none; b=c3MlHENng2uGkA1zCs1iu7/7aC4YM+6oZMfTNQillZufX0/BlyqkKftZ84dnUS3cjU+iPNnbIOi8+DAyL9nV4iLV00lr081oTTQIYIekLKxLVSAzDXxVLmtTL+nIwMxPYk4ZQwHkyB7Aa+GpBDutdSqnXglQT4eUl5zGGLkMmnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707093186; c=relaxed/simple; bh=D++LDXE+yz9iRRvwYAcmxiBapY3kCCzcq7i6SOL+RyQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=opCON8fUdZazi75ZjH4+m8QQug9dTLi9FdAMIb0ofMa8kiohyBQbi0iiwHYIet5SGrdv6NpANwG8T8Jq6Xm/ll4e5CroLpuf33vPK0GaQfOebm0SmSdGrx/mUdk4c2ZpDjM4UKq9bGBuYR6WeVAXFe5sC86Zduz66XmNPojcsVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=l6/p7ies; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707093181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GslBK7Id8SkfqZIeWf++d62uMBUVShGZNxuE1TE6buU=; b=l6/p7iesYUtE+zfPINoF64XMtE1IDogXMq7XIKSUaFjN4fZ5wOoSXqJ+M1x07GVnE8oLma Z93fM6Eb1ouZ68ilzas/kRuTzjqlqGXAySIOBoRZdGHPQ87xP+v28mv4JmgvoQ/0UbmFYZ IDhhPw8FszgsWalQTP2n5ARMuJbHIzk= Date: Sun, 4 Feb 2024 16:32:42 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v2 1/2] bpf: Have bpf_rdonly_cast() take a const pointer Content-Language: en-GB To: Daniel Xu , andrii@kernel.org, daniel@iogearbox.net, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com Cc: martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2/4/24 1:06 PM, Daniel Xu wrote: > Since 20d59ee55172 ("libbpf: add bpf_core_cast() macro"), libbpf is now > exporting a const arg version of bpf_rdonly_cast(). This causes the > following conflicting type error when generating kfunc prototypes from > BTF: > > In file included from skeleton/pid_iter.bpf.c:5: > /home/dxu/dev/linux/tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_core_read.h:297:14: error: conflicting types for 'bpf_rdonly_cast' > extern void *bpf_rdonly_cast(const void *obj__ign, __u32 btf_id__k) __ksym __weak; > ^ > ./vmlinux.h:135625:14: note: previous declaration is here > extern void *bpf_rdonly_cast(void *obj__ign, u32 btf_id__k) __weak __ksym; > > This is b/c the kernel defines bpf_rdonly_cast() with non-const arg. > Since const arg is more permissive and thus backwards compatible, we > change the kernel definition as well to avoid conflicting type errors. > > Signed-off-by: Daniel Xu Acked-by: Yonghong Song