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 71709427A04 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=1790293205; cv=none; b=cPJ7QZSEtnJy8ZKkwwqW4v2rI7qchEdIJ8n9Cas3gCXbgAbuFoyhZq/Tv2QdD8L06r3XoiVWdUa5LGX79Z36IJ6CoX1MJYEzqv+mjvKdLNBSujpFagDuTMLcjm3QqKD3AWrvURkmuKLPJ1p6X2E1iIC+zkh9ueVzLljgS1hPLL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790293205; c=relaxed/simple; bh=4h4cpDObZqi2JEPN69eOCH4YBG2slYUeYHjBIAENU48=; h=Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To: References:MIME-Version; b=nAJGI2ECLTssoWu5s1XyHMhfI1MLp+WrSKt52wLoqBC97iRCRBhqYza5JvUpfGlpKfKCbpQOlZuKx/lBjvLPIlnFxAjSIODI5gG/3hfyY5DW7bx+aTJDQVGH8xxW38PIigxBpkEKdTVRRksVhCdePKtpyO+rpTbsf51rWBAsD4Q= 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-2db18fe433fso1037665ad.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=xmCbSuDtrLGLJ6McAl2SbtZSyB1cJuX2CHTbPTTgnyRLO6Ag+Tsk+vKNm/RL9T8bZO Cr3i5aqaWwZbA1GLQIH/sJcK5rxu5Bu2LGiEuLoJY/b6wcWZjp9C7CjqLEgdEqV64An8 4mrh9rYvpTV00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:39e:6c69: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: rust-for-linux@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.