From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD694C433EF for ; Wed, 2 Mar 2022 17:58:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53C108D0002; Wed, 2 Mar 2022 12:58:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4ECFF8D0001; Wed, 2 Mar 2022 12:58:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B8118D0002; Wed, 2 Mar 2022 12:58:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 2E1AE8D0001 for ; Wed, 2 Mar 2022 12:58:22 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 07F8F81D30 for ; Wed, 2 Mar 2022 17:58:22 +0000 (UTC) X-FDA: 79200205644.05.2569C25 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by imf20.hostedemail.com (Postfix) with ESMTP id 790821C0015 for ; Wed, 2 Mar 2022 17:58:21 +0000 (UTC) Received: by mail-qv1-f43.google.com with SMTP id b12so2138695qvk.1 for ; Wed, 02 Mar 2022 09:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zvKlF5CBF/rkG5nSvJoUB04cPViOb4UlDQuxw1t5TK8=; b=o1rvRlbIekInTaP5gN9O/cX68ET/0lXeGjf7MgVmTM5L/8lRjPa/IJ7WNrNwf3N30a 3Tmu3mKMdDuZCG02eCNmE3j/9IhIp7jdjoAT9xfSOac07SZSRQhnxH1CLD6VJwK2xV/S KM/UdGAopuTvUQ8WD5vwJFLkZJMBGPkSHd3n43hwY0GgBAzdWiVclXOYBwxcea16WxGS TA7SQ2nQKEsvZaGM8ebrR6g2i6JDG5cM9HjBmPxy+FT2rpV/HHUljB2D2hRBoaSDYcgQ Knm5Fak6lm3jyJ/r1M3cvMR7BAQ0DveTBgmyKkFPwbH9QzLFVilhrdx4PMEj8lwHdRCn r3rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zvKlF5CBF/rkG5nSvJoUB04cPViOb4UlDQuxw1t5TK8=; b=cq4n+709taSRsrUD6E4vXhaCLXtPEyB0HAY9nCm9QFEFjalOQBu8vupivMzou7CS8i BkhnFj11ej9+jgk9SNhEPvjzeKUOAYAbugG+/ynVp4kS2D9hDUnEbmg27AYG1K9qPoQ7 5YD5T+QLYEwpRae9ZXggURYD7emKX5wNM6QpDwJyikgjgtr2Gs1NVjfwnaCo8wBq1k6W +URea3sCRXNJ+i3ogDRQpTAxLBz+f/9OX8VnlWPZh7BkJ1J0r5pYNRR77vIW/Uicb3po nIRpXZRD7STbHpvW38PKP2HFoWMfWzpXDjEWkPtiFa6ylW+9uKYXimYsJrfuaRjfhpHk z+QA== X-Gm-Message-State: AOAM5327VJ9TRr6WGkDAwoxX+hMDW4SbPsUJWoNhYTkVWbZBfZSQqPNR TDgqLTUY4QtoZU0XLpSify2mDOes6uh4H8g5S3Evrg== X-Google-Smtp-Source: ABdhPJzTTUYS3ffXoEIdXknK41uZyJFQRdA2sfLtlHMvf0+8v9l4bZBRsqCv1PJoxB8skWShG0pFknbEhwlC3ZbnrHo= X-Received: by 2002:ad4:5fcb:0:b0:432:d049:c6d with SMTP id jq11-20020ad45fcb000000b00432d0490c6dmr17606335qvb.39.1646243900457; Wed, 02 Mar 2022 09:58:20 -0800 (PST) MIME-Version: 1.0 References: <223592d38d2a601a160a3b2b3d5a9f9090350e62.1646237226.git.andreyknvl@google.com> In-Reply-To: <223592d38d2a601a160a3b2b3d5a9f9090350e62.1646237226.git.andreyknvl@google.com> From: Alexander Potapenko Date: Wed, 2 Mar 2022 18:57:44 +0100 Message-ID: Subject: Re: [PATCH mm 08/22] kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT To: andrey.konovalov@linux.dev Cc: Marco Elver , Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Andrew Morton , Linux Memory Management List , LKML , Andrey Konovalov Content-Type: multipart/alternative; boundary="000000000000e6efbe05d9400642" X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 790821C0015 X-Stat-Signature: ku9p81qzj3c6p76au5eqnwyu8cdpro63 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=o1rvRlbI; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of glider@google.com designates 209.85.219.43 as permitted sender) smtp.mailfrom=glider@google.com X-HE-Tag: 1646243901-571323 X-Bogosity: Ham, tests=bogofilter, spamicity=0.004846, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000e6efbe05d9400642 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 2, 2022 at 5:37 PM wrote: > From: Andrey Konovalov > > Check the more specific CONFIG_KASAN_KUNIT_TEST config option when > defining things related to KUnit-compatible KASAN tests instead of > CONFIG_KUNIT. > > Also put the kunit_kasan_status definition next to the definitons of > other KASAN-related structs. > > Signed-off-by: Andrey Konovalov > Reviewed-by: Alexander Potapenko > --- > mm/kasan/kasan.h | 18 ++++++++---------- > mm/kasan/report.c | 2 +- > 2 files changed, 9 insertions(+), 11 deletions(-) > > diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h > index 4447df0d7343..cc7162a9f304 100644 > --- a/mm/kasan/kasan.h > +++ b/mm/kasan/kasan.h > @@ -7,16 +7,6 @@ > #include > #include > > -#if IS_ENABLED(CONFIG_KUNIT) > - > -/* Used in KUnit-compatible KASAN tests. */ > -struct kunit_kasan_status { > - bool report_found; > - bool sync_fault; > -}; > - > -#endif > - > #ifdef CONFIG_KASAN_HW_TAGS > > #include > @@ -224,6 +214,14 @@ struct kasan_free_meta { > #endif > }; > > +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) > +/* Used in KUnit-compatible KASAN tests. */ > +struct kunit_kasan_status { > + bool report_found; > + bool sync_fault; > +}; > +#endif > + > struct kasan_alloc_meta *kasan_get_alloc_meta(struct kmem_cache *cache, > const void *object); > #ifdef CONFIG_KASAN_GENERIC > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > index 59db81211b8a..93543157d3e1 100644 > --- a/mm/kasan/report.c > +++ b/mm/kasan/report.c > @@ -356,7 +356,7 @@ static bool report_enabled(void) > return !test_and_set_bit(KASAN_BIT_REPORTED, &kasan_flags); > } > > -#if IS_ENABLED(CONFIG_KUNIT) > +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) > static void update_kunit_status(bool sync) > { > struct kunit *test; > -- > 2.25.1 > > -- > You received this message because you are subscribed to the Google Groups > "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/kasan-dev/223592d38d2a601a160a3b2b3d5a9= f9090350e62.1646237226.git.andreyknvl%40google.com > . > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Falls Sie diese f=C3=A4lschlicherweise erhalt= en haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, l=C3=B6schen Sie alle Kopien und Anh=C3=A4nge davon und lassen Sie mich bit= te wissen, dass die E-Mail an die falsche Person gesendet wurde. This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. --000000000000e6efbe05d9400642 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Mar 2, 2022 at 5:37 PM <andrey.konovalov@linux.dev&= gt; wrote:
From:= Andrey Konovalov <andreyknvl@google.com>

