From nobody Thu Oct 10 22:23:53 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPknG0ndDz5Yksc for ; Thu, 10 Oct 2024 22:24:02 +0000 (UTC) (envelope-from vadimnuclight@gmail.com) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPknF0Y6Bz4lhQ for ; Thu, 10 Oct 2024 22:24:01 +0000 (UTC) (envelope-from vadimnuclight@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=O4sp7Zrk; spf=pass (mx1.freebsd.org: domain of vadimnuclight@gmail.com designates 2a00:1450:4864:20::234 as permitted sender) smtp.mailfrom=vadimnuclight@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2fb2e21b631so3891781fa.0 for ; Thu, 10 Oct 2024 15:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728599038; x=1729203838; darn=freebsd.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HO5UFR7Av1lM/tHrEgFid5gJGAKLwVGttB0YlxJXSTg=; b=O4sp7ZrkHHtu0I5kfjs/vcpCSZ/iaYWBrPv31xrItmVbS4M7g2wmtWurwEMbNR+bJi nW2jWN3jrhCXu8nBoseHDOMTY7kF1THil7ZjWTjKhJKNBgkFL+a/NOuXoJM5LfLfppxJ k8Oi9DvLBWKS1MbHfzJWTq2BGPQlBcuyjh2dicmZiTEUIxnldDHRFNXn2C8TzXTHC7Nj XLAoR7neORukFkjSN4DStPnynxPTdBRaWSOg5fXBWaeDmCUUdw0jvRzP3qXDaQda3I3C jXsxAoEh/s+oKukh2cydbfZjCMcIhEwMMtsLcCX+rfOpte+TCizIfnv/UPMbdFxNpeIG 7x0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728599038; x=1729203838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HO5UFR7Av1lM/tHrEgFid5gJGAKLwVGttB0YlxJXSTg=; b=ofYzWW/O6y6lqCgeplpCtS2+PhNaorfwyT96qaqEZe9IB+/hJCLynktEdEGCBPHvsI 70DFXjMzINp9/8sORCx3OiMRg6szgTa/t/x2fF5w7RHk80txN7f01tjFhKfR/1vktX6Z GwkqeU1uPh7g7pe7yaH3kDzN+5jx+RKa5lpCUc/Dd/8ixCDuqjdOtBZklIVHH3g2uu4i 34pyrQ90YMuzuPaSjK5SnF0YC2iu2B1RE/bXcp3nkepPuUII7xtlHeT99qGU2nz5Dkg8 jNyu4h02ga4iFSPWpFiZP5TAWScJbYqMjD3IegbX3j2/I+F5SphRvALLtIJlinRirEOz 1vpw== X-Gm-Message-State: AOJu0YwVPWJHfnazFMz29qunwtHn6gbtKEa1MIcsPM2A41lDs+bFETAN ZzX9pcPZribTvrtdcX0Hr7klF+xJ32X2GWac+Q1uE1jGxCQ0LWddLhFvM7Xp X-Google-Smtp-Source: AGHT+IF4sITiOShFK+7FjuGBKlL8HLvYW7TF8/0P9LfTSBcKDHinbhP2eppXDvOIamLVfzDbHuvD+w== X-Received: by 2002:a2e:6119:0:b0:2fa:faed:e86b with SMTP id 38308e7fff4ca-2fb30dfab1bmr1482871fa.13.1728599037794; Thu, 10 Oct 2024 15:23:57 -0700 (PDT) Received: from nuclight.lan ([37.204.254.214]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2fb24706343sm3402321fa.77.2024.10.10.15.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 15:23:57 -0700 (PDT) Date: Fri, 11 Oct 2024 01:23:53 +0300 From: Vadim Goncharov To: "Gavin D. Howard" Cc: "freebsd-hackers@FreeBSD.org" Subject: Re: BPF64: proposal of platform-independent hardware-friendly backwards-compatible eBPF alternative Message-ID: <20241011012353.59784a96@nuclight.lan> In-Reply-To: References: <20240910040544.125245ad@nuclight.lan> <20240910181711.5d324ac5@nuclight.lan> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd12.4) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.988]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::234:from] X-Rspamd-Queue-Id: 4XPknF0Y6Bz4lhQ X-Spamd-Bar: --- On Thu, 12 Sep 2024 06:29:38 +0000 "Gavin D. Howard" wrote: > > > If I understand Turing-completeness correctly, the "no backward > > > jumps but allow recursion and quit on stack overflow" is exactly > > > equivalent to having non-infinite loops. > > > > Sure, but then look at practical usefulness: suppose you have stack > > of 32 frames (current limit of eBPF and BPF64). Then you can have > > only 31 iterations on a loop, loosing ability to call more > > functions from loop body. > > That is true. > > However, I wonder if everyone is going at this the wrong way. More > specifically, I wonder if we are targeting the entirely wrong level. > Maybe verifying bytecode or some other low-level code form is just too > hard. What if it were easier just to provide a higher level language > that had enough restrictions to be just barely not Turing-complete. The problem is, then you need compiler of this language in target environment, e.g. kernel, because you cannot trust that compiler's output was not modified in a circumventing way. > To test that idea, I did a quick experiment. > > I have been working on a language called Yao for the past three years. > One feature I planned for the future was the ability to restrict what > packages and keywords are available at compile time. I had already > put in the plumbing, but I just hadn't implemented it. > > But I decided to quickly implement it as an experiment. > > First, I needed a stack limit: > > https://git.yzena.com/Yzena/Yc/commit/99c822bf7b > > Now, you can run this: > > ``` > $ ./release/yc yao --max-stack-depth=32