From patchwork Fri Feb 9 04:06:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Starovoitov X-Patchwork-Id: 13550858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D799C48297 for ; Fri, 9 Feb 2024 04:07:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98D878D000E; Thu, 8 Feb 2024 23:07:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 916BE8D0001; Thu, 8 Feb 2024 23:07:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 769268D000E; Thu, 8 Feb 2024 23:07:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 61E838D0001 for ; Thu, 8 Feb 2024 23:07:28 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 461D9A265F for ; Fri, 9 Feb 2024 04:07:28 +0000 (UTC) X-FDA: 81770930976.06.8E61D61 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by imf27.hostedemail.com (Postfix) with ESMTP id 3FD0A4001E for ; Fri, 9 Feb 2024 04:07:25 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=knk6lra0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.210.171 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707451646; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cygxMwXpUKU81RFmqoqePBosJeNZ00y1PK/p5gN4GLo=; b=AqzI/5oqtqhJtrWRJqfc0PXiI98UHRrD7S3Z24p/ZBn+nD30nZ1fLYkGzqyYsoN6txPSFz hJiy8t63S8nghPd0F7z+A1Kcidrh88B6B1m1eP1u9iZ0ga2xA/GUV8KFEEQSVVN+AqcjZh 4qJxSRqH1KevZGipbD58Qf7HW8wfL6I= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=knk6lra0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.210.171 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707451646; a=rsa-sha256; cv=none; b=xxDbIKhO64+GOc0nS4rrogVp36hJNhONUqP9VlgkUXevzqv/7PYjPb0WIvZJ/UAGiYPuAB XiB4d9Bj1RbiLP+7BI/Yx8cCmhTtLQNkIqjv7KmQI/8l1y0mDuDde0Vo6ihNGt6hFWH86i g+BwqZh35RULGW5xOcqhZVNjipvqt4g= Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6e04fd5e05aso440875b3a.0 for ; Thu, 08 Feb 2024 20:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707451645; x=1708056445; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cygxMwXpUKU81RFmqoqePBosJeNZ00y1PK/p5gN4GLo=; b=knk6lra0qujXKcs/FbTt47TGViFp0CPHs3lKyf7z3AfBOJOkIi6ZkZOfiKfJ19RF+l giXdKkXH5F5tBoIju6dK0z5ibKk7sRmlQa+mNRyPXteDFqopqVgTfEhPtG1WdZ6jnLLK UbSqx/xA/vvtmfmuNpP6GEDPvAIyCjwiROtWeKfxA1pG7LqtbWvkm2fHO4940Ej9hUdU ygymofC/HxInly/oW5owRXyyWhZ9Ozng27Zb4hmAWOvTsr7JY0fZJGP+UdSTz62fXFkz TK1AQxkSUPRR1eBNqwefr6aaPnuTQSP1LhCbPg1YUmBtKCTv9vGEcOpHxgOBWEzlg1DV cx0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707451645; x=1708056445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cygxMwXpUKU81RFmqoqePBosJeNZ00y1PK/p5gN4GLo=; b=WuCFVXXUhQCOGYXbM/GKEqN+nXghzfm+AWjs1VYPzXR05Q7c6kY8TEolWRBzxhNaxj 0Tv9jGSQbmsKUYdXd381qWxGp7cgSaAdUbE2HCnc7lGP/0pccaqfvv+Pqi2iWL/weIcg QvLyKy6A7+tj5FWWxVAOvn+xsAqIRMUe6HNlwTTvCFE0fJLnRHr6sC2TP6DoxOmQNU1c 8oLmTvEMOrdHcZ8fYWPMbfwGcHnMq9LXHS2qrV3py5x60UapPGy8jJPQ7iDFrDRR1Ej5 yQr9YDIqWsMASQ/5dU2/Q8mC+ZsY62erCNQ4YzVVb1ZO9qLxHnpUpcOdGK7WWmj3vw+m 9n0g== X-Gm-Message-State: AOJu0YwUe2uF6jZZl6auA8KFDDUQWr6j/KQSvn79WIvqozqXXj5ccipq GHJQmgACe1t2Y52v/S/MZBg+7yNuVcmiAGQQlKMx9mmwYUwfBQk/ X-Google-Smtp-Source: AGHT+IHaHqKC2gjT6eMMFa5TCSDFBnv1yNEkB/syWL6KEWt6hbk/NU6aBcqi1y0pyAXerAeLHX9DIA== X-Received: by 2002:a62:f901:0:b0:6da:bcea:4cd4 with SMTP id o1-20020a62f901000000b006dabcea4cd4mr650234pfh.16.1707451645004; Thu, 08 Feb 2024 20:07:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXKa7AoYoSTpHf4QY1MuRhoeHy/otD5YbJxf7F1nq3Kf80HMJe7T0JPldiANHIWK0RPvaLH7ALpvryppvlFYP3mvzADeCO+6W0Df2OEfEyZCy1EthA0awtTR8laxGBdXgAA+oT4niKbJetncz2Fps4xueuExRoXrm/pX3Gcvt7rdxSEJ2rWTFSq+W25Wl3Drj8BYjUFe9Ck6okd8ulBbCOHQJIDRJ8dlA6f3o17pQoFudGpIsq00Zyk6sAn17YSRtSDazpAvv0earkDd4DsTwoFLj0GNPgNctSu+ObZYiRoMJJK+zmn/wkbO9+fovsxt3aeg00hIDWktHbfbs2uiBwomv1vCaKMYx0lfUcmtBHD7mvIUD0euQ== Received: from macbook-pro-49.dhcp.thefacebook.com ([2620:10d:c090:400::4:a894]) by smtp.gmail.com with ESMTPSA id v14-20020aa7850e000000b006e0825acbc3sm590230pfn.77.2024.02.08.20.07.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 20:07:24 -0800 (PST) From: Alexei Starovoitov To: bpf@vger.kernel.org Cc: daniel@iogearbox.net, andrii@kernel.org, memxor@gmail.com, eddyz87@gmail.com, tj@kernel.org, brho@google.com, hannes@cmpxchg.org, lstoakes@gmail.com, akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org, kernel-team@fb.com Subject: [PATCH v2 bpf-next 17/20] selftests/bpf: Add unit tests for bpf_arena_alloc/free_pages Date: Thu, 8 Feb 2024 20:06:05 -0800 Message-Id: <20240209040608.98927-18-alexei.starovoitov@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20240209040608.98927-1-alexei.starovoitov@gmail.com> References: <20240209040608.98927-1-alexei.starovoitov@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 4yrsjbjuse5rhw7drrxj78e6xc7xwxim X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3FD0A4001E X-HE-Tag: 1707451645-440812 X-HE-Meta: U2FsdGVkX1/t3vs+sEfNTG3SnftZf0y55KacwDl9akPrxkbM4gMYcVxLob3mW1tHOAVD/XOyF7raa3SRY6TjVO9I0TaV8ElTyh8OppjKXFD171z9Fn29lkFIUav8K5SDvonAURwMgdM+84w2c0jUcEsdKl92uR6gqzGih4tRNbyQL7iILNzpNs01BCgShxBcpRgAaFvYAoa69kWMoh3jRCw/54Lh5LJpFZhRZJiWJup8PzfVeGlDX3wR21e6m2F186edxK8dvaudr3gGwU+ONS7BGHZY0EuNDql+rYYGmYu3jMmEiZ427iZtpVdqXp+WzXz+fiUGposPF0gWRaO+H0PbL6VUSSdAZoz8Jp+GdFnXgyU9nyFPisf55Pc39NW/qxLe284z3qzQHxO+9wYJbMQF6ekrnfaA2z6oNWhWgc/uEUbbe2+bKbXGXucfF9b1J9enKreyg5r0vB9lQUKTOtomJO25xKJtB24VzHuwtAO540si1baZ26+fIlXAOJBRvfd21i3GyJAy2hB24zQsq6PZ0w57gozsMREN+VrGrtG/DB+cl//OZcWWn/bqxjKLV3trLy/pDIazwALdjlj8NGSAgK34ELEKe8LxNW5CSiIO8BDbvCONIv7lzUgHlpc1qk8ROVqpMXv5fZeocmmpO/UGRpyeUrOFZ2zZ0Kc92/SwRvDHHIEntGW8Mnz9H5dT2/i4P6cj+Iry8hLdPKpgUF52TfPa8qerudnKYa1OQuE1XppxH8spWgv3/FZuCwNwIFKDdzU5IoiRrI5bRLWGAX/mTpR29mzmX2+m9YphWAEebXb0XELvxsA3Grtgb7D1JWu7jVgYD5rsts3VnSQtYazCVg/QJqbfTP9A0rz9A8zmAHfKfqCTvAtR8o6n7Rp8gRe1YzHKOajT0iuf3/TYywmpZvdVVzC83EWq2uNv6FVs9kFJYfs3YKlJWDG2e/kBOgXW/R88ZEtr/uAQoCY XHGh5pr7 bExr0l3dK34s11K9KdyXn06HwGxJ6soYJBlEW3lihI5j4wxwWfMxMwvVBGvjosAWBvPl5I6DroWjfcR3J8/G7HfsA+uiubeaCi2YJ512/4pIVnB62gLJPbfm4k/pG/u1QEZFHlb7ge8PVGmOTUHR6Ti69ct5z26s7MerRuuGffRCZWi70Gor48+Tf0uaWZq2fzE8DSwqSFfM+rdW8pgqDA5rz31BFqjGqLILoEPj5jtbITWexZzDKXEDSpIGN3JobDRWnPwioc+BnG6ryWyFZHIX6yPib/5tWrIfUxxi7jqIR+ZizLjUY9GZKSfk+tSr/w0/j1IgsNoR2SMIi+1yUrEA7BjP5hE2cVhcneY6ygeF34MhWJCM9aOIfXv/Ml/XJY67K5tN4fznZdaOflLXn7JQxmlkqubu2NXhMYi/+MBRTCcv/aIcN04YahJUI05HEMrh7WHMpN7PH/Egd//yXwIkuxwsEbeH1LBNv4DWyDgqOpEJ5JlA90uAlHH1qqiI0Ts4WRqTI8nzdXXLIYzoqN2cy2fAYWLbegkJa0fP50BUmocEhJAgL+r+eeIerW7H/v4YvF03VFrm0ot9DHJ0sLeO5dkDEHxS5l8MK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Alexei Starovoitov Add unit tests for bpf_arena_alloc/free_pages() functionality and bpf_arena_common.h with a set of common helpers and macros that is used in this test and the following patches. Also modify test_loader that didn't support running bpf_prog_type_syscall programs. Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/DENYLIST.aarch64 | 1 + tools/testing/selftests/bpf/DENYLIST.s390x | 1 + .../testing/selftests/bpf/bpf_arena_common.h | 70 ++++++++++++++ .../selftests/bpf/prog_tests/verifier.c | 2 + .../selftests/bpf/progs/verifier_arena.c | 91 +++++++++++++++++++ tools/testing/selftests/bpf/test_loader.c | 9 +- 6 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/bpf/bpf_arena_common.h create mode 100644 tools/testing/selftests/bpf/progs/verifier_arena.c diff --git a/tools/testing/selftests/bpf/DENYLIST.aarch64 b/tools/testing/selftests/bpf/DENYLIST.aarch64 index 5c2cc7e8c5d0..8e70af386e52 100644 --- a/tools/testing/selftests/bpf/DENYLIST.aarch64 +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64 @@ -11,3 +11,4 @@ fill_link_info/kprobe_multi_link_info # bpf_program__attach_kprobe_mu fill_link_info/kretprobe_multi_link_info # bpf_program__attach_kprobe_multi_opts unexpected error: -95 fill_link_info/kprobe_multi_invalid_ubuff # bpf_program__attach_kprobe_multi_opts unexpected error: -95 missed/kprobe_recursion # missed_kprobe_recursion__attach unexpected error: -95 (errno 95) +verifier_arena # JIT does not support arena diff --git a/tools/testing/selftests/bpf/DENYLIST.s390x b/tools/testing/selftests/bpf/DENYLIST.s390x index 1a63996c0304..ded440277f6e 100644 --- a/tools/testing/selftests/bpf/DENYLIST.s390x +++ b/tools/testing/selftests/bpf/DENYLIST.s390x @@ -3,3 +3,4 @@ exceptions # JIT does not support calling kfunc bpf_throw (exceptions) get_stack_raw_tp # user_stack corrupted user stack (no backchain userspace) stacktrace_build_id # compare_map_keys stackid_hmap vs. stackmap err -2 errno 2 (?) +verifier_arena # JIT does not support arena diff --git a/tools/testing/selftests/bpf/bpf_arena_common.h b/tools/testing/selftests/bpf/bpf_arena_common.h new file mode 100644 index 000000000000..07849d502f40 --- /dev/null +++ b/tools/testing/selftests/bpf/bpf_arena_common.h @@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ +#pragma once + +#ifndef WRITE_ONCE +#define WRITE_ONCE(x, val) ((*(volatile typeof(x) *) &(x)) = (val)) +#endif + +#ifndef NUMA_NO_NODE +#define NUMA_NO_NODE (-1) +#endif + +#ifndef arena_container_of +#define arena_container_of(ptr, type, member) \ + ({ \ + void __arena *__mptr = (void __arena *)(ptr); \ + ((type *)(__mptr - offsetof(type, member))); \ + }) +#endif + +#ifdef __BPF__ /* when compiled as bpf program */ + +#ifndef PAGE_SIZE +#define PAGE_SIZE __PAGE_SIZE +/* + * for older kernels try sizeof(struct genradix_node) + * or flexible: + * static inline long __bpf_page_size(void) { + * return bpf_core_enum_value(enum page_size_enum___l, __PAGE_SIZE___l) ?: sizeof(struct genradix_node); + * } + * but generated code is not great. + */ +#endif + +#if defined(__BPF_FEATURE_ARENA_CAST) && !defined(BPF_ARENA_FORCE_ASM) +#define __arena __attribute__((address_space(1))) +#define cast_kern(ptr) /* nop for bpf prog. emitted by LLVM */ +#define cast_user(ptr) /* nop for bpf prog. emitted by LLVM */ +#else +#define __arena +#define cast_kern(ptr) bpf_arena_cast(ptr, BPF_ARENA_CAST_KERN, 1) +#define cast_user(ptr) bpf_arena_cast(ptr, BPF_ARENA_CAST_USER, 1) +#endif + +void __arena* bpf_arena_alloc_pages(void *map, void __arena *addr, __u32 page_cnt, + int node_id, __u64 flags) __ksym __weak; +void bpf_arena_free_pages(void *map, void __arena *ptr, __u32 page_cnt) __ksym __weak; + +#else /* when compiled as user space code */ + +#define __arena +#define __arg_arena +#define cast_kern(ptr) /* nop for user space */ +#define cast_user(ptr) /* nop for user space */ +__weak char arena[1]; + +#ifndef offsetof +#define offsetof(type, member) ((unsigned long)&((type *)0)->member) +#endif + +static inline void __arena* bpf_arena_alloc_pages(void *map, void *addr, __u32 page_cnt, + int node_id, __u64 flags) +{ + return NULL; +} +static inline void bpf_arena_free_pages(void *map, void __arena *ptr, __u32 page_cnt) +{ +} + +#endif diff --git a/tools/testing/selftests/bpf/prog_tests/verifier.c b/tools/testing/selftests/bpf/prog_tests/verifier.c index 9c6072a19745..985273832f89 100644 --- a/tools/testing/selftests/bpf/prog_tests/verifier.c +++ b/tools/testing/selftests/bpf/prog_tests/verifier.c @@ -4,6 +4,7 @@ #include "cap_helpers.h" #include "verifier_and.skel.h" +#include "verifier_arena.skel.h" #include "verifier_array_access.skel.h" #include "verifier_basic_stack.skel.h" #include "verifier_bitfield_write.skel.h" @@ -118,6 +119,7 @@ static void run_tests_aux(const char *skel_name, #define RUN(skel) run_tests_aux(#skel, skel##__elf_bytes, NULL) void test_verifier_and(void) { RUN(verifier_and); } +void test_verifier_arena(void) { RUN(verifier_arena); } void test_verifier_basic_stack(void) { RUN(verifier_basic_stack); } void test_verifier_bitfield_write(void) { RUN(verifier_bitfield_write); } void test_verifier_bounds(void) { RUN(verifier_bounds); } diff --git a/tools/testing/selftests/bpf/progs/verifier_arena.c b/tools/testing/selftests/bpf/progs/verifier_arena.c new file mode 100644 index 000000000000..0e667132ef92 --- /dev/null +++ b/tools/testing/selftests/bpf/progs/verifier_arena.c @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ + +#include +#include +#include +#include "bpf_misc.h" +#include "bpf_experimental.h" +#include "bpf_arena_common.h" + +struct { + __uint(type, BPF_MAP_TYPE_ARENA); + __uint(map_flags, BPF_F_MMAPABLE); + __uint(max_entries, 2); /* arena of two pages close to 32-bit boundary*/ + __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */ +} arena SEC(".maps"); + +SEC("syscall") +__success __retval(0) +int basic_alloc1(void *ctx) +{ + volatile int __arena *page1, *page2, *no_page, *page3; + + page1 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); + if (!page1) + return 1; + *page1 = 1; + page2 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); + if (!page2) + return 2; + *page2 = 2; + no_page = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); + if (no_page) + return 3; + if (*page1 != 1) + return 4; + if (*page2 != 2) + return 5; + bpf_arena_free_pages(&arena, (void __arena *)page2, 1); + if (*page1 != 1) + return 6; + if (*page2 != 0) /* use-after-free should return 0 */ + return 7; + page3 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); + if (!page3) + return 8; + *page3 = 3; + if (page2 != page3) + return 9; + if (*page1 != 1) + return 10; + return 0; +} + +SEC("syscall") +__success __retval(0) +int basic_alloc2(void *ctx) +{ + volatile char __arena *page1, *page2, *page3, *page4; + + page1 = bpf_arena_alloc_pages(&arena, NULL, 2, NUMA_NO_NODE, 0); + if (!page1) + return 1; + page2 = page1 + __PAGE_SIZE; + page3 = page1 + __PAGE_SIZE * 2; + page4 = page1 - __PAGE_SIZE; + *page1 = 1; + *page2 = 2; + *page3 = 3; + *page4 = 4; + if (*page1 != 1) + return 1; + if (*page2 != 2) + return 2; + if (*page3 != 0) + return 3; + if (*page4 != 0) + return 4; + bpf_arena_free_pages(&arena, (void __arena *)page1, 2); + if (*page1 != 0) + return 5; + if (*page2 != 0) + return 6; + if (*page3 != 0) + return 7; + if (*page4 != 0) + return 8; + return 0; +} + +char _license[] SEC("license") = "GPL"; diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c index ba57601c2a4d..524c38e9cde4 100644 --- a/tools/testing/selftests/bpf/test_loader.c +++ b/tools/testing/selftests/bpf/test_loader.c @@ -501,7 +501,7 @@ static bool is_unpriv_capable_map(struct bpf_map *map) } } -static int do_prog_test_run(int fd_prog, int *retval) +static int do_prog_test_run(int fd_prog, int *retval, bool empty_opts) { __u8 tmp_out[TEST_DATA_LEN << 2] = {}; __u8 tmp_in[TEST_DATA_LEN] = {}; @@ -514,6 +514,10 @@ static int do_prog_test_run(int fd_prog, int *retval) .repeat = 1, ); + if (empty_opts) { + memset(&topts, 0, sizeof(struct bpf_test_run_opts)); + topts.sz = sizeof(struct bpf_test_run_opts); + } err = bpf_prog_test_run_opts(fd_prog, &topts); saved_errno = errno; @@ -649,7 +653,8 @@ void run_subtest(struct test_loader *tester, } } - do_prog_test_run(bpf_program__fd(tprog), &retval); + do_prog_test_run(bpf_program__fd(tprog), &retval, + bpf_program__type(tprog) == BPF_PROG_TYPE_SYSCALL ? true : false); if (retval != subspec->retval && subspec->retval != POINTER_VALUE) { PRINT_FAIL("Unexpected retval: %d != %d\n", retval, subspec->retval); goto tobj_cleanup;