Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2894236lqp; Mon, 25 Mar 2024 12:13:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEo1/L4YJmqgz3NaD+wIXdTlcvR2E6Eh4pkobK2M3tAvaFz4fHEJht4AhlR51TqAOA3lJctJcLDaAneMBXyksM8phchkX3iUmQikDBcg== X-Google-Smtp-Source: AGHT+IG136+U7QLYKbrwe2PpQDXlg1Dit5liHsN/oItFP+ALAFNEawxXQngL6r+2OLAEHPV0w28s X-Received: by 2002:a05:620a:4592:b0:78a:2d35:3071 with SMTP id bp18-20020a05620a459200b0078a2d353071mr11699179qkb.38.1711394017017; Mon, 25 Mar 2024 12:13:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711394017; cv=pass; d=google.com; s=arc-20160816; b=fLIgeu/e4bZq7nJDZHjmIVL8gbq4JnSc3kYSW1GB2b/JjW5P+zHFv94ZQmKl4InxPc PeQRszCKHoFBCxcBIUoPqUDKypt06OHik8n8wV3557X15GUsx3nO2OKRquDxifC4JTkg zv2BZY6ffqKM+fBVaDJ8OSNEoLFfAkgOUq8O47Tdy1YAnygs00aF3og1unYB93uOspj9 DYCCdYQ1nEEF31vg6hIguooYhs2XXGJkgDHmD/GkezGYxmqHnM+0mEuuo5ru4omWxQcg CMTOx5oTpmtDfQ6rhv8Dby0VQeH4xPeANFxv6RVyuFs0zgXrHBO3BmUCAjgnuYVKxHeA veUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=bgBGkwDpvy+zR/EPv0TXmjkYIf1V+bfMcLLs2S2pnX0=; fh=sB+l+8KeE4FSquIJk6XW0gwPVA/JkpErUemlbuPsdog=; b=r23JUabg2Yfz2lJ57po2zL2S5oNV5dQmSeiQqhMApoXU58c1Mojt6ySiW8zed6szG/ sn9IKio1xF+zUr82ISsZmW7jSEiq5BkSnmiyLBdsnjUGdLOPOpTsNDo64aXTOsZ3Lsta HSdCOFCG9Phr9Zix++kj/rPvV1sDOpWgW4tmW6JV0IHcsQ60cLvu6UJ7K2+ODdbQIYJD GGhUfz9oeX/VRIVCpiLVo8YX5ZVKRUjNyK9tVmPfLyj2/i6i6wyIrM4e1dHNl5a38HUc t3rHyNqLJi/r6kdyWKpI7XX3SUuCa83/+B1t7InsKoe/Kx6B996lqW2dhzfl7aIYxkG0 rQDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bUW1fZJq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-117783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p4-20020a05620a22a400b007885a2d38d2si5717363qkh.483.2024.03.25.12.13.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 12:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bUW1fZJq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-117783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AEB741C3D6F5 for ; Mon, 25 Mar 2024 19:13:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2595F17995; Mon, 25 Mar 2024 19:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bUW1fZJq" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6F3213FF5; Mon, 25 Mar 2024 19:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711394005; cv=none; b=qZHK6lIAOQ+G/RtPzGLg4o5+fs5ZpNeI6xb3Ffw+vc4zH+yT3lM3ZeweR0ejsYwYtnzt6pxFmaZF3IsSkO6UinTVDsm33XQdqWgzwkqkLCFNU8AV+S01+3kfc48eWN2o4B2RiTiCcziUyDWjNaUIyFB/1gHlKl/tbewbUzBmKnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711394005; c=relaxed/simple; bh=mHd8yBTq95tlBMjpkzBSblmDNN2ufxBHwGLG6XPFLiI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KbKq7+3y2ICO78wdBBi0aNaFJ9NQnkNCNqMJnCFZdo5V16ifFP5/5HONO3AXyOwKmAZR92DWuVPDuWsDufQrumgPL2o/SaVQ/LYOhyLB2iUjs8MHTmgzJbZgGtD6vvJ9UNXEjrj8tM1e3Qj/+36oX3rMGoCYCjKF0qhEz6cOzak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bUW1fZJq; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-51588f70d2dso5512991e87.3; Mon, 25 Mar 2024 12:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711394002; x=1711998802; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bgBGkwDpvy+zR/EPv0TXmjkYIf1V+bfMcLLs2S2pnX0=; b=bUW1fZJqFD2ZHHJh2qZt1OFvYdccfTWAzoi5sLu2LO+Z5gJSJ7b7u8eBeD67t4UvGd FNi5Xlmid+Nx6DHbPEFkGZn+M5EdFU0NwO/0IbjytdUvA0qhkh4mrTbBsz0TulC7Lu07 RX9quaUkVniaiR4u0PWeJzvHyXph4JmL2Cawl2zcOEwu4lCoeRGHKipZzuMq1MuJRscy cDJkt8MuuuILNElnir70/GCadaqrQhaauw2+dkCP0HsVfgxxrWPAemCzWqhzokNojjxM 74Bocq5dZSi8zPY/HosRK4EOLGJ5YyhdqQMNGjQjwHRRmutqWLo9zbBt9/+DVhZGY1xT jv7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711394002; x=1711998802; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bgBGkwDpvy+zR/EPv0TXmjkYIf1V+bfMcLLs2S2pnX0=; b=OU0xMAzbJgpVa121ecj5Wby2VASYIZgYjftqK3dCmw3o3vGYmBRCRRVxmFzm22JirB a/STMEjd1uW3AT9VCl8zukvjLeJUh/unNiOgwdnRPJH3wj9/ejlkb+LCQqnf6TT/aBqT LmS+ExTcmsauyNy8Glu3R/V97yRbG1XmmlO2zChF0KRXJ1CB4TEvnW30bPzdv4iHxyGp IDjD0QDMEqvirdscrfHxYZhZo0m23TSlUuNQDOswe8Jt/QEiMp3ZhiiqWnQRmGteK+0E /+lds20vpO9Wh9GjsH7JDLsjSXuJu1HHKP/dWuzA3e+sTxIh3/t38YU2SuYbC0mLC5l2 8swQ== X-Forwarded-Encrypted: i=1; AJvYcCUftoFb0H/sZ/+tEdWGdMsKdTMCh+7VqOJuH1OOB3x8djc4IbkM4rMyHeBFNOfncficL25aAk/TBjtx4AXBdHa9Cc4aSdEK6x3GCw9u3drZI0i8HE0jVZgvfRHjDet6wBn9 X-Gm-Message-State: AOJu0Yx/gv0Xzr/QNV3bQiCFvS0f04AjorbEQpxS8y2cpn0br03YkZba LL8fA9d/8PwTTZ2wtRiPO6cCNkX5M62++HlCH5p6HnjGA1d0elru+qntyUvlzJxkwl8Ae3NSL/k JI/AxPxp3Xe3zCSGoHMu4Wk7aP6I= X-Received: by 2002:a05:6512:328a:b0:513:cc25:d3b5 with SMTP id p10-20020a056512328a00b00513cc25d3b5mr5423878lfe.7.1711394001477; Mon, 25 Mar 2024 12:13:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240325155434.65589-1-puranjay12@gmail.com> <20240325155434.65589-3-puranjay12@gmail.com> <20240325-nineteen-unvaried-cb5cb5fd3a73@spud> In-Reply-To: <20240325-nineteen-unvaried-cb5cb5fd3a73@spud> From: Puranjay Mohan Date: Mon, 25 Mar 2024 20:13:10 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2 2/2] bpf,riscv: Implement bpf_addr_space_cast instruction To: Conor Dooley Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Luke Nelson , Xi Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Pu Lehui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2024 at 8:10=E2=80=AFPM Conor Dooley wro= te: > > On Mon, Mar 25, 2024 at 03:54:34PM +0000, Puranjay Mohan wrote: > > LLVM generates bpf_addr_space_cast instruction while translating > > pointers between native (zero) address space and > > __attribute__((address_space(N))). The addr_space=3D0 is reserved as > > bpf_arena address space. > > > > rY =3D addr_space_cast(rX, 0, 1) is processed by the verifier and > > converted to normal 32-bit move: wX =3D wY > > > > rY =3D addr_space_cast(rX, 1, 0) has to be converted by JIT. > > > > Signed-off-by: Puranjay Mohan > > Doesn't compile for allmodconfig: > ../arch/riscv/net/bpf_jit_comp64.c:1086:7: error: call to undeclared fu= nction 'insn_is_cast_user'; ISO C99 and later do not support implicit funct= ion declarations [-Wimplicit-function-declaration] > > Cheers, > Conor. Yes, I mentioned in the cover letter that a patch is required. It just got merged in bpf-next/master: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id= =3D770546ae9f4c1ae1ebcaf0874f0dd9631d77ec97 So, rebasing on the latest bpf-next/master should fix the issue. Thanks, Puranjay