From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 AC76431ED65 for ; Mon, 15 Dec 2025 10:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765793570; cv=none; b=cpuxJ/1MHeKB4wKnNxon2pxWrWTvUJiqDFTrpvTxpJjhB5Hi+whYKsHa1/GGEP7dVERZeaUAwVnOUaWtfmKdRJhpk7geu2Aca5JBAsp/DSZpA+jaU37rcjPluzjLccAdfBEElN8mPsXEgQWh61m7Ja0M+ugBzyK7dzwf/qza7bQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765793570; c=relaxed/simple; bh=r0WIO57ls/lLDWVBE0Y7r+SApfy5C/agl3LDwzRipR0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=uS1VuA1MIEqSXetLzAM78666EwgOo5oUy31m6XAuowqdEWZpnS2KkWIF2xIxF1qXRVEBQ/NK/AD3Uu7t3qdj4NFU/gA2G3ugqJDkDgAphixD9JNl+k9rRJ/58VnbSBOe50L+8z//DEpDl/NzdJhsnILZhvVGP+ZG0QmlElQE2FQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=egbb7VKy; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="egbb7VKy" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-47a83800743so15869715e9.0 for ; Mon, 15 Dec 2025 02:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765793564; x=1766398364; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=VN0V1tPgvY8SofsZQUsWAMHh5jjoUhKRWaN4QsOByNk=; b=egbb7VKyuygCzWu/hPkEAQ9Ti04NxPEUb80GH1KFMtahR4AoXsvqFbQz+eawFTwzoP 6F+hcIX2gIaKR97w4tHuPyIRbF5dnVwNyW4Nj76M60ew2ZfXOQomF0KieiuVrw2KWhqo 63R/Wu3TtQBgqHEFCDWLVQZ0Zd0lE8mZNADp7LltrOsOMBOcFaCrE98FCnsjqdGMvub5 xplcG7teLOi3DeJeTtoKvRBhiDAmx8prLwY3rvmQkKMueyPuS0bKWPhVcw1RxdTHVu/E j3NZjRX5Vb7Jjmt5yQI3yXIvU6zLfRq+xWLsEpRnWZsAtkXTYpIxKBWl1TjGgAlC5u7f faZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765793564; x=1766398364; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VN0V1tPgvY8SofsZQUsWAMHh5jjoUhKRWaN4QsOByNk=; b=eKy4e0mrQYOFWKP/f8RGQQQUzT9DFlRM6+rR9t1tKRnBvra1rGOl4ZczeQH0jnWDH0 2xkw1K0B6Cx1L21ezQNWq+uzcvAP2v5x83xjTVxDp7TxW8FkNa7yDbKkCukFpCiVe/ym irqjWNRh3SPZ0+BkiL/y+6JiVJw/8ptDMqpNPYjCBSDE+L7Kw2fZPqUhP5K7e697mMLH /V5by6Wj2hCwiln5MMqJFPykBLhKTVIqLBbFh7YlwtFoMh6bDMGCee1+sEhaTpMdkeZs 5ZSd+tEqoJdq94jrXi6uNH5PCdKOSHLtOILge6ZOl3siIgH+ylCdU0VcaMJjOE9rIdDL v0kw== X-Forwarded-Encrypted: i=1; AJvYcCXKLP67JJBZniv2mQQF0hYHckRAWNc+Ch17RkaX3sLwEPqMHyFc9T/RswJi6Qogh1xHnnsKRNlvxixWD38=@vger.kernel.org X-Gm-Message-State: AOJu0YxXIpzUovEmqCjtTGD7tIXRyr7RGWdhUox1p3dK9MLfHPW0v5pe 4tiawYbNgjacDiJjrP1zYW/FZBEWM9ydMcaT+3pD9fR+NyFrTjAeWEnkD7jTWVv3gBrNajru9QB AQW5lMc8c/UXHyw== X-Google-Smtp-Source: AGHT+IGOXiVRuwZEPrjBGynAwgddeUHqMh4f5afFkef4gtAeyV4OjShd+gNMVSkmDhPjG92i0Vrn+bbeKLDUKA== X-Received: from wmbgx1.prod.google.com ([2002:a05:600c:8581:b0:477:9856:8f53]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4d98:b0:477:5639:ff66 with SMTP id 5b1f17b1804b1-47a89ed5c1emr93875665e9.13.1765793563729; Mon, 15 Dec 2025 02:12:43 -0800 (PST) Date: Mon, 15 Dec 2025 10:12:38 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIABbfP2kC/32NQQrCMBBFr1Jm7UgSEy2uvId0UeI0HagZSUpQS u5u7AFcvgf//Q0yJaYM126DRIUzS2xgDh34eYyBkB+NwSjjtFE9Bi8FOS4cCaNwzGtC7ZzyE5G 1zkNbvhJN/N6r96HxzHmV9NlPiv7Z/72iUeHZnLzt/egu2t6CSFjo6OUJQ631C/aMKNW3AAAA X-Change-Id: 20251208-gcov-inline-noinstr-1550cfee445c X-Mailer: b4 0.14.2 Message-ID: <20251215-gcov-inline-noinstr-v2-0-6f100b94fa99@google.com> Subject: [PATCH v2 0/3] Noinstr fixes for K[CA]SAN with GCOV From: Brendan Jackman To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Ard Biesheuvel Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Details: - =E2=9D=AF=E2=9D=AF clang --version Debian clang version 19.1.7 (3+build5) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-19/bin - Kernel config: https://gist.githubusercontent.com/bjackman/bbfdf4ec2e1dfd0e18657174f053= 7e2c/raw/a88dcc6567d14c69445e7928a7d5dfc23ca9f619/gistfile0.txt Note I also get this error: vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x3b: relocation to !ENDBR: = machine_kexec_prepare+0x810 That one's a total mystery to me. I guess it's better to "fix" the SEV one independently rather than waiting until I know how to fix them both. Note I also mentioned other similar errors in [0]. Those errors don't exist in Linus' master and I didn't note down where I saw them. Either they have since been fixed, or I observed them in Google's internal codebase where they were instroduced downstream. As discussed in [2], the GCOV+*SAN issue is attacked from two angles: both adding __always_inline to the instrumentation helpers AND disabling GCOV for noinstr.c. Only one or the other of these things is needed to make the build error go away, but they both make sense in their own right and both may serve to prevent other similar errors from cropping up in future. Signed-off-by: Brendan Jackman --- Changes in v2: - Also disable GCOV for noinstr.c (i.e. squash in [0]). - Link to v1: [2]=20 [0] https://lore.kernel.org/all/DERNCQGNRITE.139O331ACPKZ9@google.com/ [1] https://lore.kernel.org/all/20251117-b4-sev-gcov-objtool-v1-1-54f7790d5= 4df@google.com/ [2] https://lore.kernel.org/r/20251208-gcov-inline-noinstr-v1-0-623c48ca571= 4@google.com --- Brendan Jackman (3): kasan: mark !__SANITIZE_ADDRESS__ stubs __always_inline kcsan: mark !__SANITIZE_THREAD__ stub __always_inline x86/sev: Disable GCOV on noinstr object arch/x86/coco/sev/Makefile | 2 ++ include/linux/kasan-checks.h | 4 ++-- include/linux/kcsan-checks.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) --- base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 change-id: 20251208-gcov-inline-noinstr-1550cfee445c Best regards, --=20 Brendan Jackman