From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 583652230C for ; Fri, 26 Apr 2024 17:11:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714151469; cv=none; b=fRd/yk8LCENYtmGHSXF6PIysv5D/oOz8ANsipKWSIH/fv7V25E0Fp4mnGgdDVRRsipjT3DLkPN1ah3XILRxMxMAldx4cCBTBlgp8aXzg3DfyNY9qjcRUxtF5B/uPxAPCNmq2T/kzoqqSvB16ndsAETWr/5wxDxcApP+BJWhqVwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714151469; c=relaxed/simple; bh=vp4EewgOAvB0hUY10fQnqWOhJqcUtLpXe3JwUECRiuU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=AoqiL3yHhzKvGC3S+RI4EOiA7w5ewwOrnFhy0LA09FhzwJQlpyvw+dk1CtsQCQbE8sdZuUlzpeHZvCf3UZCS6GCno68NO7TPfjz/3xpRrXt9WVz8avVXM4pWg7v8NIHy+OjnJob+/HRZkiWCI14vgiSp022J9FtFCyULANJn2tc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b=iXAun7Bf; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="iXAun7Bf" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e65a1370b7so22129275ad.3 for ; Fri, 26 Apr 2024 10:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1714151467; x=1714756267; 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=hdvIkzQYL0QUQIUZDBpESmAbo+26vKvrycV4Z6MfDZw=; b=iXAun7BfHCyt7EwpERDP06ouRZCUv7obvPwwKhMZd/ukaEyYv7vOL0/q0Mg2FchSWn bt9rYq2i6xDOzcD8DOFGGBAgDOndmDOmBttsK/rWVCDDFUhp+3+XWjTUmjRkWFXWtlkF M5trz2SLkHb7SjxQxNEA0ChOhenMj7Tx+ApcuuTwrgzX8I67HvpaLZj5kh1OTOCV6Py8 WeCZdqg3tAWY5CBm38/NnvWlZytDo9Fw3Mi7HfgpI5UyteofSeLcolnnb4LqZa9dwz31 0ZgeD+CCmsrKhQcAJbH+ShVDQLAQsKDxMvUx1whnpBR8aHQxpn2kRGeUfMYAU74u+WU/ 7GpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714151467; x=1714756267; 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=hdvIkzQYL0QUQIUZDBpESmAbo+26vKvrycV4Z6MfDZw=; b=e5dj69OumSxKtPKVBzJ2PLEoq7IO9JJ/61Xm+4PXuB9UavnSvMPkk137tZ9GizmRqi RzlsHbEtOdL+si9UpOKXdHdZG9m3RIBz0hur7gV0y+wfBi8q/6yBJ4vQQrCQslJB5/ed DKG3smsuXcHHNdrKNQt/uLjeQPQXtj66fJwhxTll1ab2DL0epX6x4F4U7UXdswBF3/fl dxk7WZl4OufE+zfv3sLOZP+LzLqTlCLjcc62ZV7VlEcNCmVZJM6uXQvoIc2N3lx/1vBk o5VOp0DSt9mAoeZhYJrJNGqhj2L2Iw+mD/fuqklekWKISwSE1A/3ruDIXqi0NQegTnbg UZJA== X-Gm-Message-State: AOJu0Yzr+mdPy7fmX+jLntfxK4ayuL/4uoK4HTQ29eW1+/HyS71j9rrD sXLRk2Xce3w4kYYKNtlOJD7vhi9RX7X2Dxqpscmmj9GjlRgN0EP/SL7xV9ve X-Google-Smtp-Source: AGHT+IElEKZ8x0CBcgq/KkKh2SpyS80PR7LG5hgyM43/sAPnP0ZwsNN8Dr+kPqnGunXRe4lnmJwEUg== X-Received: by 2002:a17:902:cec3:b0:1e4:48e7:3dab with SMTP id d3-20020a170902cec300b001e448e73dabmr5051864plg.38.1714151467302; Fri, 26 Apr 2024 10:11:07 -0700 (PDT) Received: from ubuntu2310.lan (c-67-170-74-237.hsd1.wa.comcast.net. [67.170.74.237]) by smtp.gmail.com with ESMTPSA id n10-20020a170902d2ca00b001e27dcfdf15sm15664394plc.145.2024.04.26.10.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:11:06 -0700 (PDT) From: Dave Thaler X-Google-Original-From: Dave Thaler To: bpf@vger.kernel.org Cc: bpf@ietf.org, Dave Thaler , Dave Thaler Subject: [PATCH bpf-next] bpf, docs: Clarify PC use in instruction-set.rst Date: Fri, 26 Apr 2024 10:11:03 -0700 Message-Id: <20240426171103.3496-1-dthaler1968@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch elaborates on the use of PC by expanding the PC acronym, explaining the units, and the relative position to which the offset applies. Signed-off-by: Dave Thaler --- Documentation/bpf/standardization/instruction-set.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst index b44bdacd0..5592620cf 100644 --- a/Documentation/bpf/standardization/instruction-set.rst +++ b/Documentation/bpf/standardization/instruction-set.rst @@ -469,6 +469,11 @@ JSLT 0xc any PC += offset if dst < src signed JSLE 0xd any PC += offset if dst <= src signed ======== ===== ======= ================================= =================================================== +where 'PC' denotes the program counter, and the offset to increment by +is in units of 64-bit instructions relative to the instruction following +the jump instruction. Thus 'PC += 1' results in the next instruction +to execute being two 64-bit instructions later. + The BPF program needs to store the return value into register R0 before doing an ``EXIT``. -- 2.40.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ietf.org (mail.ietf.org [50.223.129.194]) (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 F0FEB2230C for ; Fri, 26 Apr 2024 17:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=50.223.129.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714151481; cv=none; b=miW+TISWYfKMW+DZSR3IebrUzwiZuiS0eJi3ghxwuuePS70EpLJbXZ9fb0MNs0KNBWn0DgTyirXRj+gK2fR96AZVBEO+2qPDB+egcIEx37V9CTrtBF7mNkg4yvdeFrX4PBu4CNgNfhHno7kq9H/3/csClCiNDPxUh1lVQ6iMz0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714151481; c=relaxed/simple; bh=7F83scvny5HLxbKUxWo8/UgBnoadOaVIdCLLaSNSKWU=; h=To:Cc:Date:Message-Id:MIME-Version:Subject:Content-Type:From; b=OHYJyXv8k3MXtpfrC1O8eWj05tBdOeNTc0qDkeI58uhawbGYY3dfiQbuwHOj1F+3V2a5z4f7w7JIlGrs7swoVUqf0WVCGOirvZH+a7Ocyi5po+1r8wRI7bLJvSUcTSCKalwlGUyMBqktyOOjS06fAeT33RPWcBqHuK7tnF38Z4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dmarc.ietf.org; spf=pass smtp.mailfrom=ietf.org; dkim=pass (1024-bit key) header.d=ietf.org header.i=@ietf.org header.b=KnOGF2d6; dkim=fail (1024-bit key) header.d=ietf.org header.i=@ietf.org header.b=OKki465a reason="signature verification failed"; dkim=fail (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b=Wk5W7ttl reason="signature verification failed"; arc=none smtp.client-ip=50.223.129.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dmarc.ietf.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ietf.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ietf.org header.i=@ietf.org header.b="KnOGF2d6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ietf.org header.i=@ietf.org header.b="OKki465a"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="Wk5W7ttl" Received: from ietfa.amsl.com (localhost [IPv6:::1]) by ietfa.amsl.com (Postfix) with ESMTP id 3A463C169433 for ; Fri, 26 Apr 2024 10:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1714151473; bh=7F83scvny5HLxbKUxWo8/UgBnoadOaVIdCLLaSNSKWU=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=KnOGF2d6mB76ZB/HVGkvOhsH11h2q+IAB2pnigViaGPI6MvfMxQ9Tibwn4e+opgot OsfrWB54I6zqFJqrQ8LVQpWpto8upkYl9fD3kIAolX/Nwgx2Yl5VezLS7q8yXBtSCf SFwaRh0RmDgGSQVekh8YPlZ9fVnfcX7lYvSKSJc4= Received: from ietfa.amsl.com (localhost [IPv6:::1]) by ietfa.amsl.com (Postfix) with ESMTP id 172D1C14F738; Fri, 26 Apr 2024 10:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1714151473; bh=7F83scvny5HLxbKUxWo8/UgBnoadOaVIdCLLaSNSKWU=; h=From:To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=OKki465ahnZRoJJM07xNHT3RAs1JWZi4dsmF4R28dTHehNKs3a54+HzulGtvKudHz Arw/919hlUXHSsKAM2aWwuksp8hlQNwxLrPI9Ef7nelBzWwiJ5SN5ex2gf+JkDzMPc LAo+2G6gZj2FuEaMo98cM1UlRU8XO0MyQXwOYksU= Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EEC0CC14F738 for ; Fri, 26 Apr 2024 10:11:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at amsl.com X-Spam-Flag: NO X-Spam-Score: -6.845 X-Spam-Level: Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EEylUXgC4zCZ for ; Fri, 26 Apr 2024 10:11:08 -0700 (PDT) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 306F4C14F6F7 for ; Fri, 26 Apr 2024 10:11:08 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e8bbcbc2b7so22153025ad.0 for ; Fri, 26 Apr 2024 10:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1714151467; x=1714756267; darn=ietf.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hdvIkzQYL0QUQIUZDBpESmAbo+26vKvrycV4Z6MfDZw=; b=Wk5W7ttl33Wzaf6/OSRz0e0wDCMPBuM9cCZ0Gc9kmIacBL7DzDG1U97zZuGkE/fS+I 4uIvTpF0Fqqb6IQ4JduBlD6ZrjV8QJO2tVCMhILL2BvsIbuGCiknM1VDBG+4xZdpooei YAwigFaW4e2RZX5nRfYiGHWpKOG4GS5bpK6nXNAd7e3RkqRwcOgJ248bxlEmAIJoSMbu 8A4nmwWK+oBd5yfMeQkNDY1iPggDMkZmfqqRxYv87I3HRhxsg3JbQtQSgaNVVpNKILOG P4d/SdhQLic4PlJ1HK8NoPuufQkQOQCUpIC+HNYeE9VQVMaSbt2VAOevpKW94a1bKmLY yGCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714151467; x=1714756267; 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=hdvIkzQYL0QUQIUZDBpESmAbo+26vKvrycV4Z6MfDZw=; b=RZueJ9xYtxSzaPhyNzq4oWnb4FS71ZOCsr+FjOxGwMPOy7RxzFydBqe40Ne5aE1p+F bYTMAs+swgyvo6AG8g7Tpmlx5teW3G0A4lM95d9KexEUZdIjJ4IVnnbHptc4rvOfsHBy mGi6B445X7VG4FeKUd+UyDmBVC5bD9ViQAuYbpShAuT5xPqlBc7GUsJhFQr3kRaIcjic YbqqVwx1ro8C5wUbQ4gftciX5agiiGpldpqgDVDiXift9JlwuRkHM1PUsElOQra745q9 KPLzXGazAVRfwOc84mOeW50jv8B/t0G3NDb//WjsoqlR9zVE8kBwgcZp1LePfmjDvMXy FX7Q== X-Gm-Message-State: AOJu0Yyim8DSf2IAzo96hvxb2iGZDb6Bikqx6ndm05oQe8xXfbrLYtYP ee4mb2afMQsfBTwQ0QQCDJ7spCa/LCsBct/OjR5PE/So8orcdP0h X-Google-Smtp-Source: AGHT+IElEKZ8x0CBcgq/KkKh2SpyS80PR7LG5hgyM43/sAPnP0ZwsNN8Dr+kPqnGunXRe4lnmJwEUg== X-Received: by 2002:a17:902:cec3:b0:1e4:48e7:3dab with SMTP id d3-20020a170902cec300b001e448e73dabmr5051864plg.38.1714151467302; Fri, 26 Apr 2024 10:11:07 -0700 (PDT) Received: from ubuntu2310.lan (c-67-170-74-237.hsd1.wa.comcast.net. [67.170.74.237]) by smtp.gmail.com with ESMTPSA id n10-20020a170902d2ca00b001e27dcfdf15sm15664394plc.145.2024.04.26.10.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:11:06 -0700 (PDT) X-Google-Original-From: Dave Thaler To: bpf@vger.kernel.org Cc: bpf@ietf.org, Dave Thaler , Dave Thaler Date: Fri, 26 Apr 2024 10:11:03 -0700 Message-ID: <20240426171103.3496-1-dthaler1968@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Archived-At: Subject: [Bpf] [PATCH bpf-next] bpf, docs: Clarify PC use in instruction-set.rst X-BeenThere: bpf@ietf.org X-Mailman-Version: 2.1.39 Precedence: list List-Archive: List-Post: List-Help: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: bpf-bounces@ietf.org Sender: "Bpf" X-Original-From: Dave Thaler From: Dave Thaler Message-ID: <20240426171103.8Qbr0uRoECpn7q2nJd3n7746Xu0PXahyjBZF2PEubko@z> This patch elaborates on the use of PC by expanding the PC acronym, explaining the units, and the relative position to which the offset applies. Signed-off-by: Dave Thaler --- Documentation/bpf/standardization/instruction-set.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst index b44bdacd0..5592620cf 100644 --- a/Documentation/bpf/standardization/instruction-set.rst +++ b/Documentation/bpf/standardization/instruction-set.rst @@ -469,6 +469,11 @@ JSLT 0xc any PC += offset if dst < src signed JSLE 0xd any PC += offset if dst <= src signed ======== ===== ======= ================================= =================================================== +where 'PC' denotes the program counter, and the offset to increment by +is in units of 64-bit instructions relative to the instruction following +the jump instruction. Thus 'PC += 1' results in the next instruction +to execute being two 64-bit instructions later. + The BPF program needs to store the return value into register R0 before doing an ``EXIT``. -- 2.40.1 -- Bpf mailing list Bpf@ietf.org https://www.ietf.org/mailman/listinfo/bpf