From: Brendan Jackman <jackmanb@google.com>
To: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Marco Elver <elver@google.com>, Ard Biesheuvel <ardb@kernel.org>
Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
Brendan Jackman <jackmanb@google.com>
Subject: [PATCH v2 3/3] x86/sev: Disable GCOV on noinstr object
Date: Mon, 15 Dec 2025 10:12:41 +0000 [thread overview]
Message-ID: <20251215-gcov-inline-noinstr-v2-3-6f100b94fa99@google.com> (raw)
In-Reply-To: <20251215-gcov-inline-noinstr-v2-0-6f100b94fa99@google.com>
With Debian clang version 19.1.7 (3+build5) there are calls to
kasan_check_write() from __sev_es_nmi_complete, which violates noinstr.
Fix it by disabling GCOV for the noinstr object, as has been done for
previous such instrumentation issues.
Note that this file already disables __SANITIZE_ADDRESS__ and
__SANITIZE_THREAD__, thus calls like kasan_check_write() ought to be
nops regardless of GCOV. This has been fixed in other patches. However,
to avoid any other accidental instrumentation showing up, (and since, in
principle GCOV is instrumentation and hence should be disabled for
noinstr code anyway), disable GCOV overall as well.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
arch/x86/coco/sev/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile
index 3b8ae214a6a64de6bb208eb3b7c8bf12007ccc2c..b2e9ec2f69014fa3507d40c6c266f1b74d634fcb 100644
--- a/arch/x86/coco/sev/Makefile
+++ b/arch/x86/coco/sev/Makefile
@@ -8,3 +8,5 @@ UBSAN_SANITIZE_noinstr.o := n
# GCC may fail to respect __no_sanitize_address or __no_kcsan when inlining
KASAN_SANITIZE_noinstr.o := n
KCSAN_SANITIZE_noinstr.o := n
+
+GCOV_PROFILE_noinstr.o := n
--
2.50.1
next prev parent reply other threads:[~2025-12-15 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 10:12 [PATCH v2 0/3] Noinstr fixes for K[CA]SAN with GCOV Brendan Jackman
2025-12-15 10:12 ` [PATCH v2 1/3] kasan: mark !__SANITIZE_ADDRESS__ stubs __always_inline Brendan Jackman
2025-12-15 10:12 ` [PATCH v2 2/3] kcsan: mark !__SANITIZE_THREAD__ stub __always_inline Brendan Jackman
2025-12-15 12:11 ` Marco Elver
2025-12-16 9:41 ` Brendan Jackman
2025-12-15 10:12 ` Brendan Jackman [this message]
2025-12-15 12:15 ` [PATCH v2 0/3] Noinstr fixes for K[CA]SAN with GCOV Marco Elver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251215-gcov-inline-noinstr-v2-3-6f100b94fa99@google.com \
--to=jackmanb@google.com \
--cc=andreyknvl@gmail.com \
--cc=ardb@kernel.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®