From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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 0388D28689A for ; Mon, 19 Jan 2026 07:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768806183; cv=none; b=lMcWPo8xihXCnx8wkMrweUJE8zPdf+ucnfL27Pd21qzOhxlYILWy5JNF3onuEx1YcfWncB18ZSzfyNmT0vKA5BGZP3f4HnLbzdYBx1KHrWh0xugDtp29D1+KXVBO5Tnk2ud5cpcKFJsaHHrXJ3YsboO2nYpJr0Ih16iCSeCvfTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768806183; c=relaxed/simple; bh=DdgCNbFnRFaEMMfPy9jfiV+sBRHcEwM8dVKuFJjqdSE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ss8FSMVbsiN3qP/+KkU6+nFdDmDfcpLKDIFvMIorwX0KpBBWNziTkrPh/Y2NUQHsZaUNDozXXXMYQAYvntTbOmeDzEmqwUgUJ/Lj0OOHSFPgN92KriStuuiRntLbUcHPWjUOpWwEufspLp+i+TvdZLDJXtzs8KnyBqO5LXVp8ic= 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=ZTBlbN63; arc=none smtp.client-ip=209.85.216.68 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="ZTBlbN63" Received: by mail-pj1-f68.google.com with SMTP id 98e67ed59e1d1-34ccbf37205so1948968a91.2 for ; Sun, 18 Jan 2026 23:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768806181; x=1769410981; 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=4cdRzCfUgSJDKZEWtKLgkcTp+mO+wBFV38oyrlfiOmQ=; b=ZTBlbN630zQCkj+hPuw8492sPwm/c66poOr5g+4nnYTkl8IBp6mxKCdgFHtiLf7cZA me3ZeUnwsOebYH4mo3BBZdWMf0vKCIGjR9Shg9Nl7MqAiolzbdor2mo9VNZIPAHDUuEZ HDj9niVBgpjnyjgrr2FbHThfEosGcWmI6JBgieG0Z4m2tz0nrf7UkQWfq82CIGZdv6bJ rtASabbQM/FUxl+aOLyc93OnLxeCRNmCb1mlGJ2csQllLRLPekbyF8JHQbLUezFrro64 LZaXlcA6u38szPPsrqFj3C2m/8uu78MJsk8DnrpaCDbpgmOd9lnXlzpruTD4AZB9ZXer IrEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768806181; x=1769410981; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4cdRzCfUgSJDKZEWtKLgkcTp+mO+wBFV38oyrlfiOmQ=; b=a9ZbpT0iUr2DySY9vzY9eHBpmB+HZ98K9HxuMCE6Q6jlxxe/0gzMmhP5p6+yaer/mN 7h7/sIOouh/0SbxSvDugsDiK+zh/uRxjc49Zt2pElUCEz3VVQHt/ErAriqw+Zjs0ODFy naSKcEWkH2WfI6rtZ3//fybmbPVDuWl73b/67mAzRdFOiV78yuDIZx0XDMwEdZ4gGo8q FH8whPFHQva0tvxSIHdU8x6uurJ2EiOlYe12F5WiM5sp0WEC9J+wv8c+1Ia4fBOuTA0V VbBAu3I2usRLYKpBdf73EjAluZA2af3P5jOLyJAIMqH8Y6JJcD80VEvbmNpISFdHgMw4 XtzQ== X-Forwarded-Encrypted: i=1; AJvYcCXrz2IDbBH7mrkLlM96oeIXFzMsFenS+ZMncSpGndUrsV/39HoVqB4Ulsb5oPstI+gBzzqiPqiyhHy4GFI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+sh8kPgpeHg5YQy7ZVl1afKUJs/9ZzXViE0Ws7b3dJztrvsBK 8LysmA6HOK2d0P4fgYEnJkkqjATz0ClPlbbf32lbHbF/7ndCvByKtwc9pxId1S0w X-Gm-Gg: AZuq6aL9gaK7qyuq9Wen8rcF309Zwr1gL4xyvwtasXkL5bfbRTdJ85lbz8azD++kUZ0 sFTsJL7GOLY9zd/E6klNqOYipXS4/Ig5l9NWEwDRmjmBhgX3KV1yNenWgMXZNgWvDwL6g1e+etC RXZ62n8gh8RqmJEhahzKa6pOvGI1sQHDZcl7H1dZsZHh2BpWU9SvbtBQ+yObtvFi0v628YcbtNI wIHoVU8uK+NxwzUPTPQ52OUH/Z35OaslppC8JGcC1SsK98j1mAvrT96GdN6Y/KAVRLpQJgBEhet tpG6MZv1XIn/gvRZKZxIxZZ+ATLw7jMAspeqekBB7NrD+PqB2gt+yUzR43smCTq0nJJG8sRwG1t fYIl58KwfJwygwxBbteBUQ8WL5VWPtQW5PquNOAJO7nsbb7mFMARZVUQymcVwrvKhBoqA9LPLaR W0GaIfK1m/Zi76jmOwkA0= X-Received: by 2002:a17:90b:5344:b0:34c:cb3c:f544 with SMTP id 98e67ed59e1d1-35273179d01mr8288444a91.14.1768806181104; Sun, 18 Jan 2026 23:03:01 -0800 (PST) Received: from 7940hx ([103.173.155.241]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-352677ec7dasm10772027a91.8.2026.01.18.23.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 23:03:00 -0800 (PST) From: Menglong Dong X-Google-Original-From: Menglong Dong To: ast@kernel.org, eddyz87@gmail.com Cc: daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v5 0/2] bpf, x86: inline bpf_get_current_task() for x86_64 Date: Mon, 19 Jan 2026 15:02:44 +0800 Message-ID: <20260119070246.249499-1-dongml2@chinatelecom.cn> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Inline bpf_get_current_task() and bpf_get_current_task_btf() for x86_64 to obtain better performance, and add the testcase for it. Changes since v4: * don't support the !CONFIG_SMP case * v4: https://lore.kernel.org/bpf/20260112104529.224645-1-dongml2@chinatelecom.cn/ Changes since v3: * handle the !CONFIG_SMP case * ignore the !CONFIG_SMP case in the testcase, as we enable CONFIG_SMP for x86_64 in the selftests Changes since v2: * implement it in the verifier with BPF_MOV64_PERCPU_REG() instead of in x86_64 JIT (Alexei). Changes since v1: * add the testcase * remove the usage of const_current_task Menglong Dong (2): bpf, x86: inline bpf_get_current_task() for x86_64 selftests/bpf: test the jited inline of bpf_get_current_task kernel/bpf/verifier.c | 22 ++++++++++++ .../selftests/bpf/prog_tests/verifier.c | 2 ++ .../selftests/bpf/progs/verifier_jit_inline.c | 35 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 tools/testing/selftests/bpf/progs/verifier_jit_inline.c -- 2.52.0