From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f41.google.com (mail-dl1-f41.google.com [74.125.82.41]) (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 322182DEA90 for ; Wed, 14 Jan 2026 20:46:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768423583; cv=none; b=AlVg0PXEt4S52YFH/DrGKvMSFsFZxxbMu5pfTRd03tvObp3UBOVNKwMXTTwS4ysBtRQBzRCy7XCk74jTdJRGRKx//NdByXOQETlA84RLEuDJN++enwHJEbvEHmaV673LGXuMKu6k9pn2+UvkerIfPHj7OXYZQiZWDSawqIudMFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768423583; c=relaxed/simple; bh=PSZqhr7fvldty9yhJSzFIySWtqFdFNfdF7+2G5csF+0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=g1W/DBZExxtE3TynM1CDsI5ZQTwBeK/3jIRGbo8+7neYYoIFI3rITvaqK8fSUB8HcJoJCO2lOfOeDjJBgo+Vi46bPqinwQdZIMSM01m54+jMbWMT5oK4UdCgfpGUWmzCi6UuI7EG/Y/kkmG7XPrkBY3De57uXRprGVmP2xFVoF0= 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=lBlN1yHD; arc=none smtp.client-ip=74.125.82.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lBlN1yHD" Received: by mail-dl1-f41.google.com with SMTP id a92af1059eb24-12331482b8fso559474c88.1 for ; Wed, 14 Jan 2026 12:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768423581; x=1769028381; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=PSZqhr7fvldty9yhJSzFIySWtqFdFNfdF7+2G5csF+0=; b=lBlN1yHD5PdmlZOB8fEUqRMUdVIt3Od9QNc7kylb6TetyCOvhWy+IKjGtW7NBvvqQI zhCQaDXOcXIU8aHyUOp6EVpEg7kkzgy/Y/iLK4GTLs+4NTIJz7Il41EHBxes0NZ4iESw OUZzOek1d4u7a+eso6RVvnG1x/5oB3eaBxs9g29E22Qovwkn5u7cZqxyYpN3pp6QPvun 82S29OcYl3IoRNvYKXcgvoLeyXGVf5t65Ht3dfOG+a2sud2TZkKxyzVvpPPp1nHhW8bP RdjFat52mvnHr2GOBBYmrC/ECHOyVE2wjNiANqUfSZz1knG6eWO8Yqoz1J+2FrOOpNd6 nJ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768423581; x=1769028381; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PSZqhr7fvldty9yhJSzFIySWtqFdFNfdF7+2G5csF+0=; b=h0rCB7Mq3rYXP5KrRMryD8hV+I6xnGEOwZiSE4XotRI+xU2CebTe9o7HDmYhsoKXbb 4brGUu+7gBlUXMUHFTSVaQ9PBQSuSr3s0YSAPXKy57tE2wZUl3f+VpHdUC3jUAsCW74E bC6XIga0xjgKp4pyfXUNeUiZqNq0EFPe2RttN/LZwhcMRySXSUsgk9tRqnooqVG0OKt4 XLcYHrjEThm37y8dd8jA3GQDXJccCi6QALrFuZuXCYb2MnJAD1mtpi81XwqcFC+Spz7X GpciRdwr2FlGF9N5YmQ4C8GE/k58ai4XqvpWBCtFsNjeSsaMoQWPhYOmQ5CzGi0l5rWF wsJA== X-Forwarded-Encrypted: i=1; AJvYcCXlJg51rGGJFQDBkGByA3gEoXvizPzsAJlcfQYftPeJuCWVi/4gXimiJSnLsDyCZu3vhZ+ATXs/AxqArWQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yxx9KkWyYXz2In3A/7PH2PZgO1AVrLwulSquP3bci4PsQnztZOB Xm5BKCf4bB4VYbg30D+/3LjdJ2cVPF0qhla8dn74euqMf7NI0zoss1FX X-Gm-Gg: AY/fxX5GOhAvCB4eUttflSk/u0B+au9IzaEcsI0sUFQMfABx7WN18BcbIHJK86s4F+6 +oNLrPFoGa1aDZcpF2i8hTIao86FAikv6/uVP7U6Jd6EIsaotbwGCwl67CuzgbkUKIRimeWeVHn IGYvYuyFCl1ICMEdDDKlPCAHFrMLIE/yAOxSUZhl+IXyNdNUZEUduJeTfxw2D3ixh/9tremgONj H1cPFDsVARTHMrdpoyIGcxQHmJ/1apZOX8AWwp/Xp70rdAOrdymBUQRWrpk2venq2mjWr+at9VW L6zWaUNTqAMBiZ23pvFZl9KinDOMl6DUY+BPwJNTA0Zj3PP0HlZE/WthCTbYvDyvqOQpEqpRL0y 1RNNm6MRBqs70/QrRwSU8iwWjE2DMeNdHsZ6n2gwObFz9/+qLYTlbHyCkWO2izk4b6rp6nyJ52b AFOct/pf3rUWJzXhmXl69soKDk2PbvyVaKwjBRRE7TBwnYg8RfV46wZOUNgiGse5+hfg== X-Received: by 2002:a05:7022:f516:b0:11e:3e9:3e99 with SMTP id a92af1059eb24-1233778d7d9mr3337201c88.49.1768423581158; Wed, 14 Jan 2026 12:46:21 -0800 (PST) Received: from ?IPv6:2a03:83e0:115c:1:19da:d3de:fbdf:aaba? ([2620:10d:c090:500::c9bd]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12316f2db84sm12839971c88.14.2026.01.14.12.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 12:46:20 -0800 (PST) Message-ID: <2e5ed01463ae8f79780a42c4e7f93baeafd2565a.camel@gmail.com> Subject: Re: [PATCH bpf-next v4 2/4] bpf: Add helper to detect indirect jump targets From: Eduard Zingerman To: Xu Kuohai , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Yonghong Song , Puranjay Mohan , Anton Protopopov Date: Wed, 14 Jan 2026 12:46:18 -0800 In-Reply-To: <20260114093914.2403982-3-xukuohai@huaweicloud.com> References: <20260114093914.2403982-1-xukuohai@huaweicloud.com> <20260114093914.2403982-3-xukuohai@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 (3.58.2-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-01-14 at 17:39 +0800, Xu Kuohai wrote: > From: Xu Kuohai >=20 > Introduce helper bpf_insn_is_indirect_target to determine whether a BPF > instruction is an indirect jump target. This helper will be used by > follow-up patches to decide where to emit indirect landing pad instructio= ns. >=20 > Add a new flag to struct bpf_insn_aux_data to mark instructions that are > indirect jump targets. The BPF verifier sets this flag, and the helper > checks it to determine whether an instruction is an indirect jump target. >=20 > Since bpf_insn_aux_data is only available before JIT stage, add a new > field to struct bpf_prog_aux to store a pointer to the bpf_insn_aux_data > array, making it accessible to the JIT. >=20 > For programs with multiple subprogs, each subprog uses its own private > copy of insn_aux_data, since subprogs may insert additional instructions > during JIT and need to update the array. For non-subprog, the verifier's > insn_aux_data array is used directly to avoid unnecessary copying. >=20 > Signed-off-by: Xu Kuohai > --- Hm, I've missed the fact insn_aux_data is not currently available to jit. Is it really necessary to copy this array for each subprogram? Given that we still want to free insn_aux_data after program load, I'd expect that it should be possible just to pass a pointer with an offset pointing to a start of specific subprogram. Wdyt? [...]