Check the more specific CONFIG_KASAN_KUNIT_TEST config option when
defining things related to KUnit-compatible KASAN tests instead of
CONFIG_KUNIT.

Also put the kunit_kasan_status definition next to the definitons of
other KASAN-related structs.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Revi= ewed-by: Alexander Potapenko <glide= r@google.com>
=C2=A0
---
=C2=A0mm/kasan/kasan.h=C2=A0 | 18 ++++++++----------
=C2=A0mm/kasan/report.c |=C2=A0 2 +-
=C2=A02 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index 4447df0d7343..cc7162a9f304 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -7,16 +7,6 @@
=C2=A0#include <linux/kfence.h>
=C2=A0#include <linux/stackdepot.h>

-#if IS_ENABLED(CONFIG_KUNIT)
-
-/* Used in KUnit-compatible KASAN tests. */
-struct kunit_kasan_status {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0bool report_found;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0bool sync_fault;
-};
-
-#endif
-
=C2=A0#ifdef CONFIG_KASAN_HW_TAGS

=C2=A0#include <linux/static_key.h>
@@ -224,6 +214,14 @@ struct kasan_free_meta {
=C2=A0#endif
=C2=A0};

+#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
+/* Used in KUnit-compatible KASAN tests. */
+struct kunit_kasan_status {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0bool report_found;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0bool sync_fault;
+};
+#endif
+
=C2=A0struct kasan_alloc_meta *kasan_get_alloc_meta(struct kmem_cache *cach= e,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 const void *object);
=C2=A0#ifdef CONFIG_KASAN_GENERIC
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index 59db81211b8a..93543157d3e1 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -356,7 +356,7 @@ static bool report_enabled(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return !test_and_set_bit(KASAN_BIT_REPORTED, &a= mp;kasan_flags);
=C2=A0}

-#if IS_ENABLED(CONFIG_KUNIT)
+#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
=C2=A0static void update_kunit_status(bool sync)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct kunit *test;
--
2.25.1

--
You received this message because you are subscribed to the Google Groups &= quot;kasan-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to kasan-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://gro= ups.google.com/d/msgid/kasan-dev/223592d38d2a601a160a3b2b3d5a9f9090350e62.1= 646237226.git.andreyknvl%40google.com.


--
Alexander Potapenko
Software= Engineer

Google Germany GmbH
Erika-Mann-Stra=C3=9Fe, 33
80636= M=C3=BCnchen

Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebasti= an
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellsch= aft: Hamburg

Diese E-Mail ist vertraulich. Falls Sie diese f=C3=A4ls= chlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jeman= d anderes weiter, l=C3=B6schen Sie alle Kopien und Anh=C3=A4nge davon und l= assen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet= wurde.

=C2=A0 =C2=A0 =C2=A0

This e-mail is confidential. If= you received this communication by mistake, please don't forward it to= anyone else, please erase all copies and attachments, and please let me kn= ow that it has gone to the wrong person.
--000000000000e6efbe05d9400642--