Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp561296lqp; Thu, 21 Mar 2024 08:56:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXK51CMzvx/l49Qh1NLvSs49x5CFfz56ZG3zxYawB23uNf+iKeXXIGD7fYhd6UTjLlbiSJLk5MfTd1E5jCrC4bdPPp3+OZBud3pxEzdUg== X-Google-Smtp-Source: AGHT+IGZJwxeHqR7W246WS19Smi1munBg9rWTKOzjb3Iig1bILTCGZgS/HSh67RcC0cUI6r72koN X-Received: by 2002:a05:6359:4592:b0:17b:f4e9:7093 with SMTP id no18-20020a056359459200b0017bf4e97093mr10063464rwb.11.1711036598420; Thu, 21 Mar 2024 08:56:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711036598; cv=pass; d=google.com; s=arc-20160816; b=YhmApM9qkrUDOPVHSKHnSvxy4nOtouJxCDZ7uhDBHVc2L82hbCpPwPz+ufmotPrklw 0S9TyLj2PjDWiKEzqba5So+oCnj3euwnI/ongZL0H0jlxfjWrpR+BjDNR4WSd3iv/xb+ fwUQ12EPeKDujxF3sduEYzn442z2KhC7+Ybe2E+0s3RG1y1fEOf9jRmqcXDD/4lnWYL1 W3xdj40NJHlaeGY8AFtWzOHJi6Yp5DUvSJtmMY8vGl00F52joEOsqjARaIP6qqTMF6iD 5OH8N/fkRSlniDks9YekQ5afbmzScyU9xnkSug4EFDrrHtaLTVe7KYJnrOJ35jo37COU yGlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/ZtMkxhYHr3cmoF6PxywbCBZ7mb57k0gnbHTqu/snDY=; fh=gkUBmtxllvyvGU0ly6dC4xd1Y9NT/Re2iVYR8H4aSNs=; b=Hi01uYjrpUWp9B/vdqnfkK6+RXw9zKPRDvWeSrhlcw4ttpumKxDtWAHZBWnmi/uW3s go1ugu/Gpcgh8xhAGOG0ONm0wyoJKI44HSmo9jpK7/3U0SprOD5xuA0N1E1iKkwvJDr9 dBIgRjYZ++b78ZIBXrxvoihAFufJpJo5uwZMK97WGu5mOXCN5+65c2Xk1mQxoU8y5fEp IN1v7Aep0TukZM5Je+DsoseE9CyH38YITPBuf09vpR5VtgsfL+JlCctfCgGl+b1Edd+i HLBIEfyTvmUf8g5Uy5SdE8Ak6Z3bWxKVlg7kX1MBnwbAy2IwT/ByKd+uWRQCULJ8FTmW 7v+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=D2V8AnPH; 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-110250-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110250-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n125-20020a632783000000b005dccf9561c0si37124pgn.150.2024.03.21.08.56.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 08:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110250-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=D2V8AnPH; 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-110250-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110250-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4B220B24520 for ; Thu, 21 Mar 2024 15:38:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5A2C1E879; Thu, 21 Mar 2024 15:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D2V8AnPH" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 6B35C8624E; Thu, 21 Mar 2024 15:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711035071; cv=none; b=RTshH72FHk3Nvq0FfnF3ZFAVlFjXvrQnKDcbjYVY62pSFouq5y6SnggiwRzC5IfZtdmBAbqxSw2xfO1wrOVpBCV5SbXZhbIAq29C/ExWwvsIPKYtrBmanHI7hIu1sE1GltOXVCYttwNNCLoG5AGf+iK8TvMT8FZ+mEUTK8QjiMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711035071; c=relaxed/simple; bh=zuZVbsZ2MqalPAwdY7Ruzi14ilWt8q0p1FkWTz7Nn9g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PmEDyIQo6Y8n27pwv+ZJbd5+HwIhw/CCe88z67r3nOuvPJx0xYfKWAEt2Do6SrdRPwQpcAdyyBvZicJJd8owcIzM7zwijOxP88gSFGpFjmjzwvDPb8biagx33U1hSCY3EZ/R9+6whQEjlTZajP2jbMxcoIR9rssLqzeAcpM6gsI= 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=D2V8AnPH; arc=none smtp.client-ip=209.85.128.47 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-wm1-f47.google.com with SMTP id 5b1f17b1804b1-41477211086so4042115e9.1; Thu, 21 Mar 2024 08:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711035068; x=1711639868; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/ZtMkxhYHr3cmoF6PxywbCBZ7mb57k0gnbHTqu/snDY=; b=D2V8AnPHSSMeGCl7yDAc9u9kmoanicfn2h6YxMhkSf+1a+4KbLlKuB3vJT8sVblW8k Y5hqqeobpNRVLj6JcDi+eyjHHcSSfm492t4yqE9yPc163QtW+5qM8+sQb/t8aYRE5NRY 3EGRkhqVQnLhFguV+b8J/zup3OM1T7j61EYvvYxMN0A9kR0Tvxam18I0YP1VKXDIjnWo OBelRKZh0pfyDfiQAEKeXwaBT38jwVF3uPgD8V4CBfS0Scoav+8mGPuAR/lKBpaxF7qS xU30r4E/iReY4ge+MmmGMNOEogc3+kGFpzPZRw8eM1Oa1M3XHBvqpGs6tUWR+DTlaFEU wI4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711035068; x=1711639868; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/ZtMkxhYHr3cmoF6PxywbCBZ7mb57k0gnbHTqu/snDY=; b=llRCNPl73X7uLPnhlinnumaO0o1qMP6yQgWQF6RwUozkoacluYET2ugNrNNtSJBw3F jhGGO34T5DOi4dDFujlCt5qJ3/eLaLPujoHnLC8dVEOHULTUoBbezP28AFHv0+xynPZl itA961fkdn88MjoGrfxEGHn80bcGmhHCTXgPCT5/f4lOzOODCKkeBgLRlZenPPmYWvL0 AfviOBws2KRUR1gxvWouUKWR3Io1E+KHgj/ybrWWjYOyOP2XbIpsZvqt29hQ1FnnIvBf //9N8I+qzpTP4AEPSEoJBbdW0kKUbtjTz6EkQ7J6k3Q1vZrJL/1tHViYVjETdogsvWXv mP0g== X-Forwarded-Encrypted: i=1; AJvYcCWtwGjMKbyS3kF6IAigY/V8jf6DpjAO03ikOwR+30gYG1Fw88cNjXH2tWb5w3ytyPVL4Uky/Zb6Czb3L04soVQqzXL6q1JOnyMHIN17TIuOvrCCz0mDzlYiVz/Y66JztCut X-Gm-Message-State: AOJu0Yw/PyO/cOTzEW0EqfKVy76rSlhl/RBDhOyIagS1i/XtMk/WI9iU bQYHumG6+/+gIQrh8IrtWcVYholEuHQxMOa/bcKxy+cXtl2NlekG X-Received: by 2002:a05:600c:a49:b0:414:6773:d13b with SMTP id c9-20020a05600c0a4900b004146773d13bmr2202794wmq.12.1711035067543; Thu, 21 Mar 2024 08:31:07 -0700 (PDT) Received: from localhost (54-240-197-231.amazon.com. [54.240.197.231]) by smtp.gmail.com with ESMTPSA id iv13-20020a05600c548d00b0041463334822sm88000wmb.26.2024.03.21.08.31.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2024 08:31:07 -0700 (PDT) From: Puranjay Mohan To: Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Zi Shen Lim , Xu Kuohai Cc: puranjay12@gmail.com Subject: [PATCH bpf-next v2 0/2] bpf,arm64: Add support for BPF Arena Date: Thu, 21 Mar 2024 15:31:00 +0000 Message-Id: <20240321153102.103832-1-puranjay12@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Changes in V2 V1: https://lore.kernel.org/bpf/20240314150003.123020-1-puranjay12@gmail.com/ - Fix build warnings by using 5 in place of 32 as DONT_CLEAR marker. R5 is not mapped to any BPF register so it can safely be used here. This series adds the support for PROBE_MEM32 and bpf_addr_space_cast instructions to the ARM64 BPF JIT. These two instructions allow the enablement of BPF Arena. All arena related selftests are passing. [root@ip-172-31-6-62 bpf]# ./test_progs -a "*arena*" #3/1 arena_htab/arena_htab_llvm:OK #3/2 arena_htab/arena_htab_asm:OK #3 arena_htab:OK #4/1 arena_list/arena_list_1:OK #4/2 arena_list/arena_list_1000:OK #4 arena_list:OK #434/1 verifier_arena/basic_alloc1:OK #434/2 verifier_arena/basic_alloc2:OK #434/3 verifier_arena/basic_alloc3:OK #434/4 verifier_arena/iter_maps1:OK #434/5 verifier_arena/iter_maps2:OK #434/6 verifier_arena/iter_maps3:OK #434 verifier_arena:OK Summary: 3/10 PASSED, 0 SKIPPED, 0 FAILED The implementation of bpf_addr_space_cast can be optimised by using ROR (immediate) and CSEL instructions. Currently, lib/insn.c doesn't have APIs to generate these intructions. I will send subsequent patches to implement the APIs and then use these instructions in the JIT. Puranjay Mohan (2): bpf: Add arm64 JIT support for PROBE_MEM32 pseudo instructions. bpf: Add arm64 JIT support for bpf_addr_space_cast instruction. arch/arm64/net/bpf_jit.h | 1 + arch/arm64/net/bpf_jit_comp.c | 105 +++++++++++++++++-- tools/testing/selftests/bpf/DENYLIST.aarch64 | 2 - 3 files changed, 96 insertions(+), 12 deletions(-) -- 2.40.1