From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f13.google.com (mail-pj2-f13.google.com [74.125.227.141]) (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 9866943B6C5 for ; Thu, 24 Sep 2026 23:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790293206; cv=none; b=HTgloftxGfQv4OsPoW6y7xRnI537ld2XTzSmqP+0PGHLwA6NOpZ0tsS2bwIQVhq2UUergUDMbiuJK3WzjCVGNzV/hslacJyyy9Pv903abGW0M+VvIBwVBFZBt7xH/1kFTa6U8uZ/xfFL5W01NNn1fXMCJ4Jr429QMUuUKOiEEJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790293206; c=relaxed/simple; bh=4h4cpDObZqi2JEPN69eOCH4YBG2slYUeYHjBIAENU48=; h=Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To: References:MIME-Version; b=oZ2W8gwYU4JSWesAgNW+foxNpmKs58gJvZ0xANX0ygqtwMLFAV/l80Mv592g3fpq/0cydnbTFRoFkWlfkXFzB7mqbR3cxX72lgZsm2El8GlF1cYrUIIy+Q5NNXphRvd1n/9pwQqfsE6mAeqYW3H3vDurezBCpUSXBVog9ZmXM1M= 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=ZGFYs1jG; arc=none smtp.client-ip=74.125.227.141 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="ZGFYs1jG" Received: by mail-pj2-f13.google.com with SMTP id d9443c01a7336-2db18fe433fso1037695ad.2 for ; Thu, 24 Sep 2026 16:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790293204; x=1790898004; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=gn5dD1CJfoor6GODqvLgahaKF8S1PUZ5xI0XuIL5LIc=; b=ZGFYs1jG/Xr4uwPy2133K5sF0poGH1omJ0ns5UwD8enApwiJPDDFi1gLMSA+UY+qrO 6lyZmvL2zJXgrS4urBwMTV3vFSBosNfxEeAHC2L0cHJkMBE9Oj9QKSvAuXGCWTgwH0c7 yWYOAFlZXJt9BDXnhQUwZElM3+pKqDf9ymR/77Qjhm4q2k9A8H7TmnWzDJf4Vw1zQ8Vz HgO06YL+sF+7Efo+udo1jYXz4T5XB+sMNcQcYJJG3eDGSkCa/UybsOWnOQ+yWqiUaJ9C yc+2TaftdirQziHgwjLgiQLYNZ+cgLnH7mjbZhOQnbR+1/zQ5qgml8qc2Dm7Da1OEro+ myTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790293204; x=1790898004; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gn5dD1CJfoor6GODqvLgahaKF8S1PUZ5xI0XuIL5LIc=; b=PeCF6VdZ75mtJEJlauclwEUFP6xBF4kDZr5oOjCkqvKM1VpKN6j1lvCfDfjn3T9sot silM/CxSa4I3Trm//WN0ApIrxeS/I2ZjHzTTvO7lzWV8/5bRCG8EU9e8Xz9SvRs8N7jm fbVEwymBaU+lfRNUa+QZnzhAx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:34d8 with SMTP id 98e67ed59e1d1-3a098fc574cmr3554656a91.60.1790293203799; Thu, 24 Sep 2026 16:40:03 -0700 (PDT) Received: from localhost ([153.61.198.240]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3a0b8efaeb3sm909723a91.2.2026.09.24.16.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2026 16:40:03 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Date: Thu, 24 Sep 2026 23:40:01 +0000 Message-Id: Cc: "Leon Hwang" , "Ihor Solodrai" , "Josh Poimboeuf" , , , , , , , , , , "Ben Cressey" , "Florent Revest (Anthropic)" Subject: Re: [PATCH v2 6/9] arm64: cfi: Use CONFIG_ARM64_FUNCTION_PREFIX_NOPS for the type hash offset From: "Alexei Starovoitov" To: "Jose Fernandez (Anthropic)" , "Steven Rostedt" , "Masami Hiramatsu" , "Mark Rutland" , "Mathieu Desnoyers" , "Nathan Chancellor" , "Nicolas Schier" , "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , "Catalin Marinas" , "Will Deacon" , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Martin KaFai Lau" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , "Emil Tsalapatis" , "Puranjay Mohan" , "Xu Kuohai" , "Ard Biesheuvel" , "Ilias Apalodimas" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Daniel Almeida" , "Tamir Duberstein" , "Alexandre Courbot" , =?utf-8?q?Onur_=C3=96zkan?= , "Sami Tolvanen" , "Kees Cook" In-Reply-To: <20260924-b4-arm64-callops-kcfi-v2-6-587865b6d991@linux.dev> References: <20260924-b4-arm64-callops-kcfi-v2-0-587865b6d991@linux.dev> <20260924-b4-arm64-callops-kcfi-v2-6-587865b6d991@linux.dev> X-Mailer: mkdraft (claude review draft; edit before sending) Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, Sep 24, 2026 at 10:35 PM Jose Fernandez (Anthropic) wrote: > static inline void emit_kcfi(u32 hash, struct jit_ctx *ctx) > { > - if (IS_ENABLED(CONFIG_CFI)) > - emit_u32_data(hash, ctx); > + if (!IS_ENABLED(CONFIG_CFI)) > + return; > + > + emit_u32_data(hash, ctx); > + for (int i = 0; i < CONFIG_ARM64_FUNCTION_PREFIX_NOPS; i++) > + emit(A64_NOP, ctx); > } For the series: Acked-by: Alexei Starovoitov unrelated minor issue: ctx.offset[] is counted from ro_image, but bpf_prog_fill_jited_linfo() adds it to prog->bpf_func which is ro_image + cfi_get_offset(). So with CFI jited_line_info is already off by one insn. After this patch it will be off by 4 or 6. s390 does jit.addrs[i] -= cfi_get_offset(); before the call. Would be great to send a follow up eventually.